hi roy
SimpleDbPersistenceManager has a configurable option 'externalBLOBs'.
if you set it to false binaries will be stored in the database instead of the
local file system. Note that this has nothing to do with DbFileSystem.
there's other repository state like custom node types, registered namespaces,
locks etc that is stored in an abstract FileSystem, typically in a
LocalFileSystem
(i.e. on your local drive).
now you can use DbFileSystem to store this information in a database.
this way only the search index would be stored locally, everyhing else
is in the database. the advantages are obvious. however, the disadvantage
of this configuration is that you cannot easily read/edit the
information stored
in the DbFileSystem. therefore i wouldn't recommend it for development work.
btw: i wouldn't recommend using the FileSystem-based PMs (ObjectPM & XMLPM)
on a DbFileSystem, this just doesn't make sense. if you need jdbc-persistence
use SimpleDbPersistenceManager or a subclass thereof.
cheers
stefan
ps: as a proof of concept i attached a sample configuration that
stores everything
in a mysql database.
On 12/2/05, Roy Russo <[EMAIL PROTECTED]> wrote:
> When using the DBFileSystem Store, I'm noticing that the actual binary
> content is being stored on the filesystem and not in the DB, where all
> the nodereferences are.
>
> Is there a plan to have the DBFileSystem store ALL content in the DB, or
> is it meant for only state and node refs?
>
> STAY METAL!
> Roy Russo
> JBoss Portal Developer
>
>
>
<?xml version="1.0"?>
<!DOCTYPE Repository [
<!--
the Repository element configures a repository instance;
individual workspaces of the repository are configured through
separate configuration files called workspace.xml which are
located in a subfolder of the workspaces root directory
(see Workspaces element).
it consists of
a FileSystem element (the virtual file system
used by the repository to persist global state such as
registered namespaces, custom node types, etc..
a Security element that specifies the name of the app-entry
in the JAAS config and the access manager
a Workspaces element that specifies to the location of
workspaces root directory, the name of default workspace
and optionally the workspace configuration root directory
within the virtual repository file system
a Workspace element that is used as a workspace configuration
template; it is used to create the initial workspace if there's
no workspace yet and for creating additional workspaces through
the api
a SearchIndex element that is used for configuring per workspace
Indexing-related settings
a Versioning element that is used for configuring
versioning-related settings
-->
<!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)>
<!--
a virtual file system
-->
<!ELEMENT FileSystem (param*)>
<!ATTLIST FileSystem
class CDATA #REQUIRED>
<!--
the Security element specifies the name (appName attribute)
of the JAAS configuration app-entry for this repository.
it also specifies the access manager to be used (AccessManager element).
-->
<!ELEMENT Security (AccessManager, LoginModule?)>
<!ATTLIST Security
appName CDATA #REQUIRED>
<!--
the AccessManager element configures the access manager to be used by
this repository instance; the class attribute specifies the FQN of the
class implementing the AccessManager interface
-->
<!ELEMENT AccessManager (param*)>
<!ATTLIST AccessManager
class CDATA #REQUIRED>
<!--
generic parameter (name/value pair)
-->
<!ELEMENT param EMPTY>
<!ATTLIST param
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!--
the LoginModule element optionally specifies a JAAS login module to
authenticate users. This feature allows the use of Jackrabbit in a
non-JAAS environment.
-->
<!ELEMENT LoginModule (param*)>
<!ATTLIST LoginModule
class CDATA #REQUIRED>
<!--
the Workspaces element specifies the physical workspaces root directory
(rootPath attribute), the name of the default workspace
(defaultWorkspace attribute) and optionally the workspace configuration
root directory within the virtual repository file system (configRootPath
attribute).
individual workspaces are configured through individual workspace.xml
files located in a subfolder each of either
a) the physical workspaces root directory
or, if configRootPath had been specified,
b) the configuration root directory within the virtual repository file system.
-->
<!ELEMENT Workspaces EMPTY>
<!ATTLIST Workspaces
rootPath CDATA #REQUIRED
defaultWorkspace CDATA #REQUIRED
configRootPath CDATA #IMPLIED>
<!--
the Workspace element serves as a workspace configuration template;
it is used to create the initial workspace if there's no workspace yet
and for creating additional workspaces through the api
-->
<!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?)>
<!ATTLIST Workspace
name CDATA #REQUIRED>
<!--
the PersistenceManager element configures the persistence manager
to be used for the workspace; the class attribute specifies the
FQN of the class implementing the PersistenceManager interface
-->
<!ELEMENT PersistenceManager (param*)>
<!ATTLIST PersistenceManager
class CDATA #REQUIRED>
<!--
the SearchIndex element specifies the locaction of the search index
(used by the QueryHandler); the class attribute specifies the
FQN of the class implementing the QueryHandler interface.
-->
<!ELEMENT SearchIndex (param*,FileSystem?)>
<!ATTLIST SearchIndex
class CDATA #REQUIRED>
<!--
the Versioning element configures the persistence manager
to be used for persisting version state
-->
<!ELEMENT Versioning (FileSystem, PersistenceManager)>
<!ATTLIST Versioning
rootPath CDATA #REQUIRED
>
]>
<!-- Example Repository Configuration File -->
<Repository>
<!--
virtual file system where the repository stores global state
(e.g. registered namespaces, custom node types, etc.)
-->
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql:///test"/>
<param name="user" value="sa"/>
<param name="password" value=""/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="rep_"/>
</FileSystem>
<!--
security configuration
-->
<Security appName="Jackrabbit">
<!--
access manager:
class: FQN of class implementing the AccessManager interface
-->
<AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
<!-- <param name="config" value="${rep.home}/access.xml"/> -->
</AccessManager>
<LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
<!-- anonymous user name ('anonymous' is the default value) -->
<param name="anonymousId" value="anonymous"/>
</LoginModule>
</Security>
<!--
location of workspaces home directories, configs and name of default workspace
-->
<Workspaces rootPath="${rep.home}/wspHomes" defaultWorkspace="default" configRootPath="/wspConfigs"/>
<!--
workspace configuration template:
used to create the initial workspace if there's no workspace yet
-->
<Workspace name="${wsp.name}">
<!--
virtual file system of the workspace:
class: FQN of class implementing the FileSystem interface
-->
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql:///test"/>
<param name="user" value="sa"/>
<param name="password" value=""/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
</FileSystem>
<!--
persistence manager of the workspace:
class: FQN of class implementing the PersistenceManager interface
-->
<PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql:///test"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>
<!--
Search index and the file system it uses.
class: FQN of class implementing the QueryHandler interface
-->
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
</SearchIndex>
</Workspace>
<!--
Configures the versioning
-->
<Versioning rootPath="${rep.home}/version">
<!--
Configures the filesystem to use for versioning for the respective
persistence manager
-->
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql:///test"/>
<param name="user" value="sa"/>
<param name="password" value=""/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="version_"/>
</FileSystem>
<!--
Configures the persistence manager to be used for persisting version state.
Please note that the current versioning implementation is based on
a 'normal' persistence manager, but this could change in future
implementations.
-->
<PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver" value="com.mysql.jdbc.Driver"/>
<param name="url" value="jdbc:mysql:///test"/>
<param name="schema" value="mysql"/>
<param name="schemaObjectPrefix" value="version_"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>
</Versioning>
</Repository>