public class PluginHandlers extends Object
This class will provide JSFTemplating Handlers that
provide access to IntegrationPoints and possibily other
information / services needed to provide plugin functionality
i.e. getting resources, etc.).
| Modifier | Constructor and Description |
|---|---|
protected |
PluginHandlers()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
calculateHelpUrl(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx) |
static void |
getAppEditIntegrationPoint(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx) |
static void |
getContentOfIntegrationPoints(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
Finds the integration point of the specified type.
|
static String |
getHelpPathForResource(String resource,
Locale locale,
ClassLoader cl)
This function attempts to calculate a help path with the
given locale and classloader.
|
static jakarta.faces.component.UIComponent |
getIntegrationPointParent(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent root,
org.glassfish.admingui.connector.IntegrationPoint point)
This method returns the parent for the content of the given
IntegrationPoint. |
static List<org.glassfish.admingui.connector.IntegrationPoint> |
getIntegrationPoints(jakarta.faces.context.FacesContext context,
String type) |
static void |
getIntegrationPoints(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler provides access to
IntegrationPoints for the
requested key. |
static void |
getPluginIdFromViewId(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx) |
static void |
getPluginResources(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler returns a
Map<String id, List<URL>> containing all
the matches of the requested resource. |
static org.glassfish.admingui.plugin.ConsolePluginService |
getPluginService(jakarta.faces.context.FacesContext ctx)
Find and return the
ConsolePluginService. |
static Set<org.glassfish.admingui.connector.IntegrationPoint> |
getSortedIntegrationPoints(List<org.glassfish.admingui.connector.IntegrationPoint> points)
This method sorts the given
IntegrationPoint's by parentId
and then by priority. |
static void |
includeFirstIntegrationPoint(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
Includes the first IP based on priority for the given type.
|
static void |
includeIntegrationPoint(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent parent,
org.glassfish.admingui.connector.IntegrationPoint point)
This method includes a single
IntegrationPoint under the
given parent UIComponent. |
static void |
includeIntegrationPoints(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent root,
Set<org.glassfish.admingui.connector.IntegrationPoint> points) |
static void |
includeIntegrations(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler adds
IntegrationPoints of a given type to a
UIComponent tree. |
static void |
retrievePluginPageContents(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler is used for the navigation nodes that request content
from an external URL.
|
public static org.glassfish.admingui.plugin.ConsolePluginService getPluginService(jakarta.faces.context.FacesContext ctx)
Find and return the ConsolePluginService. This method
uses the HK2 Habitat to locate the
ConsolePluginService.
ctx - The FacesContext.public static void getPluginResources(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler returns a
Map<String id, List<URL>> containing all
the matches of the requested resource. Each List in
the Map is associated with a GUI Plugin, and the key
to the Map is the plugin id.
handlerCtx - The HandlerContext.public static void getIntegrationPoints(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler provides access to IntegrationPoints for the
requested key.
handlerCtx - The HandlerContext.public static List<org.glassfish.admingui.connector.IntegrationPoint> getIntegrationPoints(jakarta.faces.context.FacesContext context, String type)
public static void includeIntegrations(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler adds IntegrationPoints of a given type to a
UIComponent tree. It looks for
IntegrationPoints using the given type. It
then sorts the results (if any) by parentId, and then
by priority. It next interates over each one looking for a
UIComponent with an id which matches the
its own parentId value. It then uses the content of
the IntegrationPoint to attempt to include the .jsf page
it refers to under the identified parent component.
public static void includeFirstIntegrationPoint(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
throws IOException
IOExceptionpublic static void getContentOfIntegrationPoints(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
throws IOException
IOExceptionpublic static void getAppEditIntegrationPoint(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
throws IOException
IOExceptionpublic static Set<org.glassfish.admingui.connector.IntegrationPoint> getSortedIntegrationPoints(List<org.glassfish.admingui.connector.IntegrationPoint> points)
This method sorts the given IntegrationPoint's by parentId
and then by priority. It returns a SortedSet of the
results with the ABC order parentId. When parentId's match, the
highest piority will appear first.
public static void includeIntegrationPoints(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent root,
Set<org.glassfish.admingui.connector.IntegrationPoint> points)
points - This parameter should be the IntegrationPoints
to include in the order in which you want to include
them if that matters (i.e. use SortedSet).public static jakarta.faces.component.UIComponent getIntegrationPointParent(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent root,
org.glassfish.admingui.connector.IntegrationPoint point)
This method returns the parent for the content of the given
IntegrationPoint.
root - The UIComponent in which to search for
the parent.point - The IntegrationPoint which is looking for its
parent UIComponent.public static void includeIntegrationPoint(jakarta.faces.context.FacesContext ctx,
jakarta.faces.component.UIComponent parent,
org.glassfish.admingui.connector.IntegrationPoint point)
This method includes a single IntegrationPoint under the
given parent UIComponent.
ctx - The FacesContext.parent - The parent for the IntegrationPoint.point - The IntegrationPoint.public static void retrievePluginPageContents(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler is used for the navigation nodes that request content
from an external URL. This handler pulls the "real url" from from
the component specified by the compId parameter (this
necessarily depends on the presence of the navigation container in
the view for the component look up to work). Once the component
has been found, the url is retrieved from the attribute map, and
its contents retrieved. If processPage is true, the
URL contents are interpretted and the resulting component(s) are
added to the component tree (This feature is not currently
supported).. Otherwise, the contents are returned in the output
parameter pluginPage to be output as-is on the
page.
handlerCtx - The HandlerContext.public static void getPluginIdFromViewId(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
public static void calculateHelpUrl(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
public static String getHelpPathForResource(String resource, Locale locale, ClassLoader cl)
This function attempts to calculate a help path with the
given locale and classloader. It only succeeds if it is able to
confirm a file exists at the generated path as determined by
ClassLoader.getResource(path). The paths checked are
the following in this order:
/locale.toString()/help/<resource>/locale.getLanguage()_locale.getCountry()/help/<resource>/locale.getLanguage()/help/<resource> If all of those fail to yield a file in the classpath, then
null will be returned.
Copyright © 2017–2020 Eclipse Foundation. All rights reserved.