Skip to content

Commit 0c4da7e

Browse files
committed
Updated docs for the March release
1 parent 07564cc commit 0c4da7e

5 files changed

+432
-52
lines changed

docs/transform/modernize-userinterface-site-pages-api.md

Lines changed: 240 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
title: Page Transformation Functions and Selectors
3+
description: Page Transformation Functions and Selectors
4+
ms.date: 03/06/2019
5+
ms.prod: sharepoint
6+
localization_priority: Normal
7+
---
8+
19
# Page Transformation Functions and Selectors
210

311
## Summary
@@ -129,22 +137,38 @@ Name|Description
129137
Name|Description
130138
:-----|:----------
131139
{CleanedText}|Html compliant with client side text part
132-
### TextCleanUpSummaryLinks
140+
### ContainsScript
133141

134-
**Description:** Rewrites summarylinks web part html to be compliant with the html supported by the client side text part.
142+
**Description:** Checks if the provided html contains JavaScript
135143

136-
**Example:** `{CleanedText} = TextCleanUpSummaryLinks({Text})`
144+
**Example:** `{HasScript} = ContainsScript({Text})`
137145

138146
#### Input parameters
139147

140148
Name|Description
141149
:-----|:----------
142-
{Text}|Original wiki html content
150+
{Text}|Html content to check
143151
#### Output parameters
144152

145153
Name|Description
146154
:-----|:----------
147-
{CleanedText}|Html compliant with client side text part
155+
{HasScript}|True is the html contains script, false otherwise
156+
### ListCrossSiteCheck
157+
158+
**Description:** Returns the cross site collection save list id.
159+
160+
**Example:** `{ListId} = ListCrossSiteCheck({ListId})`
161+
162+
#### Input parameters
163+
164+
Name|Description
165+
:-----|:----------
166+
{ListId}|Guid of the list to use
167+
#### Output parameters
168+
169+
Name|Description
170+
:-----|:----------
171+
{ListId}|Cross site collection safe list id
148172
### ListAddServerRelativeUrl
149173

150174
**Description:** Returns the server relative url of a list.
@@ -177,6 +201,22 @@ Name|Description
177201
Name|Description
178202
:-----|:----------
179203
{ListWebRelativeUrl}|Web relative url of the list
204+
### ListHideToolBar
205+
206+
**Description:** Checks if an XSLTListView web part has a hidden toolbar.
207+
208+
**Example:** `{HideToolBar} = ListHideToolBar({XmlDefinition})`
209+
210+
#### Input parameters
211+
212+
Name|Description
213+
:-----|:----------
214+
{XmlDefinition}|XmlDefinition attribute of the XSLTListViewWebPart
215+
#### Output parameters
216+
217+
Name|Description
218+
:-----|:----------
219+
{HideToolBar}|Boolean indicating if the toolbar should be hidden
180220
### ListDetectUsedView
181221

182222
**Description:** Detects the list view id that was used by the webpart by mapping the web part xmldefinition to the list views. If no view found the list default view id is returned.
@@ -211,6 +251,22 @@ Name|Description
211251
:-----|:----------
212252
{ImageListId}|Id of the list holding the file
213253
{ImageUniqueId}|UniqueId of the file
254+
### ReturnCrossSiteRelativePath
255+
256+
**Description:** Transforms the incoming path into a server relative path. If the page is located on another page the asset is transferred and url updated. Any failures keep to the original value.
257+
258+
**Example:** `{ServerRelativeFileName} = ReturnCrossSiteRelativePath({ImageLink})`
259+
260+
#### Input parameters
261+
262+
Name|Description
263+
:-----|:----------
264+
{ImageLink}|Original value for the image link
265+
#### Output parameters
266+
267+
Name|Description
268+
:-----|:----------
269+
{ServerRelativeFileName}|New target ___location for the asset if transferred.
214270
### ExtractWebpartProperties
215271

216272
**Description:** Extracts the client side web part properties so they can be reused.
@@ -246,11 +302,65 @@ Name|Description
246302
{DocumentUniqueId}|UniqueId of the file
247303
{DocumentAuthor}|User principal name of the document author
248304
{DocumentAuthorName}|Name of the file author
305+
### ContentEmbedCrossSiteCheck
306+
307+
**Description:** Throws an exception when link to .aspx file.
308+
309+
**Example:** `{Temp} = ContentEmbedCrossSiteCheck({ContentLink})`
310+
311+
#### Input parameters
312+
313+
Name|Description
314+
:-----|:----------
315+
{ContentLink}|Link value if set
316+
#### Output parameters
317+
318+
Name|Description
319+
:-----|:----------
320+
{Temp}|Unused variable
321+
### LoadContentFromFile
322+
323+
**Description:** Loads contents of a file as a string.
324+
325+
**Example:** `{FileContents} = LoadContentFromFile({ContentLink})`
326+
327+
#### Input parameters
328+
329+
Name|Description
330+
:-----|:----------
331+
{ContentLink}|Server relative url to the file to load
332+
#### Output parameters
333+
334+
Name|Description
335+
:-----|:----------
336+
{FileContents}|Text content of the file. Return empty string if file was not found
337+
### ContentBySearchToHighlightedContentProperties
338+
339+
**Description:** Maps content by search web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
340+
341+
**Example:** `ContentBySearchToHighlightedContentProperties({DataProviderJSON}, {SelectedPropertiesJson}, {ResultsPerPage}, {RenderTemplateId})`
342+
343+
#### Input parameters
344+
345+
Name|Description
346+
:-----|:----------
347+
{DataProviderJson}|
348+
{SelectedPropertiesJson}|
349+
{ResultsPerPage}|
350+
{RenderTemplateId}|
351+
#### Output parameters
352+
353+
Name|Description
354+
:-----|:----------
355+
{JsonProperties}|Properties collection for the contentrollup (= Highlighted Content) web part
356+
{SearchablePlainTexts}|SearchablePlainTexts nodes to be added in the serverProcessedContent node
357+
{Links}|Links nodes to be added in the serverProcessedContent node
358+
{ImageSources}|ImageSources nodes to be added in the serverProcessedContent node
249359
### ContentByQueryToHighlightedContentProperties
250360

251-
**Description:** Maps content by query web part data into a properties collection for the contentrollup (= Highlighted Content) web part
361+
**Description:** Maps content by query web part data into a properties collection and supporting serverProcessedContent nodes for the content rollup (= Highlighted Content) web part
252362

253-
**Example:** `{JsonProperties} = ContentByQueryToHighlightedContentProperties({WebUrl},{ListGuid},{ListName},{ServerTemplate},{ContentTypeBeginsWithId},{FilterField1},{Filter1ChainingOperator},{FilterDisplayValue1},{FilterOperator1},{FilterField2},{Filter2ChainingOperator},{FilterDisplayValue2},{FilterOperator2},{FilterField3},{FilterDisplayValue3},{FilterOperator3},{SortBy},{SortByDirection},{GroupBy},{GroupByDirection},{ItemLimit},{DisplayColumns},{DataMappings})`
363+
**Example:** `ContentByQueryToHighlightedContentProperties({WebUrl},{ListGuid},{ListName},{ServerTemplate},{ContentTypeBeginsWithId},{FilterField1},{Filter1ChainingOperator},{FilterDisplayValue1},{FilterOperator1},{FilterField2},{Filter2ChainingOperator},{FilterDisplayValue2},{FilterOperator2},{FilterField3},{FilterDisplayValue3},{FilterOperator3},{SortBy},{SortByDirection},{GroupBy},{GroupByDirection},{ItemLimit},{DisplayColumns},{DataMappings})`
254364

255365
#### Input parameters
256366

@@ -284,6 +394,66 @@ Name|Description
284394
Name|Description
285395
:-----|:----------
286396
{JsonProperties}|Properties collection for the contentrollup (= Highlighted Content) web part
397+
{SearchablePlainTexts}|SearchablePlainTexts nodes to be added in the serverProcessedContent node
398+
{Links}|Links nodes to be added in the serverProcessedContent node
399+
{ImageSources}|ImageSources nodes to be added in the serverProcessedContent node
400+
### TextCleanUpSummaryLinks
401+
402+
**Description:** Rewrites summarylinks web part html to be compliant with the html supported by the client side text part.
403+
404+
**Example:** `{CleanedText} = TextCleanUpSummaryLinks({Text})`
405+
406+
#### Input parameters
407+
408+
Name|Description
409+
:-----|:----------
410+
{Text}|Original wiki html content
411+
#### Output parameters
412+
413+
Name|Description
414+
:-----|:----------
415+
{CleanedText}|Html compliant with client side text part
416+
### SummaryLinksToQuickLinksProperties
417+
418+
**Description:** Maps summarylinks web part data into a properties collection and supporting serverProcessedContent nodes for the quicklinks web part
419+
420+
**Example:** `SummaryLinksToQuickLinksProperties({Text})`
421+
422+
#### Input parameters
423+
424+
Name|Description
425+
:-----|:----------
426+
{Text}|Original wiki html content
427+
#### Output parameters
428+
429+
Name|Description
430+
:-----|:----------
431+
{JsonProperties}|Properties collection for the quicklinks web part
432+
{SearchablePlainTexts}|SearchablePlainTexts nodes to be added in the serverProcessedContent node
433+
{Links}|Links nodes to be added in the serverProcessedContent node
434+
{ImageSources}|ImageSources nodes to be added in the serverProcessedContent node
435+
### LookupPerson
436+
437+
**Description:** Looks up a person from the UserInfo list and returns the needed details
438+
439+
**Example:** `LookupPerson({ContactLoginName})`
440+
441+
#### Input parameters
442+
443+
Name|Description
444+
:-----|:----------
445+
{ContactLoginName}|User account to lookup (in i:0#.f|membership|[email protected] format)
446+
#### Output parameters
447+
448+
Name|Description
449+
:-----|:----------
450+
{PersonName}|Name of the user
451+
{PersonEmail}|User's email
452+
{PersonUPN}|UPN of the user
453+
{PersonRole}|Role of the user
454+
{PersonDepartment}|User's department
455+
{PersonPhone}|Phone number of the user
456+
{PersonSip}|SIP address of the user
287457
## Selectors
288458
### TextSelector
289459

@@ -344,21 +514,29 @@ WebPage|The embedded content is a page
344514
ServerFolderOrFile|The embedded content points to a server folder or file
345515
### ContentEmbedSelectorContentLink
346516

347-
**Description:** If ContentLink is set (content editor) then return Link, otherwise return Content.
517+
**Description:** Content editor can be transformed in various ways depending on whether a link was used, what file type was used, if script is used or not...
348518

349-
**Example:** `ContentEmbedSelectorContentLink({ContentLink})`
519+
**Example:** `ContentEmbedSelectorContentLink({ContentLink}, {Content}, {FileContents}, {UseCommunityScriptEditor})`
350520

351521
#### Input parameters
352522

353523
Name|Description
354524
:-----|:----------
355525
{ContentLink}|Link value if set
526+
{Content}|Content embedded inside the web part
527+
{FileContents}|Text content of the file. Return empty string if file was not found
528+
{UseCommunityScriptEditor}|The UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance
356529
#### Output values
357530

358531
Name|Description
359532
:-----|:----------
360-
Link|If the link was not empty
361-
Content|If no link was specified
533+
Link|If the link was not empty and it was an aspx file
534+
NonASPXLink|If the link was not empty and it was not an aspx file but the file contents did contain JavaScript
535+
NonASPXLinkNoScript|If the link was not empty and it was not an aspx file and the contents did not contain JavaScript
536+
NonASPXUseCommunityScriptEditor|Use the community script editor to host the content
537+
Content|If no link was specified but content was embedded and it contains JavaScript
538+
ContentNoScript|If no link was specified and the embedded content and it does not contain JavaScript
539+
ContentUseCommunityScriptEditor|Use the community script editor to host the content
362540
### ContentByQuerySelector
363541

364542
**Description:** Analyzes a list and returns if the list can be transformed.
@@ -377,3 +555,54 @@ Name|Description
377555
:-----|:----------
378556
Default|Transform the list
379557
NoTransformation|Don't transform the list
558+
### SummaryLinkSelector
559+
560+
**Description:** Uses the SummaryLinksToQuickLinks mapping property provided via the PageTransformationInformation instance to determine the mapping
561+
562+
**Example:** `SummaryLinkSelector({SummaryLinksToQuickLinks})`
563+
564+
#### Input parameters
565+
566+
Name|Description
567+
:-----|:----------
568+
{SummaryLinksToQuickLinks}|The SummaryLinksToQuickLinks mapping property provided via the PageTransformationInformation instance
569+
#### Output values
570+
571+
Name|Description
572+
:-----|:----------
573+
UseQuickLinks|Transform to the QuickLinks web part
574+
UseText|Transform to the formatted text
575+
### ScriptEditorSelector
576+
577+
**Description:** Uses the UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance to determine the mapping
578+
579+
**Example:** `ScriptEditorSelector({UseCommunityScriptEditor})`
580+
581+
#### Input parameters
582+
583+
Name|Description
584+
:-----|:----------
585+
{UseCommunityScriptEditor}|The UseCommunityScriptEditor mapping property provided via the PageTransformationInformation instance
586+
#### Output values
587+
588+
Name|Description
589+
:-----|:----------
590+
UseCommunityScriptEditor|Transform to the community script editor web part
591+
NoScriptEditor|Don't transform as there's no script editor
592+
### UserExistsSelector
593+
594+
**Description:** Checks if the passed value is a user or not
595+
596+
**Example:** `UserExistsSelector({PersonEmail})`
597+
598+
#### Input parameters
599+
600+
Name|Description
601+
:-----|:----------
602+
{PersonEmail}|Account of the user
603+
#### Output values
604+
605+
Name|Description
606+
:-----|:----------
607+
InvalidUser|User is invalid
608+
ValidUser|User info is valid

docs/transform/modernize-userinterface-site-pages-configuration.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Options to control the page transformation process
33
description: Explains how to configure the page transformation process
4-
ms.date: 01/30/2019
4+
ms.date: 03/06/2019
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
@@ -140,6 +140,41 @@ PageTransformationInformation pti = new PageTransformationInformation(page)
140140
};
141141
```
142142

143+
## RemoveEmptySectionsAndColumns option (as of March 2019 release)
144+
145+
Type | Default value if not specified
146+
-----|----
147+
Bool | true
148+
149+
The default behavior is to remove all empty sections and columns (e.g. you transform from a 3 column layout and only have one web part in the middle column) as that will result in better use of the screen real estate, if you don't want this then set this option to false
150+
151+
```Csharp
152+
PageTransformationInformation pti = new PageTransformationInformation(page)
153+
{
154+
RemoveEmptySectionsAndColumns = false,
155+
};
156+
```
157+
158+
## MappingProperties dictionary (as of March 2019 release)
159+
160+
Type | Default value if not specified
161+
-----|----
162+
Dictionary<string,string> | empty
163+
164+
The default mapping file can be configured by setting mapping properties
165+
166+
```csharp
167+
PageTransformationInformation pti = new PageTransformationInformation(page)
168+
{
169+
// If target page exists, then overwrite it
170+
Overwrite = true,
171+
};
172+
173+
pti.MappingProperties["SummaryLinksToQuickLinks"] = "false";
174+
175+
pageTransformator.Transform(pti);
176+
```
177+
143178
## HandleWikiImagesAndVideos option
144179

145180
Type | Default value if not specified

0 commit comments

Comments
 (0)