cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <>
Subject [jcr] JCRNodeSource implementing InspectableSource?
Date Fri, 22 Jul 2005 15:20:34 GMT
Hi Cocoon devs,

in order to support properties for JCR sources, the JCRNodeSource could
implement the InspectableSource from the repository block.

IIUC this requires a mapping between namespace+name to JCR property names.
Could this be implemented in the following way?

     public SourceProperty getSourceProperty(String namespace, String name)
         throws SourceException {
         try {
             String prefix = getSession().getNamespacePrefix(namespace);
             String prefixedName = prefix + ":" + name;

             Node node = getNode();
             String value = node.getProperty(prefixedName).getString();

             return new SourceProperty(namespace, name, value);
         } catch (RepositoryException e) {
             throw new SourceException("Resolving properties failed: ", e);

Some open questions:

- (How) would non-string properties be supported?

- How could one register namespaces at the JCR repository? Could that be
   a configuration option of the AbstractRepository? Or would it require to
   override the JackrabbitRepository to register namespaces at startup?

-- Andreas

View raw message