|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opencms.jsp.CmsJspBean
org.opencms.jsp.CmsJspActionElement
org.opencms.frontend.templateone.CmsTemplateBase
org.opencms.frontend.templateone.CmsTemplateNavigation
public class CmsTemplateNavigation
Provides methods to build the different navigations for the OpenCms template one.
The navigation methods are used by the included JSP elements of template one. The inclusion has to be done by passing the Map of request parameters to the included element. The following request parameters have to be added before inclusion:
| Field Summary | |
|---|---|
static java.lang.String |
FILE_CONFIG_HEADNAV
Configuration file name for the optional manual head navigation configuration. |
static java.lang.String |
PARAM_HEADNAV_FOLDER
Request parameter name for the head navigation start folder. |
static java.lang.String |
PARAM_HEADNAV_IMAGES
Request parameter name for the head navigation flag to use images on 1st level. |
static java.lang.String |
PARAM_HEADNAV_MANUAL
Request parameter name for the head navigation flag to manually configure the head navigation. |
static java.lang.String |
PARAM_HEADNAV_MARKCURRENT
Request parameter name for the head navigation flag to mark the current top level folder. |
static java.lang.String |
PARAM_HEADNAV_MENUCLICK
Request parameter name for the head navigation flag to expand the submenus on click (true) or mouseover (false). |
static java.lang.String |
PARAM_HEADNAV_MENUDEPTH
Request parameter name for the head navigation sub menu depth. |
static java.lang.String |
PARAM_LOCALE
Request parameter name for the current locale. |
static java.lang.String |
PARAM_NAVLEFT_ELEMENTURI
Request parameter name for the left navigation editable include element uri. |
static java.lang.String |
PARAM_NAVLEFT_SHOWSELECTED
Request parameter name for the flag if the left navigation should display only the selected resources. |
static java.lang.String |
PARAM_NAVLEFT_SHOWTREE
Request parameter name for the flag if the left navigation tree should be displayed. |
static java.lang.String |
PARAM_RESPATH
Request parameter name for the current resource path. |
static java.lang.String |
PARAM_SHOWMENUS
Request parameter name for the flag if the head navigation menus should be shown. |
static java.lang.String |
PARAM_STARTFOLDER
Request parameter name for the current start folder. |
static java.lang.String |
PROPERTY_HEADNAV_USE
Name of the property key to determine if the current element is shown in headnav. |
| Fields inherited from class org.opencms.frontend.templateone.CmsTemplateBase |
|---|
ATTRIBUTE_ORIGINAL_URI |
| Fields inherited from class org.opencms.jsp.CmsJspActionElement |
|---|
NOT_INITIALIZED |
| Constructor Summary | |
|---|---|
CmsTemplateNavigation()
Empty constructor, required for every JavaBean. |
|
CmsTemplateNavigation(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Constructor, with parameters. |
|
| Method Summary | |
|---|---|
java.lang.String |
buildNavigationBreadCrumb(java.lang.String styleClass)
Returns the html for the bread crumb navigation above the page content. |
java.lang.String |
buildNavigationHead(java.lang.String homeLabel,
java.lang.String styleLink,
java.lang.String styleSeparator)
Returns the html for the head navigation row. |
java.lang.String |
buildNavigationHeadMenus(java.lang.String styleClass)
Returns the html for the head navigation menus. |
java.lang.String |
buildNavigationLeft()
Returns the html for the left navigation tree. |
void |
buildNavLeftIncludeElement()
Builds the html for the inclusion of the editable element under the left navigation tree. |
java.lang.String |
getConfigPath()
Returns the template configuration path in the OpenCms VFS. |
org.opencms.xml.content.CmsXmlContent |
getConfiguration()
Returns the common configuration properties for the current web site area. |
java.lang.String |
getConfigurationValue(java.lang.String key,
java.lang.String defaultValue)
Returns the value for the specified property key name from the configuration. |
java.lang.String |
getHeadNavFolder()
Returns the path to the head navigation start folder. |
java.util.List |
getHeadNavItemsFromConfig(int menuLevel,
java.lang.String menuIndexes)
Creates a List of CmsJspNavElement objects from a manual XML content configuration file. |
boolean |
getHeadNavMarkCurrent()
Returns if the currently active top level folder should be marked in the head navigation. |
boolean |
getHeadNavMenuClick()
Returns if the submenus are expanded on click (true) or mouseover (false). |
java.lang.String |
getLocale()
Returns the currently active locale. |
int |
getMenuDepth()
Returns the maximum depth of the head navigation sub menu structure. |
java.lang.StringBuffer |
getMenuNavigation(java.util.List curNav,
java.lang.String styleClass,
java.lang.String prefix,
int currentDepth,
java.lang.String menuIndexes)
This method builds a complete menu navigation with entries of all branches from the specified folder. |
java.lang.String |
getNavLeftElementUri()
Returns the URI of the page element to include on the left navigation. |
java.lang.String |
getResourcePath()
Returns the substituted path to the modules resource folder. |
java.lang.String |
getStartFolder()
Returns the start folder for navigation and search results. |
void |
init(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Initialize this bean with the current page context, request and response. |
java.lang.String |
key(java.lang.String keyName)
Gets the localized resource string for a given message key. |
org.opencms.i18n.CmsMessages |
messages()
Returns the initialized CmsMessages object to use on the JSP template. |
void |
setHeadNavItemDefaultValue(boolean defaultValue)
Sets the default value of the property style_head_nav_showitem in case the property is not set. |
boolean |
showAccessibleVersion()
Returns if the accessible version of the page should be shown. |
boolean |
showHeadNavImages()
Returns if the head navigation should use images for the 1st navigation level. |
boolean |
showMenus()
Returns if the second level navigation menus of the head navigation should be shown. |
boolean |
showNavLeftElement()
Returns true if the left navigation include element should be shown. |
boolean |
showNavLeftSelected()
Returns true if the left navigation follows the selection in the head navigation menu. |
boolean |
showNavLeftTree()
Returns true if the left navigation tree should be displayed. |
| Methods inherited from class org.opencms.frontend.templateone.CmsTemplateBase |
|---|
getOriginalUri, initUri, isUriChanged |
| Methods inherited from class org.opencms.jsp.CmsJspActionElement |
|---|
editable, editable, editable, editableManualClose, editableManualOpen, getContent, getContent, getMessages, getMessages, getMessages, getMessages, getNavigation, getNavigationUri, img, img, include, include, include, include, include, include, includeSilent, includeSilent, includeSilent, includeSilent, info, label, link, link, properties, properties, property, property, property, property, template, template, template, toAbsolute, user |
| Methods inherited from class org.opencms.jsp.CmsJspBean |
|---|
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FILE_CONFIG_HEADNAV
public static final java.lang.String PARAM_HEADNAV_FOLDER
public static final java.lang.String PARAM_HEADNAV_IMAGES
public static final java.lang.String PARAM_HEADNAV_MARKCURRENT
public static final java.lang.String PARAM_HEADNAV_MANUAL
public static final java.lang.String PARAM_HEADNAV_MENUCLICK
public static final java.lang.String PARAM_HEADNAV_MENUDEPTH
public static final java.lang.String PARAM_LOCALE
public static final java.lang.String PARAM_NAVLEFT_ELEMENTURI
public static final java.lang.String PARAM_NAVLEFT_SHOWSELECTED
public static final java.lang.String PARAM_NAVLEFT_SHOWTREE
public static final java.lang.String PARAM_RESPATH
public static final java.lang.String PARAM_SHOWMENUS
public static final java.lang.String PARAM_STARTFOLDER
public static final java.lang.String PROPERTY_HEADNAV_USE
| Constructor Detail |
|---|
public CmsTemplateNavigation()
public CmsTemplateNavigation(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Use this constructor for the template.
context - the JSP page context objectreq - the JSP requestres - the JSP response| Method Detail |
|---|
public java.lang.String buildNavigationBreadCrumb(java.lang.String styleClass)
The bread crumb navigation is only displayed if the folder depth of the current URI is deeper than 3 levels relative to the defined start level.
styleClass - the CSS class name to use in the <div> and <a> elements
public java.lang.String buildNavigationHead(java.lang.String homeLabel,
java.lang.String styleLink,
java.lang.String styleSeparator)
This method only creates the head row part, be sure to add the dhtml menu entries by calling the method buildNavigationHeadMenus(java.lang.String).
homeLabel - the label of the "home" linkstyleLink - the CSS class name of the link nodestyleSeparator - the CSS class name of the spearator node
public java.lang.String buildNavigationHeadMenus(java.lang.String styleClass)
This method only creates the menu entries, be sure to build the head row calling the menus, too.
styleClass - the CSS class name of the <div> nodes
public java.lang.String buildNavigationLeft()
public void buildNavLeftIncludeElement()
throws java.io.IOException,
javax.servlet.jsp.JspException
java.io.IOException - if writing the output fails
javax.servlet.jsp.JspException - if including the element failspublic java.lang.String getConfigPath()
public org.opencms.xml.content.CmsXmlContent getConfiguration()
public java.lang.String getConfigurationValue(java.lang.String key,
java.lang.String defaultValue)
Returns the default value argument if the property is not found.
key - the property key name to look updefaultValue - a default value
public java.lang.String getHeadNavFolder()
public java.util.List getHeadNavItemsFromConfig(int menuLevel,
java.lang.String menuIndexes)
CmsJspNavElement objects from a manual XML content configuration file.A manual configuration file can be used to build a head navigation that does not depend on the OpenCms resource structure. The menu level starts with 0 meaning the current level to create, the menuIndexes String contains at each char position numbers from 0-9 meaning the xpath index of the submenu entries in the XML content configuration file.
To get the first row, call this method like getHeadNavItemsFromConfig(0, "0") ,
to get the subitems for the second entry in the second row getHeadNavItemsFromConfig(1, "1").
menuLevel - the menu level to get the items for, starting with 0menuIndexes - the menu indexes of the submenus for xpath creation, starting with "0"
public boolean getHeadNavMarkCurrent()
public boolean getHeadNavMenuClick()
public java.lang.String getLocale()
public int getMenuDepth()
public java.lang.StringBuffer getMenuNavigation(java.util.List curNav,
java.lang.String styleClass,
java.lang.String prefix,
int currentDepth,
java.lang.String menuIndexes)
curNav - the List of current navigation elementsstyleClass - the CSS class name of the <div> nodesprefix - the prefix to generate the unique menu node id.currentDepth - the depth of the current submenumenuIndexes - String representing the menu indexes in the manual XML configuration, if null, no manual configuration is used
public java.lang.String getNavLeftElementUri()
public java.lang.String getResourcePath()
public java.lang.String getStartFolder()
public void init(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
It is required to call one of the init() methods before you can use the instance of this bean.
init in class org.opencms.jsp.CmsJspBeancontext - the JSP page context objectreq - the JSP requestres - the JSP responsepublic java.lang.String key(java.lang.String keyName)
If the key was not found in the bundle, the return value is
"??? " + keyName + " ???". This will also be returned
if the bundle was not properly initialized first.
keyName - the key for the desired string
public org.opencms.i18n.CmsMessages messages()
public void setHeadNavItemDefaultValue(boolean defaultValue)
style_head_nav_showitem in case the property is not set.
defaultValue - if true, all resources without property value are included in head menu, if false, vice versapublic boolean showAccessibleVersion()
public boolean showHeadNavImages()
public boolean showMenus()
public boolean showNavLeftElement()
public boolean showNavLeftSelected()
public boolean showNavLeftTree()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||