XmlIndexQueryQuery Method (ConnectionId, SessionId, CategoryId, String, String, Boolean, Boolean, Int32, Int32, Int32, Int32) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Performs a query against the Content Studio Xml index and optionally returns data.

Namespace: ContentStudio.Document.EPT
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public string Query(
	ConnectionId connectionId,
	SessionId sessionId,
	CategoryId categoryId,
	string filter,
	string fieldName,
	bool returnData,
	bool sortDescending,
	int pageNumber,
	int pageSize,
	out int pageCount,
	out int recordCount
)

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
The category that contains data to filter on.
filter
Type: SystemString
The filter to use. This should be written as the WHERE clause in an SQL statement with field names surrounded with brackets. e.g. [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.
fieldName
Type: SystemString
A field name to use. This field must exist.
returnData
Type: SystemBoolean
Set to true to return the data in the FieldName parameter.
sortDescending
Type: SystemBoolean
Set to true to sort the returned data descending.
pageNumber
Type: SystemInt32
The page number to read. If this value is less than 1 PageNumber will be 1.
pageSize
Type: SystemInt32
The size of the pages to read. If this parameter is less than 1 PageSize will be 0 which is unlimited.
pageCount
Type: SystemInt32
The total pages of data found
recordCount
Type: SystemInt32
The total entries found

Return Value

Type: String
Xml with the following sample syntax
<root>
  <status>0</status>
  <statustext>Success</statustext>
  <pageno>1</pageno>
  <pagesize>5</pagesize>
  <pagecount>1</pagecount>
  <recordcount>1</recordcount>
  <rows>
    <row documentid="1242" Introduction="Content Studio 5 " />
    <!-- more row items can follow -->
  </rows>
</root>
For an example on how to make an xml query see the the example provided with the overloaded version documentation of this method.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

BROWSE permission on the documents selected is required if DraftsOnly is false otherwise READ permission is required.
Remarks

The XmlFilter class provides a much more user friendly way of programming against the Content Studio Xml filter.
See Also

Reference