Thursday, September 1, 2016

O365 - SPFX - Get the list of ClientSideWebParts Manifest details

After the recent announcement of the SPFX preview announcement, had a chance to look into it in details. This time, I took it as a challenge to use only Mac and VS code to develop my SPFX client web part and it was quite a fun and first time I have developed a SP component using my Mac without Windows and Visual Studio.

There are so many blogs / helps available and here are the few I used for mine.

Right, after my first SPFx client web parts, I was looking into in details about how it works etc. While looking into it, found an api where we can get the list of ClientWebparts from deployed. Internally it is used to pull the deployed ClientWebParts to get the manifest.

If you need to get all the manifest details of the ClientWebparts deployed,

_api/web/GetClientSideWebParts - returns the list of ClientWebparts (uploaded to the appcatalog) with the manifest details.

<d:GetClientSideWebParts xmlns:d="http://ift.tt/1cVQIMf" xmlns:m="http://ift.tt/1dtZymv" xmlns:georss="http://ift.tt/N7lROd" xmlns:gml="http://ift.tt/WaETtx" m:type="Collection(Microsoft.SharePoint.ClientSideComponent.SPClientSideComponentQueryResult)"><d:element><d:ComponentType m:type="Edm.Int32">0</d:ComponentType>
<d:Id m:type="Edm.Guid">2a75530c-04df-47b9-82b0-9e0dae8cded6</d:Id>
<d:Manifest>
{"id":"2a75530c-04df-47b9-82b0-9e0dae8cded6","componentType":"WebPart","version":"0.0.1","manifestVersion":2,"preconfiguredEntries":[{"groupId":"2a75530c-04df-47b9-82b0-9e0dae8cded6","group":{"default":"Under Development"},"title":{"default":"KendoUiSample"},"description":{"default":"Kendo UI"},"officeFabricIconFontName":"Page","properties":{"description":"HelloWorld","test":"Multi-line text field","test1":"hello"}}],"loaderConfig":{"entryModuleId":"kendo-ui-sample.bundle","internalModuleBaseUrls":["http://ift.tt/2bTtDxV"],"scriptResources":{"kendo-ui-sample.bundle":{"type":"internal","path":"dist/kendo-ui-sample.bundle.js"},"mystrings":{"defaultPath":"lib/webparts/kendoUiSample/loc/en-us.js","type":"localized","paths":{}},"@microsoft/sp-client-preview":{"type":"framework","version":"latest","failoverPath":"node_modules/@microsoft/sp-client-preview/dist/sp-client-preview.js"}}}}
</d:Manifest>
<d:Name>KendoUiSample</d:Name>
<d:Status m:type="Edm.Int32">0</d:Status>
</d:element>
</d:GetClientSideWebParts>

The manifest contains the client web part details like,

  • Webpart Id
  • Webpart properties
  • BaseUrl
  • Script Resources etc

Screenshot:


by Balamurugan Kailasam via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment