org.benow.web.menu
Class MenuServiceImpl

java.lang.Object
  extended by org.benow.web.menu.MenuServiceImpl
All Implemented Interfaces:
org.benow.java.spec.Markup, org.benow.service.Service, MenuService

public class MenuServiceImpl
extends java.lang.Object
implements MenuService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.benow.java.spec.Markup
org.benow.java.spec.Markup.ParamName, org.benow.java.spec.Markup.ReturnDescription
 
Constructor Summary
MenuServiceImpl()
           
 
Method Summary
 void addChild(MenuItem parent, MenuItem child)
           
 MenuItem addChild(java.lang.String path, MenuItem item)
           
 void deleteItem(java.lang.Object key)
           
 MenuItem getCurrentMenu(java.lang.String selectedPath)
          gets the menu for the currently rendered page, including selection of current items.
 java.util.List<ImportableMenu> getImportableMenus()
           
 MenuItem getMenu()
           
 MenuItemBundle getMenuItemBundle(java.lang.Object key)
           
 MenuItem getMenuItemByPath(java.lang.String path)
           
 ResultWriter getMenuXML()
           
 void importItem(java.lang.String res, java.lang.String path)
           
 void loadMenu(java.io.InputStream menuStream)
           
 void moveDown(java.lang.Object key)
          decrease the position of this item in the child list of it's parent
 void moveUp(java.lang.Object key)
          increase the position of this item in the child list of it's parent
 MenuItemBundle prepMenuItem()
           
 void setEnabled(java.lang.Object key, boolean enabled)
           
 void update(MenuItem item)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuServiceImpl

public MenuServiceImpl()
Method Detail

addChild

public void addChild(MenuItem parent,
                     MenuItem child)

getMenu

public MenuItem getMenu()
Specified by:
getMenu in interface MenuService

update

public void update(MenuItem item)
Specified by:
update in interface MenuService

prepMenuItem

public MenuItemBundle prepMenuItem()
Specified by:
prepMenuItem in interface MenuService

addChild

public MenuItem addChild(java.lang.String path,
                         MenuItem item)
Specified by:
addChild in interface MenuService

getMenuItemBundle

public MenuItemBundle getMenuItemBundle(java.lang.Object key)
                                 throws org.benow.repository.NoSuchObjectException
Specified by:
getMenuItemBundle in interface MenuService
Throws:
org.benow.repository.NoSuchObjectException

moveUp

public void moveUp(java.lang.Object key)
Description copied from interface: MenuService
increase the position of this item in the child list of it's parent

Specified by:
moveUp in interface MenuService

moveDown

public void moveDown(java.lang.Object key)
Description copied from interface: MenuService
decrease the position of this item in the child list of it's parent

Specified by:
moveDown in interface MenuService

deleteItem

public void deleteItem(java.lang.Object key)
Specified by:
deleteItem in interface MenuService

getMenuItemByPath

public MenuItem getMenuItemByPath(java.lang.String path)
                           throws org.benow.repository.NoSuchObjectException
Specified by:
getMenuItemByPath in interface MenuService
Throws:
org.benow.repository.NoSuchObjectException

loadMenu

public void loadMenu(java.io.InputStream menuStream)
              throws javax.xml.transform.TransformerException
Specified by:
loadMenu in interface MenuService
Throws:
javax.xml.transform.TransformerException

setEnabled

public void setEnabled(java.lang.Object key,
                       boolean enabled)
                throws org.benow.repository.NoSuchObjectException
Specified by:
setEnabled in interface MenuService
Throws:
org.benow.repository.NoSuchObjectException

getCurrentMenu

public MenuItem getCurrentMenu(java.lang.String selectedPath)
Description copied from interface: MenuService
gets the menu for the currently rendered page, including selection of current items.

Specified by:
getCurrentMenu in interface MenuService
Parameters:
selectedPath - optional path to menu item to select (ie /menuitem/submenuitem), if not given, current request url will be used to determine path
Returns:

getMenuXML

public ResultWriter getMenuXML()
                        throws javax.xml.transform.TransformerException
Specified by:
getMenuXML in interface MenuService
Throws:
javax.xml.transform.TransformerException

getImportableMenus

public java.util.List<ImportableMenu> getImportableMenus()
                                                  throws java.io.IOException
Specified by:
getImportableMenus in interface MenuService
Throws:
java.io.IOException

importItem

public void importItem(java.lang.String res,
                       java.lang.String path)
                throws org.benow.xml.io.TransformerError,
                       java.io.IOException,
                       org.benow.repository.NoSuchObjectException
Specified by:
importItem in interface MenuService
Throws:
org.benow.xml.io.TransformerError
java.io.IOException
org.benow.repository.NoSuchObjectException