Inheritance: OfficeDevPnP.Core.Framework.TimerJobs.TimerJob
        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);
            }
        }
        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();
        }
 protected override void ProcessRecord()
 {
     WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
     webPartTransformationHelper.ConfigureNewWebPartXml(TargetWebPartXmlFilePath, SourceXmlFilesDirectory, OutPutDirectory);
 }
 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.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.GetWebPartProperties(PageUrl, StorageKey, WebUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web");
 }
 protected override void ProcessRecord()
 {
     WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
     webPartTransformationHelper.GetWebPartProperties_UsingCSV(SourceWebPartType, WebPartUsageFilePath, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "CSVUpdates");
 }
 protected override void ProcessRecord()
 {
     WebPartTransformationHelper webPartTransformationHelper = new WebPartTransformationHelper();
     webPartTransformationHelper.ReplaceWebPart(WebUrl, TargetWebPartFileName, TargetWebPartXmlFile, SourceWebPartStorageKey, WebPartZoneIndex, WebPartZoneID, ServerRelativePageUrl, OutPutDirectory, SharePointOnline_OR_OnPremise, UserName, Password, Domain, "web");
 }
Esempio n. 10
0
 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);
 }