Documentation Center

Configuring content storage

The cd_storage_conf.xml file is the Content Delivery Storage Layer configuration file. This task explains how to configure standard storage scenarios.

About this task

When the Content Deployer receives incoming content it deploys that content to the Storage Layer which then stores the content in the Content Data Store. The Content Data Store is the local file system and/or a relational database.

Procedure

  1. Open cd_storage_conf.xml located in the config\ subdirectory of your Content Delivery root location in a plain-text editor or XML editor.
  2. In the Storages element, configure one or more of the following storage mechanisms:
    • To enable storage of content in a Microsoft SQL Server database, ensure the presence of the following <Storage> element, uncommented:
      <Storage Type="persistence" Id="MSSQL_01" dialect="MSSQL" 
      	Class="com.tridion.storage.persistence.JPADAOFactory">
      	<Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
      	<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
      		<Property Name="serverName" Value="SERVER_NAME" />
      		<Property Name="portNumber" Value="1433" />
      		<Property Name="databaseName" Value="DATABASE_NAME" />
      		<Property Name="user" Value="USER_NAME" />
      		<Property Name="password" Value="PASSWORD" />
      	</DataSource>
      </Storage>
    • To enable storage of content in an Oracle database, ensure the presence of the following <Storage> element, uncommented:
      <Storage Type="persistence" Id="Oracle_01" dialect="ORACLESQL" 
      	Class="com.tridion.storage.persistence.JPADAOFactory">
      	<Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
      	<DataSource class="oracle.jdbc.pool.OracleDataSource">
      		<Property Name="driverType" Value="thin" />
      		<Property Name="networkProtocol" Value="tcp" />
      		<Property Name="serverName" Value="SERVER_NAME" />
      		<Property Name="portNumber" Value="1521" />
      		<Property Name="databaseName" Value="DATABASE_NAME" />
      		<Property Name="user" Value="USER_NAME" />
      		<Property Name="password" Value="PASSWORD" />
      	</DataSource>
      </Storage>

      If you are connecting to Oracle RAC, use the property name serviceName instead of databaseName.

    • To enable storage of content on the local file system, ensure the presence of the following <Storage> element, uncommented:
      <Storage Type="filesystem" Id="LocalFileSystem_01" defaultFilesystem="true" defaultStorage="true"
      	Class="com.tridion.storage.filesystem.FSDAOFactory">
      	<Root Path="STORAGE_PATH" />
      </Storage>

      where STORAGE_PATH is the fully qualified path to the root folder of your storage location.

    • To enable storage through JNDI (that is, storage in an Oracle or Microsoft SQL Server database via your Web application server), ensure the presence of the following <Storage> element, uncommented:
      <Storage Type="persistence" Id="JNDI_01" dialect="DIALECT_TYPE" 
      	Class="com.tridion.storage.persistence.JPADAOFactory" JNDIName="JNDI_NAME" />

      where DIALECT_TYPE is ORACLESQL (for storage in an Oracle database)

      or MSSQL (for storage in a SQL Server database), and JNDI_NAME is the identifier of your data source (the exact inner structure of this string depends on the Web application server you use).
  3. Provide values for the properties by replacing the following strings in the Value attributes of the Property elements:

    For database storage, specify the following:

    SERVER_NAME
    Replace this string with the name of the database server host.
    DATABASE_NAME
    Replace this string with the name of the database to access.
    USER_NAME
    Replace this string with the name of a user who can access the database.
    PASSWORD
    Replace this string with a valid password for the user you specified.
  4. Select one of the storage media you configured (a database or a file system location) as your default storage destination in the ItemTypes element, located directly after the Global section:
    <ItemTypes defaultStorageId="STORAGE_ID" cached="CACHE_BEHAVIOR">
    </ItemTypes>

    Replace STORAGE_ID with a value of the Id attribute of one of your Storage elements (for example, MSSQL_01). Also, set cached to true or false depending on your preference. Typically, in a development environment you would set cached to false and in a live environment to true.

    Content Delivery will now store all content in the storage medium identified by the storage ID you specified, and cache or not cache it (depending on your value for cached).
  5. You now have a number of ways in which you can override this default behavior:
    • You can change whether or not items of a certain type are cached. To do this, insert an Item element inside the ItemTypes element and set the value of cached to the reverse of the value specified in ItemTypes:
      <Item typeMapping="TYPE_NAME" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID"/>
    • You can store items of a certain type in a different storage medium. To do this, insert an Item element inside the ItemTypes element and set the value of storageId to another value than the one specified in ItemTypes:
      <Item typeMapping="TYPE_NAME" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID"/>
    • You can store specific types of binary items (that is, binary files with specific file extensions) in a different storage medium. To do this, insert an Item element inside the ItemTypes element:
      <Item typeMapping="Binary" itemExtension=".EXT" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />
    • You can store specific types of Pages (that is, Web pages with specific file extensions) in a different storage medium. To do this, insert an Item element inside the ItemTypes element:
      <Item typeMapping="Page" itemExtension=".Jsp" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />

      Other possible values for itemExtension are .Aspx and .html

    • You can store specific types of Component Presentations (that is, Component Presentations with specific file extensions) in a different storage medium. To do this, insert an Item element inside the ItemTypes element:
      <Item typeMapping="ComponentPresentation" itemExtension=".Jsp" cached="CACHE_BEHAVIOR" storageId="STORAGE_ID" />

      Possible values for itemExtension are:

      • .Jsp
      • .Ascx
      • .Xml
      • .Txt
      • .rel
    • You can specify a different storage medium and/or caching behavior for items that were published from a specific Publication in the Content Manager, by inserting a Publication element inside the ItemTypes element, directly after any Item elements:
      <Publication Id="PUB_ID" defaultStorageId="STORAGE_ID" cached="CACHE_BEHAVIOR">
      </Publication>
    • You can specify a different storage medium and/or caching behavior for items of a certain type that were published from a specific Publication, by inserting an Item element inside a Publication element. These elements are formatted the same way as the Item elements directly under the ItemTypes element.

    Replace the strings as follows:

    STORAGE_ID
    The ID of one of the storage mediums you specified in the <Storages> element.
    CACHE_BEHAVIOR
    Either true if you want the items to be cached, or false if you do not.
    TYPE_NAME
    The name of an item type you wish to configure storage for. TYPE_NAME must have one of the following values:
    ValueDescription
    BinaryA binary resource
    ComponentLinkClickInformation about visitors clicking on a Component Link, used in the Communication Statistics product
    ComponentPresentationA Component Presentation (the result of rendering a Component with a Component Template)
    ComponentVisitInformation about visitors visiting a Component, used in the Communication Statistics product
    DynamicLinkInfoThe properties of a dynamic link
    ExtensionDataRendering instructions related to custom content you add during publishing (if TYPE_NAME has this value, STORAGE_ID must refer to a database, not a file system)
    MetadataThe metadata of items, including binary variants and link information
    PageA Page
    PersonalizationData related to Personalization & Profiling functionality
    PublicationA Publication
    QueryA Query used for Intelligent Navigation
    TaxonomyA Taxonomy
    TimeframeA Timeframe, as used in Personalization & Profiling
    TrackedPageA Tracked Page, as used in Personalization & Profiling
    XSLTAn Dynamic Template containing an XSLT stylesheet
    You now override the default storage and caching behavior configured in the ItemTypes behavior, as specified.
  6. Optional: Change the transaction timeout value by adding a <Transaction> element directly after the Storages element and before the </Global> closing tag. The following example sets the timeout value to 240000 ms (4 minutes):
    ...
    </Storages>
    	<Transaction Timeout="240000" MonitorInterval="5000" />
    </Global>

    The Storage Layer has a default timeout value of 2 minutes for transactions to the storage system. If you intend to store larger data sets, such as a large taxonomy containing 150,000 Keywords or more, this default timeout value is insufficient (4 minutes would be a better value in this example.)

  7. Save and close the cd_storage_conf.xml file.
  8. Assuming that the Storage Layer is running as part of a Web application, restart the Web application according to the instructions of your Web application server. In IIS, for example, perform an iisreset.

What to do next

Performing this configuration may involve entering sensitive data such as passwords in the configuration file. For that reason, you may want to encrypt these strings.