public static void GetWebPartUsage() { //string SharePointOnline_OR_OnPremise = "OP"; //string UserName =ConfigurationManager.AppSettings["userName"]; //string Password = ConfigurationManager.AppSettings["password"]; //string Domain = ConfigurationManager.AppSettings["domain"]; //string WebUrl = "https://awsit.avivaworld.com"; //string WebPartType = "CommentBoardWebPart"; //String OutPutDirectory = @"F:\481921\ReplaceWebPart\out\list\replace\r"; string SharePointOnline_OR_OnPremise = "OP"; string UserName = ConfigurationManager.AppSettings["userName"]; string Password = ConfigurationManager.AppSettings["password"]; string Domain = ConfigurationManager.AppSettings["domain"]; string WebUrl = ConfigurationManager.AppSettings["siteurl"]; string WebPartType = "CommentBoardWebPart"; String OutPutDirectory = ConfigurationManager.AppSettings["outputpath"]; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper("GetWebPartUsage"); if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OP")) { webPartTransformationHelper.UseNetworkCredentialsAuthentication(UserName, Password, Domain); } else if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OL")) { webPartTransformationHelper.UseOffice365Authentication(UserName, Password); } webPartTransformationHelper.AddSite(WebUrl); webPartTransformationHelper.WebPartType = WebPartType; webPartTransformationHelper.ExpandSubSites = true; webPartTransformationHelper.OutPutDirectory = OutPutDirectory; webPartTransformationHelper.Run(); }
public static void ReplaceWebPartByCSV() { //string SharePointOnline_OR_OnPremise = "OP"; //string UserName = "******"; //string Password = "******"; //string Domain = "awdev"; ////string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ReplaceWebPartByCSV"; //string targetWebPartFileName = "MSContentEditor.dwp"; //string targetWebPartXmlDir = @"F:\481921\ReplaceWebPart\out\list\replace"; //string sourceWebPartTitle = "CommentBoardWebPart"; //string usageFilePath = @"F:\481921\ReplaceWebPart\out\list\replace\WebPartUsage.csv"; string SharePointOnline_OR_OnPremise = "OP"; string UserName = ConfigurationManager.AppSettings["userName"]; string Password = ConfigurationManager.AppSettings["password"]; string Domain = ConfigurationManager.AppSettings["domain"]; string outPutDirectory = ConfigurationManager.AppSettings["outputpath"]; string targetWebPartFileName = "SiteFeed.dwp"; string targetWebPartXmlDir = ConfigurationManager.AppSettings["targetxmlpath"]; string sourceWebPartTitle = "CommunityActivityFeedWebPart"; string usageFilePath = ConfigurationManager.AppSettings["usagefilepath"]; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ReplaceWebPart_UsingCSV(sourceWebPartTitle, targetWebPartFileName, targetWebPartXmlDir, usageFilePath, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); string csvFile = OutPutDirectory + @"\" + System.IO.Path.GetFileNameWithoutExtension(WebPartUsageFilePath) + "_DeleteOperationStatus" + "_" + DateTime.Now.ToString("dd_MM_yyyy_hh_ss") + ".csv"; if (String.Equals(Transformation.PowerShell.Common.Constants.ActionType_All, SourceWebPartType, StringComparison.CurrentCultureIgnoreCase)) { //Reading Input File IEnumerable <WebPartDiscoveryInput> objWPDInput; objWPDInput = ImportCsv.ReadMatchingColumns <WebPartDiscoveryInput>(WebPartUsageFilePath, Transformation.PowerShell.Common.Constants.CsvDelimeter); if (objWPDInput.Any()) { IEnumerable <string> webPartTypes = objWPDInput.Select(x => x.WebPartType); webPartTypes = webPartTypes.Distinct(); foreach (string webPartType in webPartTypes) { webPartTransformationHelper.DeleteWebPart_UsingCSV(webPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain); } } } else { webPartTransformationHelper.DeleteWebPart_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, csvFile, SharePointOnline_OR_OnPremise, UserName, Password, Domain); } }
public static void ConfigureNewWebPartXmlBulk() { string targetWebPartXmlFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Bulk\TargetContentQuery.xml"; string sourceXmlFilesDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Bulk\SourceDir"; //string targetXmlFilesDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Bulk\TargetDir"; string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Bulk"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ConfigureNewWebPartXml(targetWebPartXmlFilePath, sourceXmlFilesDirectory, outPutDirectory); }
public static void GetWebPartProperties_UsingCSV() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string outPutDir = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartPropertiesByCSV\Current"; string usageFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartPropertiesByCSV\WebParts_Usage.csv"; string sourceWebPartTitle = "Featured Links Web Part"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.GetWebPartProperties_UsingCSV(sourceWebPartTitle, usageFilePath, outPutDir, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void GetWebPartProperties() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string WebUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; string pageUrl = "/sites/TestContosoPublishingSite/Pages/TestWebPartTransformation.aspx"; string outPutDir = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartProperties"; //string webPartID = "d72fd359-2294-4434-b77c-514cc8ebafc5"; string webPartID = "c7d8da93-0d50-4587-89d6-cd4e3663c660"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.GetWebPartProperties(pageUrl, webPartID, "N/A", WebUrl, outPutDir, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void UploadDependencyFile() { string folderServerRelativeUrl = "/sites/TestContosoPublishingSite/_catalogs/masterpage/Display Templates/Content Web Parts"; string fileName = "Item_PictureOnTop_MyCustom.html"; string localFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\UploadDependencyFile\Item_PictureOnTop_MyCustom.html"; bool overwriteIfExists = true; string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\UploadDependencyFile"; string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string webUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.UploadDependencyFile(webUrl, folderServerRelativeUrl, fileName, localFilePath, overwriteIfExists, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void AddWebPart_UsingCSV() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string usageFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartPropertiesByCSV\WebParts_Usage.csv"; string sourceWebPartTitle = "Featured Links Web Part"; //string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\AddWebPartByCsv"; string configuredWebPartFileName = "ContentQuery.webpart"; string configuredWebPartXmlDir = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\bulk\TargetDir"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.AddWebPart_UsingCSV(sourceWebPartTitle, configuredWebPartFileName, configuredWebPartXmlDir, usageFilePath, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper("GetWebPartUsage"); if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OP")) { webPartTransformationHelper.UseNetworkCredentialsAuthentication(UserName, Password, Domain); } else if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OL")) { webPartTransformationHelper.UseOffice365Authentication(UserName, Password); } webPartTransformationHelper.AddSite(SiteUrl); webPartTransformationHelper.WebPartType = WebPartType; webPartTransformationHelper.OutPutDirectory = OutPutDirectory; webPartTransformationHelper.ExpandSubSites = ExpandSubSites; webPartTransformationHelper.Run(); }
public static void AddWebPart() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string webUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; string serverRelativePageUrl = "/sites/TestContosoPublishingSite/Pages/TestWebPartTransformation.aspx"; string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\AddWebPart"; string webPartZoneIndex = "0"; string webPartZoneID = "LeftColumnZone"; string configuredWebPartFileName = "N/A"; string configuredWebPartXmlFile = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Single\TargetConfiguredWebPartXmls\Configured_c7d8da93-0d50-4587-89d6-cd4e3663c660_AppPartXml.xml"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.AddWebPart(webUrl, configuredWebPartFileName, configuredWebPartXmlFile, webPartZoneIndex, webPartZoneID, serverRelativePageUrl, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void ReplaceWebPart() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; string webUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; string serverRelativePageUrl = "/sites/TestContosoPublishingSite/Pages/TestWebPartTransformation.aspx"; string outPutDirectory = @"F:\481921\ReplaceWebPart\replace"; string webPartZoneIndex = "0"; string webPartZoneID = "TopLeftRow"; string targetWebPartFileName = "Haveyoursay.dwp"; string targetWebPartXmlFile = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Bulk\TargetContentQuery.xml"; Guid sourceWebPartID = new Guid("b3d55ff9-d032-45e1-9670-cd442ba5cab3"); WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ReplaceWebPart(webUrl, targetWebPartFileName, targetWebPartXmlFile, sourceWebPartID, webPartZoneIndex, webPartZoneID, serverRelativePageUrl, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void TransformWebPart_UsingCSV() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; //string WebUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; //string WebPartType = "Content Editor"; // string WebPartType = "RemoteContentQueryWebPart"; string WebPartType = "TeaserWebPart"; //string WebPartType = "WelcomeWebPart"; //String OutPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\TransformWebPartAcrossWeb"; String OutPutDirectory = @"E:\VirendraKumar\ProjectTest\TransformWebPartAcrossWeb"; string targetWebPartFileName = "N/A"; string targetWebPartXmlFile = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\ConfigureNewWebPartXml\Single\AppPartXml.xml"; //string UsageFile = @"C:\DiscoveryTool\CAM\WebParts_Usage.csv"; string UsageFile = @"E:\VirendraKumar\ProjectTest\WebParts_Usage.csv"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.TransformWebPart_UsingCSV(UsageFile, WebPartType, targetWebPartFileName, targetWebPartXmlFile, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
public static void DeleteWebPart() { string SharePointOnline_OR_OnPremise = "OP"; string UserName = "******"; string Password = "******"; string Domain = "MGMT7"; //string webUrl = "https://intranet.poc.com/sites/TestContosoPublishingSite/"; //string ServerRelativePageUrl = "/sites/TestContosoPublishingSite/Pages/TestWebPartTransformation.aspx"; string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\DeleteWebPart"; //string webPartTitle = "Featured Links Web Part"; //string zoneIndex = "1"; //string zoneId = "Left Column"; //Guid webPartID = new Guid("c7d8da93-0d50-4587-89d6-cd4e3663c660"); Guid StorageKey = new Guid("d2d4f7bd-6f2d-4677-b4f9-f63a59e09317"); Guid webPartID = new Guid("40d61b73-b96e-44d4-a2d3-504dce482f99"); string webUrl = "https://intranet.poc.com/sites/TestContosoTeamSite/"; string ServerRelativePageUrl = "/sites/TestContosoTeamSite/SitePages/TestWebPart.aspx"; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart(webUrl, ServerRelativePageUrl, webPartID, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper("GetWebPartUsage"); if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OP")) { webPartTransformationHelper.UseNetworkCredentialsAuthentication(UserName, Password, Domain); } else if (SharePointOnline_OR_OnPremise.ToUpper().Equals("OL")) { webPartTransformationHelper.UseOffice365Authentication(UserName, Password); } //Deleted the Web Part Usage File webPartTransformationHelper.DeleteUsageFiles_WebPartHelper(OutPutDirectory, Constants.WEBPART_USAGE_ENTITY_FILENAME); webPartTransformationHelper.AddSite(SiteUrl); webPartTransformationHelper.WebPartType = WebPartType; webPartTransformationHelper.OutPutDirectory = OutPutDirectory; webPartTransformationHelper.ExpandSubSites = ExpandSubSites; webPartTransformationHelper.headerWebPart = false; webPartTransformationHelper.Run(); }
public static void DeleteWebPart_UsingCSV() { //string SharePointOnline_OR_OnPremise = "OP"; //string UserName = "******"; //string Password = "******"; //string Domain = "MGMT7"; // string usageFilePath = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\GetWebPartPropertiesByCSV\WebParts_Usage.csv"; //string sourceWebPartTitle = "Featured Links Web Part"; // string outPutDirectory = @"E:\v-suamso\FTC-CAMSimulation\TransformationTool\TestingResults\DeleteWebPartByCSV"; string SharePointOnline_OR_OnPremise = "OP"; string UserName = ConfigurationManager.AppSettings["userName"]; string Password = ConfigurationManager.AppSettings["password"]; string Domain = ConfigurationManager.AppSettings["domain"]; string WebUrl = ConfigurationManager.AppSettings["siteurl"]; string outPutDirectory = ConfigurationManager.AppSettings["outputpath"]; string usageFilePath = ConfigurationManager.AppSettings["usagefilepath"]; string sourceWebPartTitle = ConfigurationManager.AppSettings["sourcewebparttype"]; WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart_UsingCSV(sourceWebPartTitle, usageFilePath, outPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ReplaceWebPart_UsingCSV(SourceWebPartType, TargetWebPartXmlFilePath, TargetWebPartFileName, TargetWebPartXmlDir, WebPartUsageFileName, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "CSV"); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.GetWebPartsByWeb(WebUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.AddWebPart(WebUrl, ConfiguredWebPartFileName, ConfiguredWebPartXmlFile, WebPartZoneIndex, WebPartZoneID, ServerRelativePageUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, Constants.ActionType_Web); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.GetWebPartProperties_UsingCSV(InputFolder, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.GetWebPartProperties(PageUrl, StorageKey, WebUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web"); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ReplaceWebPart(WebUrl, TargetWebPartFileName, TargetWebPartXmlFile, new Guid(SourceWebPartID), WebPartZoneIndex, WebPartZoneID, ServerRelativePageUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web"); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart(WebUrl, ServerRelativePageUrl, StorageKey, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web"); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.UploadDependencyFile(WebUrl, FolderServerRelativeUrl, FileName, LocalFilePath, OverwriteIfExists, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.UploadAppInAppCatalog(AppCatalogUrl, FileName, AppFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.DeleteWebPart_UsingCSV(InputFolder, SharePointOnline_OR_OnPremise, UserName, Password, Domain); }
protected override void ProcessRecord() { WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper(); webPartTransformationHelper.ConfigureNewWebPartXml(TargetWebPartXmlFilePath, SourceXmlFilesDirectory, OutPutDirectory); }