sf.net.kayestry.components.menu
Class MenuComponent

java.lang.Object
  extended by org.apache.tapestry.spec.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
              extended by sf.net.kayestry.KayaBaseComponent
                  extended by sf.net.kayestry.components.menu.MenuComponent
All Implemented Interfaces:
org.apache.tapestry.IComponent, org.apache.tapestry.ILocatable, org.apache.tapestry.ILocationHolder, org.apache.tapestry.IRender

public abstract class MenuComponent
extends KayaBaseComponent

Genera un menu con JavaScript. El menu esta compuesto de items, que pueden tener items hijos (submenues) o no. Soporta control de acceso en cada item. Y el menu se lee desde menu.xml, desde el raiz del classpath.
Un menu de ejemplo para ver la estructura del xml es el siguiente:

       
          <?xml version="1.0"?>
          <root>
              <item id="0" name="Inicio" pageName="Home"/>
              <item id="1" name="Administracion">
                  <item name="Beneficiarios" pageName="BeneficiarioBrowse">
                      <allowed-roles>
                          <role>admin</role>
                      </allowed-roles>
                  </item>
              </item>
              <item id="2" name="Reportes">
                  <allowed-roles>
                      <role>usuario</role>
                  </allowed-roles>
              </item>
              ...
          </root>
        
 
Los roles permitidos son los que existan en la aplicacion, utilizando el esquema de seguridad que ofrece kommons. Estos roles no se heredan en los subitems. El id del menu debe ser unico en toda la definicion. Este id es utilizado para establecer el nombre del elemento que contiene el item.

Author:
jmile, lparra

Constructor Summary
MenuComponent()
           
 
Method Summary
protected abstract  java.lang.String getDefinition()
           
 java.util.Collection getMenu()
           
 MenuItem getMenuItem()
           
 MenuItem getMenuSubItem()
           
protected abstract  boolean getShowLogin()
           
 void setCurrentMenuItem(MenuItem value)
           
 void setCurrentMenuSubItem(MenuItem value)
           
 
Methods inherited from class sf.net.kayestry.KayaBaseComponent
getVisit
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad, renderComponent
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, cleanupAfterRender, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Constructor Detail

MenuComponent

public MenuComponent()
Method Detail

getDefinition

protected abstract java.lang.String getDefinition()

getShowLogin

protected abstract boolean getShowLogin()

getMenu

public java.util.Collection getMenu()

setCurrentMenuItem

public void setCurrentMenuItem(MenuItem value)

setCurrentMenuSubItem

public void setCurrentMenuSubItem(MenuItem value)

getMenuSubItem

public MenuItem getMenuSubItem()

getMenuItem

public MenuItem getMenuItem()


Copyright © 2006 Kaya. All Rights Reserved.