Web parts

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

Web parts for connection to SharePoint are stored in the Microsoft SharePoint category in the web part catalog. It is the following four web parts:

 

SharePoint datasource
SharePoint datagrid
SharePoint datalist
SharePoint repeater

 

In this text, you can find information about the specific properties of these web parts.

 

Sharepoint

 

The following properties can be configured in the Sharepoint section. The settings are common for all the web parts listed above.

 

Mode: determines what the web part will do (what data will be retrieved from the SharePoint server) and therefore which web service should be used
SharePoint site URL: URL of the SharePoint site; based on the "Mode" settings, the full URL of the required web service is determined by this  option (it is not configured directly)
Username, password: you can specify username and password for authentication directly in the web part properties, or you can inherit global values from Site Manager -> Settings -> Microsoft SharePoint; if you want to use Site Manager settings, leave the fields empty
List name: if you use the “Display list items” or “Display list of pictures” options, you must specify the list from which the items should be loaded; in the other two modes, you can leave it empty; please note: the field is case sensitive

 

Just these settings should make the SharePoint datagrid display data or the SharePoint datasource to provide them. The other two webparts still need to have a transformation specified.

 

devguide_clip0963

 

Transformations

 

The SharePoint datalist and SharePoint repeater need to have a transformation specified in order to display the retrieved data.

 

There is a number of pre-defined transformations which you can use almost right-off and of course modify them to your needs. The transformations are stored under the SharePoint - Transformations document type (can be edited in Site Manager -> Development -> Document types). Their names are self-explaining - they correspond to what they should be used for.

 

The only thing you need to get them work is to edit (Edit) them and replace the sample server names or field names with the real names used on the SharePoint server.

 

Advanced

 

In the Advanced section, you can specify (limit) in more detail what you want to be retrieved. These settings are applied only in the “Get list items” mode.

 

Row limit: sets the maximum number of retrieved items
Query: filters or sorts returned items; it is similar to WHERE conditions in SQL, but it has totally different syntax based on CAML; for more information on how to construct such queries, search SharePoint documentation or use Google with keywords like “sharepoint query”.
View fields: specifies directly which fields (columns) of SharePoint list should be retrieved

 

Display

 

In this section, you can control how the retrieved data will be processed and displayed.

 

Selected item querystring key name: name of a querystring key by whose presence will the items be selected
Selected item field name: allows you to specify by which field you want the items to be selected; the default approach is to select items by ID - the web part tries to get query parameters with the name specified in the Selected item querystring key property and use its value, e.g. .aspx?id=2 will select item with the value of the ID field equal to 2 if you entered id in the property above; note: the original field name is used here – without the ows_ prefix; the field is case sensitive
Selected item field type: provides information about the type of the ItemID field; for IDs, you should use the “Counter” type; for strings, use the “Text” type; these two should be sufficient for most cases, but you can search SharePoint documentation for other types
Use dataset: switches between usage of ASCX and XSLT transformations; if enabled, retrieved XML is converted to a dataset which serves as data source to a classic ASP repeater; using XSLT, you can convert XML to HTML directly
Dataset fields: if you want to use the dataset, but you don’t need all fields, you can enumerate the fields which should be included in the dataset, separated by semicolons; this property can be particularly useful if you want to use cache

 

Please note: Properties in the Display section are not available for the SharePoint datagrid web part.

 

Debug

 

Because it is sometimes hard to tell or remember how SharePoint addresses list fields, we implemented the Show raw response function. It displays all retrieved SharePoint data in its raw XML form. You can look for fields which contain valuable information and can be displayed. Note: if the data is fetched from cache, the response can’t be printed.

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?sharepoint_web_parts.htm