Differences between revisions 7 and 8
Revision 7 as of 2005-06-05 14:06:21
Size: 6670
Editor: host81-156-54-2
Revision 8 as of 2009-09-20 22:02:50
Size: 6670
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 131: Line 131:
Based on some work we have been doing, we have developed a number of configuration guidelines and samples. Now available here - ["MultipleStoresWithSamples"] Based on some work we have been doing, we have developed a number of configuration guidelines and samples. Now available here - [[MultipleStoresWithSamples]]

(As collected from our gracious friends on the Slide mailing lists)

Configuring a single NameSpace/Slide Server with multiple Stores


  • The goal of this page is to extend an existing and working NameSpace (single Slide server/servlet) to support multiple stores. NameSpace converstations are more advanced than this topic and should be examined elsewhere. Examples are based on the 2.1M1 binary server distribution but should also work with future 2.1.XXX distributions.


  • Working Slide installation you want to extend.
  • Domain.xml - only file to change.

What will be changed:

  • adding another <store> under /slide/namespace/definition - Adding a new store.

  • adding another <scope> referencing the new <store> under /slide/namespace/definition - Configure the scope of new stores.

  • adding another <objectnode> referencing the new <scope> under /slide/namespace/data/<<root objectnode>> - Configure data objectnode for scope.

Adding a new store: You can add (to my knowledge) an unlimited number of additional stores pending your hardware. You must keep one store as a root store, "/", that the rest of the stores will be children of (otherwise you will get an error describing something along those lines).

Example is worth more than me talking, so here we go:

    <namespace name="slide">
<!--default store from distribution, can change if you want-->
            <store name="tx">
<!--Aha! A new store!-->
            <store name="mysecondstore">
                <parameter name="tlock-timeout">120</parameter>
<!--Don't forget to configure the location of your new store-->
                <nodestore classname="org.apache.slide.store.txfile.TxXMLFileDescriptorsStore">
                    <parameter name="rootpath">newstore/metadata</parameter>
                    <parameter name="workpath">newwork/metadata</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                <sequencestore classname="org.apache.slide.store.txfile.FileSequenceStore">
                    <parameter name="rootpath">newstore/sequence</parameter>
                    <reference store="nodestore"/>
                    <reference store="nodestore"/>
                    <reference store="nodestore"/>
                    <reference store="nodestore"/>
<!--Don't forget to configure the location of your new store-->
                <contentstore classname="org.apache.slide.store.txfile.TxFileContentStore">
                    <parameter name="rootpath">newstore/content</parameter>
                    <parameter name="workpath">newwork/content</parameter>
                    <parameter name="defer-saving">true</parameter>
                    <parameter name="timeout">120</parameter>
                <!-- uncomment if you want to use the sample Indexer -->
                <!-- be sure to have Lucene in your classpath-->
                <parameter name="indexpath">./newindex</parameter>
<!--Aha! End of the new store!-->

For more stores, simply rinse and repeat the above!

Configure the scope of new stores: Now that a new store is configured, need to add the scope to have it visisble. This is pretty trivial, just use common sense:

    <namespace name="slide">
             <scope match="/" store="tx"/>
             <scope match="/newstorescope" store="mysecondstore"/>

So far, you can choose to configure the <scope> tags either directly underneath each store, or 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.

Configure data objectnode for scope: This section could use a lot more detail, and the example is not recommended for production as, at of this writing, I do not understand the ACL schemantics related to stores and sub-stores.

    <namespace name="slide">
<!--this is the root node. the 'uri' attribute points to the scope configured previously-->
            <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
                <permission action="all" subject="/roles/root" inheritable="true"/>
                <permission action="/actions/read-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/write-acl" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/unlock" subject="all" inheritable="true" negative="true"/>
                <permission action="/actions/read" subject="all" inheritable="true"/>
                 ....(probably should have all the user, role, and other security objectnodes run first)....
<!--my new store (or sub-store rather)-->
                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/newstorescope">
                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
<!--close my new store above tag, close root node tag below-->

Nonetheless, these examples should help get you started!

As always, have fun and detailed feedback is always welcome!


Additional Configuration Notes

Based on some work we have been doing, we have developed a number of configuration guidelines and samples. Now available here - MultipleStoresWithSamples

MultiStoreConfig (last edited 2009-09-20 22:02:50 by localhost)