Sling
  1. Sling
  2. SLING-1725

Register internal post operations as services for consumption by servlets other than the SlingPostServlet

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Servlets Post 2.0.4
    • Fix Version/s: Servlets Post 2.1.2
    • Component/s: Servlets
    • Labels:
      None

      Description

      As discussed in [1] it would be useful to have the internal operations of the Sling POST Servlet available as services for other bundles to reuse.

      [1] http://markmail.org/message/a7vrtyhictf7tv4m

      1. SLING-1725.patch
        122 kB
        Felix Meschberger

        Issue Links

          Activity

          Hide
          Felix Meschberger added a comment -

          Registering operations as services.

          In addition, the existing Sling API HtmlResponse is not general enough for use in a genralized post processing. Thus a new interface PostResponse is introduced with

          Show
          Felix Meschberger added a comment - Registering operations as services. In addition, the existing Sling API HtmlResponse is not general enough for use in a genralized post processing. Thus a new interface PostResponse is introduced with
          Hide
          Alexander Klimetschek added a comment -

          Cool, but I would add the new method using the PostResponse to the SlingPostOperation interface because:

          • does not add a new interface (confusing)
          • very rare that clients implement a SlingPostOperation (I don't know a single case, it's all about post processors)
          • since AbstractSlingPostOperation is present, upgrade is easy (just recompile if extending from it)
          • would need a 2.1.0 release number then IIUC
          Show
          Alexander Klimetschek added a comment - Cool, but I would add the new method using the PostResponse to the SlingPostOperation interface because: does not add a new interface (confusing) very rare that clients implement a SlingPostOperation (I don't know a single case, it's all about post processors) since AbstractSlingPostOperation is present, upgrade is easy (just recompile if extending from it) would need a 2.1.0 release number then IIUC
          Hide
          Felix Meschberger added a comment -

          Reschedule for 2.1.0 release

          Show
          Felix Meschberger added a comment - Reschedule for 2.1.0 release
          Hide
          Felix Meschberger added a comment -

          I don't want to add the new method to the old interface, because this would mean that an implementation of the interface is forced to implement two methods: the new one, which is probably desired, and the old one, which is just adding code.

          The only option we could discuss as an alternative to adding a new interface is to modify the signature of the existing interface. This would introduce an incompatible change, though, and would require use to increase the major version number of the exported package. Not a big problem, probably, but we should be aware. In fact this would enable use really clean up and drop support for the "old" API altogether.

          Show
          Felix Meschberger added a comment - I don't want to add the new method to the old interface, because this would mean that an implementation of the interface is forced to implement two methods: the new one, which is probably desired, and the old one, which is just adding code. The only option we could discuss as an alternative to adding a new interface is to modify the signature of the existing interface. This would introduce an incompatible change, though, and would require use to increase the major version number of the exported package. Not a big problem, probably, but we should be aware. In fact this would enable use really clean up and drop support for the "old" API altogether.
          Hide
          Felix Meschberger added a comment -

          Implemented this functionality in Rev. 1076637

          Integration tests still pass, thus this change is stable with respect to existing HTTP POST requests

          Show
          Felix Meschberger added a comment - Implemented this functionality in Rev. 1076637 Integration tests still pass, thus this change is stable with respect to existing HTTP POST requests
          Hide
          Carsten Ziegeler added a comment -

          Can we resolve this issue?

          Show
          Carsten Ziegeler added a comment - Can we resolve this issue?
          Hide
          Felix Meschberger added a comment -

          Yes, resolved.

          Show
          Felix Meschberger added a comment - Yes, resolved.
          Hide
          Bertrand Delacretaz added a comment -

          The proxying mechanism for old operations implemented here does not work, it looks like it hasn't been tested at all.

          Reopening to add some tests and fix related SLING-2453 and SLING-2186 issues.

          Show
          Bertrand Delacretaz added a comment - The proxying mechanism for old operations implemented here does not work, it looks like it hasn't been tested at all. Reopening to add some tests and fix related SLING-2453 and SLING-2186 issues.
          Hide
          Bertrand Delacretaz added a comment -

          Integration tests added in 1308840, we now have two example (old and new style) of POST operations at http://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/post/

          Show
          Bertrand Delacretaz added a comment - Integration tests added in 1308840, we now have two example (old and new style) of POST operations at http://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/post/
          Hide
          Bertrand Delacretaz added a comment -

          I have also updated the "Extending the SlingPostServlet" docs at http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html to reflect this change, should be online soon

          Show
          Bertrand Delacretaz added a comment - I have also updated the "Extending the SlingPostServlet" docs at http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html to reflect this change, should be online soon

            People

            • Assignee:
              Bertrand Delacretaz
              Reporter:
              Felix Meschberger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development