protected override void ProcessRecord() { SiteColumnAndContentTypeHelper obj = new SiteColumnAndContentTypeHelper(); obj.AddSiteColumnToContentType_ForCSV(ContentTypeName, SiteColumnName, ContentTypeUsageFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { SiteColumnAndContentTypeHelper obj = new SiteColumnAndContentTypeHelper(); obj.AddSiteColumnToContentType_ForCSV(ContentTypeName,SiteColumnName,ContentTypeUsageFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void CT_ContentTypesCommands() { //228 String OutPutDirectory = @"E:\VirendraKumar\ProjectTest\ContentType"; string WebUrl = "http://*****:*****@"E:\VirendraKumar\ProjectTest\ContentType_Usage.csv", OutPutDirectory, "OP", "ms-mla-paraja", "Password123", "mgmt7"); //objSC.AddSiteColumnToContentType_ForWeb(@"E:\VirendraKumar\ProjectTest\SiteColumnsContentType", "https://intranet.poc.com/sites/TestContosoPublishingSite/", "ContosoLibraryContentTypeCSV6", "ContosoStatusNew", "web", "OP", "ms-mla-paraja", "Password123", "mgmt7"); objSC.AddSiteColumnToContentType_ForCSV("ContosoLibraryContentType", "ContosoStatusNew", @"E:\VirendraKumar\ProjectTest\ContentType_Usage.csv", @"E:\VirendraKumar\ProjectTest\SiteColumnsContentType", "OP", "ms-mla-paraja", "Password123", "mgmt7"); //objSC.ContentType_CreateContentTypeAndDuplicateDetailsFromOldContentType_ForWEB(@"E:\VirendraKumar\ProjectTest\SiteColumnsContentType", "https://intranet.campoc.com/sites/T_Master_Page_Offshore/", "Contoso Document", "NewCT23Apr3", "web", "OP", "ms-mla-paraja", "Password123", "mgmt7"); //objSC.ReplaceContentTypeinList_ForWeb(@"E:\VirendraKumar\ProjectTest\SiteColumnsContentType", "https://intranet.campoc.com/sites/T_Master_Page_Offshore/", "VK_C_List ", "0x010090E84F7F337045DB9DCB9F4D3688DB8B00E05E98E692502F4AA55DB54546B2639F", "NewCT22Apr", "web", "OP", "ms-mla-paraja", "Password123", "mgmt7"); //objSC.SiteColumns_CreateSiteColumnsAndDuplicateDetailsFromOldSiteColumn_ForWEB(@"E:\VirendraKumar\ProjectTest\SiteColumnsContentType", "https://intranet.campoc.com/sites/T_Master_Page_Offshore/", "Contoso Status", "8478039d-fbd5-421d-bd6c-87a07d7ce499", "SC22Apr", "SC22Apr", "web", "OP", "ms-mla-paraja", "Password123", "mgmt7"); //objSC.SiteColumns_CreateSiteColumnsAndDuplicateDetailsFromOldSiteColumn_UsingCSV(@"E:\VirendraKumar\ProjectTest", "OP", "ms-mla-paraja", "Password123", "mgmt7"); /*using (var cc = new ClientContext("https://intranet.campoc.com/sites/T_Master_Page_Offshore/")) * { * //https://intranet.campoc.com/sites/TestListWorkFlowAssociationsContoso * * //https://intranet.campoc.com/sites/T_Master_Page_Offshore/ * * * string internalName = "ContosoStatusxx"; * string oldSiteColumn_ID = "8478039d-fbd5-421d-bd6c-87a07d7ce499"; * FieldCollection fields = cc.Web.Fields; * //cc.Web.Context.Load(fields, fc => fc.Include(f => f.Id, f => f.InternalName)); * //cc.Web.Context.ExecuteQuery(); * * //bool yes= SiteColumns_ISAlreadyExists(cc, internalName); * //Console.WriteLine(yes); * //Field field = SiteColumns_GetSiteColumnsDetails(cc, internalName); * //var field = fields.FirstOrDefault(f => f.InternalName == internalName); * //Field field = fields.GetByInternalNameOrTitle(internalName); * Guid oldGUID = new Guid(oldSiteColumn_ID); * Field field = fields.GetById(oldGUID); * * * try * { * if (field != null && field.ToString() != "") * { * cc.Web.Context.Load(field); * cc.Web.Context.ExecuteQuery(); * * Console.WriteLine(field.Id.ToString()); * Console.WriteLine(field.InternalName.ToString()); * Console.WriteLine(field.Title.ToString()); * Console.WriteLine(field.Hidden.ToString()); * Console.WriteLine(field.CanBeDeleted.ToString()); * Console.WriteLine(field.SchemaXml.ToString()); * //Console.WriteLine("YESSSSSSSSSS"); * } * } * catch (Exception ex) * { Console.WriteLine(ex.Message.ToString()); } * * //SiteColumns_ISAlreadyExists(cc, internalName, ""); * * //Field field = SiteColumns_GetSiteColumnsDetails(cc, internalName, ""); * //Console.WriteLine(field.Id.ToString()); * * //Console.WriteLine(field.InternalName.ToString()); * //Console.WriteLine(field.Title.ToString()); * * //Console.WriteLine(field.Hidden.ToString()); * //Console.WriteLine(field.CanBeDeleted.ToString()); * //Console.WriteLine(field.SchemaXml.ToString()); * //ContentType CT = GetContentTypeByName(cc, cc.Web, "ContosoLibraryContentTypeNEWWW2"); * //ContosoLibraryContentTypeNEWWW2 * //Console.WriteLine(CT.SchemaXml.ToString()); * }*/ }