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

Reply via email to