Class GetParentsTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.apache.sling.scripting.jsp.taglib.GetParentsTag
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
-
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
-
Constructor Summary
Constructors Constructor Description GetParentsTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdoEndTag()Default processing of the end tag returning EVAL_PAGE.ResourcegetResource()Gets the resource.java.lang.StringgetStartDepth()Retrieves the start depthjava.lang.StringgetVar()Gets the variable name to which to save the list of children.voidsetResource(Resource resource)Sets the resource.voidsetStartDepth(java.lang.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 returnedvoidsetVar(java.lang.String var)Sets the variable name to which to save the parent resource.-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
-
-
-
Method Detail
-
doEndTag
public int doEndTag()
Description copied from class:TagSupportDefault processing of the end tag returning EVAL_PAGE.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Returns:
- EVAL_PAGE
- See Also:
Tag.doEndTag()
-
getResource
public Resource getResource()
Gets the resource.- Returns:
- the resource
-
getStartDepth
public java.lang.String getStartDepth()
Retrieves the start depth- Returns:
- the start depth to retrieve
-
getVar
public java.lang.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(java.lang.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(java.lang.String var)
Sets the variable name to which to save the parent resource.- Parameters:
var- the variable name
-
-