|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.jsp.CmsJspNavBuilder
public class CmsJspNavBuilder
Bean to provide a convenient way to build navigation structures based on the
.CmsJspNavElement
Use this together with the
to obtain navigation information based on the current users permissions.
For example, use CmsJspActionElement
and pass the
value of the current OpenCms user context uri obtained
from getNavigationForFolder(String)
as argument to obtain a list
of all items in the navigation of the current folder. Then use a simple scriptlet to
iterate over these items and create a HTML navigation.CmsRequestContext.getUri()
CmsJspNavElement
Field Summary | |
---|---|
protected CmsObject |
m_cms
The current CMS context. |
protected String |
m_requestUri
The current request URI. |
protected String |
m_requestUriFolder
The current request folder. |
Constructor Summary | |
---|---|
CmsJspNavBuilder()
Empty constructor, so that this bean can be initialized from a JSP. |
|
CmsJspNavBuilder(CmsObject cms)
Default constructor. |
Method Summary | |
---|---|
static String |
getDefaultFile(CmsObject cms,
String folder)
Deprecated. use CmsObject.readDefaultFile(String) instead |
List<CmsJspNavElement> |
getNavigationBreadCrumb()
Build a "bread crumb" path navigation to the current folder. |
List<CmsJspNavElement> |
getNavigationBreadCrumb(int startlevel,
boolean currentFolder)
Build a "bread crumb" path navigation to the current folder. |
List<CmsJspNavElement> |
getNavigationBreadCrumb(int startlevel,
int endlevel)
Build a "bread crumb" path navigation to the current folder. |
List<CmsJspNavElement> |
getNavigationBreadCrumb(String folder,
int startlevel,
int endlevel,
boolean currentFolder)
Build a "bread crumb" path navigation to the given folder. |
List<CmsJspNavElement> |
getNavigationForFolder()
Collect all navigation elements from the files of the folder of the current request URI. |
static List<CmsJspNavElement> |
getNavigationForFolder(CmsObject cms,
String folder)
Deprecated. use getNavigationForFolder(String) instead |
static List<CmsJspNavElement> |
getNavigationForFolder(CmsObject cms,
String folder,
int level)
Deprecated. use getNavigationForFolder(String, int) instead |
List<CmsJspNavElement> |
getNavigationForFolder(int level)
Build a navigation for the folder that is either minus levels up from of the folder of the current request URI, or that is plus levels down from the root folder towards the current request URI. |
List<CmsJspNavElement> |
getNavigationForFolder(String folder)
Collect all navigation visible elements from the files in the given folder. |
List<CmsJspNavElement> |
getNavigationForFolder(String folder,
boolean includeInvisible)
Collect all navigation elements from the files in the given folder. |
List<CmsJspNavElement> |
getNavigationForFolder(String folder,
int level)
Build a navigation for the folder that is either minus levels up from the given folder, or that is plus levels down from the root folder towards the given folder. |
CmsJspNavElement |
getNavigationForResource()
Returns a navigation element for the resource of the current request URI. |
static CmsJspNavElement |
getNavigationForResource(CmsObject cms,
String resource)
Deprecated. use getNavigationForResource(String) instead |
CmsJspNavElement |
getNavigationForResource(String sitePath)
Returns a navigation element for the named resource. |
static List<CmsJspNavElement> |
getNavigationTreeForFolder(CmsObject cms,
String folder,
int startlevel,
int endlevel)
Deprecated. use getNavigationForResource(String) instead |
List<CmsJspNavElement> |
getNavigationTreeForFolder(int startlevel,
int endlevel)
Builds a tree navigation for the folders between the provided start and end level. |
List<CmsJspNavElement> |
getNavigationTreeForFolder(String folder,
int startlevel,
int endlevel)
Builds a tree navigation for the folders between the provided start and end level. |
List<CmsJspNavElement> |
getSiteNavigation()
This method builds a complete site navigation tree with entries of all branches. |
static List<CmsJspNavElement> |
getSiteNavigation(CmsObject cms,
String folder,
int endLevel)
Deprecated. use getNavigationForResource(String) instead |
List<CmsJspNavElement> |
getSiteNavigation(String folder,
int endLevel)
This method builds a complete navigation tree with entries of all branches from the specified folder. |
void |
init(CmsObject cms)
Initializes this bean. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CmsObject m_cms
protected String m_requestUri
protected String m_requestUriFolder
Constructor Detail |
---|
public CmsJspNavBuilder()
public CmsJspNavBuilder(CmsObject cms)
cms
- context provider for the current requestMethod Detail |
---|
@Deprecated public static String getDefaultFile(CmsObject cms, String folder)
CmsObject.readDefaultFile(String)
instead
null
if the navigation element is not a folder.
The default file of a folder is determined by the value of the property
default-file
or the system wide property setting.
cms
- the CMS objectfolder
- full name of the folder
@Deprecated public static List<CmsJspNavElement> getNavigationForFolder(CmsObject cms, String folder)
getNavigationForFolder(String)
instead
CmsJspNavElement
.
cms
- context provider for the current requestfolder
- the selected folder
@Deprecated public static List<CmsJspNavElement> getNavigationForFolder(CmsObject cms, String folder, int level)
getNavigationForFolder(String, int)
instead
If level is set to zero the root folder is used by convention.
cms
- context provider for the current requestfolder
- the selected folderlevel
- if negative, walk this many levels up, if positive, walk this many
levels down from root folder
@Deprecated public static CmsJspNavElement getNavigationForResource(CmsObject cms, String resource)
getNavigationForResource(String)
instead
cms
- context provider for the current requestresource
- the resource name to get the navigation information for,
must be a full path name, e.g. "/docs/index.html"
@Deprecated public static List<CmsJspNavElement> getNavigationTreeForFolder(CmsObject cms, String folder, int startlevel, int endlevel)
getNavigationForResource(String)
instead
A tree navigation includes all navigation elements that are required to display a tree structure.
However, the data structure is a simple list.
Each of the navigation elements in the list has the CmsJspNavElement.getNavTreeLevel()
set
to the level it belongs to. Use this information to distinguish between the navigation levels.
cms
- context provider for the current requestfolder
- the selected folderstartlevel
- the start levelendlevel
- the end level
@Deprecated public static List<CmsJspNavElement> getSiteNavigation(CmsObject cms, String folder, int endLevel)
getNavigationForResource(String)
instead
For an unlimited depth of the navigation (i.e. no endLevel
),
set the endLevel
to a value < 0.
cms
- the current CMS contextfolder
- the root folder of the navigation treeendLevel
- the end level of the navigation
public List<CmsJspNavElement> getNavigationBreadCrumb()
getNavigationBreadCrumb(String, int, int, boolean)
public List<CmsJspNavElement> getNavigationBreadCrumb(int startlevel, boolean currentFolder)
startlevel
- the start level, if negative, go down |n| steps from selected foldercurrentFolder
- include the selected folder in navigation or not
getNavigationBreadCrumb(String, int, int, boolean)
public List<CmsJspNavElement> getNavigationBreadCrumb(int startlevel, int endlevel)
startlevel
- the start level, if negative, go down |n| steps from selected folderendlevel
- the end level, if -1, build navigation to selected folder
getNavigationBreadCrumb(String, int, int, boolean)
public List<CmsJspNavElement> getNavigationBreadCrumb(String folder, int startlevel, int endlevel, boolean currentFolder)
The startlevel
marks the point where the navigation starts from, if negative,
the count of steps to go down from the given folder.
The endlevel
is the maximum level of the navigation path, set it to -1 to build the
complete navigation to the given folder.
You can include the given folder in the navigation by setting currentFolder
to
true
, otherwise false
.
folder
- the selected folderstartlevel
- the start level, if negative, go down |n| steps from selected folderendlevel
- the end level, if -1, build navigation to selected foldercurrentFolder
- include the selected folder in navigation or not
public List<CmsJspNavElement> getNavigationForFolder()
public List<CmsJspNavElement> getNavigationForFolder(int level)
If level is set to zero the root folder is used by convention.
level
- if negative, walk this many levels up, if positive, walk this many
levels down from root folder
public List<CmsJspNavElement> getNavigationForFolder(String folder)
folder
- the selected folder
public List<CmsJspNavElement> getNavigationForFolder(String folder, boolean includeInvisible)
folder
- the selected folderincludeInvisible
- true
to include elements not visible in navigation
public List<CmsJspNavElement> getNavigationForFolder(String folder, int level)
If level is set to zero the root folder is used by convention.
folder
- the selected folderlevel
- if negative, walk this many levels up, if positive, walk this many
levels down from root folder
public CmsJspNavElement getNavigationForResource()
public CmsJspNavElement getNavigationForResource(String sitePath)
sitePath
- the resource name to get the navigation information for,
must be a full path name, e.g. "/docs/index.html"
public List<CmsJspNavElement> getNavigationTreeForFolder(int startlevel, int endlevel)
startlevel
- the start levelendlevel
- the end level
getNavigationTreeForFolder(String, int, int)
public List<CmsJspNavElement> getNavigationTreeForFolder(String folder, int startlevel, int endlevel)
folder
- the selected folderstartlevel
- the start levelendlevel
- the end level
public List<CmsJspNavElement> getSiteNavigation()
getSiteNavigation(String, int)
public List<CmsJspNavElement> getSiteNavigation(String folder, int endLevel)
folder
- folder the root folder of the navigation treeendLevel
- the end level of the navigation
public void init(CmsObject cms)
cms
- the current cms context
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |