Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

justsayantan

💭
I may be slow to respond.
View GitHub Profile
View UpdateGetCompinentId.cs
public string getcomponentid()
{
var client = Utility.GetCoreServiceSettings();
string result = "Item not found";
string TargetFolderTcmId = @"/webdav/200%20Master%20Content%20(ENG)/Building%20Blocks/Content/"; // Put your folder's webdav url or tcm uri here
string title = @"Component Title";// Put your component title here
var productsXML =
client.GetListXml(TargetFolderTcmId,
new OrganizationalItemItemsFilterData
@justsayantan
justsayantan / GetCompinentId.cs
Last active Aug 15, 2019
Retrieve Component By Title
View GetCompinentId.cs
public string getcomponentid()
        {
            var client = Utility.GetCoreServiceSettings();
            string result = "Item not found";
            string TargetFolderTcmId = @"tcm:5-1945-2"; // Put your folder tcm id here
            string title = @"Component Title";// Put your component title here
           
            var productsXML =
              client.GetListXml(TargetFolderTcmId,
              new OrganizationalItemItemsFilterData
View PublishToLive.cs
//=======================================//
// ------- Author : Sayantan Basu -------
// ------- Date   : 24-03-2015   -------
//=======================================//
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
@justsayantan
justsayantan / RemoveItemFromBundle.cs
Last active Jun 22, 2018
Remove Item From Bundle
View RemoveItemFromBundle.cs
public static void RemoveItemFromBundle(string bundleId, string itemId)
{
CoreServiceClient _CoreServiceClient = Utility.GetCoreServiceSettings();
ReadOptions _readOption = new ReadOptions();
//string bundleId = "tcm:5-1076-8192";
VirtualFolderData bundle = (VirtualFolderData)_CoreServiceClient.Read(bundleId, _readOption);
XmlDocument bundleConfiguration = new XmlDocument();
bundleConfiguration.LoadXml(bundle.Configuration);
XmlNameTable nameTable = new NameTable();
@justsayantan
justsayantan / AddItemToBundle.PS1
Last active Jun 6, 2018
Script to add items to Bundle
View AddItemToBundle.PS1
Function AddItemToBundle
{
[CmdletBinding()]
Param (
# Bundle ID
[Parameter(Mandatory=$true)]
[string]$BundleId,
# Item ID .
[Parameter(Mandatory=$true)]
@justsayantan
justsayantan / CreateBundle.PS1
Last active Jun 5, 2018
Create Bundle Using Tridion Coreservice [C# version]
View CreateBundle.PS1
function New-TridionBundle
{
<#
.Synopsis
Creates a new bundle based on specified bundle schema.
.Inputs
None.
.Outputs
@justsayantan
justsayantan / PageViewModel.cs
Last active Dec 20, 2017
Component Link in Page Metadata for DXA
View PageViewModel.cs
using System.Globalization;
using Sdl.Web.Common.Models;
namespace Models
{
public class PageViewModel : PageModel
{
private SecurityMessage message;
Provide provider = new Provider();
@justsayantan
justsayantan / script.cs
Last active Aug 7, 2017
Link BPT in Web Site Publication using Coreservice API
View script.cs
static void Main(string[] args)
{
using (var client = Utility.CoreServiceClient)
{
// get the list of the publications.
var publications = client.GetSystemWideList(new RepositoriesFilterData());
foreach (var pub in publications.Where(p => p.Title.Contains("600") || p.Title.Contains("700"))
{
// Read Publication details.
@justsayantan
justsayantan / CustomNavigationProvider
Created Jul 26, 2017
Create Secondary Navigation From Structure Group
View CustomNavigationProvider
public class CustomNavigationProvider : INavigationProvider
{
// #region INavigationProvider Members
/// <summary>
/// Gets the Navigation Model (Sitemap) for a given Localization.
/// </summary>
/// <param name="localization">The Localization.</param>
/// <returns>The Navigation Model (Sitemap root Item).</returns>
public SitemapItem GetNavigationModel(Localization localization)
@justsayantan
justsayantan / Audience Manager Login
Last active Apr 16, 2017
Encrypt user passwords from Audience Manager Login
View Audience Manager Login
using Sdl.AudienceManager.ContentDelivery;
using Sdl.AudienceManager.ContentDelivery.Profile;
namespace My.Controllers
{
public class LoginController : BaseController
{
[HttpPost]
public virtual ActionResult LoginForm(FormModel model, EntityModel entity, int containerSize = 0)
{