Domain.xml Definition Node

From my understanding, the definition section sets where all the data concerning different parts of Slide will be stored. In the example all sub-stores (lock, content, etc...) are stored using "org.apache.slide.store.txfile.TxXMLFileDescriptorsStore", which essentially stores data in an XML formatted file.

<definition>
    <store name="tx">
       <parameter name="tlock-timeout">120</parameter>
       <nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
           <parameter name="rootpath">store/metadata</parameter>
           <parameter name="workpath">work/metadata</parameter>
           <parameter name="defer-saving">true</parameter>
           <parameter name="timeout">120</parameter>
       </nodestore>
       <sequencestore classname="org.apache.slide.store.txfile.FileSequenceStore">
           <parameter name="rootpath">store/sequence</parameter>
       </sequencestore>
       <securitystore>
           <reference store="nodestore"/>
       </securitystore>
       <lockstore>
           <reference store="nodestore"/>
       </lockstore>
       <revisiondescriptorsstore>
           <reference store="nodestore"/>
       </revisiondescriptorsstore>
       <revisiondescriptorstore>
           <reference store="nodestore"/>
       </revisiondescriptorstore>
       <contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">
           <parameter name="rootpath">store/content</parameter>
           <parameter name="workpath">work/content</parameter>
           <parameter name="defer-saving">true</parameter>
           <parameter name="timeout">120</parameter>
       </contentstore>
       <!-- uncomment if you want to use the sample Indexer -->
       <!-- be sure to have Lucene in your classpath             -->
       <!--
                <contentindexer classname="org.apache.slide.index.SampleTxtContainsIndexer">
                <parameter name="indexpath">./index</parameter>
                </contentindexer>
        -->
    </store>
    <scope match="/" store="tx"/>
</definition>

To setup Slide with multiple Store Definitions see MultiStoreConfig

General Store Information

Stores are low level services that handle the actual storage of content and related data. Stores are totally pluggable, enabling the use of the most appropriate storage method for the type of data to store.

Two different kinds of services exist:

This distinction has been made because it's easy to see that while some repositories are very efficient at managing and indexing small amounts of data (relational databases are a good example of this), others are best for storing big chunks of data (for example filesystems). Within Slide, every object can possibly have a different kind of backing low-level service. For example, some objects might be stored in a remote LDAP directory, while others could be stored in an local SQL database. Thus, the content of a namespace can be distributed across several different descriptors and content stores. It is up to the administrator to choose how objects will be stored using the Slide configuration file, which maps low-level services to individual nodes in the namespace. Services are attributed to nodes in the namespace. This mapping is automatically inherited by sub-nodes. Here is an example of how one namespace might be mapped into different low-level services:

http://jakarta.apache.org/slide/javadoc-2.1/javadoc/org/apache/slide/common/doc-files/stores.png

Parameters

Cache Parameters

<parameter name="cache-mode">cluster</parameter>

Caching mode should be set to "cluster" when you want every change in the file system to be immediately displayed in Slide. Other options for this parameter are not yet known - if you know it please add / elaborate here

For more information see CacheConfiguration.

Locking

<parameter name="tlock-timeout">120</parameter>

This determines how many seconds pass before your Slide session times out?

Rootpath

<parameter name="rootpath">store/metadata</parameter>

Cache Timeout

For Slide 2.2 and above you can add this parameter for more caching with a timeout (100 sec in this case)

<parameter name="cache-timeout">100</parameter>
<parameter name="cache-mode">full</parameter>

Scope

"You need to add the scope to have the store (tx) visible."

<scope match="/" store="tx"/>

"So far, you can choose to configure the <scope> tags either directly underneath each store, or put all the <scope> tags at the bottom of configuring all your stores at this time. Soon there will be a standard and expectation, but for now lasse faire."

Basically this determines how you access your Slide applicatio. In the above example accessing the Slide application would be: http://localhost:8080/tx

General Store Definition Information (Low Level Services)

This describes low-level services configuration for the store. (For some reason, it was decided that these low level services also be called "stores" - this makes it a bit confusing.)

<contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">

"classname" specifies the class that implements the sub-store in question. This hints at developers being able to create their own custom store, which is what Slide was designed for from the beginning. For more information see the CreateNewSlideStore entry.

The following are sub-store class implementions that are built into Slide -

TxFileContentStore

TxXMLFileDescriptorsStore

JDBCStore

FileSequenceStore

From my understanding (please correct me if I'm wrong), you have the following choices in regard to low level services related to stores.

  1. Define the low level service by associating it with the appropriate concrete class

<securitystore classname="org.apache.slide.store.mem.TransientSecurityStore"/>
  1. Define a low level service that can be referenced by other low level services as seen in nodestore

<nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
    <parameter name="rootpath">store/metadata</parameter>
    <parameter name="workpath">work/metadata</parameter>
    <parameter name="defer-saving">true</parameter>
    <parameter name="timeout">120</parameter>
</nodestore>
<securitystore>
    <reference store="nodestore"/>
</securitystore>

"The reference means that for the security store the same object is used as is configured at the node store." To get a better understanding compare the default nodestore definition (above) and the nodestore definition using JDBC. The default nodestore stores all of its data in XML format text files while the nodestore below stores the data in predefined tables.

callback-store Parameter

<parameter name="callback-store">org.apache.slide.store.simple.WebdavFileStore</parameter>

rootpath Parameter

This is where all the resources in the "files, content, etc..." collection go to

<parameter name="rootpath">c:/tmp</parameter>

Content Store Low Level Service

The storage mechanism for node content.

<contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">
    <parameter name="rootpath">store/content</parameter>
    <parameter name="workpath">work/content</parameter>
    <parameter name="defer-saving">true</parameter>
    <parameter name="timeout">120</parameter>
</contentstore>

Node Store Low Level Service

The storage mechanism for node information. There are a few different types provided by the Slide framework for use, additionally a user could create a custom one (see WebDavConstructionKit)

Default File Based Node Store Low Level Service

Using the default node store, will have the namespace's data be stored in XML formatted text files.

<nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
    <parameter name="rootpath">store/metadata</parameter>
    <parameter name="workpath">work/metadata</parameter>
    <parameter name="defer-saving">true</parameter>
    <parameter name="timeout">120</parameter>
</nodestore>

JDBC Node Store Low Level Service

Ofcourse, for ease of maintenance most people will probably want to use a database to store most of the data related to a Slide namespace. In the example below, most sub-stores (except content) are using the JDBC configured nodestore.

Note

If you want to try a JDBC nodestore you also have to create all the necessary tables and views that Slide expects. You can use the scripts (configured for most major database servers) found in jakarta-slide-2.1b2-tomcat-5.0.28/webapps/slide/db-schema/ (for 2.1b2).

<nodestore classname="org.apache.slide.store.impl.rdbms.JDBCStore">
    <parameter name="adapter">org.apache.slide.store.impl.rdbms.PostgresRDBMSAdapter</parameter>
    <parameter name="driver">org.postgresql.Driver</parameter>
    <parameter name="url">jdbc:postgresql://19.26.54.86:5432/db_name</parameter>
    <parameter name="user">test</parameter>
    <parameter name="password">12345</parameter>
    <parameter name="dbcpPooling">true</parameter>
    <parameter name="maxPooledConnections">10</parameter>
    <parameter name="isolation">SERIALIZABLE</parameter>
    <parameter name="compress">false</parameter>
</nodestore>

<parameter name="driver">org.postgresql.Driver</parameter>

Put the name of the jdbc driver you want to use here.

<parameter name="url">jdbc:postgresql://19.26.54.86:5432/db_name</parameter>

The database url varies by database and jdbc driver. Consult the accompanying jdbc documentation.

<parameter name="user">test</parameter>
<parameter name="password">12345</parameter>

A username / password combination that can access the database.

<parameter name="dbcpPooling">true</parameter>
<parameter name="maxPooledConnections">10</parameter>

This enables DBCPPooling and specifies the number of connections it can have.

<parameter name="compress">false</parameter>

I believe if you set this true, Slide will compress (using zip) incomming data and uncompress outbound data. This is quite useful.

Sequence Store

Store for sequence support. A sequence is an entity that provides unique numbers. See the javadoc for SequenceStore.

Security Store

Store for NodePermission objects. See the javadoc for SequenceStore.

Lock Store

Store for Lock objects. See the javadoc for SequenceStore.

DefinitionNode (last edited 2009-09-20 22:02:32 by localhost)