com.dotmarketing.viewtools
Class NavigationWebAPI

java.lang.Object
  extended by com.dotmarketing.viewtools.NavigationWebAPI
All Implemented Interfaces:
org.apache.velocity.tools.view.tools.ViewTool

public class NavigationWebAPI
extends java.lang.Object
implements org.apache.velocity.tools.view.tools.ViewTool


Field Summary
 int formCount
           
 
Constructor Summary
NavigationWebAPI()
           
 
Method Summary
 java.lang.String buildMenuItems(java.lang.String startFromPath, int numberOfLevels, javax.servlet.http.HttpServletRequest request)
          Return and/or create the path of the file with the menu items ordered.
 java.lang.String createMenu(java.lang.String startFromPath, int numberOfLevels, javax.servlet.http.HttpServletRequest request)
          Return the htmlcode with the navigation menu
 java.lang.String createMenuByDepth(int startFromLevel, int maxDepth, javax.servlet.http.HttpServletRequest request)
          Return path of the file with the menu items ordered
 java.lang.String createSiteMapMenu(int startFromLevel, int numberOfLevels, javax.servlet.http.HttpServletRequest request)
          This code is to built the site map menu
 java.lang.String createSiteMapMenu(int startFromLevel, int numberOfLevels, java.lang.String path, javax.servlet.http.HttpServletRequest request, boolean addHome)
          This code is to built the site map menu
 java.lang.String createSiteMapMenu(int startFromLevel, int numberOfLevels, java.lang.String path, javax.servlet.http.HttpServletRequest request, boolean addHome, boolean reverseOrder)
          This code is to built the site map menu
 java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request, java.lang.String imgPath)
          Return the htmlcode with the crumbtrail
 java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request, java.lang.String imgPath, java.lang.String homePath)
          Return the htmlcode with the crumbtrail
 java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request, java.lang.String imgPath, java.lang.String homePath, java.lang.String crumbTitle)
          Return the htmlcode with the crumbtrail
 int getFormCount()
           
 java.util.List<HTMLPage> getPagesList(java.lang.String folderPath, javax.servlet.http.HttpServletRequest request)
          Return array list of html page in a folder
 java.lang.String getStartFromPath(int startFromLevel, javax.servlet.http.HttpServletRequest request)
          Return start from path
 void increaseFormCount()
           
 void init(java.lang.Object obj)
          WebApi init method
 boolean menuItems(java.lang.String startFromPath, int numberOfLevels, javax.servlet.http.HttpServletRequest request)
          Returns true if the menu is valid and contains items in it
 boolean menuItemsByDepth(int startFromLevel, int maxDepth, javax.servlet.http.HttpServletRequest request)
          Returns true if the menu is valid and contains items in it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formCount

public int formCount
Constructor Detail

NavigationWebAPI

public NavigationWebAPI()
Method Detail

crumbTrail

public java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request,
                                   java.lang.String imgPath)
                            throws javax.servlet.jsp.JspException,
                                   DotSecurityException,
                                   com.liferay.portal.PortalException,
                                   com.liferay.portal.SystemException,
                                   DotDataException
Return the htmlcode with the crumbtrail

Parameters:
request - HttpServletRequest.
imgPath - String.
Returns:
String.
Throws:
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException
JspException.
DotSecurityException.
javax.servlet.jsp.JspException
DotSecurityException

crumbTrail

public java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request,
                                   java.lang.String imgPath,
                                   java.lang.String homePath)
                            throws javax.servlet.jsp.JspException,
                                   DotSecurityException,
                                   com.liferay.portal.PortalException,
                                   com.liferay.portal.SystemException,
                                   DotDataException
Return the htmlcode with the crumbtrail

Parameters:
request - HttpServletRequest.
homePath - String.
imgPath - String.
Returns:
String.
Throws:
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException
JspException.
DotSecurityException.
javax.servlet.jsp.JspException
DotSecurityException

crumbTrail

public java.lang.String crumbTrail(javax.servlet.http.HttpServletRequest request,
                                   java.lang.String imgPath,
                                   java.lang.String homePath,
                                   java.lang.String crumbTitle)
                            throws javax.servlet.jsp.JspException,
                                   DotSecurityException,
                                   com.liferay.portal.PortalException,
                                   com.liferay.portal.SystemException,
                                   DotDataException
Return the htmlcode with the crumbtrail

Parameters:
request - HttpServletRequest.
imgPath - String.
homePath - String.
crumbTitle - String.
Returns:
String.
Throws:
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException
JspException.
DotSecurityException.
javax.servlet.jsp.JspException
DotSecurityException

createMenu

public java.lang.String createMenu(java.lang.String startFromPath,
                                   int numberOfLevels,
                                   javax.servlet.http.HttpServletRequest request)
                            throws com.liferay.portal.PortalException,
                                   com.liferay.portal.SystemException,
                                   DotDataException,
                                   DotSecurityException
Return the htmlcode with the navigation menu

Parameters:
startFromPath - String.
numberOfLevels - int.
request - HttpServletRequest.
Returns:
String.
Throws:
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException
JspException.

init

public void init(java.lang.Object obj)
WebApi init method

Specified by:
init in interface org.apache.velocity.tools.view.tools.ViewTool
Parameters:
obj - Object.

createSiteMapMenu

public java.lang.String createSiteMapMenu(int startFromLevel,
                                          int numberOfLevels,
                                          java.lang.String path,
                                          javax.servlet.http.HttpServletRequest request,
                                          boolean addHome)
                                   throws com.liferay.portal.PortalException,
                                          com.liferay.portal.SystemException,
                                          DotDataException,
                                          DotSecurityException
This code is to built the site map menu

Parameters:
startFromLevel - This is number of folders the map should start at from the path.
numberOfLevels - This is how many folders to drill inside of from the start depth.
path - This is the path of the current folder
request - HttpServletRequest
Returns:
String
Throws:
javax.servlet.jsp.JspException
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException

createSiteMapMenu

public java.lang.String createSiteMapMenu(int startFromLevel,
                                          int numberOfLevels,
                                          java.lang.String path,
                                          javax.servlet.http.HttpServletRequest request,
                                          boolean addHome,
                                          boolean reverseOrder)
                                   throws com.liferay.portal.PortalException,
                                          com.liferay.portal.SystemException,
                                          DotDataException,
                                          DotSecurityException
This code is to built the site map menu

Parameters:
startFromLevel - This is number of folders the map should start at from the path.
numberOfLevels - This is how many folders to drill inside of from the start depth.
path - This is the path of the current folder
request - HttpServletRequest
reverseOrder - return the list in reverse order
Returns:
String
Throws:
javax.servlet.jsp.JspException
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException

createSiteMapMenu

public java.lang.String createSiteMapMenu(int startFromLevel,
                                          int numberOfLevels,
                                          javax.servlet.http.HttpServletRequest request)
                                   throws javax.servlet.jsp.JspException,
                                          com.liferay.portal.PortalException,
                                          com.liferay.portal.SystemException,
                                          DotDataException,
                                          DotSecurityException
This code is to built the site map menu

Parameters:
startFromLevel - This is number of folders the map should start at from the path.
numberOfLevels - This is how many folders to drill inside of from the start depth.
request - HttpServletRequest
Returns:
String
Throws:
javax.servlet.jsp.JspException
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException

menuItemsByDepth

public boolean menuItemsByDepth(int startFromLevel,
                                int maxDepth,
                                javax.servlet.http.HttpServletRequest request)
                         throws javax.servlet.jsp.JspException
Returns true if the menu is valid and contains items in it

Parameters:
startFromLevel - start level from the current request path
maxDepth -
request -
Returns:
Throws:
javax.servlet.jsp.JspException

menuItems

public boolean menuItems(java.lang.String startFromPath,
                         int numberOfLevels,
                         javax.servlet.http.HttpServletRequest request)
                  throws javax.servlet.jsp.JspException
Returns true if the menu is valid and contains items in it

Parameters:
startFromPath -
maxDepth -
request -
Returns:
Throws:
javax.servlet.jsp.JspException

getPagesList

public java.util.List<HTMLPage> getPagesList(java.lang.String folderPath,
                                             javax.servlet.http.HttpServletRequest request)
                                      throws com.liferay.portal.PortalException,
                                             com.liferay.portal.SystemException,
                                             DotDataException,
                                             DotSecurityException
Return array list of html page in a folder

Parameters:
folderPath - String.
request - HttpServletRequest.
Returns:
List
Throws:
javax.servlet.jsp.JspException
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException

createMenuByDepth

public java.lang.String createMenuByDepth(int startFromLevel,
                                          int maxDepth,
                                          javax.servlet.http.HttpServletRequest request)
                                   throws javax.servlet.jsp.JspException,
                                          com.liferay.portal.PortalException,
                                          com.liferay.portal.SystemException,
                                          DotDataException,
                                          DotSecurityException
Return path of the file with the menu items ordered

Parameters:
startFromLevel - integer with the level where the navigation menu will start to show.
maxDepth - integer with the number of level to show counting from the startFromLevel.
request - HttpServletRequest.
Returns:
String with the page of the file with the menu items ordered.
Throws:
javax.servlet.jsp.JspException
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException

getStartFromPath

public java.lang.String getStartFromPath(int startFromLevel,
                                         javax.servlet.http.HttpServletRequest request)
                                  throws javax.servlet.jsp.JspException
Return start from path

Parameters:
startFromLevel - integer with the level where the path will start to show.
request - HttpServletRequest.
Returns:
String with the path
Throws:
javax.servlet.jsp.JspException

buildMenuItems

public java.lang.String buildMenuItems(java.lang.String startFromPath,
                                       int numberOfLevels,
                                       javax.servlet.http.HttpServletRequest request)
                                throws com.liferay.portal.PortalException,
                                       com.liferay.portal.SystemException,
                                       DotDataException,
                                       DotSecurityException
Return and/or create the path of the file with the menu items ordered. The file will contain a velocity array of hashmap. Each item of the array will be a item of the menu. Each item (hashmap) will have the following keys, depending the type of item: Type FOLDER key="type" value="FOLDER" key="title" String key="name" String key="path" String key="submenu" ArrayList of the next level key="isFirstItem" Boolean key="isLastItem" Boolean Type CODED LINK key="type" value="LINK" key="path" String key="linkType" value="CODE" key="isFirstItem" Boolean key="isLastItem" Boolean Type LINK key="type" value="LINK" key="name" String key="protocal" String key="target" String key="title" String key="isFirstItem" Boolean key="isLastItem" Boolean Type HTMLPAGE key="type" value="HTMLPAGE" key="name" String key="path" String key="title" String key="isFirstItem" Boolean key="isLastItem" Boolean Type FILE key="type" value="FILE" key="name" String key="path" String key="title" String key="isFirstItem" Boolean key="isLastItem" Boolean

Parameters:
startFromPath - String with the start path of the menu items.
numberOfLevels - integer with the number of level of the menu items counting from startFromPath.
request - HttpServletRequest.
Returns:
String with the path
Throws:
DotSecurityException
DotDataException
com.liferay.portal.SystemException
com.liferay.portal.PortalException
javax.servlet.jsp.JspException

getFormCount

public int getFormCount()

increaseFormCount

public void increaseFormCount()


Copyright © 2013 dotCMS Inc. All Rights Reserved.