This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes to tokenparser when provisioning and extracting clientsidepages
- Loading branch information
1 parent
ce109bb
commit 9688ead
Showing
5 changed files
with
126 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/TokenDefinitions/FqdnToken.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Microsoft.SharePoint.Client; | ||
using OfficeDevPnP.Core.Attributes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.TokenDefinitions | ||
{ | ||
[TokenDefinitionDescription( | ||
Token = "{fqdn}", | ||
Description = "Returns a full url of the current host", | ||
Example = "{fqdn}", | ||
Returns = "mycompany.sharepoint.com")] | ||
public class FqdnToken: TokenDefinition | ||
{ | ||
public FqdnToken(Web web): base(web, "{fqdn}") | ||
{ | ||
} | ||
|
||
public override string GetReplaceValue() | ||
{ | ||
if (CacheValue == null) | ||
{ | ||
TokenContext.Web.EnsureProperty(w => w.Url); | ||
var uri = new Uri(TokenContext.Web.Url); | ||
CacheValue = $"{uri.DnsSafeHost.ToLower().Replace("-admin","")}"; | ||
} | ||
return CacheValue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters