|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.jsp.CmsJspNavElement
public class CmsJspNavElement
Bean to collect navigation information from a resource in the OpenCms VFS.
Each nav element contains a number of information about a VFS resource, obtained either from the resources properties or attributes. You can use this information to generate a HTML navigation for files in the VFS in your template.
CmsJspNavBuilder| Constructor Summary | |
|---|---|
CmsJspNavElement()
Empty constructor required for every JavaBean, does nothing. |
|
CmsJspNavElement(String resource,
Map properties)
Create a new instance of the bean and calls the init method with the provided parametes. |
|
CmsJspNavElement(String resource,
Map properties,
int navTreeLevel)
Create a new instance of the bean and calls the init method with the provided parametes. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object obj)
|
boolean |
equals(Object obj)
|
String |
getDescription()
Returns the value of the property PROPERTY_DESCRIPTION of this nav element, or null if this property is not set. |
String |
getFileName()
Returns the filename of the nav element, i.e. |
String |
getInfo()
Returns the value of the property of this nav element,
or null if this property is not set. |
String |
getLocale()
Returns the value of the property of this nav element,
or null if this property is not set. |
String |
getNavImage()
Returns the value of the property of this nav element,
or null if this property is not set. |
float |
getNavPosition()
Returns the value of the property C_PROPERTY_NAVPOS converted to a float,
or a value of Float.MAX_VALUE if the nav position property is not
set (or not a valid number) for this resource. |
String |
getNavText()
Returns the value of the property PROPERTY_NAVTEXT of this nav element, or a warning message if this property is not set (this method will never return null). |
int |
getNavTreeLevel()
Returns the nav tree level of this resource. |
String |
getParentFolderName()
Returns the name of the parent folder of the resource of this nav element. |
Map |
getProperties()
Returns the original Hashtable of all file properties of the resource that the nav element belongs to. |
String |
getProperty(String key)
Returns the value of the selected property from this nav element. |
String |
getResourceName()
Returns the resource name this nav element was initalized with. |
String |
getTitle()
Returns the value of the property PROPERTY_TITLE of this nav element, or null if this property is not set. |
int |
hashCode()
|
void |
init(String resource,
Map properties)
Same as calling init(String, Hashtable, -1). |
void |
init(String resource,
Map properties,
int navTreeLevel)
Initialized the member variables of this bean with the values provided. |
boolean |
isFolderLink()
Returns true if this nav element describes a folder, false
otherwise. |
boolean |
isInNavigation()
Returns true if this nav element is in the navigation, false
otherwise. |
void |
setNavPosition(float value)
Sets the value that will be returned by the getNavPosition()
method of this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CmsJspNavElement()
Call one of the init methods afer you have created an instance of the bean. Instead of using the constructor you should use the static factory methods provided by this class to create navigation beans that are properly initialized with current OpenCms context.
CmsJspNavBuilder.getNavigationForResource(),
CmsJspNavBuilder.getNavigationForFolder(),
CmsJspNavBuilder.getNavigationTreeForFolder(int, int)
public CmsJspNavElement(String resource,
Map properties)
resource - will be passed to initproperties - will be passed to initinit(String, Map)
public CmsJspNavElement(String resource,
Map properties,
int navTreeLevel)
resource - will be passed to initproperties - will be passed to initnavTreeLevel - will be passed to initinit(String, Map, int)| Method Detail |
|---|
public int compareTo(Object obj)
compareTo in interface ComparableComparable.compareTo(Object)public boolean equals(Object obj)
equals in class ObjectObject.equals(Object)public String getDescription()
null if this property is not set.
null if this property is not setpublic String getFileName()
public String getInfo()
CmsPropertyDefinition.PROPERTY_NAVINFO of this nav element,
or null if this property is not set.
null if this property is not setpublic String getLocale()
CmsPropertyDefinition.PROPERTY_LOCALE of this nav element,
or null if this property is not set.
null if this property is not setpublic String getNavImage()
CmsPropertyDefinition.PROPERTY_NAVIMAGE of this nav element,
or null if this property is not set.
null if this property is not setpublic float getNavPosition()
float,
or a value of Float.MAX_VALUE if the nav position property is not
set (or not a valid number) for this resource.
float,
or a value of Float.MAX_VALUE if the nav position property is not
set (or not a valid number) for this resourcepublic String getNavText()
null).
null)public int getNavTreeLevel()
public String getParentFolderName()
public Map getProperties()
Please note that the original reference is returned, so be careful when making changes to the Hashtable.
public String getProperty(String key)
The nav element contains a hash of all file properties of the resource that the nav element belongs to.
key - the property name to look up
public String getResourceName()
public String getTitle()
null if this property is not set.
null if this property is not setpublic int hashCode()
hashCode in class ObjectObject.hashCode()
public void init(String resource,
Map properties)
init(String, Hashtable, -1).
resource - the name of the resource to extract the navigation
information fromproperties - the properties of the resource read from the vfs
public void init(String resource,
Map properties,
int navTreeLevel)
A resource will be in the nav if at least one of the two properties
I_CmsConstants.PROPERTY_NAVTEXT or
I_CmsConstants.PROPERTY_NAVPOS is set. Otherwise
it will be ignored.
This bean does provides static methods to create a new instance
from the context of a current CmsObject. Call these static methods
in order to get a properly initialized bean.
resource - the name of the resource to extract the navigation
information fromproperties - the properties of the resource read from the vfsnavTreeLevel - tree level of this resource, for building
navigation treesCmsJspNavBuilder.getNavigationForResource()public boolean isFolderLink()
true if this nav element describes a folder, false
otherwise.
true if this nav element describes a folder, false
otherwise.public boolean isInNavigation()
true if this nav element is in the navigation, false
otherwise.A resource is considered to be in the navigation, if
true if this nav element is in the navigation, false
otherwisepublic void setNavPosition(float value)
getNavPosition()
method of this class.
value - the value to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||