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

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

Returns a configurable collection of information about this instance of Content Studio

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

public string FetchInfo(
	ConnectionId connectionId,
	SessionId sessionId,
	CSApplicationCSInfoTypes infoType
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the users session. This value usually originates from a call to OpenSession(ConnectionId).
infoType
Type: ContentStudioCSApplicationCSInfoTypes
A combination of CSApplicationCSInfoTypes flags that specifies what information to return.

Return Value

Type: String
XML containing the information.
The info elements returned are depending on the information requested by the infoType parameter
<root>
  <status>0</status>
  <statustext>Success</statustext>
  <info>
    <INFO_CSSERVER_VERSION>Value</INFO_CSSERVER_VERSION>
    <INFO_CSSERVER_MACHINE>Value</INFO_CSSERVER_MACHINE>
    <INFO_CSDATABASE_VERSION>Value</INFO_CSDATABASE_VERSION>
    <INFO_CSDATABASESERVER_INFO>Value</INFO_CSDATABASESERVER_INFO>
    <INFO_DBSERVER_MACHINE>Value</INFO_DBSERVER_MACHINE>
    <INFO_DB_NAME>Value</INFO_DB_NAME>
    <INFO_BUILD>Value</INFO_BUILD>
    <INFO_BUILD_DATE>Value</INFO_BUILD_DATE>
  </info>
</root>
The elements returned are depending on the information requested by the infoType parameter. The example shows the document returned when all information is returned.
The names of the elements that contain the data matches the string INFO + the upper case form of the CSApplicationCSInfoTypes entered in the infoType parameter.
Examples

The following sample shows how to get information about the CS installation and writes the result to a html table. This sample only works in a Content Studio document.
CSApplication app = new CSApplication();
string xml = app.FetchInfo(
             CS_ConnectionId, 
             CS_User_SessionId, 
             CSApplication.CSInfoTypes.Build |
                           CSApplication.CSInfoTypes.Build_Date |
                           CSApplication.CSInfoTypes.CSDatabase_Version |
                           CSApplication.CSInfoTypes.CSDatabaseServer_Info |
                           CSApplication.CSInfoTypes.CSServer_Machine |
                           CSApplication.CSInfoTypes.CSServer_Version |
                           CSApplication.CSInfoTypes.DB_Name |
                           CSApplication.CSInfoTypes.DBserver_Machine
                          );
StringBuilder sbu = new StringBuilder();
using (StringReader sr = new StringReader(xml))
{
  sbu.AppendLine("<table>");
  sbu.AppendLine("  <tr><th>Field</th><th>Value</th></tr>");
  using (XmlReader xr = XmlReader.Create(sr))
  {
    while (xr.Read())
    {
      if (xr.NodeType == XmlNodeType.Element)
      {
        if (xr.Name.StartsWith("INFO"))
        {
          sbu.AppendLine(String.Format("  <tr><td>{0}</td><td>{1}</td></tr>", 
                                       xr.Name, 
                                       xr.ReadString()));
        }
      }
    }
  }
  sbu.AppendLine ("</table>");
}
Response.Write(sbu.ToString());

The sample above might write out the following data on the web page
Html
<table>
  <tr><th>Field</th><th>Value</th></tr>
  <tr><td>INFO_CSSERVER_VERSION</td><td>5.0.0.1</td></tr>
  <tr><td>INFO_CSSERVER_MACHINE</td><td>A58T33Z-99</td></tr>
  <tr><td>INFO_CSDATABASE_VERSION</td><td>5.0.502 Release</td></tr>
  <tr><td>INFO_CSDATABASESERVER_INFO</td><td>
  This is database Content Studio 5 utveckling running on dataserver GOLLUM
  Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) 
  Apr 14 2006 01:12:25 
  Copyright (c) 1988-2005 Microsoft Corporation
  Express Edition with Advanced Services on Windows NT 5.2 (Build 3790: Service Pack 2)
  </td></tr>
  <tr><td>INFO_DBSERVER_MACHINE</td><td>gollum</td></tr>
  <tr><td>INFO_DB_NAME</td><td>Content Studio 5 utveckling</td></tr>
  <tr><td>INFO_BUILD</td><td>5003</td></tr>
  <tr><td>INFO_BUILD_DATE</td><td>2007-09-17</td></tr>
</table>
See Also

Reference