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 |
17 | @if (Model != null && !String.IsNullOrEmpty(Model.InfrastructuralSiteUrl))
18 | {
19 |
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 |
)
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 = $('