You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2008/07/31 19:02:31 UTC

[jira] Closed: (SLING-594) Add pre and post processing hooks to the sling post servlet

     [ https://issues.apache.org/jira/browse/SLING-594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-594.
----------------------------------

       Resolution: Fixed
    Fix Version/s: Servlets Post 2.0.4

I've added the following interface SlingPostProcessor:

    void process(SlingHttpServletRequest request, List<Modification> changes)
    throws Exception;


> Add pre and post processing hooks to the sling post servlet
> -----------------------------------------------------------
>
>                 Key: SLING-594
>                 URL: https://issues.apache.org/jira/browse/SLING-594
>             Project: Sling
>          Issue Type: Improvement
>          Components: Servlets Post
>    Affects Versions: Servlets Post 2.0.2
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Servlets Post 2.0.4
>
>
> 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, List<Change>);
> }
> 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, then all post processors are executed.
> Finally all changes are saved.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.