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 2014/04/04 11:07:17 UTC

[jira] [Closed] (SLING-3444) Provide a switch to enable feature flags for the resource resolver

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

Carsten Ziegeler closed SLING-3444.
-----------------------------------


> Provide a switch to enable feature flags for the resource resolver
> ------------------------------------------------------------------
>
>                 Key: SLING-3444
>                 URL: https://issues.apache.org/jira/browse/SLING-3444
>             Project: Sling
>          Issue Type: Improvement
>          Components: Feature Flags, ResourceResolver
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Feature Flags 1.0.0, Resource Resolver 1.1.0
>
>
> When sending a post request which e.g. sets the feature flag property on a resource, this results in an exception in the post servlet. (unsetting is not possible either).
> The reason is, that the post servlet gets the resource several times and once the feature flag is set, it's not visible to the resource resolver anymore.
> This is a proposal on how to fix this:
>     FeatureFlag support for hiding resources is an implementation (detail) feature of the ResourceResolver(Impl).
>     FeatureFlag support for hiding resources is in general needed for GET (and HEAD) requests only (see the button hiding use case, etc).
> This is the proposed
>     Feature Flag Support is disabled by default in the ResourceResolverImpl.
>     Feature Flag Support can be enabled in the ResourceResolverImpl by setting a new "sling.resourceresolver.feature" (or so) property in the authenticationInfo map given to the get*ResourceResolver method.
>     The Feature bundle implements an AuthenticationInfoPostProcessor which checks the request method (and optionally a request parameter) to decide whether to set or not the "sling.resourceresolver.feature" property in the AuthenticationInfo. By default this AuthenticationInfoPostProcessor sets the flag only for GET and HEAD requests.
> This would enable feature flag support for GET/HEAD requests while still alowing content updates with POST (and other non-idempotent) requests. As a consequence, though, background processing requesting ResourceResolver instances from the ResourceResolverFactory directly will by default get ResourceResolver instances with feature flag support disabled.



--
This message was sent by Atlassian JIRA
(v6.2#6252)