Skip to content

Commit 22e87d4

Browse files
committed
Updated SP asset story
1 parent 0cfa47a commit 22e87d4

File tree

2 files changed

+50
-29
lines changed

2 files changed

+50
-29
lines changed

docs/spfx/toolchain/provision-sharepoint-assets.md

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Provision SharePoint items with your solution package
1+
# Provision SharePoint assets with your solution package
22

33
At times, you may need to provision a SharePoint list or a document library along with your client-side solution package so that that list or library is available for your client-side components, such as web parts. SharePoint Framework toolchain allows you to package and deploy SharePoint items with your client-side solution package. These items are then provisioned when the client-side solution is installed on a site.
44

@@ -101,14 +101,35 @@ Below is an example of a list instance definition that uses a custom schema:
101101
And the custom schema definition that defines a content type for the list instance defined above:
102102

103103
```xml
104-
<List xmlns:ows="Microsoft SharePoint" Title="Basic List"
105-
EnableContentTypes="TRUE" FolderCreation="FALSE"
106-
Direction="$Resources:Direction;" Url="Lists/Basic List"
107-
BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
104+
<List xmlns:ows="Microsoft SharePoint" Title="Basic List" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Basic List" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
108105
<MetaData>
109106
<ContentTypes>
110107
<ContentTypeRef ID="0x010042D0C1C200A14B6887742B6344675C8B" />
111-
</ContentTypes>
108+
</ContentTypes>
109+
<Fields></Fields>
110+
<Views>
111+
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
112+
<XslLink Default="TRUE">main.xsl</XslLink>
113+
<JSLink>clienttemplates.js</JSLink>
114+
<RowLimit Paged="TRUE">30</RowLimit>
115+
<Toolbar Type="Standard" />
116+
<ViewFields>
117+
<FieldRef Name="LinkTitle"></FieldRef>
118+
<FieldRef Name="SPFxAmount"></FieldRef>
119+
<FieldRef Name="SPFxCostCenter"></FieldRef>
120+
</ViewFields>
121+
<Query>
122+
<OrderBy>
123+
<FieldRef Name="ID" />
124+
</OrderBy>
125+
</Query>
126+
</View>
127+
</Views>
128+
<Forms>
129+
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
130+
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
131+
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
132+
</Forms>
112133
</MetaData>
113134
</List>
114135
```
@@ -175,31 +196,31 @@ Below is an example of an upgrade action file that applies an element manifest f
175196
In order to include the XML files, you will need to first define the feature configuration in the *package-solution.json* configuration file underneath the *config* folder in your project. The *package-solution.json* contains the key metadata information about your client-side solution package and is referenced when you run the `package-solution` gulp task which packages your solution into a `.sppkg` file.
176197

177198
```json
178-
{
179-
"solution": {
180-
"name": "hello-world-client-side-solution",
181-
"id": "26364618-3056-4b45-98c1-39450adc5723",
182-
"version": "1.1.0.0",
183-
"features": [{
184-
"title": "hello-world-client-side-solution",
185-
"description": "hello-world-client-side-solution",
186-
"id": "d46cd9d6-87fc-473b-a4c0-db9ad9162b64",
187-
"assets": {
188-
"elementManifests": [
189-
"elements.xml"
190-
],
191-
"elementFiles":[
192-
"schema.xml"
199+
{
200+
"solution": {
201+
"name": "hello-world-client-side-solution",
202+
"id": "26364618-3056-4b45-98c1-39450adc5723",
203+
"version": "1.1.0.0",
204+
"features": [{
205+
"title": "hello-world-client-side-solution",
206+
"description": "hello-world-client-side-solution",
207+
"id": "d46cd9d6-87fc-473b-a4c0-db9ad9162b64",
208+
"assets": {
209+
"elementManifests": [
210+
"elements.xml"
211+
],
212+
"elementFiles":[
213+
"schema.xml"
193214
],
194215
"upgradeActions":[
195216
"upgrade-actions-v1.xml"
196-
]
197-
}
198-
}]
199-
},
200-
"paths": {
201-
"zippedPackage": "solution/hello-world.sppkg"
202-
}
217+
]
218+
}
219+
}]
220+
},
221+
"paths": {
222+
"zippedPackage": "solution/hello-world.sppkg"
223+
}
203224
}
204225
```
205226
The `features` JSON object contains the metadata about the feature:

misc/SharePointDocumentationToc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Item text="Optimize builds for production" url="spfx/toolchain/optimize-builds-for-production" SEODescription="Optimizing SharePoint Framework builds for production deployment." />
1616
<Item text="Integrate gulp tasks in SharePoint Framework toolchain" url="spfx/toolchain/integrate-gulp-tasks-in-build-pipeline" SEODescription="Integrate custom gulp tasks in the build pipeline used in SharePoint Framework solutions." />
1717
<Item text="Extending Webpack in SharePoint Framework toolchain" url="spfx/toolchain/extending-webpack-in-build-pipeline" SEODescription="Extend Webpack in the build pipeline used in SharePoint Framework solutions." />
18-
<Item text="Provision SharePoint items" url="spfx/toolchain/provision-sharepoint-assets" SEODescription="SharePoint Framework toolchain allows you to package and deploy SharePoint fields, content types, list instances with your client-side solution package." />
18+
<Item text="Provision SharePoint assets" url="spfx/toolchain/provision-sharepoint-assets" SEODescription="SharePoint Framework toolchain allows you to package and deploy SharePoint fields, content types, list instances with your client-side solution package." />
1919
</Item>
2020
<Item text="Web parts" url="spfx/web-parts" SEODescription="">
2121
<Item text="Overview" url="spfx/web-parts/overview-client-side-web-parts" SEODescription="Develop SharePoint client-side web parts to provide a better customized experience for SharePoint."/>

0 commit comments

Comments
 (0)