A question about the ContentInterceptor.

Upon preRemove() and postRemove() only a NULL is passed as NodeRevisionDescriptors for the resource to be removed. But from NodeRevisionDescriptor and SlideToken i can't find any way to obtain the uri of the resource in question. I have searched mailinglist and documentation and have found no way of obtaining the full path to the resource from within the class implementing ContentInterceptor.

The NodeRevisionDescriptor has the resource name, but no information about the uri the of the resource. So i looked at org.apache.slide.content.ContentImpl and found that the pre/post events for remove doesn't retrieve the NodeRevisionDescriptors and only passes NULL even if such a NodeRevisionDescriptors might exists.

So i added to ContentImpl.java line 1138 :

NodeRevisionDescriptors nrds = objectUri.getStore().retrieveRevisionDescriptors(objectUri);

and modified ContentImpl.java line 1144 to :

invokeInterceptors(token, nrds, revisionDescriptor, null, PRE_REMOVE);

rebuilt and tested, and it seems to work as expected, upon preRemove() i get passed the NodeRevisionDescriptors and i can now lookup the uri for the resource.

My question is if this will break or contradict some logic inside slide that prevents this hack to work? If line 1138 doesn´t find any NodeRevisionDescriptors it will be NULL anyway right?

And if this is a bad way of doing it, wouldn't it be logical to pass the full uri of the resource to be removed onto the interceptor? Without the uri there is no way of knowing exactly what resource to act upon... And of course, if there is a way to obtain the uri from preRemove() without this hack, i would be most happy to know about it! In advance thanks.

Any feedback is appreciated.

Mvh Karl Ĝie


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to