Class BuiltIn
Set of native, builtin, functions
Inherited Members
Namespace: PnP.Framework.Modernization.Functions
Assembly: PnP.Framework.dll
Syntax
public class BuiltIn : FunctionsBase
Constructors
BuiltIn(BaseTransformationInformation, ClientContext, ClientContext, IPage, IList<ILogObserver>)
Methods
Concatenate(String, String)
Declaration
public string Concatenate(string string1, string string2)
Parameters
System.String
string1
|
System.String
string2
|
Returns
System.String
|
ConcatenateWithPipeDelimiter(String, String)
Declaration
public string ConcatenateWithPipeDelimiter(string string1, string string2)
Parameters
System.String
string1
|
System.String
string2
|
Returns
System.String
|
ConcatenateWithSemiColonDelimiter(String, String)
Declaration
public string ConcatenateWithSemiColonDelimiter(string string1, string string2)
Parameters
System.String
string1
|
System.String
string2
|
Returns
System.String
|
ContainsScript(String)
Checks if the provided html contains JavaScript
Declaration
public bool ContainsScript(string content)
Parameters
System.String
content
Html content to check |
Returns
System.Boolean
True is the html contains script, false otherwise |
ContentByQuerySelector(String, String)
Declaration
public string ContentByQuerySelector(string listGuid, string listName)
Parameters
System.String
listGuid
|
System.String
listName
|
Returns
System.String
|
ContentByQueryToHighlightedContentProperties(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, Int32, String)
Maps content by query web part data into a properties collection for the contentrollup (= Highlighted Content) web part
Declaration
public Dictionary<string, string> ContentByQueryToHighlightedContentProperties(string webUrl, string listGuid, string listName, string serverTemplate, string contentTypeBeginsWithId, string filterField1, string filter1ChainingOperator, string filterField1Value, string filterOperator1, string filterField2, string filter2ChainingOperator, string filterField2Value, string filterOperator2, string filterField3, string filterField3Value, string filterOperator3, string sortBy, string sortByDirection, string groupBy, string groupByDirection, string itemLimit, int displayColumns, string dataMappings)
Parameters
System.String
webUrl
|
System.String
listGuid
|
System.String
listName
|
System.String
serverTemplate
|
System.String
contentTypeBeginsWithId
|
System.String
filterField1
|
System.String
filter1ChainingOperator
|
System.String
filterField1Value
|
System.String
filterOperator1
|
System.String
filterField2
|
System.String
filter2ChainingOperator
|
System.String
filterField2Value
|
System.String
filterOperator2
|
System.String
filterField3
|
System.String
filterField3Value
|
System.String
filterOperator3
|
System.String
sortBy
|
System.String
sortByDirection
|
System.String
groupBy
|
System.String
groupByDirection
|
System.String
itemLimit
|
System.Int32
displayColumns
|
System.String
dataMappings
|
Returns
Dictionary<System.String, System.String>
A properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part |
ContentBySearchToHighlightedContentProperties(String, String, Int32, String)
Maps content by search web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
Declaration
public Dictionary<string, string> ContentBySearchToHighlightedContentProperties(string dataProviderJson, string selectedPropertiesJson, int resultsPerPage, string renderTemplateId)
Parameters
System.String
dataProviderJson
|
System.String
selectedPropertiesJson
|
System.Int32
resultsPerPage
|
System.String
renderTemplateId
|
Returns
Dictionary<System.String, System.String>
A properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part |
ContentEmbedCrossSiteCheck(String)
Throws an exception when link to .aspx file.
Declaration
public string ContentEmbedCrossSiteCheck(string contentLink)
Parameters
System.String
contentLink
Link value if set |
Returns
System.String
Unused variable |
ContentEmbedSelectorContentLink(String, String, String, String)
Declaration
public string ContentEmbedSelectorContentLink(string contentLink, string embeddedContent, string fileContent, string useCommunityScriptEditor)
Parameters
System.String
contentLink
|
System.String
embeddedContent
|
System.String
fileContent
|
System.String
useCommunityScriptEditor
|
Returns
System.String
|
ContentEmbedSelectorSourceType(String)
Declaration
public string ContentEmbedSelectorSourceType(string sourceType)
Parameters
System.String
sourceType
|
Returns
System.String
|
DocumentEmbedLookup(String)
Declaration
public Dictionary<string, string> DocumentEmbedLookup(string serverRelativeUrl)
Parameters
System.String
serverRelativeUrl
|
Returns
Dictionary<System.String, System.String>
|
ExtractWebpartProperties(String)
Extracts the client side web part properties so they can be reused
Declaration
public string ExtractWebpartProperties(string clientSideWebPartHtml)
Parameters
System.String
clientSideWebPartHtml
Html defining the client side web part hosted on a classic page |
Returns
System.String
Client side web part properties ready for reuse |
HtmlEncode(String)
Html encodes a string
Declaration
public string HtmlEncode(string text)
Parameters
System.String
text
Text to html encode |
Returns
System.String
Html encoded string |
HtmlEncodeForJson(String)
Html encodes string for inclusion in JSON
Declaration
public string HtmlEncodeForJson(string text)
Parameters
System.String
text
Text to html encode |
Returns
System.String
Html encoded string for inclusion in JSON |
ImageAnchorUrlRewrite(String, String, String)
Rewrite the image anchor tag url
Declaration
public string ImageAnchorUrlRewrite(string anchor, string originalImageUrl, string newImageUrl)
Parameters
System.String
anchor
Original anchor tag fetched from the source image |
System.String
originalImageUrl
Original image url |
System.String
newImageUrl
New image url |
Returns
System.String
The url after url rewrite. If the anchor and original image url were the same then the anchor will be set to the new image url |
ImageLookup(String)
Does return image properties based on given server relative image path
Declaration
public Dictionary<string, string> ImageLookup(string serverRelativeImagePath)
Parameters
System.String
serverRelativeImagePath
Server relative path of the image |
Returns
Dictionary<System.String, System.String>
A set of image properties |
ListAddServerRelativeUrl(Guid)
Function that returns the server relative url of the given list
Declaration
public string ListAddServerRelativeUrl(Guid listId)
Parameters
Guid
listId
Id of the list |
Returns
System.String
Server relative url of the list |
ListAddWebRelativeUrl(Guid)
Function that returns the web relative url of the given list
Declaration
public string ListAddWebRelativeUrl(Guid listId)
Parameters
Guid
listId
Id of the list |
Returns
System.String
Web relative url of the list |
ListCrossSiteCheck(Guid)
Returns the cross site collection save list id.
Declaration
public string ListCrossSiteCheck(Guid listId)
Parameters
Guid
listId
Id of the list |
Returns
System.String
Cross site collection safe list id |
ListDetectUsedView(Guid, String)
Tries to find the id of the view used to configure the web part
Declaration
public string ListDetectUsedView(Guid listId, string xmlDefinition)
Parameters
Guid
listId
Id of the list |
System.String
xmlDefinition
Webpart view definition |
Returns
System.String
Id of the detected view if found or otherwise the id of the default list view |
ListHideToolBar(String)
Checks if an XSLTListView web part has a hidden toolbar
Declaration
public bool ListHideToolBar(string xmlDefinition)
Parameters
System.String
xmlDefinition
XmlDefinition attribute of the XSLTListViewWebPart |
Returns
System.Boolean
Boolean indicating if the toolbar should be hidden |
ListSelectorListLibrary(Guid, String)
Selector that returns the base type of the list as input for selecting the correct mapping
Declaration
public string ListSelectorListLibrary(Guid listId, string viewXml)
Parameters
Guid
listId
Id of the list |
System.String
viewXml
|
Returns
System.String
Mapping to be used for the given list |
LoadContentFromFile(String)
Loads contents of a file as a string.
Declaration
public string LoadContentFromFile(string contentLink)
Parameters
System.String
contentLink
Server relative url to the file to load |
Returns
System.String
Text content of the file. Return empty string if file was not found |
LookupPerson(String)
Looks up a person from the UserInfo list and returns the needed details
Declaration
public Dictionary<string, string> LookupPerson(string person)
Parameters
System.String
person
User account to lookup (in i:0#.f|membership|joe@contoso.onmicrosoft.com format) |
Returns
Dictionary<System.String, System.String>
Information about the found user |
ReturnCrossSiteRelativePath(String)
Copy the asset to target site in cross site transformation
Declaration
public string ReturnCrossSiteRelativePath(string imageLink)
Parameters
System.String
imageLink
|
Returns
System.String
|
ReturnFalse()
Return false
Declaration
public string ReturnFalse()
Returns
System.String
False |
ReturnFileName(String)
Returns the filename of the given path
Declaration
public string ReturnFileName(string path)
Parameters
System.String
path
|
Returns
System.String
File name |
ReturnServerRelativePath(String)
Transforms the incoming path into a server relative path
Declaration
public string ReturnServerRelativePath(string path)
Parameters
System.String
path
Path to transform |
Returns
System.String
Server relative path |
ReturnTrue()
Return true
Declaration
public string ReturnTrue()
Returns
System.String
True |
ScriptEditorSelector(String)
Uses the UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance to determine the mapping
Declaration
public string ScriptEditorSelector(string useCommunityScriptEditor)
Parameters
System.String
useCommunityScriptEditor
The UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance |
Returns
System.String
Whether to transform via the community script editor web part |
StaticString(String)
Returns an the (static) string provided as input
Declaration
public string StaticString(string staticString)
Parameters
System.String
staticString
|
Returns
System.String
String provided as input |
SummaryLinkSelector(String)
Uses the SummaryLinksToQuickLinks mapping property provided via the PageTransformationInformation instance to determine the mapping
Declaration
public string SummaryLinkSelector(string useQuickLinks)
Parameters
System.String
useQuickLinks
The SummaryLinksToQuickLinks mapping property provided via the PageTransformationInformation instance |
Returns
System.String
Whether to transform via the QuickLinks web part or via Text |
SummaryLinksToQuickLinksProperties(String, String)
Maps summarylinks web part data into a properties collection and supporting serverProcessedContent nodes for the quicklinks web part
Declaration
public Dictionary<string, string> SummaryLinksToQuickLinksProperties(string text, string quickLinksJsonProperties = "")
Parameters
System.String
text
Original wiki html content |
System.String
quickLinksJsonProperties
|
Returns
Dictionary<System.String, System.String>
Properties collection for the quicklinks web part |
TextCleanup(String, String)
Wiki html rewrite to work in RTE
Declaration
public string TextCleanup(string text, string usePlaceHolders)
Parameters
System.String
text
Wiki html to rewrite |
System.String
usePlaceHolders
|
Returns
System.String
Html that's compatible with RTE |
TextCleanUpSummaryLinks(String, Int32, String)
Rewrites summarylinks web part html to be compliant with the html supported by the client side text part
Declaration
public string TextCleanUpSummaryLinks(string text, int chromeType, string title)
Parameters
System.String
text
Original wiki html content |
System.Int32
chromeType
Specifies the kind of border that surrounds the webpart, see PartChromeType for a complete list of possible values |
System.String
title
Webpart title |
Returns
System.String
Html compliant with client side text part |
TextSelector(String)
Selector to allow to embed a spacer instead of an empty text
Declaration
public string TextSelector(string text)
Parameters
System.String
text
Text to evaluate |
Returns
System.String
Text if text needs to be inserted, Spacer if text was empty and you want a spacer |
UserDocumentsToHighlightedContentProperties()
Maps the user documents web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
Declaration
public Dictionary<string, string> UserDocumentsToHighlightedContentProperties()
Returns
Dictionary<System.String, System.String>
A properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part |
UserExistsSelector(String)
Checks if the passed value is a user or not
Declaration
public string UserExistsSelector(string person)
Parameters
System.String
person
Account of the user |
Returns
System.String
Indication if user is valid or not |