Class NodeServlet

  • All Implemented Interfaces:
    com.composum.sling.core.service.RestrictedService, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class NodeServlet
    extends com.composum.sling.core.servlet.NodeTreeServlet
    The JCR nodes service servlet to walk though and modify the entire hierarchy.
    See Also:
    Serialized Form
    • Constructor Detail

      • NodeServlet

        public NodeServlet()
    • Method Detail

      • bindFilterConfiguration

        protected void bindFilterConfiguration​(com.composum.sling.core.config.FilterConfiguration config)
        for each configured filter in the OSGi configuration a tree filter is added to the filter set
        Parameters:
        config - the OSGi filter configuration object
      • unbindFilterConfiguration

        protected void unbindFilterConfiguration​(com.composum.sling.core.config.FilterConfiguration config)
        removing of a configuration which is not longer available; removes the corresponding tree filter also
        Parameters:
        config - the OSGi filter configuration object to remove
      • activate

        protected void activate()
      • deactivate

        protected void deactivate()
        Overrides:
        deactivate in class com.composum.sling.core.servlet.AbstractServiceServlet
      • buildTreeFilter

        protected com.composum.sling.core.filter.ResourceFilter buildTreeFilter​(com.composum.sling.core.filter.ResourceFilter configuredFilter)
        Creates a 'tree filter' as combination with the configured filter and the rules for the 'intermediate' nodes (folders) to traverse up to the target nodes.
        Parameters:
        configuredFilter - the filter for the target nodes
      • getNodeFilter

        protected com.composum.sling.core.filter.ResourceFilter getNodeFilter​(org.apache.sling.api.SlingHttpServletRequest request)
        Determines the filter to use for node retrieval; scans the request for filter parameter or selector.
        Specified by:
        getNodeFilter in class com.composum.sling.core.servlet.NodeTreeServlet
      • checkNodeName

        protected boolean checkNodeName​(@Nullable
                                        @Nullable String name)
      • checkNodePath

        protected boolean checkNodePath​(@Nullable
                                        @Nullable String path)
      • getOperations

        @NotNull
        protected @NotNull com.composum.sling.core.servlet.ServletOperationSet<NodeServlet.Extension,​NodeServlet.Operation> getOperations()
        Specified by:
        getOperations in class com.composum.sling.core.servlet.AbstractServiceServlet
      • init

        public void init()
                  throws javax.servlet.ServletException
        setup of the servlet operation set for this servlet instance
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • prepareTreeItems

        protected List<org.apache.sling.api.resource.Resource> prepareTreeItems​(com.composum.sling.core.ResourceHandle resource,
                                                                                List<org.apache.sling.api.resource.Resource> items)
        sort children of orderable nodes
        Overrides:
        prepareTreeItems in class com.composum.sling.core.servlet.NodeTreeServlet
      • getJsonSelectorRules

        public static com.composum.sling.core.mapping.MappingRules getJsonSelectorRules​(org.apache.sling.api.SlingHttpServletRequest request)
      • getJsonSelectorIndent

        public static int getJsonSelectorIndent​(org.apache.sling.api.SlingHttpServletRequest request)