Class NavigationNodeFactory

  • All Implemented Interfaces:
    com.sun.jsftemplating.component.factory.ComponentFactory

    public class NavigationNodeFactory
    extends com.sun.jsftemplating.component.factory.ComponentFactoryBase

    The NavigationNodeFactory provides an abstraction layer for the a tree node component, currently implemented as a Woodstock treeNode component. This provides the ability to change the treeNode implementation to another component or set, or a different component type altogether. The supported attributes are:

    • id - The ID of the component. While IDs are optional, it is a good idea to provide a specific ID, especially if one expects to want to add nodes under this node in the future.
    • label - The text label for the navigation node
    • url - An optional URL
    • icon - The URL to an image for the tree's root icon
    • target - An optional target to specify on the link created for this node (e.g., '_blank')
    • expanded - A boolean indicating whether or not this node should be expanded by default.
    • template - An optional parameter which indicates what template should be used to decorate the page to which this node links. The value will be a relative path to a template file provided by the Admin Console or one of its plugins (e.g., '/pluginId/templates/customLayout.xhtml'). The default value is /templates/default.layout. If the url parameter points to an external resource, the URL rendered will point a page in the admin console. This page will then read the contents of the users-specified URL and display those contents in the appropriate spot in the specified template.
    • processPage - This option is intended to be used in conjunction with the template parameter. By default, the page referred to by the URL will displayed as is. If, however, the plugin author provides a page which does not represent HTML, but instead represents the admin console's native data format, the parameter should be set to true.
    Author:
    Jason Lee, Ken Paulsen ([email protected])
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String COMPONENT_TYPE
      The UIComponent type that must be registered in the faces-config.xml file mapping to the UIComponent class to use for this UIComponent.
      static String REAL_URL
      The attribute name on the TreeNode component that contains the real URL of the content in which to include.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void applyOption​(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent comp, com.sun.jsftemplating.layout.descriptors.LayoutComponent lc, String name, Object value)  
      jakarta.faces.component.UIComponent create​(jakarta.faces.context.FacesContext context, com.sun.jsftemplating.layout.descriptors.LayoutComponent descriptor, jakarta.faces.component.UIComponent parent)
      This is the factory method responsible for creating the UIComponent.
      • Methods inherited from class com.sun.jsftemplating.component.factory.ComponentFactoryBase

        addChild, createComponent, getExtraInfo, setExtraInfo, setOption, setOptions, storeInstanceHandlers
    • Field Detail

      • COMPONENT_TYPE

        public static final String COMPONENT_TYPE

        The UIComponent type that must be registered in the faces-config.xml file mapping to the UIComponent class to use for this UIComponent.

        See Also:
        Constant Field Values
      • REAL_URL

        public static final String REAL_URL

        The attribute name on the TreeNode component that contains the real URL of the content in which to include. This is only used if the user wishes to take advantage of the admin console templating to add the header and navigation content to their page.

        See Also:
        Constant Field Values
    • Constructor Detail

      • NavigationNodeFactory

        public NavigationNodeFactory()
    • Method Detail

      • create

        public jakarta.faces.component.UIComponent create​(jakarta.faces.context.FacesContext context,
                                                          com.sun.jsftemplating.layout.descriptors.LayoutComponent descriptor,
                                                          jakarta.faces.component.UIComponent parent)

        This is the factory method responsible for creating the UIComponent.

        Specified by:
        create in interface com.sun.jsftemplating.component.factory.ComponentFactory
        Specified by:
        create in class com.sun.jsftemplating.component.factory.ComponentFactoryBase
        Parameters:
        context - The FacesContext.
        descriptor - The LayoutComponent descriptor associated. with the requested UIComponent.
        parent - The parent UIComponent.
        Returns:
        The newly created TreeNode.
      • applyOption

        protected void applyOption​(jakarta.faces.context.FacesContext context,
                                   jakarta.faces.component.UIComponent comp,
                                   com.sun.jsftemplating.layout.descriptors.LayoutComponent lc,
                                   String name,
                                   Object value)