Skip to content

aSiteContentTypes statement

The aSiteContentTypes statement returns a collection of content type definitions for all site content types on the specified sites.

<aSiteContentTypes tableName="">
<from type=""></from>
<fields></fields>
<where></where>
</aSiteContentTypes>

Specify one or more web sites from which to retrieve the content type definitions. The type attribute will indicate how site urls are specified.

Type Description
Url Specify one or more relative site url separated by a comma. A report’s parameter may be specified instead of a literal value.
ResultSet Specify the tableName value of another statement. The resulting data from the statement must contain a column named “relativeSiteUrl”.

The following statement will return all the content type definitions for all site content types on the sites “/sites/ersdedemo/” and “/sites/ersdetest”.

Sample

<aSiteContentTypes tableName="SiteContentTypes">
<from type="Url">/sites/ersdedemo/,/sites/ersdetest/</from>
<fields>*</fields>
<where></where>
</aSiteContentTypes>

In the following example, the query will return the content type definitions for all the site content types on the sites specified in another result set called “MergingList”. The “MergingList” result set contains data returned by a list statement that queries the “Merging List” SharePoint list.

The SharePoint list “Merging list” must contain a column called “RelativeSiteUrl” that contains relative urls that point to SharePoint sites.

The aSiteContentTypes statement will retrieve the content type definitions for all the content types available in each item in the “MergingList” result set based on the “RelativeSiteUrl” column’s value.

Sample

<root xmlns="http://enesyssoftware.com/schemas">
<list title="Merging list" relativeSiteUrl="/sites/demo/" tableName="Merginglist">
<fields>relativeSiteUrl</fields>
<query></query>
</list>
<aSiteContentTypes tableName="aSiteContentTypes">
<from type="ResultSet">Merginglist</from>
<fields></fields>
<where></where>
</aSiteContentTypes>
<resultSet>aSiteContentTypes</resultSet>
</root>

Specify the fields to be returned by the statement.

Field Description
Name The content type name.  
ID The content type ID.  
Description A description for the content type.  
Group The content type group to which the content type is assigned.  
NewDocumentControl
Scope
Version Version number of the content type.
RequireClientRenderingOnNew

SQL Where clause used to filter the resulting data.

As the aSiteContentTypes statement returns all the content types created in both the current and parent sites, you may want to filter the content types to only have those that were created in the sub-site.

The following query only returns content types located in the “/sites/ersdetest/demosubsite01” site:

Sample

<aSiteContentTypes tableName="SiteContentTypes">
<from type="Url">/sites/ersdetest/demosubsite01/</from>
<fields>*</fields>
<where>Scope = "http://intranet/sites/ersdetest/demosubsite01"</where>
</aSiteContentTypes>