On 3 Jun 2009, at 09:26, Felix Meschberger wrote:

Not in the sense of "inheriting the resource type from the parent node
if none is set".

But: We have a ResourceTypeProvider service interface, which you may
implement. This provider is called by the JcrResourceProvider if a node
has no sling:resourceType property.

In a custom resource provider, you could find a sling:resourceType
property up the ancestors of the node to build inheritance this way.

HTH

Felix,

Yes It does to a degree

I had a look at that interface and it works if there is a Node, but URL does not directly map to the JCR path either because the JCR path doesnt exist yet, or because there is mapping between the URL and the JCR path, then there is no Node, so the JcrResourceType doesnt get called.

What *would* work is something like

/**
 * Provide a resource type for resource paths which do not have
 * resourceType.
 */
public interface ResourceTypeProvider {

    /**
     * Return the resource type to use for the node.
     * @param absPath The node.
     * @return The resource type to use or null.
     */
String getResourceTypeForPath(String absPath) throws RepositoryException;
}

That would also get rid of the need for my patch local on ResourceProvider registrations (classifier)

Ian




Regards
Felix

Reply via email to