Hello,

In working on a POC project, I was endeavoring to implement a custom
ModifyingResourceProvider.  The documentation seems to indicate that what
is necessary for a custom resource provider to participate in CRUD requests
initiated from a ResourceResolver is to register the custom provider as a
service which implements ModifyingResourceProvider and implement the
appropriate methods.  Digging around in the Sling source this does not seem
to be entirely true.  While this is true for most operations, the
hasChanges method of custom providers is not called when hasChanges is
called on the ResourceResolver.

This appears to be a consequence of the
org.apache.sling.resourceresolver.impl.helper.ResourceResolverContext
implementation.  The modifyingProviders list is only updated for providers
which come from a ResourceProviderFactory.  As such, in order to make a
ModifyingResourceProvider which properly participates in the hasChanges
method the provider must be instantiated by a custom
ResourceProviderFactory (I went about doing this in my POC to ensure this
was in-fact the case).

That said, I'm happy to endeavor to patch this if it is a defect, however
before starting down that path I wanted to determine whether this was the
intended behavior for some reason.

Best
-Paul

-- 
Paul Michelotti
CITYTECH, Inc.
312.673.6433 x 171
[email protected]
www.citytechinc.com

Reply via email to