Content Studio Web Content Management System
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
A ListDefinition object that represents the created list definition.
Either CREATE permission on the site root - or - the GlobalGroupAdmin - or - WriteActiveContent global right is required to perform actions against global list definitions.
[This is preliminary documentation and is subject to change.]
Adds a new list definition
Namespace: ContentStudio.Document.Listing
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
public ListDefinition Add( ConnectionId connectionId, SessionId sessionId, CategoryId categoryId, string name, string groupName, string description, string filter, string searchFilter, string defaultSortExpression, ListDefinitionVisibility visibility, ListType listType, IEnumerable<XmlFilteringFieldDefinition> fields )
Parameters
- connectionId
- Type: ContentStudioConnectionId
A value that identifies the web site - sessionId
- Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId). - categoryId
- Type: ContentStudio.DocumentCategoryId
An identifier to the category that defines the list. The category must be either of the "XmlDocument" or "File" type. - name
- Type: SystemString
The name of the list. The combination of name and groupName must be unique on the site. This parameter cannot be null or empty. - groupName
- Type: SystemString
A name used to group list definitions. Use empty or null when the list should appear not grouped. - description
- Type: SystemString
A description of the list or null. - filter
- Type: SystemString
A filter that defines a selection of documents in the category that the list should contain. This should be written as the WHERE clause in an SQL statement with field names surrounded with brackets. E.g. [myfield]=2 AND [yourField] BETWEEN 10 AND 20. The syntax of this filter is checked for Sql-injection attacks and will throw an exception if any statement not valid is passed in. - searchFilter
- Type: SystemString
A search filter. This should be written as the WHERE clause in an SQL statement with field names surrounded with brackets. E.g. [myfield]LIKE'{0}' OR [yourField]LIKE'{0}'. The syntax of this filter is checked for Sql-injection attacks and will throw an exception if any statement not valid is passed in. - defaultSortExpression
- Type: SystemString
The SQL command that defines the sort instruction for the returned data. This must be sql e.g. [myfield] DESC that is valid within the ORDER BY clause and must be valid against the passed in field names. All field names must appear between brackets. The syntax of this filter is checked for Sql-injection attacks and will throw an exception if any statement not valid is passed in. This value must be sql valid in an Sql server ORDER BY clause, e.g. [myfield] DESC, and must be valid against the passed in field names. All field names must appear between brackets and must exist in the field collection.
Tip
You can get a random search order by using the NEWID() clause. - visibility
- Type: ContentStudio.Document.ListingListDefinitionVisibility
A value that specifies how the list is shown. - listType
- Type: ContentStudio.Document.ListingListType
The type of list to create. - fields
- Type: System.Collections.GenericIEnumerableXmlFilteringFieldDefinition
A list of objects that defines what fields the filter and searchFilter should work with. All these fields must be indexed.
Return Value
Type: ListDefinitionA ListDefinition object that represents the created list definition.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The name is an empty string or contains invalid characters. |
ArgumentNullException | The name is null. |
CSInvalidSessionException | |
CSPermissionDeniedException | |
CSInvalidParameterException | The filter or searchFilter are invalid or have an illegal syntax |
CSException | 1503; The category does not exist - or - 1512; The name is already in use, choose another name. - or - 1005; Invalid container type |
SqlException |
Content Studio permissions
Remarks
This method was added in Content Studio 5.6
Starting with version 5.7 Update 1 the combination of groupName and name must be unique on the site. In earlier versions the name needed to be unique.
See Also