CSApplicationGetSiteStructure Method Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Gets information about the structure of subfolders and their files in a Content Studio site, for example the ~js folder that contains global script files - or the string representation of the XmlSchema that describes the returned xml. The method returns information about folders, subfolder and files that are not stored within Content Studio and for that reason cannot be obtained with any of the regular API:s.

This method was added in Content Studio version 5.3.

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

public string GetSiteStructure(
	ConnectionId connectionId,
	SessionId sessionId,
	bool getSchema


Type: ContentStudioConnectionId
A value that uniquely identifies the requested web site.
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
Type: SystemBoolean
When set to true the string representation of the XmlSchema that describes the returned xml structure is returned rather that the data itself.

Return Value

Type: String
Xml that reflects the actual file system structure with folders, subfolders and files.

The following xml contains a small sample of this xml structure retuned by GetServerResource. To get a specific file resource a developer uses the value of the pathAndName attribute on a file element as input to the GetNamedSiteResource metod to obtain the actual resource data.

<site name="CS52" pathAndName="" xmlns="uri://contentStudio.se/api/siteStructure">
    <folder name="~js" pathAndName="~js\">       
    <!-- more folders can follow-->
        <folder name="Icons" pathAndName="~js\Icons\">
            <!-- folders can follow-->
            <file name="11_html.gif" pathAndName="~js\Icons\11_html.gif" />
            <!-- more files can follow-->
        <!-- more folders can follow-->
        <file name="script.js" pathAndName="~js\script.js" />
        <!-- more files can follow-->
    <file name="Web.Config" pathAndName="Web.Config" /> 
    <!-- more files can follow-->

NotSupportedExceptionThe current server configuration does not allow access to resource data.
UnauthorizedAccessExceptionContent Studio server does not have the required permission to access the resource.
SecurityExceptionContent Studio server does not have the required permission to access the resource.
CSInvalidSessionExceptionThe Content Studio session is invalid.
CSPermissionDeniedExceptionThe caller does not have the required permission.
Content Studio permissions

In order to read the site structure, the caller must have either the GlobalGroupAdmin or the WriteActiveContent global group right.

Note Note

Security information

To prevent Content Studio from downloading any web site resource a DWORD value named allowResourceRetrieval in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Teknikhuset\Content Studio\5.0\Websites\NNN (where NNN is the numeric connectionid of the site) can be added and given the value 0.

Developers can use the returned information to obtain a single resource by using the GetNamedSiteResource(ConnectionId, SessionId, String) method. By default the ~js, ~images and bin site subdirectories are returned but this can be overridden by adding a new string value named allowedSiteResourceSubdirectories to the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Teknikhuset\Content Studio\5.0\Websites\NNN where NNN is the identifier of the web site. This value must be a comma separated list of folders e.g. ~js, ~images, bin.
See Also