Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

oracle.apps.fnd.applcore.patterns.uishell.model.menuInternal
Class ApplicationsMenuContentHandlerImpl

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by oracle.apps.fnd.applcore.patterns.uishell.model.menuInternal.ApplicationsMenuContentHandlerImpl
All Implemented Interfaces:
ApplicationsMenuModel.MenuContentHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ApplicationsMenuContentHandlerImpl
extends org.xml.sax.helpers.DefaultHandler
implements ApplicationsMenuModel.MenuContentHandler

Handler called by the SAXParser when parsing menu metadata as part of the XML Menu Model of Trinidad Faces.

This is called through the Services API (See XMLMenuModel.java) to keep the separation between API's and internal modules.

startElement() and endElement() are called as one would expect, at the start of parsing an element in the menu metadata file and at the end of parsing an element in the menu metadata file. The menu model is created as a List of itemNodes and groupNodes which is available to and used by the XMLMenuModel to create the TreeModel and internal Maps.


Constructor Summary
ApplicationsMenuContentHandlerImpl()
          Constructs a Menu Content Handler.
 
Method Summary
 void endDocument()
          Called by the SAX Parser at the end of parsing a document.
 void endElement(java.lang.String nameSpaceUri, java.lang.String localElemName, java.lang.String qualifiedElemName)
          Processing done at the end of parsing a node enty element from the menu metadata file.
 java.util.Map<java.lang.String,java.lang.Object> getIdNodeMap(java.lang.Object modelKey)
          Get the Model's idNodeMap
 org.apache.myfaces.trinidad.model.XMLMenuModel getModel()
          Get the local (sharedNode) menu model.
 java.lang.String getModelId()
          Get the local (sharedNode) menu model's Uri.
 java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> getNodeFocusPathMap(java.lang.Object modelKey)
          Get the Model's nodeFocusPathMap
 org.apache.myfaces.trinidad.model.XMLMenuModel getRootModel()
          Get the top-level, root menu model, which contains the entire menu tree.
 java.lang.String getRootModelKey()
          Get the top-level, root menu model's Request Map Key.
 org.apache.myfaces.trinidad.model.TreeModel getTreeModel(java.lang.String uri)
          Get the treeModel built during parsing
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getViewIdFocusPathMap(java.lang.Object modelKey)
          Get the Model's viewIdFocusPathMap
 void setModelId(java.lang.String localModelId)
          Sets the local (sharedNode's) menu Model's System Id.
 void setRootModelKey(java.lang.String rootModelKey)
          Sets the root menu Model's Request map key.
 void setTreeModelKey(java.lang.String uri)
          Sets the treeModel map key used to get a cached treeModel from the MenuContentHandlerImpl.
 void startDocument()
          Called by the SAX Parser at the start of parsing a document.
 void startElement(java.lang.String nameSpaceUri, java.lang.String localElemName, java.lang.String qualifiedElemName, org.xml.sax.Attributes attrList)
          Start the parsing of an node element entry in the menu metadata file.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationsMenuContentHandlerImpl

public ApplicationsMenuContentHandlerImpl()
Constructs a Menu Content Handler.

Method Detail

startDocument

public void startDocument()
Called by the SAX Parser at the start of parsing a document.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(java.lang.String nameSpaceUri,
                         java.lang.String localElemName,
                         java.lang.String qualifiedElemName,
                         org.xml.sax.Attributes attrList)
                  throws org.xml.sax.SAXException
Start the parsing of an node element entry in the menu metadata file.

If the entry is for an itemNode or a destinationNode, create the node and it to the List. If the entry is for a sharedNode, a new submenu model is created.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
nameSpaceUri - - only used when passed to super class.
localElemName - - only used when passed to super class.
qualifiedElemName - - String designating the node type of the entry.
attrList - - List of attributes in the menudata entry.
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String nameSpaceUri,
                       java.lang.String localElemName,
                       java.lang.String qualifiedElemName)
Processing done at the end of parsing a node enty element from the menu metadata file. This manages the node depth properly so that method startElement works correctly to build the List.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
nameSpaceUri - - not used.
localElemName - - not used.
qualifiedElemName - - String designating the node type of the entry.

endDocument

public void endDocument()
Called by the SAX Parser at the end of parsing a document. Here, the menuList is put on the menuList map.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler

getViewIdFocusPathMap

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getViewIdFocusPathMap(java.lang.Object modelKey)
Get the Model's viewIdFocusPathMap

Specified by:
getViewIdFocusPathMap in interface ApplicationsMenuModel.MenuContentHandler
Returns:
the Model's viewIdFocusPathMap

getNodeFocusPathMap

public java.util.Map<java.lang.Object,java.util.List<java.lang.Object>> getNodeFocusPathMap(java.lang.Object modelKey)
Get the Model's nodeFocusPathMap

Specified by:
getNodeFocusPathMap in interface ApplicationsMenuModel.MenuContentHandler
Returns:
the Model's nodeFocusPathMap

getIdNodeMap

public java.util.Map<java.lang.String,java.lang.Object> getIdNodeMap(java.lang.Object modelKey)
Get the Model's idNodeMap

Specified by:
getIdNodeMap in interface ApplicationsMenuModel.MenuContentHandler
Returns:
the Model's idNodeMap

getTreeModel

public org.apache.myfaces.trinidad.model.TreeModel getTreeModel(java.lang.String uri)
Get the treeModel built during parsing

Specified by:
getTreeModel in interface ApplicationsMenuModel.MenuContentHandler
Parameters:
uri - String mapkey to a (possibly) treeModel cached on the MenuContentHandlerImpl.
Returns:
List of menu nodes.

getRootModel

public org.apache.myfaces.trinidad.model.XMLMenuModel getRootModel()
Get the top-level, root menu model, which contains the entire menu tree.

Returns:
root, top-level XMLMenuModel

getRootModelKey

public java.lang.String getRootModelKey()
Get the top-level, root menu model's Request Map Key.

Returns:
root, top-level XMLMenuModel's Request Map Key.

setRootModelKey

public void setRootModelKey(java.lang.String rootModelKey)
Sets the root menu Model's Request map key.

This is always only the top-level, root model's Request map key. We do this because the MenuContentHandlerImpl and nodes need to be able to call into the root model to:

Specified by:
setRootModelKey in interface ApplicationsMenuModel.MenuContentHandler
Parameters:
rootModelKey - - String the root, top-level menu model's Request map key.

getModel

public org.apache.myfaces.trinidad.model.XMLMenuModel getModel()
Get the local (sharedNode) menu model.

Returns:
sharedNode's XMLMenuModel

getModelId

public java.lang.String getModelId()
Get the local (sharedNode) menu model's Uri.

Returns:
sharedNode's XMLMenuModel Uri

setModelId

public void setModelId(java.lang.String localModelId)
Sets the local (sharedNode's) menu Model's System Id.

Specified by:
setModelId in interface ApplicationsMenuModel.MenuContentHandler
Parameters:
localModelId - - String the root, top-level menu model's Uri.

setTreeModelKey

public void setTreeModelKey(java.lang.String uri)
Sets the treeModel map key used to get a cached treeModel from the MenuContentHandlerImpl. Note: this is set from the XMLMenuModel BEFORE parsing begins

Parameters:
uri - String path to the menu model's metadata

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

Copyright © 2012 Oracle. All Rights Reserved.