2013/2/21 Felix Meschberger <[email protected]>:
>
> What hierarchy ?
>
> ResourceUtil.getSuperType(Resource) first asks the resource for a super type 
> and then falls back to ResourceUtil.getResourceSuperType(ResourceResolver, 
> String) which uses the resource type as a resource and checks that.
>
> But yes, the JcrNodeResource does not do this. We should maybe fix this by 
> calling ResourceUtil.getResourceSuperType(ResourceResolver, String) if there 
> is no super type property ? Or maybe something else ?

I think we changed this some time ago to exactly not do this - can't
remember why. So the current behaviour should be
Resource#getResourceSuperType only returns a value if the resource by
itself knows the super type (for jcr resources this means if it has
this property). I'm not sure if we should change this.

>
> In fact, looking at the ResourceUtil.getSuperType(Resource) method, this 
> should be changed to call into the new ResourceResolver method which in turn 
> gets back to the ResourceUtil.getResourceSuperType(ResourceResolver, String) 
> with the admin resolver.

Yes, while implementing this :) I just noticed that we need three
methods on the ResourceResolver (notice I now name the method
getResourceSuperType :) ):
    String getResourceSuperType(final Resource resource);
    String getResourceSuperType(final String resourceType);
    boolean isResourceType(final Resource resource, final String resourceType);

Now, the corresponding three methods on ResourceUtil can be deprecated
and call the ResourceResolver methods instead.
The AbstractResource#isResourceType(String) method can be changed to
call the method on the ResourceResolver as well

The final question is the first point in this mail - do we leave the
implementations of Resource#getResourceSuperType() as is (= returning
null if they don't know it) or do we change that to call the
ResourceResolver#getResourceSuperType? In the first case, we need to
clarify our docs, in the second we need to change the impls (and
clarify the docs)

Regards
Carsten
-- 
Carsten Ziegeler
[email protected]

Reply via email to