Class GetParentsTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.sling.scripting.jsp.taglib.GetParentsTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class GetParentsTag extends TagSupport
Tag for retrieving all of the parent resources of a specified resource, returning them in hierarchy order.
See Also:
  • Constructor Details

    • GetParentsTag

      public GetParentsTag()
  • Method Details

    • doEndTag

      public int doEndTag()
      Description copied from class: TagSupport
      Default processing of the end tag returning EVAL_PAGE.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Returns:
      EVAL_PAGE
      See Also:
    • getResource

      public Resource getResource()
      Gets the resource.
      Returns:
      the resource
    • getStartDepth

      public String getStartDepth()
      Retrieves the start depth
      Returns:
      the start depth to retrieve
    • getVar

      public String getVar()
      Gets the variable name to which to save the list of children.
      Returns:
      the variable name
    • setResource

      public void setResource(Resource resource)
      Sets the resource.
      Parameters:
      resource - the new resource
    • setStartDepth

      public void setStartDepth(String startDepth)
      The depth at which to start, for example given a path of: /content/page1/page2/page3 and a start depth of 3, the parents page2/page3 would be returned
      Parameters:
      startDepth - the start depth from which to retrieve the parent resources
    • setVar

      public void setVar(String var)
      Sets the variable name to which to save the parent resource.
      Parameters:
      var - the variable name