Package com.day.cq.wcm.api
Class WCMFilteringResourceWrapper
java.lang.Object
org.apache.sling.api.resource.ResourceWrapper
com.adobe.granite.ui.components.FilteringResourceWrapper
com.day.cq.wcm.api.WCMFilteringResourceWrapper
Filters child resources of the given
resource based on the given contentResource design properties
The current wrapper is filtering child resources using Granite ExpressionResolver
It does that by adding custom variables to the ExpressionCustomizer which will use the request as a data vessel.
Later the ExpressionResolver via its CustomVariableELResolver will read the registered custom variables to resolve the granite:hide expression.
That expression can then refer to the custom variables- See Also:
-
Field Summary
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING -
Constructor Summary
ConstructorsConstructorDescriptionWCMFilteringResourceWrapper(Resource filteredResource, Resource contentResource, ExpressionResolver expressionResolver, SlingHttpServletRequest slingRequest) Filters child resources of the givenresourcebased on the givencontentResourcedesign properties e.g. -
Method Summary
Methods inherited from class com.adobe.granite.ui.components.FilteringResourceWrapper
getChild, getChildren, getResourceType, hasChildren, listChildrenMethods inherited from class org.apache.sling.api.resource.ResourceWrapper
adaptTo, getName, getParent, getPath, getResource, getResourceMetadata, getResourceResolver, getResourceSuperType, getValueMap, isResourceType, toString
-
Constructor Details
-
WCMFilteringResourceWrapper
public WCMFilteringResourceWrapper(Resource filteredResource, Resource contentResource, ExpressionResolver expressionResolver, SlingHttpServletRequest slingRequest) Filters child resources of the givenresourcebased on the givencontentResourcedesign properties e.g. - resource: the content of a dialog that contains fields that are conditionally hidden base on the design properties associated with thecontentResource- contentResource: a resource of type image that has design properties associated- Parameters:
filteredResource- Resource for which to filter child resourcescontentResource- Content Resource from which to extract design propertiesexpressionResolver- Expression Resolver ServiceslingRequest-SlingHttpServletRequest
-