I'm a bit confused. My understanding of custom types was that they
simply define constraints on the otherwise (relatively) unstructured
nodes, more like defining constraints on your tables (UNIQUE, FOREIGN
KEY, etc) in an RDBMS than user defined types to be stored in the
tables. Just to be clear, I am not planning to subclass Jackrabbit's
NodeImpl class to add functionality based on the custom types; I'm
not even sure where this would be done because I haven't seen a place
to map JCR repository node type to Java class type.
Also, when I asked why there wasn't a place to specify custom node
definitions in the repository configuration, the "Reader" I was
referring to would be (currently) either
org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader, or
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.
Since Jackrabbit knows when it creates the repository for the first
time, it seems far better to let it decide if/when to process a
custom node file. If clients need to add custom types later, they're
on their own. The other possibility that could work well would a
repository initialization hook - a client specified function called
when a repository is created to do one time initialization (custom
node types, initial layout of the default workspace, etc.).
Mark
On Feb 19, 2006, at 8:46 AM, Chand wrote:
Mark,
My understanding of Custom nodes may not be the best and Actually
people on
the group can help me correct it if it is wrong.
Custom Nodes is similiar to "User Defined Datatype" in RDBMS.
You define storage , functions available etc. on the newly created
Data
Type- One may also includes functions to process the same.
It seems JSR 283 is supposed to work in this direction.
"- Improvement of content repository interoperability through the
addition of new standardized node types ,including node types for meta
information and internationalization."
Is there any reason there isn't an
element for specifying the custom node definition file location
there, and possibly the "Reader" type used to process the file?
Yes, if there is Custom Node e.g. "DRM file" and you know the
content will
always confirm to XrML XSD, One may wish to have "Render" which
will display
the node content in some standard way- may be different XSLT
transforms
depending on where the content needs to be display.etc.
Or May be add a property "Renderer" to custom Node which stores
info about
the rendering program.
I think it is possible to do extent "Exo - ECM " to do the same.
Benjamin Mestrallet from exo platform may be able to guide you
further . :)
Chand
-----Original Message-----
From: Mark Slater [mailto:]
Sent: Saturday, February 18, 2006 10:49 PM
To: jackrabbit-dev@incubator.apache.org
Subject: Best Practice: defining custom nodes
I've got my repository's custom nodes defined, and I have no problem
reading them in (I'm using Jackrabbit's xml.NodeTypeReader) and
adding them to the repository. The question I have is, where is the
best place to do this? I'd love to be able to specify my custom
nodes, or at least the file location, in a config file someplace, and
have Jackrabbit read them in automatically if/when it has to create
the repository for the first time. What I don't want to be doing is
trying to add them every time I get a Session since they only need to
be configured once.
What is the current Best Practice for adding custom nodes to the
repository when it is created? From what I can tell, the
specification of the Repository configuration DTD has been left
entirely up to the implementation.
Thanks,
Mark