|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.portlet.GenericPortlet javax.portlet.faces.GenericFacesPortlet
public class GenericFacesPortlet
The GenericFacesPortlet
is provided to simplify development of a portlet that in
whole or part relies on the Faces bridge to process requests. If all requests are to be handled
by the bridge, GenericFacesPortlet
is a turnkey implementation. Developers do not
need to subclass it. However, if there are some situations where the portlet doesn't require
bridge services then GenericFacesPortlet
can be subclassed and overriden.
Since GenericFacesPortlet
subclasses GenericPortlet
care is taken
to all subclasses to override naturally. For example, though doDispatch()
is
overriden, requests are only dispatched to the bridge from here if the PortletMode
isn't VIEW
, EDIT
, or HELP
.
The GenericFacesPortlet
recognizes the following portlet initialization
parameters:
javax.portlet.faces.defaultViewId.[mode]
: specifies on a per mode
basis the default viewId the Bridge executes when not already encoded in the incoming request. A
value must be defined for each PortletMode
the Bridge
is expected
to process. javax.portlet.faces.excludedRequestAttributes
: specifies on a per portlet
basis the set of request attributes the bridge is to exclude from its request scope. The
value of this parameter is a comma delimited list of either fully qualified attribute names or
a partial attribute name of the form packageName.*. In this later case all attributes
exactly prefixed by packageName are excluded, non recursive.javax.portlet.faces.preserveActionParams
: specifies on a per portlet
basis whether the bridge should preserve parameters received in an action request
and restore them for use during subsequent renders.javax.portlet.faces.defaultContentType
: specifies on a per mode
basis the content type the bridge should set for all render requests it processes. javax.portlet.faces.defaultCharacterSetEncoding
: specifies on a per mode
basis the default character set encoding the bridge should set for all render requests it
processesGenericFacesPortlet
recognizes the following application
(PortletContext
) initialization parameters:
javax.portlet.faces.BridgeImplClass
: specifies the Bridge
implementation
class used by this portlet. Typically this initialization parameter isn't set as the
GenericFacesPortlet
defaults to finding the class name from the bridge
configuration. However if more then one bridge is configured in the environment such
per application configuration is necessary to force a specific bridge to be used.
Field Summary | |
---|---|
static java.lang.String |
BRIDGE_AUTO_DISPATCH_EVENTS
Portlet init parameter containing the setting for whether the GenericFacesPortlet
overrides event processing by dispatching all events to the bridge or delegates
all event processing to the GenericPortlet . |
static java.lang.String |
BRIDGE_CLASS
Application (PortletContext) init parameter that names the bridge class used by this application. |
static java.lang.String |
BRIDGE_SERVICE_CLASSPATH
Location of the services descriptor file in a brige installation that defines the class name of the bridge implementation. |
static java.lang.String |
DEFAULT_CHARACTERSET_ENCODING
Portlet init parameter that defines the render response CharacterSetEncoding the bridge sets prior to rendering. |
static java.lang.String |
DEFAULT_CONTENT_TYPE
Portlet init parameter that defines the render response ContentType the bridge sets prior to rendering. |
static java.lang.String |
DEFAULT_VIEWID
Portlet init parameter that defines the default ViewId that should be used when the request doesn't otherwise convery the target. |
Constructor Summary | |
---|---|
GenericFacesPortlet()
|
Method Summary | |
---|---|
void |
destroy()
Release resources, specifically it destroys the bridge. |
void |
doDispatch(RenderRequest request,
RenderResponse response)
If mode is VIEW, EDIT, or HELP -- defer to the doView, doEdit, doHelp so subclasses can override. |
protected void |
doEdit(RenderRequest request,
RenderResponse response)
|
protected void |
doHelp(RenderRequest request,
RenderResponse response)
|
protected void |
doView(RenderRequest request,
RenderResponse response)
|
java.lang.String |
getBridgeClassName()
Returns the className of the bridge implementation this portlet uses. |
BridgeEventHandler |
getBridgeEventHandler()
Returns an instance of a BridgeEventHandler used to process portlet events in a JSF environment. |
BridgePublicRenderParameterHandler |
getBridgePublicRenderParameterHandler()
Returns an instance of a BridgePublicRenderParameterHandler used to post process public render parameter changes that the bridge has pushed into mapped models. |
java.lang.String |
getDefaultRenderKitId()
Returns a String defining the default render kit id the bridge should ensure for this portlet. |
java.util.Map |
getDefaultViewIdMap()
Returns the defaultViewIdMap the bridge should use when its unable to resolve to a specific target in the incoming request. |
java.util.List<java.lang.String> |
getExcludedRequestAttributes()
Returns the set of RequestAttribute names that the portlet wants the bridge to exclude from its managed request scope. |
Bridge |
getFacesBridge(PortletRequest request,
PortletResponse response)
Returns an initialized bridge instance adequately prepared so the caller can call doFacesRequest directly without further initialization. |
java.lang.String |
getResponseCharacterSetEncoding(PortletRequest request)
Deprecated. -- no longer used or called by the GenericFacesPortlet
but retained in case a subclass has called it. |
java.lang.String |
getResponseContentType(PortletRequest request)
Deprecated. -- no longer used or called by the GenericFacesPortlet
but retained in case a subclass has called it. |
void |
init(PortletConfig portletConfig)
Initialize generic faces portlet from portlet.xml |
boolean |
isAutoDispatchEvents()
Returns the value of the portlet initialization parameter javax.portlet.faces.autoDispatchEvents if non-null or
true , otherwise. |
boolean |
isPreserveActionParameters()
Returns a boolean indicating whether or not the bridge should preserve all the action parameters in the subsequent renders that occur in the same scope. |
void |
processAction(ActionRequest request,
ActionResponse response)
|
void |
processEvent(EventRequest request,
EventResponse response)
|
void |
serveResource(ResourceRequest request,
ResourceResponse response)
Handles resource requests and dispatches to the Bridge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BRIDGE_CLASS
public static final java.lang.String DEFAULT_VIEWID
PortletMode
public static final java.lang.String DEFAULT_CONTENT_TYPE
public static final java.lang.String DEFAULT_CHARACTERSET_ENCODING
public static final java.lang.String BRIDGE_AUTO_DISPATCH_EVENTS
GenericFacesPortlet
overrides event processing by dispatching all events to the bridge or delegates
all event processing to the GenericPortlet
. Default is true
.
public static final java.lang.String BRIDGE_SERVICE_CLASSPATH
Constructor Detail |
---|
public GenericFacesPortlet()
Method Detail |
---|
public void init(PortletConfig portletConfig) throws PortletException
init
in interface Portlet
init
in class GenericPortlet
PortletException
public void destroy()
destroy
in interface Portlet
destroy
in class GenericPortlet
public void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException
doDispatch
in class GenericPortlet
PortletException
java.io.IOException
protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException
doEdit
in class GenericPortlet
PortletException
java.io.IOException
protected void doHelp(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException
doHelp
in class GenericPortlet
PortletException
java.io.IOException
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException
doView
in class GenericPortlet
PortletException
java.io.IOException
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException
processAction
in interface Portlet
processAction
in class GenericPortlet
PortletException
java.io.IOException
public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, java.io.IOException
serveResource
in interface ResourceServingPortlet
serveResource
in class GenericPortlet
PortletException
java.io.IOException
public BridgeEventHandler getBridgeEventHandler()
public BridgePublicRenderParameterHandler getBridgePublicRenderParameterHandler()
public java.util.List<java.lang.String> getExcludedRequestAttributes()
public boolean isPreserveActionParameters()
public java.lang.String getDefaultRenderKitId()
public java.lang.String getBridgeClassName()
@Deprecated public java.lang.String getResponseContentType(PortletRequest request)
GenericFacesPortlet
but retained in case a subclass has called it.
@Deprecated public java.lang.String getResponseCharacterSetEncoding(PortletRequest request)
GenericFacesPortlet
but retained in case a subclass has called it.
public java.util.Map getDefaultViewIdMap()
PortletMode
. The entry key is the name of the mode. The entry value is the default viewId
for that mode.
public boolean isAutoDispatchEvents()
javax.portlet.faces.autoDispatchEvents
if non-null or
true
, otherwise.
public Bridge getFacesBridge(PortletRequest request, PortletResponse response) throws PortletException
PortletException
- exception acquiring or initializting the bridge.public void processEvent(EventRequest request, EventResponse response) throws PortletException, java.io.IOException
processEvent
in interface EventPortlet
processEvent
in class GenericPortlet
PortletException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |