After a little thinking I came up with the idea outlined below. I'm not
100% sure if this is feasable.
Ok, currently during a post a SlingPostOperation is selected and then
executed. The post operation does "everything", performing the changes
and saving them.
I think we could reintroduce a Changes interface with several
implementations like Add, Remove, Copy etc. This interface has all
knowledge of what to change.
The SlingPostOperation would then return a list of changes:
interface SlingPostOperation {
List <Change> prepare(SlingHttpServletRequest);
}
So the first step when a post comes in, is still to select the post
operation, but then this operation just generates a list of changes
without changing anything in the repository.
We then introduce pre and post processor interfaces (these are no final
names yet:)
interface PreProcessor {
void process(SlingHttpServletRequest, List<Change>);
}
interface PostProcessor {
void process(SlingHttpServletRequest);
}
There can be several pre and post processor registered, a property of a
processor is used to order them and guarantee an ordered execution.
A pre processor can alter the list of changes.
When all pre processors are run, the changes are applied to the
repository by Sling and saved.
After the save all post processors are executed.
WDYT?
Carsten
--
Carsten Ziegeler
[EMAIL PROTECTED]