Class GetParentsTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.sling.scripting.jsp.taglib.GetParentsTag
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class GetParentsTag
extends javax.servlet.jsp.tagext.TagSupport
Tag for retrieving all of the parent resources of a specified resource,
returning them in hierarchy order.
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()org.apache.sling.api.resource.ResourceGets the resource.Retrieves the start depthgetVar()Gets the variable name to which to save the list of children.voidsetResource(org.apache.sling.api.resource.Resource resource) Sets the resource.voidsetStartDepth(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 returnedvoidSets 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
-
Constructor Details
-
GetParentsTag
public GetParentsTag()
-
-
Method Details
-
doEndTag
public int doEndTag()- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.TagSupport
-
getResource
public org.apache.sling.api.resource.Resource getResource()Gets the resource.- Returns:
- the resource
-
getStartDepth
Retrieves the start depth- Returns:
- the start depth to retrieve
-
getVar
Gets the variable name to which to save the list of children.- Returns:
- the variable name
-
setResource
public void setResource(org.apache.sling.api.resource.Resource resource) Sets the resource.- Parameters:
resource- the new resource
-
setStartDepth
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
Sets the variable name to which to save the parent resource.- Parameters:
var- the variable name
-