You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2012/09/13 03:04:07 UTC

[jira] [Created] (SLING-2596) add an extension point to the Sling Post Servlet which makes it easy to add new suffixes

Justin Edelson created SLING-2596:
-------------------------------------

             Summary: add an extension point to the Sling Post Servlet which makes it easy to add new suffixes
                 Key: SLING-2596
                 URL: https://issues.apache.org/jira/browse/SLING-2596
             Project: Sling
          Issue Type: New Feature
          Components: Servlets
            Reporter: Justin Edelson


Writing a SlingPostProcessor to handle an @Foo -style property is too hard... we should make it easier.

Something like:

@Component
@Service
@Property(name="suffix", value="My")
public class MySuffixHandler implements PostSuffixHandler {
   void handle(RequestProperty prop, Map<String, RequestProperty> allProperties) {
      // TODO - recalculate the property values
   }
}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2596) add an extension point to the Sling Post Servlet which makes it easy to add new suffixes

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456989#comment-13456989 ] 

Justin Edelson commented on SLING-2596:
---------------------------------------

bq. What would that be used for ?

Imagine you wanted to encrypt property values which were annotated with @Encrypted. In other words, posting
foo=somevalue
foo@Encrypted=true

should actually set the foo property to an encrypted version of "somevalue" (how this encryption is done isn't important).

To implement this in a SlingPostProcessor requires iterating the request parameters to extract the property names and then through the enter Modification list to update the values. This is a moderate amount of code (~150 lines). If we make this SuffixHandler a first-class extension point, that amount of code would be radically reduced.
                
> add an extension point to the Sling Post Servlet which makes it easy to add new suffixes
> ----------------------------------------------------------------------------------------
>
>                 Key: SLING-2596
>                 URL: https://issues.apache.org/jira/browse/SLING-2596
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>            Reporter: Justin Edelson
>
> Writing a SlingPostProcessor to handle an @Foo -style property is too hard... we should make it easier.
> Something like:
> @Component
> @Service
> @Property(name="suffix", value="My")
> public class MySuffixHandler implements PostSuffixHandler {
>    void handle(RequestProperty prop, Map<String, RequestProperty> allProperties) {
>       // TODO - recalculate the property values
>    }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2596) add an extension point to the Sling Post Servlet which makes it easy to add new suffixes

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456994#comment-13456994 ] 

Felix Meschberger commented on SLING-2596:
------------------------------------------

Ok. Got it. So this helps simplifying the AbstractCreateOperation.collectContent method.

+1
                
> add an extension point to the Sling Post Servlet which makes it easy to add new suffixes
> ----------------------------------------------------------------------------------------
>
>                 Key: SLING-2596
>                 URL: https://issues.apache.org/jira/browse/SLING-2596
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>            Reporter: Justin Edelson
>
> Writing a SlingPostProcessor to handle an @Foo -style property is too hard... we should make it easier.
> Something like:
> @Component
> @Service
> @Property(name="suffix", value="My")
> public class MySuffixHandler implements PostSuffixHandler {
>    void handle(RequestProperty prop, Map<String, RequestProperty> allProperties) {
>       // TODO - recalculate the property values
>    }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2596) add an extension point to the Sling Post Servlet which makes it easy to add new suffixes

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456905#comment-13456905 ] 

Felix Meschberger commented on SLING-2596:
------------------------------------------

What would that be used for ?
                
> add an extension point to the Sling Post Servlet which makes it easy to add new suffixes
> ----------------------------------------------------------------------------------------
>
>                 Key: SLING-2596
>                 URL: https://issues.apache.org/jira/browse/SLING-2596
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>            Reporter: Justin Edelson
>
> Writing a SlingPostProcessor to handle an @Foo -style property is too hard... we should make it easier.
> Something like:
> @Component
> @Service
> @Property(name="suffix", value="My")
> public class MySuffixHandler implements PostSuffixHandler {
>    void handle(RequestProperty prop, Map<String, RequestProperty> allProperties) {
>       // TODO - recalculate the property values
>    }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2596) add an extension point to the Sling Post Servlet which makes it easy to add new suffixes

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457155#comment-13457155 ] 

Justin Edelson commented on SLING-2596:
---------------------------------------

To be honest, I haven't thought through whether or not this would be applicable internally to Sling (in other words, would we convert our internal suffix handling logic to SuffixHandler services); I'm more thinking about applications built on top of Sling which want to support application-specific suffixes.
                
> add an extension point to the Sling Post Servlet which makes it easy to add new suffixes
> ----------------------------------------------------------------------------------------
>
>                 Key: SLING-2596
>                 URL: https://issues.apache.org/jira/browse/SLING-2596
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>            Reporter: Justin Edelson
>
> Writing a SlingPostProcessor to handle an @Foo -style property is too hard... we should make it easier.
> Something like:
> @Component
> @Service
> @Property(name="suffix", value="My")
> public class MySuffixHandler implements PostSuffixHandler {
>    void handle(RequestProperty prop, Map<String, RequestProperty> allProperties) {
>       // TODO - recalculate the property values
>    }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira