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.
|
System.
|
Returns
System.
|
ConcatenateWithPipeDelimiter(String, String)
Declaration
public string ConcatenateWithPipeDelimiter(string string1, string string2)
Parameters
System.
|
System.
|
Returns
System.
|
ConcatenateWithSemiColonDelimiter(String, String)
Declaration
public string ConcatenateWithSemiColonDelimiter(string string1, string string2)
Parameters
System.
|
System.
|
Returns
System.
|
ContainsScript(String)
Checks if the provided html contains JavaScript
Declaration
public bool ContainsScript(string content)
Parameters
System. Html content to check |
Returns
System. True is the html contains script, false otherwise |
ContentByQuerySelector(String, String)
Declaration
public string ContentByQuerySelector(string listGuid, string listName)
Parameters
System.
|
System.
|
Returns
System.
|
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.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
Dictionary<System. 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.
|
System.
|
System.
|
System.
|
Returns
Dictionary<System. 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. Link value if set |
Returns
System. Unused variable |
ContentEmbedSelectorContentLink(String, String, String, String)
Declaration
public string ContentEmbedSelectorContentLink(string contentLink, string embeddedContent, string fileContent, string useCommunityScriptEditor)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
ContentEmbedSelectorSourceType(String)
Declaration
public string ContentEmbedSelectorSourceType(string sourceType)
Parameters
System.
|
Returns
System.
|
DocumentEmbedLookup(String)
Declaration
public Dictionary<string, string> DocumentEmbedLookup(string serverRelativeUrl)
Parameters
System.
|
Returns
Dictionary<System.
|
ExtractWebpartProperties(String)
Extracts the client side web part properties so they can be reused
Declaration
public string ExtractWebpartProperties(string clientSideWebPartHtml)
Parameters
System. Html defining the client side web part hosted on a classic page |
Returns
System. Client side web part properties ready for reuse |
HtmlEncode(String)
Html encodes a string
Declaration
public string HtmlEncode(string text)
Parameters
System. Text to html encode |
Returns
System. Html encoded string |
HtmlEncodeForJson(String)
Html encodes string for inclusion in JSON
Declaration
public string HtmlEncodeForJson(string text)
Parameters
System. Text to html encode |
Returns
System. 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. Original anchor tag fetched from the source image |
System. Original image url |
System. New image url |
Returns
System. 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. Server relative path of the image |
Returns
Dictionary<System. 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. 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. 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. 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. Webpart view definition |
Returns
System. 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. XmlDefinition attribute of the XSLTListViewWebPart |
Returns
System. 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.
|
Returns
System. 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. Server relative url to the file to load |
Returns
System. 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. User account to lookup (in i:0#.f|membership|joe@contoso.onmicrosoft.com format) |
Returns
Dictionary<System. 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.
|
Returns
System.
|
ReturnFalse()
Return false
Declaration
public string ReturnFalse()
Returns
System. False |
ReturnFileName(String)
Returns the filename of the given path
Declaration
public string ReturnFileName(string path)
Parameters
System.
|
Returns
System. File name |
ReturnServerRelativePath(String)
Transforms the incoming path into a server relative path
Declaration
public string ReturnServerRelativePath(string path)
Parameters
System. Path to transform |
Returns
System. Server relative path |
ReturnTrue()
Return true
Declaration
public string ReturnTrue()
Returns
System. 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. The UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance |
Returns
System. 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.
|
Returns
System. 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. The SummaryLinksToQuickLinks mapping property provided via the PageTransformationInformation instance |
Returns
System. 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. Original wiki html content |
System.
|
Returns
Dictionary<System. 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. Wiki html to rewrite |
System.
|
Returns
System. 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. Original wiki html content |
System. Specifies the kind of border that surrounds the webpart, see PartChromeType for a complete list of possible values |
System. Webpart title |
Returns
System. 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. Text to evaluate |
Returns
System. 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. 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. Account of the user |
Returns
System. Indication if user is valid or not |