├── Documentation ├── Figures │ ├── pnp-partner-pack-mmc.png │ ├── pnp-partner-pack-run.png │ ├── Fig-03-WebApp-Details.png │ ├── Fig-06-Azure-AD-Button.png │ ├── pnp-partner-pack-debug.png │ ├── pnp-partner-pack-https.png │ ├── pnp-partner-pack-snapin.png │ ├── Fig-01-StorageAccount-01.png │ ├── Fig-07-Azure-AD-Main-Page.png │ ├── Fig-14-O365-App-Launcher.png │ ├── pnp-partner-pack-editconfig.png │ ├── Fig-02-StorageAccount-02-Keys.png │ ├── Fig-06-Azure-AD-App-Config-01.png │ ├── Fig-11-Azure-AD-App-Config-02.png │ ├── Fig-12-Azure-AD-App-Config-03.png │ ├── Fig-13-Azure-AD-App-Config-04.png │ ├── pnp-partner-pack-editconfig-2.png │ ├── pnp-partner-pack-editconfig-3.png │ ├── pnp-partner-pack-editconfig-4.png │ ├── pnp-partner-pack-editconfig-5.png │ ├── pnp-partner-pack-editconfig-6.png │ ├── Fig-16-PnP-Partner-Pack-Home-Page.png │ ├── Fig-04-Azure-Web-App-Certificate-01.png │ ├── Fig-05-Azure-Web-App-Certificate-02.png │ ├── Fig-10-Azure-AD-Add-AplicationSecret.png │ ├── Fig-15-O365-PnP-Partner-Pack-App-Icon.png │ ├── pnp-partner-pack-azuread-app-localhost.png │ ├── pnp-partner-pack-azuread-app-manifest.png │ ├── pnp-partner-pack-snapin-certificates-2.png │ ├── pnp-partner-pack-snapin-certificates-3.png │ ├── pnp-partner-pack-snapin-certificates-4.png │ ├── pnp-partner-pack-snapin-certificates-5.png │ ├── pnp-partner-pack-snapin-certificates-6.png │ ├── pnp-partner-pack-snapin-certificates-7.png │ ├── pnp-partner-pack-snapin-certificates.png │ ├── Fig-08-Azure-AD-Add-Application-Step-01.png │ ├── Fig-09-Azure-AD-Add-Application-Step-02.png │ ├── Fig-03-Azure-AD-Add-Application-Step-01 - Copy.png │ └── Fig-05-Azure-AD-Add-Application-Step-03 - Copy.png └── PnP-Partner-Pack-Introduction.pptx ├── OfficeDevPnP.PartnerPack.SiteProvisioning ├── OfficeDevPnP.PartnerPack.SiteProvisioning │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Home │ │ │ ├── SubSiteInformation.cshtml │ │ │ ├── ApplyProvisioningTemplate.cshtml │ │ │ ├── SiteCreated.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── SearchTemplates.cshtml │ │ │ ├── GetSiteCollectionSettings.cshtml │ │ │ ├── SiteCollectionInformation.cshtml │ │ │ ├── MyProvisionedSites.cshtml │ │ │ └── UpdateSiteTemplate.cshtml │ │ ├── Shared │ │ │ ├── EditorTemplates │ │ │ │ ├── TemplateLocation.cshtml │ │ │ │ ├── MultipleFilesUpload.cshtml │ │ │ │ ├── FileUpload.cshtml │ │ │ │ ├── ManagedPath.cshtml │ │ │ │ ├── SitePolicy.cshtml │ │ │ │ ├── TimeZoneInfo.cshtml │ │ │ │ ├── Int32.cshtml │ │ │ │ ├── Int64.cshtml │ │ │ │ ├── Double.cshtml │ │ │ │ ├── Time.cshtml │ │ │ │ ├── Boolean.cshtml │ │ │ │ ├── Multilines.cshtml │ │ │ │ ├── String.cshtml │ │ │ │ └── LocaleID.cshtml │ │ │ ├── _WorkingOnIt.cshtml │ │ │ ├── Error.cshtml │ │ │ └── _Office365NavBar.cshtml │ │ ├── Governance │ │ │ ├── Temporary.cshtml │ │ │ ├── BatchScheduled.cshtml │ │ │ └── BatchStartup.cshtml │ │ └── Web.config │ ├── Global.asax │ ├── AppIcon.png │ ├── favicon.ico │ ├── PnP-O365-App-Icon.png │ ├── Scripts │ │ ├── _references.js │ │ └── custom.js │ ├── Templates │ │ ├── PnP-Empty-Site.xml │ │ ├── Infrastructure │ │ │ ├── PnP.png │ │ │ ├── PnP-Partner-Pack-Infrastructure-Jobs.xml │ │ │ └── PnP-Partner-Pack-Infrastructure-Templates.xml │ │ ├── PnP-Empty-Sub-Site.xml │ │ ├── CustomBar │ │ │ └── SPO-CustomBar.xml │ │ ├── PnP-Partner-Pack-Infrastructure-Contents.xml │ │ ├── Overrides │ │ │ └── PnP-Partner-Pack-Overrides.xml │ │ └── Responsive │ │ │ ├── SPO-Responsive.js │ │ │ └── SPO-Responsive.xml │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── Models │ │ ├── UpdateSiteTemplateViewModel.cs │ │ ├── IndexViewModel.cs │ │ ├── MyProvisionedSitesViewModel.cs │ │ ├── SearchTemplatesViewModel.cs │ │ ├── JobViewModel.cs │ │ ├── CreateSubSiteViewModel.cs │ │ ├── SettingsViewModel.cs │ │ ├── SiteCollectionsBatchViewModel.cs │ │ ├── ApplyProvisioningTemplateViewModel.cs │ │ ├── BrandingViewModel.cs │ │ ├── UpdateTemplatesViewModel.cs │ │ └── SaveTemplateViewModel.cs │ ├── Startup.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── RouteConfig.cs │ │ └── BundleConfig.cs │ ├── Content │ │ ├── sass │ │ │ ├── _Fabric.Common.scss │ │ │ ├── Fabric.Grid.Output.scss │ │ │ ├── _Fabric.Grid.scss │ │ │ ├── _Fabric.ZIndex.Variables.scss │ │ │ ├── Fabric.Icons.Font.Output.scss │ │ │ ├── Fabric.scss │ │ │ ├── _Fabric.Typography.Variables.scss │ │ │ ├── Fabric.RTL.scss │ │ │ ├── _Fabric.Responsive.Variables.scss │ │ │ ├── _Office.Color.Variables.scss │ │ │ ├── Fabric.Utilities.Output.scss │ │ │ ├── Fabric.Components.scss │ │ │ ├── Fabric.Animations.RTL.Output.scss │ │ │ ├── _Fabric.Utilities.scss │ │ │ └── _Fabric.Animations.RTL.scss │ │ └── peoplepickercontrol.css │ ├── Components │ │ ├── MSGraphAPISettings.cs │ │ ├── LightGraphUser.cs │ │ ├── UserUtility.cs │ │ └── MSGraphAPIContext.cs │ ├── Binders │ │ └── PrincipalViewModelBinder.cs │ ├── Global.asax.cs │ ├── Filters │ │ └── SharePointContextFilterAttribute.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── SupportFiles │ │ └── BatchModel.xml ├── OfficeDevPnP.PartnerPack.Setup │ ├── Resources │ │ ├── PnPMan.png │ │ └── azure-ad-app-manifest.json │ ├── Properties │ │ ├── Settings.settings │ │ └── Settings.Designer.cs │ ├── ViewModel │ │ ├── AzureLocation.cs │ │ ├── AzureSubscription.cs │ │ ├── ViewModelLocator.cs │ │ ├── AzureLocations.cs │ │ ├── AzureSubscriptions.cs │ │ └── ViewModelBase.cs │ ├── Components │ │ ├── AzureAppServiceSetting.cs │ │ ├── AzureAdApplications.cs │ │ ├── StorageKeys.cs │ │ ├── ResourceGroupCreation.cs │ │ ├── GraphError.cs │ │ ├── AzureAdApplicationPasswordCredential.cs │ │ ├── ActionCommand.cs │ │ ├── PasswordBoxEx.cs │ │ ├── RequiredIfAttribute.cs │ │ └── AzureAdApplication.cs │ ├── App.xaml.cs │ ├── App.xaml │ ├── Scripts │ │ ├── MsBuildWebJob.ps1 │ │ └── MsBuildWebSite.ps1 │ └── App.config ├── OfficeDevPnP.PartnerPack.ContinousJob │ ├── Properties │ │ ├── webjob-publish-settings.json │ │ └── AssemblyInfo.cs │ ├── Program.cs │ └── Functions.cs ├── OfficeDevPnP.PartnerPack.ScheduledJob │ ├── Properties │ │ ├── webjob-publish-settings.json │ │ └── AssemblyInfo.cs │ ├── Functions.cs │ ├── Program.cs │ └── PnPPartnerPackProvisioningJob.cs ├── OfficeDevPnP.PartnerPack.CheckAdminsJob │ ├── Properties │ │ ├── webjob-publish-settings.json │ │ └── AssemblyInfo.cs │ └── Program.cs ├── OfficeDevPnP.PartnerPack.ExternalUsersJob │ ├── Properties │ │ ├── webjob-publish-settings.json │ │ └── AssemblyInfo.cs │ └── Program.cs ├── OfficeDevPnP.PartnerPack.Infrastructure │ ├── Jobs │ │ ├── RefreshSitesJob.cs │ │ ├── BrandingJob.cs │ │ ├── RefreshSingleSiteJob.cs │ │ ├── SiteCollectionsBatchJob.cs │ │ ├── Handlers │ │ │ ├── ContinousJobItem.cs │ │ │ ├── RefreshSingleSiteJobHandler.cs │ │ │ └── ProvisioningTemplateJobHandler.cs │ │ ├── ProvisioningTemplateLocation.cs │ │ ├── ApplyProvisioningTemplateJob.cs │ │ ├── SubSiteProvisioningJob.cs │ │ ├── ProvisioningJob.cs │ │ ├── BrandingSettings.cs │ │ ├── ProvisioningJobInformation.cs │ │ └── SiteCollectionProvisioningJob.cs │ ├── SharePoint │ │ ├── SharePointGlobalTemplateRepository.cs │ │ └── SharePointLocalTemplateRepository.cs │ ├── TemplatesProviders │ │ ├── SharePointSearchCacheKey.cs │ │ ├── PnPTemplatesGalleryResultItem.cs │ │ ├── SharePointGlobalTemplatesProvider.cs │ │ └── SharePointLocalTemplatesProvider.cs │ ├── IConfigurable.cs │ ├── UserRoles.cs │ ├── Configuration │ │ └── PnPPartnerPackConfigurationSectionHandler.cs │ ├── TargetScope.cs │ ├── MicrosoftGraphConstants.cs │ ├── TargetPlatform.cs │ ├── SiteCollectionSettings.cs │ ├── JobStatus.cs │ ├── SiteTemplateInfo.cs │ ├── Diagnostics │ │ └── RemoveWordsFilter.cs │ ├── ProvisioningRepositoryFactory.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ITemplatesProvider.cs │ ├── ProvisioningTemplateInformation.cs │ └── ITemplateRepository.cs ├── PublishScripts │ └── Configurations │ │ └── OfficeDevPnPPartnerPackSiteProvisioning-WAWS-dev.json └── OfficeDevPnP.PartnerPack.SiteProvisioning.Tests │ ├── Controllers │ └── HomeControllerTest.cs │ ├── packages.config │ └── Properties │ └── AssemblyInfo.cs ├── scripts ├── Get-SelfSignedCertificateInformation.ps1 └── Reset-Configs.ps1 └── LICENSE /Documentation/Figures/pnp-partner-pack-mmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-mmc.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-run.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-03-WebApp-Details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-03-WebApp-Details.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-06-Azure-AD-Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-06-Azure-AD-Button.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-debug.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-https.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-https.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin.png -------------------------------------------------------------------------------- /Documentation/PnP-Partner-Pack-Introduction.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/PnP-Partner-Pack-Introduction.pptx -------------------------------------------------------------------------------- /Documentation/Figures/Fig-01-StorageAccount-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-01-StorageAccount-01.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-07-Azure-AD-Main-Page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-07-Azure-AD-Main-Page.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-14-O365-App-Launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-14-O365-App-Launcher.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Documentation/Figures/Fig-02-StorageAccount-02-Keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-02-StorageAccount-02-Keys.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-06-Azure-AD-App-Config-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-06-Azure-AD-App-Config-01.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-11-Azure-AD-App-Config-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-11-Azure-AD-App-Config-02.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-12-Azure-AD-App-Config-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-12-Azure-AD-App-Config-03.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-13-Azure-AD-App-Config-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-13-Azure-AD-App-Config-04.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig-2.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig-3.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig-4.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig-5.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-editconfig-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-editconfig-6.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-16-PnP-Partner-Pack-Home-Page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-16-PnP-Partner-Pack-Home-Page.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-04-Azure-Web-App-Certificate-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-04-Azure-Web-App-Certificate-01.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-05-Azure-Web-App-Certificate-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-05-Azure-Web-App-Certificate-02.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-10-Azure-AD-Add-AplicationSecret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-10-Azure-AD-Add-AplicationSecret.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-15-O365-PnP-Partner-Pack-App-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-15-O365-PnP-Partner-Pack-App-Icon.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-azuread-app-localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-azuread-app-localhost.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-azuread-app-manifest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-azuread-app-manifest.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-2.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-3.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-4.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-5.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-6.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates-7.png -------------------------------------------------------------------------------- /Documentation/Figures/pnp-partner-pack-snapin-certificates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/pnp-partner-pack-snapin-certificates.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-08-Azure-AD-Add-Application-Step-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-08-Azure-AD-Add-Application-Step-01.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-09-Azure-AD-Add-Application-Step-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-09-Azure-AD-Add-Application-Step-02.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-03-Azure-AD-Add-Application-Step-01 - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-03-Azure-AD-Add-Application-Step-01 - Copy.png -------------------------------------------------------------------------------- /Documentation/Figures/Fig-05-Azure-AD-Add-Application-Step-03 - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/Documentation/Figures/Fig-05-Azure-AD-Add-Application-Step-03 - Copy.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="OfficeDevPnP.PartnerPack.SiteProvisioning.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Resources/PnPMan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Resources/PnPMan.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/AppIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/AppIcon.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/favicon.ico -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/PnP-O365-App-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/PnP-O365-App-Icon.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Scripts/_references.js -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Empty-Site.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Empty-Site.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP.png -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Empty-Sub-Site.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Empty-Sub-Site.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/CustomBar/SPO-CustomBar.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/CustomBar/SPO-CustomBar.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Partner-Pack-Infrastructure-Contents.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/PnP-Partner-Pack-Infrastructure-Contents.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP-Partner-Pack-Infrastructure-Jobs.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP-Partner-Pack-Infrastructure-Jobs.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP-Partner-Pack-Infrastructure-Templates.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sharepoint/PnP-Partner-Pack/master/OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Infrastructure/PnP-Partner-Pack-Infrastructure-Templates.xml -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ContinousJob/Properties/webjob-publish-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", 3 | "webJobName": "ContinousJob", 4 | "startTime": null, 5 | "endTime": null, 6 | "jobRecurrenceFrequency": null, 7 | "interval": null, 8 | "runMode": "Continuous" 9 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ScheduledJob/Properties/webjob-publish-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", 3 | "webJobName": "ScheduledJob", 4 | "startTime": null, 5 | "endTime": null, 6 | "jobRecurrenceFrequency": null, 7 | "interval": null, 8 | "runMode": "OnDemand" 9 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/SubSiteInformation.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.CreateSubSiteViewModel 2 | 3 |
4 |
5 | @Html.EditorFor(model => model.InheritPermissions) 6 |
7 |
8 | 9 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.CheckAdminsJob/Properties/webjob-publish-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", 3 | "webJobName": "CheckAdminsJob", 4 | "startTime": "2015-10-27T06:00:00+01:00", 5 | "endTime": null, 6 | "jobRecurrenceFrequency": "Day", 7 | "interval": 1, 8 | "runMode": "Scheduled" 9 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ExternalUsersJob/Properties/webjob-publish-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json", 3 | "webJobName": "ExternalUsersWebJob", 4 | "startTime": "2015-10-27T06:00:00+01:00", 5 | "endTime": null, 6 | "jobRecurrenceFrequency": "Day", 7 | "interval": 1, 8 | "runMode": "Scheduled" 9 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/UpdateSiteTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 7 | { 8 | public class UpdateSiteTemplateViewModel : JobViewModel 9 | { 10 | public String TargetSiteUrl { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Owin; 4 | using Owin; 5 | 6 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 7 | { 8 | public partial class Startup 9 | { 10 | public void Configuration(IAppBuilder app) 11 | { 12 | ConfigureAuth(app); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/AzureLocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 8 | { 9 | public class AzureLocation 10 | { 11 | public String Name { get; set; } 12 | 13 | public String DisplayName { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 7 | { 8 | public class IndexViewModel 9 | { 10 | public String InfrastructuralSiteUrl { get; set; } 11 | public String CurrentUserPrincipalName { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/RefreshSitesJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines an Refresh Sites Job 11 | /// 12 | public class RefreshSitesJob : ProvisioningJob 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/AzureAppServiceSetting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.Components 8 | { 9 | public class AzureAppServiceSetting 10 | { 11 | public String Name { get; set; } 12 | 13 | public String Value { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/AzureSubscription.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 8 | { 9 | public class AzureSubscription 10 | { 11 | public Guid SubscriptionId { get; set; } 12 | 13 | public String DisplayName { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/TemplateLocation.cshtml: -------------------------------------------------------------------------------- 1 | @model System.String 2 | 3 | @{ 4 | var locations = new SelectListItem[] { 5 | new SelectListItem { Text = "Site Collection", Value = "Local" }, 6 | new SelectListItem { Text = "Tenant", Value = "Global" } 7 | }; 8 | } 9 | @Html.DropDownListFor(model => model, locations) 10 | @Html.ValidationMessageFor(model => model) 11 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/MyProvisionedSitesViewModel.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 8 | { 9 | public class MyProvisionedSitesViewModel 10 | { 11 | public ProvisioningJob[] PersonalJobs { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 8 | { 9 | public class ViewModelLocator 10 | { 11 | private static MainViewModel _main = new MainViewModel(); 12 | 13 | public MainViewModel Main => _main; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/SearchTemplatesViewModel.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.Infrastructure; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 8 | { 9 | public class SearchTemplatesViewModel 10 | { 11 | public ProvisioningTemplateInformation[] SearchResults { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/BrandingJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 9 | { 10 | /// 11 | /// Defines a Branding application Job 12 | /// 13 | public class BrandingJob : ProvisioningJob 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/AzureLocations.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 9 | { 10 | public class AzureLocations 11 | { 12 | [JsonProperty(PropertyName = "Value")] 13 | public AzureLocation[] Locations { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/AzureAdApplications.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.Components 9 | { 10 | public class AzureAdApplications 11 | { 12 | [JsonProperty("value")] 13 | public List Applications { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/JobViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 7 | { 8 | /// 9 | /// Basic abstract class that defines a ViewModel for a generic job 10 | /// 11 | public abstract class JobViewModel 12 | { 13 | public Guid? JobId { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/AzureSubscriptions.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 9 | { 10 | public class AzureSubscriptions 11 | { 12 | [JsonProperty(PropertyName = "Value")] 13 | public AzureSubscription[] Subscriptions { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/ApplyProvisioningTemplate.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.ApplyProvisioningTemplateViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Apply Provisioning Template!"; 5 | } 6 | 7 |
8 |
9 |
10 | Use this page to provision one or more Provisioning Templates to a target Site. 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/CreateSubSiteViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 9 | { 10 | public class CreateSubSiteViewModel : CreateSiteViewModel 11 | { 12 | [DisplayName("Inherit Permissions from Site Collection")] 13 | public bool InheritPermissions { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Security.Principal; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | 10 | namespace OfficeDevPnP.PartnerPack.Setup 11 | { 12 | /// 13 | /// Interaction logic for App.xaml 14 | /// 15 | public partial class App : Application 16 | { 17 | public App() 18 | { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/StorageKeys.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.Components 8 | { 9 | public class Key 10 | { 11 | public string keyName { get; set; } 12 | public string permissions { get; set; } 13 | public string value { get; set; } 14 | } 15 | 16 | public class StorageKeys 17 | { 18 | public List keys { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/SharePoint/SharePointGlobalTemplateRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.SharePoint 8 | { 9 | /// 10 | /// Provides the implementation of a Provisioning Templates Repository for Global tenant-level templates stored in SharePoint 11 | /// 12 | public class SharePointGlobalTemplateRepository : SharePointTemplateRepository 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/SharePoint/SharePointLocalTemplateRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.SharePoint 8 | { 9 | /// 10 | /// Provides the implementation of a Provisioning Templates Repository for Site Collection local templates stored in SharePoint 11 | /// 12 | public class SharePointLocalTemplateRepository : SharePointTemplateRepository 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TemplatesProviders/SharePointSearchCacheKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.TemplatesProviders 8 | { 9 | internal class SharePointSearchCacheKey 10 | { 11 | public String TemplatesProviderTypeName { get; set; } 12 | 13 | public String SearchText { get; set; } 14 | 15 | public TargetPlatform Platforms { get; set; } 16 | 17 | public TargetScope Scope { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/IConfigurable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Xml.Linq; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Infrastructure 9 | { 10 | /// 11 | /// Defines the behavior for a configurable object instance 12 | /// 13 | public interface IConfigurable 14 | { 15 | /// 16 | /// Initializes the Configurable object instance 17 | /// 18 | void Init(XElement configuration); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Governance/Temporary.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.IndexViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Governance"; 5 | } 6 | 7 |
8 |
9 |
10 | This is a temporary page for a Governance action! 11 |
12 |
13 |
14 |
15 |   16 |
17 |
18 |
19 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/RefreshSingleSiteJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines an Refresh Job for a single site 11 | /// 12 | public class RefreshSingleSiteJob : ProvisioningJob 13 | { 14 | /// 15 | /// Defines the Target Site URL of the Provisioning Template 16 | /// 17 | public String TargetSiteUrl { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Common.scss: -------------------------------------------------------------------------------- 1 | @import "./Fabric.Animations"; 2 | @import "./Fabric.Color.Mixins"; 3 | @import "./Fabric.Color.Variables"; 4 | @import "./Fabric.Grid"; 5 | @import "./Fabric.Icons"; 6 | @import "./Fabric.Mixins"; 7 | @import "./Fabric.Mixins.RTL"; 8 | @import './Fabric.Responsive.Utilities.Variables'; 9 | @import "./Fabric.Responsive.Variables"; 10 | @import "./Fabric.Typography"; 11 | @import "./Fabric.Typography.Fonts"; 12 | @import "./Fabric.Typography.Variables"; 13 | @import "./Fabric.Utilities"; 14 | @import "./Fabric.ZIndex.Variables"; 15 | @import "./Office.Color.Variables"; -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/PublishScripts/Configurations/OfficeDevPnPPartnerPackSiteProvisioning-WAWS-dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "environmentSettings": { 3 | "webSite": { 4 | "name": "pnp-partner-pack", 5 | "location": "North Europe" 6 | }, 7 | "databases": [ 8 | { 9 | "connectionStringName": "", 10 | "databaseName": "", 11 | "serverName": "", 12 | "user": "", 13 | "password": "", 14 | "edition": "", 15 | "size": "", 16 | "collation": "" 17 | } 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/SiteCollectionsBatchJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines a Site Collections Batch Provisioning Job 11 | /// 12 | public class SiteCollectionsBatchJob : ProvisioningJob 13 | { 14 | /// 15 | /// Defines a JSON representation of the sites to create 16 | /// 17 | public String BatchSites { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/ResourceGroupCreation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Setup.Components 8 | { 9 | public class Properties 10 | { 11 | public string provisioningState { get; set; } 12 | } 13 | 14 | public class ResourceGroupCreation 15 | { 16 | public string id { get; set; } 17 | public string name { get; set; } 18 | public string location { get; set; } 19 | public Properties properties { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/Handlers/ContinousJobItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs.Handlers 8 | { 9 | /// 10 | /// Defines an item to enqueue on the Azure Storage Queue targeting a job to execute in Continous mode 11 | /// 12 | public class ContinousJobItem 13 | { 14 | /// 15 | /// The GUID of the Job to execute 16 | /// 17 | public Guid JobId { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/UserRoles.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Infrastructure 9 | { 10 | public class UserRoles 11 | { 12 | [JsonProperty("value")] 13 | public List Roles { get; set; } 14 | } 15 | 16 | public class UserRole 17 | { 18 | [JsonProperty("@odata.type")] 19 | public String DataType { get; set; } 20 | public Guid Id { get; set; } 21 | public String DisplayName { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ScheduledJob/Functions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Microsoft.Azure.WebJobs; 8 | 9 | namespace OfficeDevPnP.PartnerPack.ScheduledJob 10 | { 11 | public class Functions 12 | { 13 | // This function will get triggered/executed when a new message is written 14 | // on an Azure Queue called queue. 15 | public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TextWriter log) 16 | { 17 | log.WriteLine(message); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/SettingsViewModel.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.Infrastructure; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 9 | { 10 | public class SettingsViewModel 11 | { 12 | /// 13 | /// The Site Collections in the current Tenant 14 | /// 15 | [DisplayName("Select a Site Collection")] 16 | public String SelectedSiteCollection { get; set; } 17 | 18 | public SiteCollectionSettings[] SiteCollections { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/SiteCollectionsBatchViewModel.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 8 | { 9 | public class SiteCollectionsBatchViewModel : JobViewModel 10 | { 11 | public BatchStep Step { get; set; } 12 | 13 | public batches Sites { get; set; } 14 | 15 | public String SitesJson { get; set; } 16 | } 17 | 18 | public enum BatchStep 19 | { 20 | BatchStartup, 21 | BatchFileUploaded, 22 | BatchScheduled, 23 | } 24 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Governance/BatchScheduled.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.SiteCollectionsBatchViewModel 2 | 3 | @using OfficeDevPnP.PartnerPack.SiteProvisioning.Models 4 | 5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 | The Batch process has been scheduled. The ID assigned to the Job is: @Model.JobId. 13 |
14 |
15 |
16 | 17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/ProvisioningTemplateLocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines where to store a provisioning template 11 | /// 12 | public enum ProvisioningTemplateLocation 13 | { 14 | /// 15 | /// Store the template in the Global infrastructural Site Collection 16 | /// 17 | Global, 18 | /// 19 | /// Store the template in the Local Site Collection 20 | /// 21 | Local, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/MultipleFilesUpload.cshtml: -------------------------------------------------------------------------------- 1 | @model List 2 | @{ 3 | var fieldId = Html.IdFor(m => m); 4 | var fieldName = Html.NameFor(m => m); 5 | var isRequired = ViewData.ModelMetadata.IsRequired; 6 | var isReadOnly = ViewData.Keys.Contains("readonly"); 7 | 8 | } 9 | 10 |
11 | 12 | 13 |
14 |
15 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/ApplyProvisioningTemplateJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | public class ApplyProvisioningTemplateJob : ProvisioningJob 10 | { 11 | /// 12 | /// Defines the Provisioning Template to use for the Site Collection or Sub site to provision 13 | /// 14 | public String ProvisioningTemplateUrl { get; set; } 15 | 16 | /// 17 | /// Defines the Target Site URL of the Provisioning Template 18 | /// 19 | public String TargetSiteUrl { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/GraphError.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.Components 9 | { 10 | public class InnerError 11 | { 12 | [JsonProperty("request-id")] 13 | public Guid requestId { get; set; } 14 | public string date { get; set; } 15 | } 16 | 17 | public class Error 18 | { 19 | public string code { get; set; } 20 | public string message { get; set; } 21 | public InnerError innerError { get; set; } 22 | } 23 | 24 | public class GraphError 25 | { 26 | public Error error { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/FileUpload.cshtml: -------------------------------------------------------------------------------- 1 | @model HttpPostedFileBase 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | var isReadOnly = ViewData.Keys.Contains("readonly"); 8 | } 9 |
10 | 11 | 12 |
13 |
14 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/AzureAdApplicationPasswordCredential.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.Components 9 | { 10 | public class AzureAdApplicationPasswordCredential 11 | { 12 | public object CustomKeyIdentifier { get; set; } 13 | 14 | [JsonProperty("startDateTime")] 15 | public string StartDate { get; set; } 16 | [JsonProperty("endDateTime")] 17 | public string EndDate { get; set; } 18 | 19 | public string KeyId { get; set; } 20 | 21 | [JsonProperty("secretText")] 22 | public object Value { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /scripts/Get-SelfSignedCertificateInformation.ps1: -------------------------------------------------------------------------------- 1 | $certPath = Read-Host "Enter certificate path (.cer)" 2 | $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 3 | $cert.Import($certPath) 4 | $rawCert = $cert.GetRawCertData() 5 | $base64Cert = [System.Convert]::ToBase64String($rawCert) 6 | $rawCertHash = $cert.GetCertHash() 7 | $base64CertHash = [System.Convert]::ToBase64String($rawCertHash) 8 | $KeyId = [System.Guid]::NewGuid().ToString() 9 | 10 | $keyCredentials = 11 | '"keyCredentials": [ 12 | { 13 | "customKeyIdentifier": "'+ $base64CertHash + '", 14 | "keyId": "' + $KeyId + '", 15 | "type": "AsymmetricX509Cert", 16 | "usage": "Verify", 17 | "value": "' + $base64Cert + '" 18 | } 19 | ],' 20 | $keyCredentials 21 | 22 | Write-Host "Certificate Thumbprint:" $cert.Thumbprint -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Components/MSGraphAPISettings.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using System.Collections.Generic; 3 | //using System.Configuration; 4 | //using System.Linq; 5 | //using System.Web; 6 | 7 | //namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Components 8 | //{ 9 | // public static class MSGraphAPISettings 10 | // { 11 | // public static string ClientId { get { return ConfigurationManager.AppSettings["ida:ClientId"]; } } 12 | // public static string ClientSecret { get { return ConfigurationManager.AppSettings["ida:ClientSecret"]; } } 13 | // public static string AADInstance { get { return ConfigurationManager.AppSettings["ida:AADInstance"]; } } 14 | 15 | // public static string MicrosoftGraphResourceId = "https://graph.microsoft.com"; 16 | // } 17 | //} -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ContinousJob/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure.WebJobs; 7 | 8 | namespace OfficeDevPnP.PartnerPack.ContinousJob 9 | { 10 | // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976 11 | class Program 12 | { 13 | // Please set the following connection strings in app.config for this WebJob to run: 14 | // AzureWebJobsDashboard and AzureWebJobsStorage 15 | static void Main() 16 | { 17 | var host = new JobHost(); 18 | // The following code ensures that the WebJob will be running continuously 19 | host.RunAndBlock(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Configuration/PnPPartnerPackConfigurationSectionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Xml; 8 | using System.Xml.Serialization; 9 | 10 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Configuration 11 | { 12 | public class PnPPartnerPackConfigurationSectionHandler : IConfigurationSectionHandler 13 | { 14 | public object Create(object parent, object configContext, XmlNode section) 15 | { 16 | XmlNodeReader xnr = new XmlNodeReader(section); 17 | XmlSerializer xs = new XmlSerializer(typeof(PnPPartnerPackConfiguration)); 18 | return (xs.Deserialize(xnr)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/SubSiteProvisioningJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines a Sub Site Provisioning Job 11 | /// 12 | public class SubSiteProvisioningJob : SiteProvisioningJob 13 | { 14 | /// 15 | /// Defines the URL of the Parent Web 16 | /// 17 | public String ParentSiteUrl { get; set; } 18 | 19 | /// 20 | /// Declares whether to inherit permissions from the parent Site Collection during Site provisioning 21 | /// 22 | public Boolean InheritPermissions { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Components/LightGraphUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Components 7 | { 8 | public class LightGraphUser 9 | { 10 | /// 11 | /// The unique ID of the entity 12 | /// 13 | public String Id { get; set; } 14 | 15 | /// 16 | /// Display Name of the user 17 | /// 18 | public String DisplayName; 19 | 20 | /// 21 | /// Mail of the user 22 | /// 23 | public String Mail; 24 | 25 | /// 26 | /// UPN for the user 27 | /// 28 | public String UserPrincipalName; 29 | } 30 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TargetScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// Defines the available scopes for a Provisioning Template definition 11 | /// 12 | public enum TargetScope 13 | { 14 | /// 15 | /// Defines a Provisioning Template for a Site Collection 16 | /// 17 | Site, 18 | /// 19 | /// Defines a Provisioning Template for a Sub Site 20 | /// 21 | Web, 22 | /// 23 | /// Defines a Provisioning Template that can be applied as a partial add-on to a site 24 | /// 25 | Partial, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning.Tests/Controllers/HomeControllerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | using OfficeDevPnP.PartnerPack.SiteProvisioning; 8 | using OfficeDevPnP.PartnerPack.SiteProvisioning.Controllers; 9 | 10 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Tests.Controllers 11 | { 12 | [TestClass] 13 | public class HomeControllerTest 14 | { 15 | [TestMethod] 16 | public void Index() 17 | { 18 | // Arrange 19 | HomeController controller = new HomeController(); 20 | 21 | // Act 22 | ViewResult result = controller.Index() as ViewResult; 23 | 24 | // Assert 25 | Assert.IsNotNull(result); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.Grid.Output.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Fluid 12-column grids for small, medium, and large devices 7 | 8 | @import "Fabric.Grid"; 9 | 10 | //== Grid container (same for all sizes) 11 | // 12 | .ms-Grid { 13 | @include ms-Grid; 14 | } 15 | 16 | //== Grid rows (pull first and last column out) 17 | // 18 | .ms-Grid-row { 19 | @include ms-Grid-row; 20 | } 21 | 22 | //== Grid cells 23 | // 24 | .ms-Grid-col { 25 | @include ms-Grid-col; 26 | } 27 | 28 | // For nested grids (a grid inside a column), removing the padding 29 | // so that the nested grid's columns go to the edge of the parent's. 30 | .ms-Grid-col .ms-Grid { 31 | padding: 0; 32 | } 33 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/MicrosoftGraphConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// Contains a bunch of constanta strings and values for the Microsoft Graph 11 | /// 12 | public static class MicrosoftGraphConstants 13 | { 14 | public static String MicrosoftGraphV1BaseUri = "https://graph.microsoft.com/v1.0/"; 15 | public static String MicrosoftGraphBetaBaseUri = "https://graph.microsoft.com/beta/"; 16 | public static String MicrosoftGraphResourceId = "https://graph.microsoft.com"; 17 | 18 | public static String GlobalTenantAdminRole = "Company Administrator"; 19 | public static String GlobalSPOAdminRole = "SharePoint Service Administrator"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Grid.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Fluid 12-column grids for small, medium, and large devices 7 | 8 | 9 | //== Grid container (same for all sizes) 10 | // 11 | @mixin ms-Grid { 12 | @include ms-u-borderBox; 13 | @include ms-u-clearfix; 14 | padding: 0 8px; 15 | } 16 | 17 | //== Grid rows (pull first and last column out) 18 | // 19 | @mixin ms-Grid-row { 20 | margin: 0 -8px; 21 | @include ms-u-borderBox; 22 | @include ms-u-clearfix; 23 | } 24 | 25 | //== Grid cells 26 | // 27 | @mixin ms-Grid-col { 28 | position: relative; 29 | min-height: 1px; 30 | padding-left: 8px; 31 | padding-right: 8px; 32 | @include ms-u-borderBox; 33 | float: left; 34 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ScheduledJob/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure.WebJobs; 7 | using OfficeDevPnP.PartnerPack.Infrastructure; 8 | 9 | namespace OfficeDevPnP.PartnerPack.ScheduledJob 10 | { 11 | class Program 12 | { 13 | static void Main() 14 | { 15 | var job = new PnPPartnerPackProvisioningJob(); 16 | job.UseThreading = false; 17 | 18 | job.AddSite(PnPPartnerPackSettings.InfrastructureSiteUrl); 19 | 20 | job.UseAzureADAppOnlyAuthentication( 21 | PnPPartnerPackSettings.ClientId, 22 | PnPPartnerPackSettings.Tenant, 23 | PnPPartnerPackSettings.AppOnlyCertificate); 24 | 25 | job.Run(); 26 | 27 | #if DEBUG 28 | Console.ReadLine(); 29 | #endif 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/ApplyProvisioningTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 9 | { 10 | public class ApplyProvisioningTemplateViewModel : JobViewModel 11 | { 12 | [Required(ErrorMessage = "Relative URL is a required field!")] 13 | [DisplayName("Relative URL")] 14 | public String RelativeUrl { get; set; } 15 | 16 | [Required(ErrorMessage = "Template is a required field!")] 17 | [DisplayName("Template")] 18 | [UIHint("ProvisioningTemplate")] 19 | public String ProvisioningTemplateUrl { get; set; } 20 | 21 | [DisplayName("Template Parameters")] 22 | public Dictionary TemplateParameters { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/ManagedPath.cshtml: -------------------------------------------------------------------------------- 1 | @model System.String 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | 8 | var managedPaths = new SelectListItem[] { 9 | new SelectListItem { Text = "/sites/", Value = "sites", Selected = Model == "sites" }, 10 | new SelectListItem { Text = "/teams/", Value = "teams", Selected = Model == "teams" }, 11 | }; 12 | } 13 |
14 | 15 | @Html.DropDownListFor(model => model, managedPaths, new { @class = "form-control", style = "width: 100px; display: inline;" }) 16 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/SitePolicy.cshtml: -------------------------------------------------------------------------------- 1 | @model System.String 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var isRequired = ViewData.ModelMetadata.IsRequired; 6 | 7 | var policies = 8 | new SelectListItem[] 9 | { 10 | new SelectListItem { Text = "Low Business Impact", Value = "LBI" }, 11 | new SelectListItem { Text = "Medium Business Impact", Value = "MBI" }, 12 | new SelectListItem { Text = "High Business Impact", Value = "HBI" }, 13 | }; 14 | } 15 | 16 | @Html.DropDownListFor(model => model, policies, new { @class = "form-control" }) 17 | @Html.ValidationMessageFor(model => model) 18 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TargetPlatform.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OfficeDevPnP.PartnerPack.Infrastructure 4 | { 5 | /// 6 | /// Defines the target platforms for a Provisioning Template 7 | /// 8 | [Flags] 9 | public enum TargetPlatform 10 | { 11 | /// 12 | /// No target platform 13 | /// 14 | None = 0, 15 | /// 16 | /// SharePoint 2013 17 | /// 18 | SharePoint2013 = 1, 19 | /// 20 | /// SharePoint 2016 21 | /// 22 | SharePoint2016 = 2, 23 | /// 24 | /// SharePoint Online 25 | /// 26 | SharePointOnline = 4, 27 | /// 28 | /// SharePoint 2013, SharePoint 2016, SharePoint Online 29 | /// 30 | All = SharePoint2013 | SharePoint2016 | SharePointOnline, 31 | } 32 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Binders/PrincipalViewModelBinder.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.SiteProvisioning.Components; 2 | using OfficeDevPnP.PartnerPack.SiteProvisioning.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | using System.Web.Mvc; 8 | 9 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Binders 10 | { 11 | public class PrincipalViewModelBinder : DefaultModelBinder 12 | { 13 | public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) 14 | { 15 | var model = (PrincipalViewModel)base.BindModel(controllerContext, bindingContext); 16 | 17 | if (!String.IsNullOrWhiteSpace(model.Mail)) 18 | { 19 | var result = UserUtility.GetUser("users/" + model.Mail); 20 | model.DisplayName = result?.DisplayName; 21 | } 22 | 23 | return model; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/SiteCollectionSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// Defines the general settings of a Site Collection from a PnP Partner Pack perspective 11 | /// 12 | public class SiteCollectionSettings 13 | { 14 | /// 15 | /// Defines the URL of the Site Collection 16 | /// 17 | public String Url { get; set; } 18 | 19 | /// 20 | /// Defines the Title of the Site Collection 21 | /// 22 | public String Title { get; set; } 23 | 24 | /// 25 | /// Declares whether the Site Collection has the PnP Partner Pack extensions provisioned 26 | /// 27 | public bool PnPPartnerPackEnabled { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.SiteProvisioning.Binders; 2 | using OfficeDevPnP.PartnerPack.SiteProvisioning.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IdentityModel.Claims; 6 | using System.Linq; 7 | using System.Web; 8 | using System.Web.Helpers; 9 | using System.Web.Mvc; 10 | using System.Web.Optimization; 11 | using System.Web.Routing; 12 | 13 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 14 | { 15 | public class MvcApplication : System.Web.HttpApplication 16 | { 17 | protected void Application_Start() 18 | { 19 | AreaRegistration.RegisterAllAreas(); 20 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 21 | RouteConfig.RegisterRoutes(RouteTable.Routes); 22 | BundleConfig.RegisterBundles(BundleTable.Bundles); 23 | 24 | AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.ZIndex.Variables.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Z-Index Layeringz 7 | 8 | 9 | // Base Layer Variables 10 | $ms-zIndex-0: 0; 11 | $ms-zIndex-1: 100; 12 | $ms-zIndex-2: 200; 13 | $ms-zIndex-3: 300; 14 | $ms-zIndex-4: 400; 15 | $ms-zIndex-5: 500; 16 | 17 | // Base Layer Modifier Variables 18 | $ms-zIndex-back: 0; 19 | $ms-zIndex-middle: 5; 20 | $ms-zIndex-front: 10; 21 | 22 | 23 | // Fabric Component Base Layer Assignments 24 | 25 | $ms-zIndex-Callout: $ms-zIndex-1; 26 | $ms-zIndex-ContextualMenu: $ms-zIndex-1; 27 | $ms-zIndex-Overlay: $ms-zIndex-2; 28 | $ms-zIndex-Panel: $ms-zIndex-3; 29 | $ms-zIndex-DatePicker: $ms-zIndex-3; 30 | $ms-zIndex-Dialog: $ms-zIndex-3; 31 | $ms-zIndex-PeoplePicker: $ms-zIndex-3; 32 | $ms-zIndex-Dropdown: $ms-zIndex-4; 33 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/_WorkingOnIt.cshtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |  Working on it... 4 |
5 | 6 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/JobStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// The status of a Provisioning Job 11 | /// 12 | [Flags] 13 | public enum ProvisioningJobStatus 14 | { 15 | /// 16 | /// The Provisioning Job is still pending 17 | /// 18 | Pending = 2, 19 | /// 20 | /// The Provisioning Job failed 21 | /// 22 | Failed = 4, 23 | /// 24 | /// The Provisioning Job has been cancelled 25 | /// 26 | Cancelled = 8, 27 | /// 28 | /// The Provisioning Job is running 29 | /// 30 | Running = 16, 31 | /// 32 | /// The Provisioning Job as been completed 33 | /// 34 | Provisioned = 32, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.Icons.Font.Output.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Icon font-family definition 7 | 8 | /* 9 | Your use of the content in the files referenced here are subject to the terms of the license at http://aka.ms/fabric-font-license 10 | */ 11 | 12 | @import "Fabric.Typography.Fonts"; 13 | 14 | @font-face { 15 | font-family: 'Office365Icons'; 16 | src: url('#{$ms-font-directory}/icons/office365icons.eot?'); 17 | src: url('#{$ms-font-directory}/icons/office365icons.eot?#iefix') format('embedded-opentype'), 18 | url('#{$ms-font-directory}/icons/office365icons.woff?') format('woff'), 19 | url('#{$ms-font-directory}/icons/office365icons.ttf?') format('truetype'), 20 | url('#{$ms-font-directory}/icons/office365icons.svg?#office365icons') format('svg'); 21 | font-weight: normal; 22 | font-style: normal; 23 | } 24 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/SiteCreated.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.CreateSiteViewModel 2 | 3 |
4 | 5 | 6 | 7 |
8 |
9 |
10 | The Site Provisioning Job has been scheduled. The ID assigned to the Job is: @Model.JobId. 11 |
12 |
13 |
14 | 15 | @if (Model.Scope == OfficeDevPnP.PartnerPack.Infrastructure.TargetScope.Web) 16 | { 17 |
18 | 23 |
24 | } 25 | 26 |
27 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/App.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/SiteTemplateInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// Defines the information about a template applied to a site 11 | /// 12 | public class SiteTemplateInfo 13 | { 14 | /// 15 | /// The template provider 16 | /// 17 | public String TemplateProviderType { get; set; } 18 | 19 | /// 20 | /// The URI of the applied template 21 | /// 22 | public String TemplateUri { get; set; } 23 | 24 | /// 25 | /// Any parameter value provided to the template 26 | /// 27 | public Dictionary TemplateParameters { get; set; } 28 | 29 | /// 30 | /// The latest date of application of the template 31 | /// 32 | public DateTime AppliedOn { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Oops! Exception occurred!"; 3 | Layout = "~/Views/Shared/_Layout.cshtml"; 4 | } 5 | 6 |
7 |
8 |
9 | 10 |
@Model.Exception.Message 11 | 12 | 13 |
14 |
15 |
@Model.Exception.StackTrace
16 |
17 |
18 |
19 |
20 | 21 | 36 | 37 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Diagnostics/RemoveWordsFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Diagnostics 5 | { 6 | /// 7 | /// Class to filter entries which contains some given words on Trace Listener 8 | /// 9 | public class RemoveWordsFilter : TraceFilter 10 | { 11 | 12 | public RemoveWordsFilter(String[] words) 13 | { 14 | _words = words; 15 | } 16 | 17 | public String[] _words { get; set; } 18 | 19 | override public bool ShouldTrace(TraceEventCache cache, string source, 20 | TraceEventType eventType, int id, string formatOrMessage, 21 | object[] args, object data, object[] dataArray) 22 | { 23 | if (formatOrMessage == null) return false; 24 | foreach (string word in _words) 25 | { 26 | if (formatOrMessage.Contains(word)) 27 | { 28 | return false; 29 | } 30 | } 31 | return true; 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Scripts/MsBuildWebJob.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [Parameter(Mandatory = $true)] [String]$ProjectPath 3 | # [Parameter(Mandatory = $true)] [String]$PublishingSettingsPath 4 | ) 5 | 6 | pushd $ProjectPath 7 | 8 | # Get the path of MSBuild v. 14.0.25420.1 or higher 9 | $vs15 = Get-ItemProperty "hklm:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7" 10 | $msBuild15Path = $vs15.'15.0' + "\MSBuild\15.0\bin\msbuild.exe" 11 | $vsVersion = "15.0" 12 | if (Test-Path $msBuild15Path) 13 | { 14 | $msbuildPath = $msBuild15Path 15 | } 16 | 17 | if ($msbuildPath -eq $null) 18 | { 19 | $msbuildPath = Get-ItemProperty "hklm:\SOFTWARE\Microsoft\MSBuild\14.0" 20 | $msbuildPath = $msbuildPath.MSBuildOverrideTasksPath.Substring(0, $msbuildPath.MSBuildOverrideTasksPath.IndexOf("\bin\") + 5) 21 | $msbuildPath = $msbuildPath + "MSBuild.exe" 22 | $vsVersion = "14.0" 23 | } 24 | 25 | & $msbuildPath /p:Configuration=Release /p:VisualStudioVersion="$vsVersion" 26 | # /p:PublishSettingsFile="$PublishingSettingsPath" /p:DeployOnBuild=true 27 | # /p:AllowUntrustedCertificate=true /p:_DestinationType=AzureWebSite 28 | 29 | popd 30 | 31 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/BrandingViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 8 | { 9 | public class BrandingViewModel : JobViewModel 10 | { 11 | [DisplayName("Logo Image File URL")] 12 | public String LogoImageUrl { get; set; } 13 | 14 | [DisplayName("Background Image File URL")] 15 | public String BackgroundImageUrl { get; set; } 16 | 17 | [DisplayName("CSS Overrides File URL")] 18 | public String CSSOverrideUrl { get; set; } 19 | 20 | [DisplayName("Color File URL")] 21 | public String ColorFileUrl { get; set; } 22 | 23 | [DisplayName("Font File URL")] 24 | public String FontFileUrl { get; set; } 25 | 26 | [DisplayName("UI Custom Actions File URL")] 27 | public String UICustomActionsUrl { get; set; } 28 | 29 | [DisplayName("Last Date and Time of Update")] 30 | public DateTime? UpdatedOn { get; set; } 31 | 32 | public Boolean RollOut { get; set; } = false; 33 | } 34 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | SharePoint Patterns and Practices (PnP) 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.IndexViewModel 2 | @{ 3 | ViewBag.Title = String.Format("Welcome to the {0}!", OfficeDevPnP.PartnerPack.Infrastructure.PnPPartnerPackSettings.Title); 4 | } 5 | 6 |
7 |
8 |
9 | @Html.Raw(OfficeDevPnP.PartnerPack.Infrastructure.PnPPartnerPackSettings.WelcomeMessage) 10 |
11 |
12 |
13 |
14 |   15 |
16 |
17 | @if (Model != null && !String.IsNullOrEmpty(Model.InfrastructuralSiteUrl)) 18 | { 19 |
20 |
21 | Go to the Infrastructural Site Collection. 22 |
23 |
24 | } 25 | 26 |
27 | 28 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // Core Module Loader 6 | 7 | 8 | // Common utilities 9 | @import './Fabric.Utilities.Output'; 10 | @import './Fabric.ZIndex.Variables'; 11 | @import './Fabric.Mixins'; 12 | @import "./Fabric.Mixins.RTL"; 13 | 14 | // Colors 15 | @import './Fabric.Color.Variables'; 16 | @import './Fabric.Color.Mixins.Output'; 17 | 18 | // Typography 19 | @import './Fabric.Typography.Variables'; 20 | @import './Fabric.Typography.Output'; 21 | @import './Fabric.Typography.Fonts.Output'; 22 | @import './Fabric.Typography.Language.Overrides.Output'; 23 | 24 | // Icons 25 | @import './Fabric.Icons.Font.Output'; 26 | @import './Fabric.Icons.Output'; 27 | 28 | // Animations 29 | @import './Fabric.Animations.Output'; 30 | 31 | // Responsive 32 | @import './Fabric.Responsive.Variables'; 33 | @import './Fabric.Responsive.Utilities.Variables'; 34 | @import './Fabric.Responsive.Utilities.Output'; 35 | 36 | // Grid 37 | @import './Fabric.Grid.Output'; 38 | 39 | // Office colors 40 | @import './Office.Color.Variables'; 41 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OfficeDevPnP.PartnerPack.Setup.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/TimeZoneInfo.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Int32 2 | @using System.Xml.Linq 3 | 4 | @{ 5 | 6 | var fieldId = Html.IdFor(m => m); 7 | var fieldName = Html.NameFor(m => m); 8 | var isRequired = ViewData.ModelMetadata.IsRequired; 9 | 10 | XElement timeZones = XElement.Load(Server.MapPath("/Content/TimeZones.xml")); 11 | 12 | var timeZoneList = from t in timeZones.Descendants("timeZone") 13 | select new SelectListItem 14 | { 15 | Text = t.Attribute("description").Value, 16 | Value = t.Attribute("value").Value, 17 | Selected = Int32.Parse(t.Attribute("value").Value) == Model 18 | }; 19 | } 20 |
21 | 22 | @Html.DropDownListFor(model => model, timeZoneList, new { @class = "form-control" }) 23 | @Html.ValidationMessageFor(model => model) 24 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TemplatesProviders/PnPTemplatesGalleryResultItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace OfficeDevPnP.PartnerPack.Infrastructure.TemplatesProviders 10 | { 11 | /// 12 | /// Class that represents an item of the result from the PnPTemplatesGallery search 13 | /// 14 | public class PnPTemplatesGalleryResultItem 15 | { 16 | public Guid Id { get; set; } 17 | 18 | public String Title { get; set; } 19 | 20 | public String Abstract { get; set; } 21 | 22 | public String ImageUrl { get; set; } 23 | 24 | public String TemplatePnPUrl { get; set; } 25 | 26 | public String SEO { get; set; } 27 | 28 | public String BaseTemplate { get; set; } 29 | 30 | public double Rating { get; set; } 31 | 32 | [JsonConverter(typeof(StringEnumConverter))] 33 | public TargetScope Scopes { get; set; } 34 | 35 | [JsonConverter(typeof(StringEnumConverter))] 36 | public TargetPlatform Platforms { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Typography.Variables.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Fabric Core Typography variables 7 | 8 | 9 | $ms-font-family-light: 'Segoe UI Light WestEuropean', 'Segoe UI Light', 'Segoe UI', Tahoma, Arial, sans-serif; 10 | $ms-font-family-regular: 'Segoe UI Regular WestEuropean', 'Segoe UI', Tahoma, Arial, sans-serif; 11 | $ms-font-family-semilight: 'Segoe UI Semilight WestEuropean', 'Segoe UI Semilight', 'Segoe UI', Tahoma, Arial, sans-serif; 12 | $ms-font-family-semibold: 'Segoe UI Semibold WestEuropean', 'Segoe UI Semibold', 'Segoe UI', Tahoma, Arial, sans-serif; 13 | 14 | 15 | //== Type sizes 16 | // 17 | 18 | $ms-font-size-su: 42px; 19 | $ms-font-size-xxl: 28px; 20 | $ms-font-size-xl: 21px; 21 | $ms-font-size-l: 17px; 22 | $ms-font-size-m-plus: 15px; 23 | $ms-font-size-m: 14px; 24 | $ms-font-size-s-plus: 13px; 25 | $ms-font-size-s: 12px; 26 | $ms-font-size-xs: 11px; 27 | $ms-font-size-mi: 10px; 28 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.RTL.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // OSS Framework Design Language 5 | // -------------------------------------------------- 6 | // Fabric Core Module Loader (RTL) 7 | 8 | // Common utilities 9 | @import './Fabric.Utilities.Output'; 10 | @import './Fabric.ZIndex.Variables'; 11 | @import './Fabric.Mixins'; 12 | @import './Fabric.Mixins.RTL'; 13 | 14 | // Colors 15 | @import './Fabric.Color.Variables'; 16 | @import './Fabric.Color.Mixins.Output'; 17 | 18 | // Typography 19 | @import './Fabric.Typography.Variables'; 20 | @import './Fabric.Typography.Fonts.Output'; 21 | @import './Fabric.Typography.Output'; 22 | @import './Fabric.Typography.Language.Overrides.Output'; 23 | 24 | // Icons 25 | @import './Fabric.Icons.Font.Output'; 26 | @import './Fabric.Icons.RTL.Output'; 27 | 28 | // Animations 29 | @import './Fabric.Animations.RTL.Output'; 30 | 31 | // Responsive 32 | @import './Fabric.Responsive.Variables'; 33 | @import './Fabric.Responsive.Utilities.Output'; 34 | 35 | // Grid 36 | @import './Fabric.Grid.Output'; 37 | 38 | // Office colors 39 | @import './Office.Color.Variables'; -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Int32.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Int32? 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | var isReadOnly = ViewData.Keys.Contains("readonly"); 8 | 9 | Dictionary htmlAttributes = new Dictionary(); 10 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 11 | htmlAttributes.Add("type", "number"); 12 | htmlAttributes.Add("step", "1"); 13 | 14 | if (isReadOnly) 15 | { 16 | htmlAttributes.Add("readonly", isReadOnly); 17 | } 18 | } 19 | 20 |
21 | 22 | @Html.TextBoxFor(m => m, htmlAttributes) 23 | @ViewData.ModelMetadata.Description 24 |
25 | @Html.ValidationMessageFor(m => m) 26 |
27 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Int64.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Int64? 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | var isReadOnly = ViewData.Keys.Contains("readonly"); 8 | 9 | Dictionary htmlAttributes = new Dictionary(); 10 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 11 | htmlAttributes.Add("type", "number"); 12 | htmlAttributes.Add("step", "1"); 13 | 14 | if (isReadOnly) 15 | { 16 | htmlAttributes.Add("readonly", isReadOnly); 17 | } 18 | } 19 | 20 |
21 | 22 | @Html.TextBoxFor(m => m, htmlAttributes) 23 | @ViewData.ModelMetadata.Description 24 |
25 | @Html.ValidationMessageFor(m => m) 26 |
27 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Double.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Double? 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | 8 | var isReadOnly = ViewData.Keys.Contains("readonly"); 9 | 10 | Dictionary htmlAttributes = new Dictionary(); 11 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 12 | htmlAttributes.Add("type", "number"); 13 | htmlAttributes.Add("step", "0.01"); 14 | 15 | if (isReadOnly) 16 | { 17 | htmlAttributes.Add("readonly", isReadOnly); 18 | } 19 | } 20 | 21 |
22 | 23 | @Html.TextBoxFor(m => m, htmlAttributes) 24 | @ViewData.ModelMetadata.Description 25 |
26 | @Html.ValidationMessageFor(m => m) 27 |
28 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Time.cshtml: -------------------------------------------------------------------------------- 1 | @model System.DateTime? 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | var isReadOnly = ViewData.Keys.Contains("readonly"); 8 | 9 | Dictionary htmlAttributes = new Dictionary(); 10 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 11 | htmlAttributes.Add("type", "time"); 12 | htmlAttributes.Add("style", "width: 250px;"); 13 | 14 | if (isReadOnly) 15 | { 16 | htmlAttributes.Add("readonly", isReadOnly); 17 | } 18 | } 19 | 20 |
21 | 22 | @Html.TextBoxFor(m => m, htmlAttributes) 23 | @ViewData.ModelMetadata.Description 24 |
25 | @Html.ValidationMessageFor(m => m) 26 |
27 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Filters/SharePointContextFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Mvc; 3 | 4 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 5 | { 6 | /// 7 | /// SharePoint action filter attribute. 8 | /// 9 | public class SharePointContextFilterAttribute : ActionFilterAttribute 10 | { 11 | public override void OnActionExecuting(ActionExecutingContext filterContext) 12 | { 13 | if (filterContext == null) 14 | { 15 | throw new ArgumentNullException("filterContext"); 16 | } 17 | 18 | Uri redirectUrl; 19 | switch (SharePointContextProvider.CheckRedirectionStatus(filterContext.HttpContext, out redirectUrl)) 20 | { 21 | case RedirectionStatus.Ok: 22 | return; 23 | case RedirectionStatus.ShouldRedirect: 24 | filterContext.Result = new RedirectResult(redirectUrl.AbsoluteUri); 25 | break; 26 | case RedirectionStatus.CanNotRedirect: 27 | filterContext.Result = new ViewResult { ViewName = "Error" }; 28 | break; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/ViewModel/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace OfficeDevPnP.PartnerPack.Setup.ViewModel 10 | { 11 | public class ViewModelBase : INotifyPropertyChanged 12 | { 13 | protected virtual bool Set(ref T value, T newValue, [CallerMemberName] string propertyName = null) 14 | { 15 | if (!EqualityComparer.Default.Equals(value, newValue)) 16 | { 17 | value = newValue; 18 | OnPropertyChanged(propertyName); 19 | 20 | return true; 21 | } 22 | 23 | return false; 24 | } 25 | 26 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) 27 | { 28 | OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); 29 | } 30 | 31 | protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) 32 | { 33 | PropertyChanged?.Invoke(this, e); 34 | } 35 | 36 | public event PropertyChangedEventHandler PropertyChanged; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Boolean.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Boolean 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | var isReadOnly = ViewData.Keys.Contains("readonly"); 8 | } 9 | 10 |
11 | @(!String.IsNullOrEmpty(ViewData.ModelMetadata.Description) ? ViewData.ModelMetadata.Description : !String.IsNullOrEmpty(ViewData.ModelMetadata.DisplayName) ? ViewData.ModelMetadata.DisplayName : ViewData.ModelMetadata.PropertyName) 12 | 13 | 17 | 18 |
19 | @Html.ValidationMessageFor(m => m) 20 |
21 |
22 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/ProvisioningJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines the base abstract class for any Provisioning Job 11 | /// 12 | public abstract class ProvisioningJob 13 | { 14 | /// 15 | /// The ID of the Provisioning Job 16 | /// 17 | public Guid JobId { get; set; } 18 | 19 | /// 20 | /// The descriptive Title of the Provisioning Job 21 | /// 22 | public String Title { get; set; } 23 | 24 | /// 25 | /// The Owner (creator) of the Provisioning Job 26 | /// 27 | public String Owner { get; set; } 28 | 29 | /// 30 | /// Defines the Status of the Provisioning Job 31 | /// 32 | public ProvisioningJobStatus Status { get; set; } 33 | 34 | /// 35 | /// Defines the Error Message of the Provisioning Job, if any 36 | /// 37 | public String ErrorMessage { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/Multilines.cshtml: -------------------------------------------------------------------------------- 1 | @model System.String 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | 8 | var isReadOnly = ViewData.Keys.Contains("readonly"); 9 | 10 | Dictionary htmlAttributes = new Dictionary(); 11 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 12 | 13 | if (isReadOnly) 14 | { 15 | htmlAttributes.Add("readonly", isReadOnly); 16 | } 17 | 18 | //var format = ViewData.ModelMetadata.AdditionalValues 19 | } 20 | 21 |
22 | 23 | @Html.TextAreaFor(m => m, htmlAttributes) 24 | @ViewData.ModelMetadata.Description 25 | @Html.ValidationMessageFor(m => m, null, new { @class = "ms-fontColor-alert" }) 26 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Responsive.Variables.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Fabric responsive variables 7 | 8 | 9 | //== Variables for responsive breakpoints 10 | // 11 | 12 | // Small screen / phone (320px - 479px) 13 | $ms-screen-sm-min: 320px; 14 | 15 | // Medium screen / tablet (480px - 639px) 16 | $ms-screen-md-min: 480px; 17 | 18 | // Large screen / tablet (640px - 1023px) 19 | $ms-screen-lg-min: 640px; 20 | 21 | // Extra large screen / tablet (1024px - 1365px) 22 | $ms-screen-xl-min: 1024px; 23 | 24 | // Extra extra large screen / desktop (1366px - 1919px) 25 | $ms-screen-xxl-min: 1366px; 26 | 27 | // Extra extra extra large screen / desktop (1366px and up) 28 | $ms-screen-xxxl-min: 1920px; 29 | 30 | // Set all maxes since order matters in SASS 31 | $ms-screen-sm-max: ($ms-screen-md-min - 1); 32 | $ms-screen-md-max: ($ms-screen-lg-min - 1); 33 | $ms-screen-lg-max: ($ms-screen-xl-min - 1); 34 | $ms-screen-xl-max: ($ms-screen-xxl-min - 1); 35 | $ms-screen-xxl-max: ($ms-screen-xxxl-min - 1); -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/String.cshtml: -------------------------------------------------------------------------------- 1 | @model System.String 2 | 3 | @{ 4 | var fieldId = Html.IdFor(m => m); 5 | var fieldName = Html.NameFor(m => m); 6 | var isRequired = ViewData.ModelMetadata.IsRequired; 7 | 8 | var isReadOnly = ViewData.Keys.Contains("readonly"); 9 | 10 | Dictionary htmlAttributes = new Dictionary(); 11 | htmlAttributes.Add("class", $"ms-TextField-field {(isRequired ? "required" : String.Empty)}"); 12 | htmlAttributes.Add("type", "text"); 13 | 14 | if (isReadOnly) 15 | { 16 | htmlAttributes.Add("readonly", isReadOnly); 17 | } 18 | 19 | //var format = ViewData.ModelMetadata.AdditionalValues 20 | } 21 | 22 |
23 | 24 | @Html.TextBoxFor(m => m, htmlAttributes) 25 |
26 | @ViewData.ModelMetadata.Description 27 | @Html.ValidationMessageFor(m => m, null, new { @class = "ms-fontColor-alert" }) 28 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/ActionCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Input; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.Components 9 | { 10 | public class ActionCommand : ICommand 11 | { 12 | private readonly Action _execute; 13 | private readonly Func _canExecute; 14 | 15 | public ActionCommand(Action execute) : this(execute, null) 16 | { 17 | 18 | } 19 | 20 | public ActionCommand(Action execute, Func canExecute) 21 | { 22 | if (execute == null) 23 | throw new ArgumentNullException(nameof(execute)); 24 | this._canExecute = canExecute; 25 | this._execute = execute; 26 | } 27 | 28 | public event EventHandler CanExecuteChanged; 29 | 30 | public bool CanExecute(object parameter) => _canExecute?.Invoke() ?? true; 31 | 32 | public void Execute(object parameter) 33 | { 34 | _execute(); 35 | RaiseCanExecuteChanged(); 36 | } 37 | 38 | public void RaiseCanExecuteChanged() 39 | { 40 | CanExecuteChanged?.Invoke(this, EventArgs.Empty); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/EditorTemplates/LocaleID.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Int32 2 | @using System.Xml.Linq 3 | 4 | @{ 5 | var fieldId = Html.IdFor(m => m); 6 | var fieldName = Html.NameFor(m => m); 7 | var isRequired = ViewData.ModelMetadata.IsRequired; 8 | 9 | XElement supportedUILanguages = XElement.Load(Server.MapPath("/Content/SupportedUILanguages.xml")); 10 | 11 | var culturesList = from l in supportedUILanguages.Descendants("supportedUILanguage") 12 | select new SelectListItem 13 | { 14 | Text = l.Attribute("description").Value, 15 | Value = l.Attribute("value").Value, 16 | Selected = (Model != 0 ? Int32.Parse(l.Attribute("value").Value) == Model : Int32.Parse(l.Attribute("value").Value) == 1033) 17 | }; 18 | } 19 |
20 | 21 | @Html.DropDownListFor(model => model, culturesList, new { @class = "form-control" }) 22 | @Html.ValidationMessageFor(model => model) 23 |
-------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/UpdateTemplatesViewModel.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.PartnerPack.Infrastructure; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 9 | { 10 | public class RefreshSitesViewModel : JobViewModel 11 | { 12 | /// 13 | /// Allows to determine the status of the Refresh Sites job 14 | /// 15 | public RefreshJobStatus Status { get; set; } 16 | 17 | /// 18 | /// The error message of the last job run, in case of any error 19 | /// 20 | public String ErrorMessage { get; set; } 21 | } 22 | 23 | /// 24 | /// Defines the status of the Refresh Sites job 25 | /// 26 | public enum RefreshJobStatus 27 | { 28 | /// 29 | /// The job is not running 30 | /// 31 | Idle, 32 | /// 33 | /// The job is scheduled 34 | /// 35 | Scheduled, 36 | /// 37 | /// The job is running 38 | /// 39 | Running, 40 | /// 41 | /// The job failed to run 42 | /// 43 | Failed, 44 | } 45 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Office.Color.Variables.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Office Core Color Variables 7 | 8 | 9 | //== Theme/Accent colors 10 | // 11 | // Colors used in Office 15 color pickers 12 | // These are deprecated as of Fabric 0.6 13 | 14 | $ms-color-officeAccent1: #FFFFFF; 15 | $ms-color-officeAccent2: #000000; 16 | $ms-color-officeAccent3: #E7E6E5; 17 | $ms-color-officeAccent4: #44546A; 18 | $ms-color-officeAccent5: #5B9BD5; 19 | $ms-color-officeAccent6: #ED7D31; 20 | $ms-color-officeAccent7: #A5A5A5; 21 | $ms-color-officeAccent8: #FFC001; 22 | $ms-color-officeAccent9: #4472C4; 23 | $ms-color-officeAccent10: #70AD47; 24 | 25 | $ms-color-presence-available: #5dd255; 26 | $ms-color-presence-away: #ffd200; 27 | $ms-color-presence-blocked-background: #dedede; 28 | $ms-color-presence-blocked-line: #c72d25; 29 | $ms-color-presence-busy-stripe-light: #e57a79; 30 | $ms-color-presence-busy-stripe-dark: #d00e0d; 31 | $ms-color-presence-busy-average: #d93b3b; 32 | $ms-color-presence-dnd-background: #c72d25; 33 | $ms-color-presence-dnd-line: #ffffff; 34 | $ms-color-presence-offline: #b6cfd8; 35 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.Utilities.Output.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Utility classes and mixins used throughout Fabric. 7 | 8 | @import "Fabric.Utilities"; 9 | 10 | // The best box is a border box. 11 | .ms-u-borderBox, .ms-u-borderBox:before, .ms-u-borderBox:after { 12 | @include ms-u-borderBox; 13 | } 14 | 15 | // To apply border base settings 16 | .ms-u-borderBase { 17 | @include ms-u-borderBase; 18 | } 19 | 20 | // Ensures the block expands to the full height to enclose its floated childen. 21 | .ms-u-clearfix { 22 | @include ms-u-clearfix; 23 | } 24 | 25 | // Basic border-box, margin, and padding reset. 26 | .ms-u-normalize { 27 | @include ms-u-normalize; 28 | } 29 | 30 | // Use to set left, center, right text alignment styles 31 | @include ms-u-textAlign(left, center, right); 32 | 33 | // Use to hide content while still making it readable by screen reader (Accessibility) 34 | .ms-u-screenReaderOnly { 35 | @include ms-u-screenReaderOnly 36 | } 37 | 38 | // Use to add truncation with ellipsis 39 | .ms-u-textTruncate { 40 | @include ms-u-textTruncate 41 | } 42 | 43 | // Use to disable text wrapping 44 | .ms-u-noWrap{ 45 | @include ms-u-noWrap 46 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TemplatesProviders/SharePointGlobalTemplatesProvider.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.Core.Framework.Provisioning.Model; 2 | using OfficeDevPnP.PartnerPack.Infrastructure.SharePoint; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace OfficeDevPnP.PartnerPack.Infrastructure.TemplatesProviders 10 | { 11 | /// 12 | /// Implements the Templates Provider that use the local tenant-scoped Site Collection as a repository 13 | /// 14 | public class SharePointGlobalTemplatesProvider : SharePointBaseTemplatesProvider 15 | { 16 | public override string DisplayName 17 | { 18 | get { return ("Global Tenant"); } 19 | } 20 | 21 | public SharePointGlobalTemplatesProvider() 22 | : base(PnPPartnerPackSettings.InfrastructureSiteUrl) 23 | { 24 | 25 | } 26 | 27 | public override ProvisioningTemplate GetProvisioningTemplate(string templateUri) 28 | { 29 | return (base.GetProvisioningTemplate(templateUri)); 30 | } 31 | 32 | public override ProvisioningTemplateInformation[] SearchProvisioningTemplates(string searchText, TargetPlatform platforms, TargetScope scope) 33 | { 34 | return (base.SearchProvisioningTemplates(searchText, platforms, scope)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Scripts/MsBuildWebSite.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [Parameter(Mandatory = $true)] [String]$ProjectPath, 3 | [Parameter(Mandatory = $true)] [String]$PublishingSettingsPath 4 | ) 5 | 6 | pushd $ProjectPath 7 | 8 | # Get the path of MSBuild v. 14.0.25420.1 or higher 9 | $vs15 = Get-ItemProperty "hklm:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7" 10 | $msBuild15Path = $vs15.'15.0' + "\MSBuild\15.0\bin\msbuild.exe" 11 | $vsVersion = "15.0" 12 | if (Test-Path $msBuild15Path) 13 | { 14 | $msbuildPath = $msBuild15Path 15 | } 16 | 17 | if ($msbuildPath -eq $null) 18 | { 19 | $msbuildPath = Get-ItemProperty "hklm:\SOFTWARE\Microsoft\MSBuild\14.0" 20 | $msbuildPath = $msbuildPath.MSBuildOverrideTasksPath.Substring(0, $msbuildPath.MSBuildOverrideTasksPath.IndexOf("\bin\") + 5) 21 | $msbuildPath = $msbuildPath + "MSBuild.exe" 22 | $vsVersion = "14.0" 23 | } 24 | 25 | if ((Test-Path $msBuild15Path) -ne $true) 26 | { 27 | Write-Host "Missing MSBuild" 28 | } 29 | 30 | # Create a temporary PnP path for the deployment files 31 | $unique = (New-Guid).GetHashCode() 32 | $tempPath = "$env:SystemDrive\PnP$unique" 33 | mkdir $tempPath 34 | 35 | # Run MSBuild to build and deploy the solution 36 | & "$msbuildPath" /p:Configuration=Release /p:OutputPath="$tempPath" /p:VisualStudioVersion="$vsVersion" /p:PublishSettingsFile="$PublishingSettingsPath" /p:DeployOnBuild=true 37 | 38 | Remove-Item $tempPath -Recurse -Force 39 | popd 40 | 41 | 42 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/ProvisioningRepositoryFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure 8 | { 9 | /// 10 | /// Provides the factory to get the current ProvisioningRepository 11 | /// 12 | public static class ProvisioningRepositoryFactory 13 | { 14 | private static readonly Lazy _provisioningRepositoryLazy = 15 | new Lazy(() => { 16 | 17 | // Creates the Provisioning Repository instance 18 | Type provisioningRepositoryType = Type.GetType(PnPPartnerPackSettings.ProvisioningRepositoryType, true); 19 | IProvisioningRepository result = (IProvisioningRepository)Activator.CreateInstance(provisioningRepositoryType); 20 | 21 | // Initializes the Provisioning Repository instance 22 | result.Init(PnPPartnerPackSettings.ProvisioningRepositoryConfiguration); 23 | 24 | return (result); 25 | }); 26 | 27 | /// 28 | /// Provides a singleton reference to the current Provisioning Repository 29 | /// 30 | public static IProvisioningRepository Current { 31 | get { return (_provisioningRepositoryLazy.Value); } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/SearchTemplates.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.SearchTemplatesViewModel 2 | 3 | @using OfficeDevPnP.PartnerPack.Infrastructure 4 | 5 | @functions{ 6 | 7 | String ProcessImagePreviewUrl(String imagePreviewUrl) 8 | { 9 | if (imagePreviewUrl != null && (imagePreviewUrl.ToLower().StartsWith("pnps://") || imagePreviewUrl.ToLower().StartsWith("pnp://"))) 10 | { 11 | return ($"/Home/GetTemplateImagePreviewFromPnP?imagePreviewUri={imagePreviewUrl}"); 12 | } 13 | else 14 | { 15 | return (imagePreviewUrl); 16 | } 17 | } 18 | 19 | } 20 | 21 | @if (Model.SearchResults.Length == 0) 22 | { 23 | 26 | } 27 | else 28 | { 29 | foreach (var template in Model.SearchResults) 30 | { 31 |
32 |
33 | @template.DisplayName 34 |
35 |
@template.DisplayName
36 | @template.Description 37 |
38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/TemplatesProviders/SharePointLocalTemplatesProvider.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.Core.Framework.Provisioning.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Infrastructure.TemplatesProviders 9 | { 10 | /// 11 | /// Implements the Templates Provider that use the local Site Collection as a repository 12 | /// 13 | public class SharePointLocalTemplatesProvider : SharePointBaseTemplatesProvider 14 | { 15 | public override string DisplayName 16 | { 17 | get { return ("Current Site Collection"); } 18 | } 19 | 20 | public SharePointLocalTemplatesProvider() 21 | : base(PnPPartnerPackSettings.ParentSiteUrl) 22 | { 23 | 24 | } 25 | 26 | // NOTE: Use the current context to determine the URL of the current Site Collection 27 | 28 | public override ProvisioningTemplate GetProvisioningTemplate(string templateUri) 29 | { 30 | return (base.GetProvisioningTemplate(templateUri)); 31 | } 32 | 33 | public override ProvisioningTemplateInformation[] SearchProvisioningTemplates(string searchText, TargetPlatform platforms, TargetScope scope) 34 | { 35 | return (base.SearchProvisioningTemplates(searchText, platforms, scope)); 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Components/UserUtility.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using OfficeDevPnP.PartnerPack.Infrastructure; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Components 9 | { 10 | public class UserUtility 11 | { 12 | public static LightGraphUser GetUser(string path) 13 | { 14 | try 15 | { 16 | String jsonResponse = HttpHelper.MakeGetRequestForString( 17 | String.Format("{0}{1}", 18 | MicrosoftGraphConstants.MicrosoftGraphV1BaseUri, path), 19 | MicrosoftGraphHelper.GetAccessTokenForCurrentUser(MicrosoftGraphConstants.MicrosoftGraphResourceId)); 20 | 21 | if (jsonResponse != null) 22 | { 23 | var user = JsonConvert.DeserializeObject(jsonResponse); 24 | return (user); 25 | } 26 | else 27 | { 28 | return (null); 29 | } 30 | } 31 | catch (Exception) 32 | { 33 | // In case of any failure, skip the request 34 | return (null); 35 | } 36 | } 37 | 38 | public static LightGraphUser GetCurrentUser() 39 | { 40 | return GetUser("me"); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/PasswordBoxEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | 10 | namespace OfficeDevPnP.PartnerPack.Setup.Components 11 | { 12 | public class PasswordBoxEx : DependencyObject 13 | { 14 | 15 | //private Dictionary 16 | 17 | static PasswordBoxEx() 18 | { 19 | EventManager.RegisterClassHandler(typeof(PasswordBox), PasswordBox.PasswordChangedEvent, new RoutedEventHandler(PasswordChangedEvent), false); 20 | } 21 | 22 | public static string GetPassword(DependencyObject obj) 23 | { 24 | return (string)obj.GetValue(PasswordProperty); 25 | } 26 | 27 | public static void SetPassword(DependencyObject obj, string value) 28 | { 29 | obj.SetValue(PasswordProperty, value); 30 | } 31 | 32 | public static readonly DependencyProperty PasswordProperty = 33 | DependencyProperty.RegisterAttached("Password", typeof(string), typeof(DependencyObject), new PropertyMetadata(String.Empty)); 34 | 35 | 36 | private static void PasswordChangedEvent(object sender, RoutedEventArgs e) 37 | { 38 | var pb = sender as PasswordBox; 39 | pb.SetValue(PasswordProperty, pb.Password); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/RequiredIfAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace OfficeDevPnP.PartnerPack.Setup.Components 10 | { 11 | public class RequiredIfAttribute : RequiredAttribute 12 | { 13 | public string DependantPropertyName { get; set; } 14 | 15 | public RequiredIfAttribute(string dependantPropertyName) 16 | { 17 | if (dependantPropertyName == null) 18 | throw new ArgumentNullException(nameof(dependantPropertyName)); 19 | DependantPropertyName = dependantPropertyName; 20 | } 21 | 22 | protected override ValidationResult IsValid(object value, ValidationContext validationContext) 23 | { 24 | var property = TypeDescriptor.GetProperties(validationContext.ObjectInstance).Find(DependantPropertyName, true); 25 | if (property == null) 26 | throw new InvalidOperationException("Cannot find property " + DependantPropertyName); 27 | 28 | var dependantValue = property.GetValue(validationContext.ObjectInstance); 29 | if (Convert.ToBoolean(dependantValue)) 30 | { 31 | return base.IsValid(value, validationContext); 32 | } 33 | 34 | return ValidationResult.Success; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ExternalUsersJob/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure.WebJobs; 7 | using OfficeDevPnP.PartnerPack.Infrastructure; 8 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 9 | using System.Configuration; 10 | 11 | namespace OfficeDevPnP.PartnerPack.WebJobs.ExternalUsersWebJob 12 | { 13 | // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976 14 | class Program 15 | { 16 | static void Main() 17 | { 18 | var job = new ValidateExternalUsersTimerJob(); 19 | 20 | var provisioningJobs = ProvisioningRepositoryFactory.Current.GetTypedProvisioningJobs(ProvisioningJobStatus.Provisioned); 21 | 22 | foreach (SiteCollectionProvisioningJob provisioningJob in provisioningJobs) 23 | { 24 | var url = PnPPartnerPackSettings.InfrastructureSiteUrl.Substring(0, PnPPartnerPackSettings.InfrastructureSiteUrl.IndexOf(".com/") + 4) + provisioningJob.RelativeUrl; 25 | job.AddSite(url); 26 | } 27 | 28 | job.UseAzureADAppOnlyAuthentication( 29 | PnPPartnerPackSettings.ClientId, 30 | PnPPartnerPackSettings.Tenant, 31 | PnPPartnerPackSettings.AppOnlyCertificate); 32 | 33 | job.Run(); 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.Components.scss: -------------------------------------------------------------------------------- 1 | @import 'Fabric.Common'; 2 | 3 | @import '../components/Breadcrumb/Breadcrumb'; 4 | @import '../components/Button/Button'; 5 | @import '../components/Callout/Callout'; 6 | @import '../components/ChoiceField/ChoiceField'; 7 | @import '../components/CommandBar/CommandBar'; 8 | @import '../components/ContextualMenu/ContextualMenu'; 9 | @import '../components/DatePicker/DatePicker'; 10 | @import '../components/Dialog/Dialog'; 11 | @import '../components/Dropdown/Dropdown'; 12 | @import '../components/Facepile/Facepile'; 13 | @import '../components/Label/Label'; 14 | @import '../components/Link/Link'; 15 | @import '../components/List/List'; 16 | @import '../components/ListItem/ListItem'; 17 | @import '../components/MessageBanner/MessageBanner'; 18 | @import '../components/MessageBar/MessageBar'; 19 | @import '../components/NavBar/NavBar'; 20 | @import '../components/OrgChart/OrgChart'; 21 | @import '../components/Overlay/Overlay'; 22 | @import '../components/Panel/Panel'; 23 | @import '../components/PeoplePicker/PeoplePicker'; 24 | @import '../components/Persona/Persona'; 25 | @import '../components/PersonaCard/PersonaCard'; 26 | @import '../components/Pivot/Pivot'; 27 | @import '../components/ProgressIndicator/ProgressIndicator'; 28 | @import '../components/SearchBox/SearchBox'; 29 | @import '../components/Spinner/Spinner'; 30 | @import '../components/Table/Table'; 31 | @import '../components/TextField/TextField'; 32 | @import '../components/Toggle/Toggle'; 33 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.CheckAdminsJob/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AdministratorPolicy")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AdministratorPolicy")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8eeaa71a-f2f4-422f-8abe-235a31bf5ee1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ContinousJob/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.ContinousJob")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.ContinousJob")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4c073aee-8996-4ddf-a7ad-4b5e49fcfe52")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ScheduledJob/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.ScheduledJob")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.ScheduledJob")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("eb640e2f-24da-46fe-a1ea-fcc3c9b8b95f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.CheckAdminsJob/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Azure.WebJobs; 7 | using OfficeDevPnP.Core.Framework.TimerJobs; 8 | using OfficeDevPnP.Core; 9 | using System.Configuration; 10 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 11 | using OfficeDevPnP.PartnerPack.Infrastructure; 12 | 13 | namespace OfficeDevPnP.PartnerPack.CheckAdminsJob 14 | { 15 | // To learn more about Microsoft Azure WebJobs SDK, please see http://go.microsoft.com/fwlink/?LinkID=320976 16 | class Program 17 | { 18 | static void Main() 19 | { 20 | var job = new EnforceTwoAdministratorsTimerJob(); 21 | 22 | var provisioningJobs = ProvisioningRepositoryFactory.Current.GetTypedProvisioningJobs(ProvisioningJobStatus.Provisioned); 23 | 24 | foreach (SiteCollectionProvisioningJob provisioningJob in provisioningJobs) 25 | { 26 | var url = PnPPartnerPackSettings.InfrastructureSiteUrl.Substring(0, PnPPartnerPackSettings.InfrastructureSiteUrl.IndexOf(".com/") + 4) + provisioningJob.RelativeUrl; 27 | job.AddSite(url); 28 | } 29 | 30 | job.UseAzureADAppOnlyAuthentication( 31 | PnPPartnerPackSettings.ClientId, 32 | PnPPartnerPackSettings.Tenant, 33 | PnPPartnerPackSettings.AppOnlyCertificate); 34 | 35 | job.Run(); 36 | 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.SiteProvisioning")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.SiteProvisioning")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8083b3e1-5810-477d-a480-a17c79ab0d81")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Overrides/PnP-Partner-Pack-Overrides.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | https://pnp-partner-pack-testpnp444321.azurewebsites.net/ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.SiteProvisioning.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.SiteProvisioning.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("42609029-be82-495e-95a8-65b5000f6c7f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ExternalUsersJob/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.WebJobs.ExternalUsersWebJob")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.WebJobs.ExternalUsersWebJob")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f85fa0e0-ff3b-40fd-bc72-d406e7bab62f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OfficeDevPnP.PartnerPack.Infrastructure")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OfficeDevPnP.PartnerPack.Infrastructure")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("af195497-cafd-444e-9b7b-d3b0acac455c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/peoplepickercontrol.css: -------------------------------------------------------------------------------- 1 | .cam-peoplepicker-userlookup { 2 | height: 50px; 3 | overflow: hidden; 4 | border: 1px solid #99b0c1; 5 | padding: 2px 5px 2px 5px; 6 | } 7 | 8 | .cam-peoplepicker-usersearch { 9 | position: absolute; 10 | z-index: 2; 11 | display: none; 12 | cursor: pointer; 13 | background-color: #fff; 14 | border-bottom-left-radius: 4px; 15 | border-bottom-right-radius: 4px; 16 | border: lightgray solid 1px; 17 | } 18 | 19 | .cam-peoplepicker-userSpan { 20 | border-collapse: collapse; 21 | cursor: pointer; 22 | display: inline-block; 23 | margin-bottom: 1px; 24 | margin-left: 2px; 25 | margin-right: 5px; 26 | margin-top: 0px; 27 | white-space: nowrap; 28 | } 29 | 30 | .cam-entity-resolved { 31 | border-collapse: collapse; 32 | cursor: pointer; 33 | display: inline-block; 34 | max-width: 500px; 35 | overflow:hidden; 36 | text-decoration: underline; 37 | vertical-align:bottom; 38 | white-space:nowrap; 39 | } 40 | 41 | .cam-peoplepicker-delImage { 42 | border-collapse: collapse; 43 | cursor: pointer; 44 | margin-left: 3px; 45 | text-decoration:none; 46 | white-space:nowrap; 47 | } 48 | 49 | .cam-peoplepicker-delImage:hover { 50 | text-decoration: none; 51 | } 52 | 53 | .cam-peoplepicker-edit { 54 | border-style: none !important; 55 | border-color: currentColor !important; 56 | border-width: 0px !important; 57 | max-width: 435px; 58 | outline-color: invert !important; 59 | outline-style: none !important; 60 | outline-width: 0px !important; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/BrandingSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines the settings for Tenant branding 11 | /// 12 | public class BrandingSettings 13 | { 14 | /// 15 | /// Represents the URL of the Logo, if any 16 | /// 17 | public String LogoImageUrl { get; set; } 18 | 19 | /// 20 | /// Represents the URL of the background image, if any 21 | /// 22 | public String BackgroundImageUrl { get; set; } 23 | 24 | /// 25 | /// Represents the URL of CSS override file, if any 26 | /// 27 | public String CSSOverrideUrl { get; set; } 28 | 29 | /// 30 | /// Represents the URL of the Color file, if any 31 | /// 32 | public String ColorFileUrl { get; set; } 33 | 34 | /// 35 | /// Represents the URL of the Font file, if any 36 | /// 37 | public String FontFileUrl { get; set; } 38 | 39 | /// 40 | /// Represents the URL of the UI Custom action, if any 41 | /// 42 | public String UICustomActionsUrl { get; set; } 43 | 44 | /// 45 | /// Latest date and time of update for the branding settings 46 | /// 47 | public DateTime? UpdatedOn { get; set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/Handlers/RefreshSingleSiteJobHandler.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Online.SharePoint.TenantAdministration; 2 | using Microsoft.SharePoint.Client; 3 | using Newtonsoft.Json; 4 | using OfficeDevPnP.Core.Framework.Provisioning.Connectors; 5 | using OfficeDevPnP.Core.Framework.Provisioning.Model; 6 | using OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers; 7 | using OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.IO; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Threading.Tasks; 14 | 15 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs.Handlers 16 | { 17 | public class RefreshSingleSiteJobHandler : ProvisioningJobHandler 18 | { 19 | protected override void RunJobInternal(ProvisioningJob job) 20 | { 21 | RefreshSingleSiteJob updateJob = job as RefreshSingleSiteJob; 22 | if (updateJob == null) 23 | { 24 | throw new ArgumentException("Invalid job type for RefreshSingleSiteJobHandler."); 25 | } 26 | 27 | UpdateTemplates(updateJob); 28 | } 29 | 30 | private void UpdateTemplates(RefreshSingleSiteJob job) 31 | { 32 | using (var siteContext = PnPPartnerPackContextProvider.GetAppOnlyClientContext(job.TargetSiteUrl)) 33 | { 34 | // Get a reference to the target web 35 | var targetWeb = siteContext.Site.RootWeb; 36 | 37 | // Update the root web of the site collection 38 | RefreshSitesJobHandler.UpdateTemplateOnWeb(targetWeb); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Responsive/SPO-Responsive.js: -------------------------------------------------------------------------------- 1 | var SPOResponsiveApp = SPOResponsiveApp || {}; 2 | 3 | SPOResponsiveApp.setUpToggling = function () { 4 | 5 | var currentScriptUrl = $('#spoResponsive').attr('src'); 6 | if (currentScriptUrl != undefined) { 7 | var currentScriptBaseUrl = currentScriptUrl.substring(0, currentScriptUrl.lastIndexOf("/") + 1); 8 | $("head").append(''); 9 | } 10 | 11 | if ($("#navbar-toggle").length) 12 | return; 13 | 14 | /* Set up sidenav toggling */ 15 | var topNav = $('#DeltaTopNavigation'); 16 | var topNavClone = topNav.clone() 17 | topNavClone.addClass('mobile-only'); 18 | topNavClone.attr('id', topNavClone.attr('id') + "_mobileClone"); 19 | topNav.addClass('no-mobile'); 20 | $('#sideNavBox').append(topNavClone); 21 | 22 | var sideNavToggle = $(' 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/Fabric.Animations.RTL.Output.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // RTL overrides for Fabric Animations 7 | 8 | 9 | @import "Fabric.Animations.Output"; 10 | @import "Fabric.Animations.RTL"; 11 | 12 | // slideRightIn10 13 | .ms-u-slideRightIn10 { 14 | @include ms-u-slideRightIn10; 15 | } 16 | 17 | // slideRightIn20 18 | .ms-u-slideRightIn20 { 19 | @include ms-u-slideRightIn20; 20 | } 21 | 22 | // slideRightIn40 23 | .ms-u-slideRightIn40 { 24 | @include ms-u-slideRightIn40; 25 | } 26 | 27 | // slideLeftIn10 28 | .ms-u-slideLeftIn10 { 29 | @include ms-u-slideLeftIn10; 30 | } 31 | 32 | // slideLeftIn20 33 | .ms-u-slideLeftIn20 { 34 | @include ms-u-slideLeftIn20; 35 | } 36 | 37 | // slideLeftIn40 38 | .ms-u-slideLeftIn40 { 39 | @include ms-u-slideLeftIn40; 40 | } 41 | 42 | // slideRightIn400 43 | .ms-u-slideRightIn400 { 44 | @include ms-u-slideRightIn400; 45 | } 46 | 47 | // slideLeftIn400 48 | .ms-u-slideLeftIn400 { 49 | @include ms-u-slideLeftIn400; 50 | } 51 | 52 | // slideRightOut40 53 | .ms-u-slideRightOut40 { 54 | @include ms-u-slideRightOut40; 55 | } 56 | 57 | // slideLeftOut40 58 | .ms-u-slideLeftOut40 { 59 | @include ms-u-slideLeftOut40; 60 | } 61 | 62 | // slideRightOut400 63 | .ms-u-slideRightOut400 { 64 | @include ms-u-slideRightOut400; 65 | } 66 | 67 | // slideLeftOut400 68 | .ms-u-slideLeftOut400 { 69 | @include ms-u-slideLeftOut400; 70 | } 71 | 72 | // rotate90deg 73 | .ms-u-rotate90deg { 74 | @include ms-u-rotate90deg; 75 | } 76 | 77 | // rotateN90deg 78 | .ms-u-rotateN90deg { 79 | @include ms-u-rotateN90deg; 80 | } 81 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Models/SaveTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Models 9 | { 10 | public class SaveTemplateViewModel : JobViewModel 11 | { 12 | [Required(ErrorMessage = "Title is a required field")] 13 | [DisplayName("Title")] 14 | public String Title { get; set; } 15 | 16 | [DisplayName("Description")] 17 | [DataType(DataType.MultilineText)] 18 | [UIHint("Multilines")] 19 | public String Description { get; set; } 20 | 21 | [Required(ErrorMessage = "Template File Name is a required field")] 22 | [DisplayName("Template File Name (without extension)")] 23 | public String FileName { get; set; } 24 | 25 | [DisplayName("Include All Term Groups")] 26 | public Boolean IncludeAllTermGroups { get; set; } 27 | 28 | [DisplayName("Include Site Collection Term Group")] 29 | public Boolean IncludeSiteCollectionTermGroup { get; set; } 30 | 31 | [DisplayName("Include Search Configuration")] 32 | public Boolean IncludeSearchConfiguration { get; set; } = false; 33 | 34 | [DisplayName("Include Site Groups")] 35 | public Boolean IncludeSiteGroups { get; set; } 36 | 37 | [DisplayName("Persist Composed Look Files")] 38 | public Boolean PersistComposedLookFiles { get; set; } 39 | 40 | [DisplayName("Target Location for Template")] 41 | [UIHint("TemplateLocation")] 42 | public String Location { get; set; } 43 | 44 | public String SourceSiteUrl { get; set; } 45 | 46 | public Guid ProvisioningTemplateId { get; set; } 47 | } 48 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ScheduledJob/PnPPartnerPackProvisioningJob.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SharePoint.Client; 2 | using OfficeDevPnP.Core.Framework.TimerJobs; 3 | using OfficeDevPnP.PartnerPack.Infrastructure; 4 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace OfficeDevPnP.PartnerPack.ScheduledJob 12 | { 13 | public class PnPPartnerPackProvisioningJob : TimerJob 14 | { 15 | public PnPPartnerPackProvisioningJob(): base("PnP Partner Pack Provisioning Job") 16 | { 17 | TimerJobRun += ExecuteProvisioningJobs; 18 | } 19 | private void ExecuteProvisioningJobs(object sender, TimerJobRunEventArgs e) 20 | { 21 | Console.WriteLine("Starting job"); 22 | 23 | // Show the current context 24 | Web web = e.SiteClientContext.Web; 25 | web.EnsureProperty(w => w.Title); 26 | Console.WriteLine("Processing jobs in Site: {0}", web.Title); 27 | 28 | // Retrieve the list of pending jobs 29 | var provisioningJobs = ProvisioningRepositoryFactory.Current.GetTypedProvisioningJobs( 30 | ProvisioningJobStatus.Pending); 31 | 32 | foreach (var job in provisioningJobs) 33 | { 34 | Console.WriteLine("Processing job: {0} - Owner: {1} - Title: {2}", 35 | job.JobId, job.Owner, job.Title); 36 | 37 | Type jobType = job.GetType(); 38 | 39 | if (PnPPartnerPackSettings.ScheduledJobHandlers.ContainsKey(jobType)) 40 | { 41 | PnPPartnerPackSettings.ScheduledJobHandlers[jobType].RunJob(job); 42 | } 43 | } 44 | 45 | Console.WriteLine("Ending job"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new ScriptBundle("~/bundles/fabric").Include( 27 | "~/Scripts/jquery.fabric.*")); 28 | 29 | bundles.Add(new ScriptBundle("~/bundles/custom").Include( 30 | "~/Scripts/custom.principals.js", 31 | "~/Scripts/custom.js")); 32 | 33 | bundles.Add(new StyleBundle("~/Content/css").Include( 34 | "~/Content/bootstrap.css", 35 | "~/Content/Office365SuiteBar.css", 36 | "~/Content/fabric.css", 37 | "~/Content/fabric.components.css", 38 | "~/Content/site.css")); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Governance/BatchStartup.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.SiteCollectionsBatchViewModel 2 | 3 | @using OfficeDevPnP.PartnerPack.SiteProvisioning.Models 4 | 5 |
6 | 7 | 8 | 9 |
Upload Batch File
10 | 11 |
12 |
13 |
14 | Use this page to create a batch of Site Collections.
15 | You need to upload a batch XML file (accordingly to the following model file). 16 | The XML file adheres to this XML Schema. 17 |
18 |
19 |
20 |
21 | 22 | 23 |
24 |
25 |
26 | 27 | 32 | 37 | 38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/SupportFiles/BatchModel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | 26 | 27 | 45 | 46 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Scripts/custom.js: -------------------------------------------------------------------------------- 1 | function fixPersonaImages() { 2 | $(".ms-Persona-image").error(function () { 3 | $(this).hide(); 4 | }); 5 | } 6 | 7 | function applyOfficeUIFabricStyles() { 8 | if ($.fn.NavBar) { 9 | $('.ms-NavBar').NavBar(); 10 | } 11 | 12 | if ($.fn.Dropdown) { 13 | $(".ms-Dropdown").Dropdown(); 14 | } 15 | 16 | if ($.fn.SearchBox) { 17 | $(".ms-SearchBox").SearchBox(); 18 | } 19 | 20 | if ($.fn.DatePicker) { 21 | $(".ms-DatePicker").DatePicker(); 22 | } 23 | 24 | if ($.fn.CommandBar) { 25 | $(".ms-CommandBar").CommandBar(); 26 | } 27 | 28 | if ($.fn.Dialog) { 29 | $(".ms-Dialog").Dialog(); 30 | } 31 | 32 | //if ($.fn.ContextualMenu) { 33 | // $(".ms-ContextualMenu").ContextualMenu(); 34 | //} 35 | 36 | if ($.fn.Facepile) { 37 | $(".ms-Facepile").Facepile(); 38 | } 39 | 40 | if ($.fn.ListItem) { 41 | $(".ms-ListItem").ListItem(); 42 | } 43 | 44 | if ($.fn.Panel) { 45 | $(".ms-Panel").Panel(); 46 | } 47 | 48 | if ($.fn.PeoplePicker) { 49 | $(".ms-PeoplePicker").PeoplePicker(); 50 | } 51 | 52 | if ($.fn.PersonaCard) { 53 | $(".ms-PersonaCard").PersonaCard(); 54 | } 55 | 56 | if ($.fn.Pivot) { 57 | $(".ms-Pivot").Pivot(); 58 | } 59 | 60 | if ($.fn.TextField) { 61 | $(".ms-TextField").TextField(); 62 | } 63 | } 64 | 65 | $(document).ready(function () { 66 | 67 | // Make sure all the Office UI Fabric elements are properly rendered 68 | applyOfficeUIFabricStyles(); 69 | 70 | // Handle selection of current NavBar item 71 | $("li.ms-NavBar-item > a").each(function (index) { 72 | if (window.location.href.indexOf($(this).attr("href")) > 0) { 73 | $(this).parent().addClass("is-selected"); 74 | } 75 | else { 76 | $(this).parent().removeClass("is-selected"); 77 | } 78 | }); 79 | 80 | // Hide any unavailable persona image 81 | fixPersonaImages(); 82 | }); 83 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Utilities.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // Utility classes and mixins used throughout Fabric. 7 | 8 | @import "Fabric.Mixins"; 9 | 10 | // The best box is a border box. 11 | @mixin ms-u-borderBox { 12 | box-sizing: border-box; 13 | } 14 | 15 | // For setting the border base width 16 | @mixin ms-u-borderBase { 17 | border: 1px solid; 18 | } 19 | 20 | // Ensures the block expands to the full height to enclose its floated childen. 21 | 22 | @mixin ms-u-clearfix { 23 | *zoom: 1; 24 | &:before, 25 | &:after { 26 | display: table; 27 | content: ""; 28 | line-height: 0; 29 | } 30 | &:after { 31 | clear: both; 32 | } 33 | } 34 | 35 | // Basic border-box, margin, and padding reset. 36 | @mixin ms-u-normalize { 37 | @include ms-u-borderBox; 38 | @include resetMargins; 39 | @include resetPadding; 40 | @include resetBoxShadow; 41 | } 42 | 43 | // To set various text alignment styles 44 | // @param [variable list] $alignments 45 | @mixin ms-u-textAlign($alignments...) { 46 | @each $align in $alignments { 47 | $alignStr: inspect($align); 48 | .ms-u-textAlign#{to-upper-case(str-slice($alignStr, 1, 1)) + str-slice($alignStr, 2)} { 49 | text-align: $align; 50 | } 51 | } 52 | } 53 | 54 | // To hide content while still making it readable by screen readers (Accessibility) 55 | @mixin ms-u-screenReaderOnly { 56 | position: absolute; 57 | width: 1px; 58 | height: 1px; 59 | padding: 0; 60 | margin: -1px; 61 | overflow: hidden; 62 | clip: rect(0,0,0,0); 63 | border: 0; 64 | } 65 | 66 | // To add truncation with ellipsis 67 | @mixin ms-u-textTruncate { 68 | overflow: hidden; 69 | text-overflow: ellipsis; 70 | white-space: nowrap; 71 | word-wrap: normal; // Fix for IE 8/9 in case 'word-wrap: break-word' is set on parent nodes 72 | } 73 | 74 | // To disable text wrapping 75 | @mixin ms-u-noWrap { 76 | white-space: nowrap; 77 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/SiteCollectionInformation.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.CreateSiteCollectionViewModel 2 | 3 |
4 |
5 | @Html.EditorFor(model => model.PrimarySiteCollectionAdmin) 6 |
7 |
8 | 9 |
10 |
11 | @Html.EditorFor(model => model.SecondarySiteCollectionAdmin) 12 |
13 |
14 | 15 |
16 |
17 | @Html.EditorFor(model => model.StorageMaximumLevel, new { htmlAttributes = new { @class = "form-control" } }) 18 |
19 |
20 | 21 |
22 |
23 | @Html.EditorFor(model => model.StorageWarningLevel, new { htmlAttributes = new { @class = "form-control" } }) 24 |
25 |
26 | 27 | @* 28 |
29 |
30 | @Html.EditorFor(model => model.UserCodeMaximumLevel, new { htmlAttributes = new { @class = "form-control" } }) 31 |
32 |
33 | 34 |
35 |
36 | @Html.EditorFor(model => model.UserCodeWarningLevel, new { htmlAttributes = new { @class = "form-control" } }) 37 |
38 |
39 | *@ 40 | 41 |
42 |
43 | @Html.EditorFor(model => model.ExternalSharingEnabled) 44 |
45 |
46 | 47 |
48 |
49 | @Html.EditorFor(model => model.PartnerPackExtensionsEnabled) 50 |
51 |
52 | 53 |
54 |
55 | @Html.EditorFor(model => model.ResponsiveDesignEnabled) 56 |
57 |
58 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Components/MSGraphAPIContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Components 8 | { 9 | public static class MSGraphAPIContext 10 | { 11 | public static String CurrentUserInitials 12 | { 13 | get 14 | { 15 | String result = null; 16 | 17 | var name = System.Security.Claims.ClaimsPrincipal.Current.FindFirst("name"); 18 | if (name != null) 19 | { 20 | var nameParts = name.Value.Split(new String[] { " " }, StringSplitOptions.RemoveEmptyEntries); 21 | if (nameParts.Length >= 2) 22 | { 23 | result = nameParts[0].Substring(0, 1) + nameParts[1].Substring(0, 1); 24 | } 25 | else 26 | { 27 | result = nameParts[0].Substring(0, 2); 28 | } 29 | } 30 | 31 | return (result.ToUpper()); 32 | } 33 | } 34 | 35 | public static String CurrentUserUPN 36 | { 37 | get 38 | { 39 | String result = null; 40 | 41 | var upn = System.Security.Claims.ClaimsPrincipal.Current.FindFirst(System.Security.Claims.ClaimTypes.Upn); 42 | if (upn != null) 43 | { 44 | result = upn.Value; 45 | } 46 | 47 | return (result); 48 | } 49 | } 50 | 51 | public static String CurrentUserDisplayName 52 | { 53 | get 54 | { 55 | String result = null; 56 | 57 | var name = System.Security.Claims.ClaimsPrincipal.Current.FindFirst("name"); 58 | if (name != null) 59 | { 60 | result = name.Value; 61 | } 62 | 63 | return (result); 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.ContinousJob/Functions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Microsoft.Azure.WebJobs; 8 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs.Handlers; 9 | using OfficeDevPnP.PartnerPack.Infrastructure; 10 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 11 | using System.Diagnostics; 12 | using OfficeDevPnP.PartnerPack.Infrastructure.Diagnostics; 13 | 14 | namespace OfficeDevPnP.PartnerPack.ContinousJob 15 | { 16 | public class Functions 17 | { 18 | // This function will get triggered/executed when a new message is written 19 | // on an Azure Queue called queue. 20 | public static void ProcessQueueMessage([QueueTrigger(PnPPartnerPackSettings.StorageQueueName)] ContinousJobItem content, TextWriter log) 21 | { 22 | // Attach TextWriter log to Trace 23 | // https://blog.josequinto.com/2017/02/16/enable-azure-invocation-log-at-a-web-job-function-level-for-pnp-provisioning/ 24 | TextWriterTraceListener twtl = new TextWriterTraceListener(log); 25 | twtl.Name = "ContinousJobLogger"; 26 | string[] notShownWords = new string[] { "TokenCache", "AcquireTokenHandlerBase"}; 27 | twtl.Filter = new RemoveWordsFilter(notShownWords); 28 | Trace.Listeners.Add(twtl); 29 | Trace.AutoFlush = true; 30 | 31 | log.WriteLine(String.Format("Found Job: {0}", content.JobId)); 32 | 33 | // Get the info about the Provisioning Job 34 | ProvisioningJobInformation jobInfo = 35 | ProvisioningRepositoryFactory.Current.GetProvisioningJob(content.JobId, true); 36 | 37 | // Get a reference to the Provisioning Job 38 | ProvisioningJob job = jobInfo.JobFile.FromJsonStream(jobInfo.Type); 39 | 40 | if (PnPPartnerPackSettings.ContinousJobHandlers.ContainsKey(job.GetType())) 41 | { 42 | PnPPartnerPackSettings.ContinousJobHandlers[job.GetType()].RunJob(job); 43 | } 44 | 45 | log.WriteLine("Completed Job execution"); 46 | 47 | // Remove Trace Listener 48 | Trace.Listeners.Remove(twtl); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/Components/AzureAdApplication.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace OfficeDevPnP.PartnerPack.Setup.Components 9 | { 10 | public class KeyCredential 11 | { 12 | public string customKeyIdentifier { get; set; } 13 | public string keyId { get; set; } 14 | public string type { get; set; } 15 | public string usage { get; set; } 16 | 17 | [JsonProperty("key")] 18 | public string value { get; set; } 19 | } 20 | 21 | public class ResourceAccess 22 | { 23 | public string id { get; set; } 24 | public string type { get; set; } 25 | } 26 | 27 | public class RequiredResourceAccess 28 | { 29 | public string resourceAppId { get; set; } 30 | public List resourceAccess { get; set; } 31 | } 32 | 33 | public class AzureAdApplication 34 | { 35 | public Guid? Id { get; set; } 36 | public List addIns { get; set; } 37 | public List appRoles { get; set; } 38 | public Guid? AppId { get; set; } 39 | public bool availableToOtherOrganizations { get; set; } 40 | public string displayName { get; set; } 41 | public object errorUrl { get; set; } 42 | public object groupMembershipClaims { get; set; } 43 | public string homepage { get; set; } 44 | public List identifierUris { get; set; } 45 | public List keyCredentials { get; set; } 46 | public List knownClientApplications { get; set; } 47 | public object logoutUrl { get; set; } 48 | public bool oauth2AllowImplicitFlow { get; set; } 49 | public bool oauth2AllowUrlPathMatching { get; set; } 50 | public List oauth2Permissions { get; set; } 51 | public bool oauth2RequirePostResponse { get; set; } 52 | public List passwordCredentials { get; set; } 53 | public bool publicClient { get; set; } 54 | public List replyUrls { get; set; } 55 | public List requiredResourceAccess { get; set; } 56 | public object samlMetadataUrl { get; set; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Shared/_Office365NavBar.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | 3 | var userIsTenantGlobalAdmin = OfficeDevPnP.PartnerPack.Infrastructure.PnPPartnerPackUtilities.UserIsTenantGlobalAdmin(); 4 | var userIsSharePointAdmin = OfficeDevPnP.PartnerPack.Infrastructure.PnPPartnerPackUtilities.UserIsSPOAdmin(); 5 | } 6 |
7 |
8 | 9 |
10 | 39 |
40 | -------------------------------------------------------------------------------- /scripts/Reset-Configs.ps1: -------------------------------------------------------------------------------- 1 | ################################################################################################# 2 | # 3 | # 4 | # Use this script to reset the app.config and web.config files to their original unmodified state 5 | # 6 | # 7 | ################################################################################################# 8 | 9 | $ClientId= "[CLIENT ID]" 10 | $ClientSecret = "[CLIENT SECRET]" 11 | $ADTenant = "[TENANT].onmicrosoft.com" 12 | $InfrastructureSiteUrl = "[INFRASTRUCTURE SITE URL]" 13 | 14 | # DO NOT MODIFY BELOW 15 | $basePath = "$(convert-path ..)\OfficeDevPnP.PartnerPack.SiteProvisioning" 16 | $configFiles = "OfficeDevPnP.PartnerPack.CheckAdminsJob\App.config", 17 | "OfficeDevPnP.PartnerPack.ExternalUsersJob\App.config", 18 | "OfficeDevPnP.PartnerPack.ContinousJob\App.config", 19 | "OfficeDevPnP.PartnerPack.ScheduledJob\App.config", 20 | "OfficeDevPnP.PartnerPack.SiteProvisioning\Web.config" 21 | 22 | $azureWebJobsDashBoardNodeValue = ""; 23 | 24 | foreach($configFile in $configFiles) 25 | { 26 | $configDoc = (Get-Content "$basePath\$configFile") -As [Xml] 27 | $azureWebJobsDashboardNode = $configDoc.configuration.connectionStrings.add | ?{$_.name -eq "AzureWebJobsDashboard"} 28 | if($azureWebJobsDashboardNode -ne $null) 29 | { 30 | $azureWebJobsDashboardNode.connectionString = $azureWebJobsDashBoardNodeValue 31 | } 32 | $azureWebJobsStorageNode = $configDoc.configuration.connectionStrings.add | ?{$_.name -eq "AzureWebJobsStorage"} 33 | if($azureWebJobsStorageNode -ne $null) 34 | { 35 | $azureWebJobsStorageNode.connectionString = $azureWebJobsDashBoardNodeValue 36 | } 37 | $clientIdNode = $configDoc.configuration.appSettings.add | ? {$_.key -eq "ida:ClientId"} 38 | $clientIdNode.value = $ClientId 39 | $clientSecretNode = $configDoc.configuration.appSettings.add | ? {$_.key -eq "ida:ClientSecret"} 40 | $clientSecretNode.value = $ClientSecret 41 | 42 | $tenantSettingsNode = $configDoc.configuration.PnPPartnerPackConfiguration.TenantSettings 43 | $tenantSettingsNode.tenant = $ADTenant 44 | $tenantSettingsNode.appOnlyCertificateThumbprint = "[CERTIFICATE THUMBPRINT]" 45 | $tenantSettingsNode.infrastructureSiteUrl = $InfrastructureSiteUrl 46 | 47 | $configDoc.Save("$basePath\$configFile") 48 | } -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/MyProvisionedSites.cshtml: -------------------------------------------------------------------------------- 1 | @using OfficeDevPnP.PartnerPack.Infrastructure.Jobs 2 | 3 | @{ 4 | ViewBag.Title = "My Site Collections"; 5 | } 6 | 7 |
8 |
9 |
10 | Here you can find the list of your provisioned site collections. 11 |
12 |
13 |
14 |
15 |   16 |
17 |
18 | 19 |
20 |
21 | @Html.Partial("~/Views/Shared/_WorkingOnIt.cshtml") 22 |
23 |
24 |
25 |
26 | 27 |
28 | 29 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Setup/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/Jobs/SiteCollectionProvisioningJob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace OfficeDevPnP.PartnerPack.Infrastructure.Jobs 8 | { 9 | /// 10 | /// Defines a Site Collection Provisioning Job 11 | /// 12 | public class SiteCollectionProvisioningJob : SiteProvisioningJob 13 | { 14 | /// 15 | /// Defines the Primary Site Collection Administrator for the Site Collection to provisiong 16 | /// 17 | public String PrimarySiteCollectionAdmin { get; set; } 18 | 19 | /// 20 | /// Defines the Secondary Site Collection Administrator for the Site Collection to provisiong 21 | /// 22 | public String SecondarySiteCollectionAdmin { get; set; } 23 | 24 | /// 25 | /// Defines the Storage Maximum Level for the Site Collection to provisiong 26 | /// 27 | public Int64 StorageMaximumLevel { get; set; } 28 | 29 | /// 30 | /// Defines the Storage Warning Level for the Site Collection to provisiong 31 | /// 32 | public Int64 StorageWarningLevel { get; set; } 33 | 34 | /// 35 | /// Defines the User Code Maximum Level for the Site Collection to provisiong 36 | /// 37 | public Int64 UserCodeMaximumLevel { get; set; } 38 | 39 | /// 40 | /// Defines the User Code Warning Level for the Site Collection to provisiong 41 | /// 42 | public Int64 UserCodeWarningLevel { get; set; } 43 | 44 | /// 45 | /// Defines whether to enable External Sharing for the Site Collection to provisiong 46 | /// 47 | public Boolean ExternalSharingEnabled { get; set; } 48 | 49 | /// 50 | /// Defines whether to enable PnP Partner Pack extensions for the Site Collection to provisiong 51 | /// 52 | public Boolean PartnerPackExtensionsEnabled { get; set; } 53 | 54 | /// 55 | /// Defines whether to enable PnP Partner Pack extensions for Responsive Design 56 | /// 57 | public Boolean ResponsiveDesignEnabled { get; set; } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Templates/Responsive/SPO-Responsive.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | https://pnp-partner-pack-testpnp444321.azurewebsites.net/ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Content/sass/_Fabric.Animations.RTL.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information. 2 | 3 | // 4 | // Office UI Fabric 5 | // -------------------------------------------------- 6 | // RTL overrides for Fabric Animations 7 | 8 | 9 | @import 'Fabric.Animations'; 10 | 11 | // slideRightIn10 12 | @mixin ms-u-slideRightIn10 { 13 | @include animationMix((fadeIn, slideLeft10), $ms-duration3, $ms-ease1); 14 | } 15 | 16 | // slideRightIn20 17 | @mixin ms-u-slideRightIn20 { 18 | @include animationMix((fadeIn, slideLeft20), $ms-duration3, $ms-ease1); 19 | } 20 | 21 | // slideRightIn40 22 | @mixin ms-u-slideRightIn40 { 23 | @include animationMix((fadeIn, slideLeft40), $ms-duration3, $ms-ease1); 24 | } 25 | 26 | // slideLeftIn10 27 | @mixin ms-u-slideLeftIn10 { 28 | @include animationMix((fadeIn, slideRight10), $ms-duration3, $ms-ease1); 29 | } 30 | 31 | // slideLeftIn20 32 | @mixin ms-u-slideLeftIn20 { 33 | @include animationMix((fadeIn, slideRight20), $ms-duration3, $ms-ease1); 34 | } 35 | 36 | // slideLeftIn40 37 | @mixin ms-u-slideLeftIn40 { 38 | @include animationMix((fadeIn, slideRight40), $ms-duration3, $ms-ease1); 39 | } 40 | 41 | // slideRightIn400 42 | @mixin ms-u-slideRightIn400 { 43 | @include animationMix((fadeIn, slideLeft400), $ms-duration3, $ms-ease1); 44 | } 45 | 46 | // slideLeftIn400 47 | @mixin ms-u-slideLeftIn400 { 48 | @include animationMix((fadeIn, slideRight400), $ms-duration3, $ms-ease1); 49 | } 50 | 51 | // slideRightOut40 52 | @mixin ms-u-slideRightOut40 { 53 | @include animationMix((fadeOut, slideLeftOut40), $ms-duration1, $ms-ease2); 54 | } 55 | 56 | // slideLeftOut40 57 | @mixin ms-u-slideLeftOut40 { 58 | @include animationMix((fadeOut, slideRightOut40), $ms-duration1, $ms-ease2); 59 | } 60 | 61 | // slideRightOut400 62 | @mixin ms-u-slideRightOut400 { 63 | @include animationMix((fadeOut, slideLeftOut400), $ms-duration1, $ms-ease2); 64 | } 65 | 66 | // slideLeftOut400 67 | @mixin ms-u-slideLeftOut400 { 68 | @include animationMix((fadeOut, slideRightOut400), $ms-duration1, $ms-ease2); 69 | } 70 | 71 | // rotate90deg 72 | @mixin ms-u-rotate90deg { 73 | @include animationMix(rotateN90, 0.1s, $ms-ease2); 74 | } 75 | 76 | // rotateN90deg 77 | @mixin ms-u-rotateN90deg { 78 | @include animationMix(rotate90, 0.1s, $ms-ease2); 79 | } 80 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.Infrastructure/ITemplateRepository.cs: -------------------------------------------------------------------------------- 1 | using OfficeDevPnP.Core.Framework.Provisioning.Model; 2 | using OfficeDevPnP.PartnerPack.Infrastructure.Jobs; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace OfficeDevPnP.PartnerPack.Infrastructure 10 | { 11 | /// 12 | /// Interface that defines the common behavior for any Sites Provisioning Templates Repository 13 | /// 14 | public interface ITemplateRepository : IConfigurable 15 | { 16 | /// 17 | /// Retrieves a single Provisioning Template 18 | /// 19 | /// Defines the repository relative URI of the template in the target repository 20 | /// Returns the Provisioning Template object for using it directly 21 | ProvisioningTemplate GetProvisioningTemplate(String templateUri); 22 | 23 | /// 24 | /// Allows to search for Provisioning Templates in the target repository 25 | /// 26 | /// Any free text to search for in title, abstract or URL/SEO of the template 27 | /// The platforms to filter the provisioning templates 28 | /// The scope to filter the provisioning templates 29 | /// 30 | ProvisioningTemplateInformation[] SearchProvisioningTemplates(String searchText, TargetPlatform platforms, TargetScope scope); 31 | 32 | /// 33 | /// Saves a Provisioning Template into the target repository 34 | /// 35 | /// The Provisioning Template to save 36 | /// The repository relative URI of the provisioning template to save 37 | void SaveProvisioningTemplate(ProvisioningTemplate template, String templateUri); 38 | 39 | /// 40 | /// Defines the display name for the current implementation of the ITemplateRepository 41 | /// 42 | String DisplayName { get; } 43 | 44 | /// 45 | /// Defines whether the current templates repository can store new templates 46 | /// 47 | Boolean CanWrite { get; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Views/Home/UpdateSiteTemplate.cshtml: -------------------------------------------------------------------------------- 1 | @model OfficeDevPnP.PartnerPack.SiteProvisioning.Models.UpdateSiteTemplateViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Update Site Provisioning Template"; 5 | } 6 | 7 | @if (Model.JobId.HasValue && Model.JobId.Value != Guid.Empty) 8 | { 9 |
10 |
11 |
12 | The Site will be updated with the latest version of the Provisioning Template applied to the current site. The ID assigned to the Job is: @Model.JobId. 13 |
14 |
15 |
16 | } 17 | else 18 | { 19 | using (Html.BeginForm("UpdateSiteTemplate", "Home", "", FormMethod.Post, new { enctype = "multipart/form-data" })) 20 | { 21 | @Html.AntiForgeryToken() 22 | 23 | 24 | @Html.HiddenFor(model => model.TargetSiteUrl) 25 | 26 |
27 |
28 |
29 | Click the "Update Site" button in order to refresh the Provisioning Template applied to the current site. 30 |
31 |
32 |
33 | 34 |
35 |
36 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 37 | 38 |
39 | 40 | 45 | 50 | } 51 | } 52 | 53 | @section Scripts { 54 | 55 | 64 | } 65 | 66 | --------------------------------------------------------------------------------