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 will be appended to the value automatically
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 orders 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

 

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

 

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
ItemID field: allows you to specify by which field you want the items to be selected; the default approach is to select items by ID - if this field is set, the web part tries to get query parameters with the same name and use its value, e.g. .aspx?id=2 will select item with the value of the ID field equal to 2; note: the original field name is used here – without the ows_ prefix; the field is case sensitive
ItemID 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

 

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