public class Menu
extends java.lang.Object
hipergate top menu definition JiBX handler
This class needs to be processed with JiBX after being compiled. If you get the error org.jibx.runtime.JiBXException: Unable to access binding information for class com.knowgate.hipergate.Menu whilst trying to execute hipergate then execute from the command line: C:\JRE\bin\java -cp C:\JAR\bcel.jar;C:\JAR\jibx-1beta3.jar;C:\JAR\jibx-extras.jar;C:\JAR\xpp3.jar org.jibx.binding.Compile C:\knowgate\storage\xslt\schemas\menu-def-jixb.xmlConstructor and Description |
---|
Menu()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
int |
countAccesibleSubOptions()
Number of top level options that have access set to true
|
int |
countSubOptions()
Number of top level options
|
boolean |
getAccess(int nOption) |
MenuOption |
getOption(int nIndex)
Get option by index
|
MenuOption |
getOption(java.lang.String sName)
Get option by index
Perform linear search on top level options
|
boolean |
getSelected(int nOption) |
static Menu |
parse(java.lang.String sXMLDocPath,
java.lang.String sEnc)
Create a Menu object by parsing its definition from an XML file
|
void |
setAccessFor(int iAppMask,
boolean bAdmin,
boolean bOwner)
Determine access to evey menu option for an application mask
Get whether or not a user with the given application mask and roles can
access each menu option.
|
java.lang.String |
toXML() |
public int countSubOptions()
public int countAccesibleSubOptions()
public MenuOption getOption(int nIndex) throws java.lang.ArrayIndexOutOfBoundsException
nIndex
- int Option Indexjava.lang.ArrayIndexOutOfBoundsException
- if n<0 or n>=countSubOptions()public MenuOption getOption(java.lang.String sName) throws java.lang.ArrayIndexOutOfBoundsException
Get option by index
Perform linear search on top level optionssName
- String Option namejava.lang.ArrayIndexOutOfBoundsException
- if no option with such name was foundpublic boolean getAccess(int nOption)
public boolean getSelected(int nOption)
public void setAccessFor(int iAppMask, boolean bAdmin, boolean bOwner)
Determine access to evey menu option for an application mask
Get whether or not a user with the given application mask and roles can access each menu option. Application Masks are 32 bit integers with one bit flags per application. This method calls setAccess(hasAccess(iAppMask, bAdmin, bOwner)) for each menu option thus setting the access flag for all of themiAppMask
- int Application maskbAdmin
- boolean true if user has administrator rolebOwner
- boolean true if user is owner of his WorkAreapublic java.lang.String toXML()
public static Menu parse(java.lang.String sXMLDocPath, java.lang.String sEnc) throws org.jibx.runtime.JiBXException, java.io.FileNotFoundException, java.io.UnsupportedEncodingException, java.io.IOException
sXMLDocPath
- String Full path to menu XML definition filesEnc
- String Character encoding, if null then UTF-8 is assumed.org.jibx.runtime.JiBXException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException