|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.portlet.GenericPortlet org.apache.wicket.protocol.http.portlet.WicketPortlet
public class WicketPortlet
Adapter between the Portlet world requests and the internal Wicket engine. I.e. simulates the web/servlet environment for Wicket, while it's actually running as a Portlet.
It receives a portlet request and dispatches to a a Wicket filter; wrapping the servlet context, request and response objects; intercepts response writing (especially urls and redirects) and rewrites and adapts the output to accommodate the portlet requirements.
The WicketPortlet is configured (using an initParameter) against a specific filter path, e.g. Wicket WebApplication. The WicketPortlet maintains a parameter for the current Wicket page URL being requested as a URL parameter, based against the filter path (e.g. fully qualified to the context path). When a request (action, render or direct resource/ajax call) is received by the WicketPortlet, it dispatches it to Wicket core as a filter request using the provided Wicket page URL parameter.
WICKET_URL_PORTLET_PARAMETER
,
WicketFilter
Field Summary | |
---|---|
static String |
CONFIG_PARAM_PREFIX
FIXME javadoc |
static String |
PARAM_ACTION_PAGE
Name of portlet init parameter for Action page |
static String |
PARAM_CUSTOM_PAGE
Name of portlet init parameter for Custom page |
static String |
PARAM_EDIT_PAGE
Name of portlet init parameter for Edit page |
static String |
PARAM_HELP_PAGE
Name of portlet init parameter for Edit page |
static String |
PARAM_VIEW_PAGE
Name of portlet init parameter for View page |
static String |
RESPONSE_STATE_ATTR
Marker used as key for the WicketResponseState object stored as a request attribute. |
static String |
WICKET_FILTER_PATH
FIXME javadoc |
static String |
WICKET_FILTER_PATH_PARAM
FIXME javadoc |
static String |
WICKET_FILTER_QUERY
FIXME javadoc |
static String |
WICKET_PORTLET_PROPERTIES
FIXME javadoc |
static String |
WICKET_URL_PORTLET_PARAMETER
FIXME javadoc |
static String |
WICKET_URL_PORTLET_PARAMETER_ATTR
FIXME javadoc |
Constructor Summary | |
---|---|
WicketPortlet()
|
Method Summary | |
---|---|
protected String |
buildWicketFilterPath(String filterPath)
|
protected String |
buildWicketFilterQuery(String wicketFilterPath)
|
void |
destroy()
|
protected void |
doCustom(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected void |
doEdit(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected void |
doHelp(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected void |
doView(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected String |
fixWicketUrl(String url,
String wicketFilterPath,
String wicketFilterQuery)
FIXME javadoc |
protected String |
getDefaultPage(String pageType)
|
protected String |
getWicketConfigParameter(javax.portlet.PortletRequest request,
String paramName,
String defaultValue)
FIXME javadoc - definitely needs explanation - why is no lookup attempted? |
protected String |
getWicketFilterPath()
|
protected Properties |
getWicketPortletProperties(Properties properties)
Loads the Wicket Portlet properties file off the class path. |
protected String |
getWicketURL(javax.portlet.PortletRequest request,
String pageType,
String defaultPage)
Retrieves the Wicket URL from the request object as a request parameter, or if none exists returns the default URL. |
protected String |
getWicketUrlPortletParameter(javax.portlet.PortletRequest request)
|
void |
init(javax.portlet.PortletConfig config)
|
void |
processAction(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected void |
processActionResponseState(String wicketURL,
String wicketFilterPath,
String wicketFilterQuery,
javax.portlet.PortletRequest request,
javax.portlet.ActionResponse response,
WicketResponseState responseState)
Handles redirects set from processing the action. |
protected void |
processRequest(javax.portlet.PortletRequest request,
javax.portlet.PortletResponse response,
String pageType)
Consumes and processes all portlet requests. |
void |
serveResource(javax.portlet.ResourceRequest request,
javax.portlet.ResourceResponse response)
Delegates to #processRequest(PortletRequest, PortletResponse, String, String) . |
protected void |
validateDefaultPages(Map defaultPages,
String wicketFilterPath,
String wicketFilterQuery)
FIXME javadoc |
Methods inherited from class javax.portlet.GenericPortlet |
---|
doDispatch, doHeaders, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processEvent, render |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String WICKET_URL_PORTLET_PARAMETER
The prefix for the parameter name for storing Wicket URLs.
The actual Wicket URLs generated by Wicket are passed around in portal URLs, encoded by the portal (as a URL parameter of this name). The Wicket URL is later decoded on subsequent requests, from the portal URL, so that we know where to route the request, once it's passed out of the 'portal' realm and into the 'Wicket' realm.
This is also used in generating links by PortletRequestContext
in generating links,
as the links have to be portal encoded links, but must also still contain the original wicket
url for use by Wicket (e.g. PortletRequestContext.encodeActionURL(java.lang.CharSequence)
).
The default/buildin name of the parameter which stores the name of the wicket url is stored
under WICKET_URL_PORTLET_PARAMETER_ATTR
. It will be stored suffixed with the current
portlet mode (e.g. view), so that render requests now what mode to render.
PortletRequestContext
,
WICKET_URL_PORTLET_PARAMETER_ATTR
,
Constant Field Valuespublic static final String WICKET_URL_PORTLET_PARAMETER_ATTR
The attribute name (key) to store the Wicket URL parameter name under.
WICKET_URL_PORTLET_PARAMETER
,
getWicketURL(javax.portlet.PortletRequest, java.lang.String, java.lang.String)
public static final String WICKET_FILTER_PATH_PARAM
public static final String CONFIG_PARAM_PREFIX
public static final String RESPONSE_STATE_ATTR
public static final String WICKET_PORTLET_PROPERTIES
public static final String WICKET_FILTER_PATH
public static final String WICKET_FILTER_QUERY
public static final String PARAM_ACTION_PAGE
public static final String PARAM_CUSTOM_PAGE
public static final String PARAM_EDIT_PAGE
public static final String PARAM_HELP_PAGE
public static final String PARAM_VIEW_PAGE
Constructor Detail |
---|
public WicketPortlet()
Method Detail |
---|
public void init(javax.portlet.PortletConfig config) throws javax.portlet.PortletException
init
in interface javax.portlet.Portlet
init
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
public void destroy()
destroy
in interface javax.portlet.Portlet
destroy
in class javax.portlet.GenericPortlet
protected String getDefaultPage(String pageType)
pageType
- the mode of the portlet page, e.g. VIEW, EDIT etc...
protected String buildWicketFilterPath(String filterPath)
protected String buildWicketFilterQuery(String wicketFilterPath)
protected String fixWicketUrl(String url, String wicketFilterPath, String wicketFilterQuery)
Corrects the incoming URL if the old home page style, or if it's missing the filter path prefix.
url
- the URL to fixwicketFilterPath
- wicketFilterQuery
-
protected void validateDefaultPages(Map defaultPages, String wicketFilterPath, String wicketFilterQuery)
Registers the default pages and their URLs for the different PortletMode
s. Also
corrects and slightly incorrect URLs (see fixWicketUrl(String, String, String)
).
If no specific page was specified for a given portlet mode (VIEW, EDIT etc) then the page for that mode is set to be the same page as that of the VIEW mode.
defaultPages
- wicketFilterPath
- wicketFilterQuery
- PortletMode
,
fixWicketUrl(String, String, String)
protected Properties getWicketPortletProperties(Properties properties) throws javax.portlet.PortletException
properties
- appends the portlet properties to
javax.portlet.PortletException
- if loading the properties failsprotected String getWicketConfigParameter(javax.portlet.PortletRequest request, String paramName, String defaultValue)
request
- paramName
- defaultValue
-
protected String getWicketUrlPortletParameter(javax.portlet.PortletRequest request)
request
-
WICKET_URL_PORTLET_PARAMETER
protected String getWicketFilterPath()
protected String getWicketURL(javax.portlet.PortletRequest request, String pageType, String defaultPage)
This url is then used to pass on to the matching WicketFilter
to process, by way of
RequestDispatcher
via the filters context path.
A "parameter" is a form field name/value pair passed from the HTML side of the world. Its value is a String.
An "attribute" is a Java object name/value pair passed only through the internal JavaServer processes. (I.e. it can come from a JSP or servlet but not an HTML page.) Its value is an Object.
request
- pageType
- defaultPage
- url of the default page
PortletRequestContext.getLastEncodedPath()
protected void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
doView
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
IOException
#processRequest(PortletRequest, PortletResponse, String, String)
protected void doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
doEdit
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
IOException
#processRequest(PortletRequest, PortletResponse, String, String)
protected void doHelp(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
doHelp
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
IOException
#processRequest(PortletRequest, PortletResponse, String, String)
protected void doCustom(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
javax.portlet.PortletException
IOException
#processRequest(PortletRequest, PortletResponse, String, String)
public void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
Stores the ActionResponse
so that PortletEventService#broadcast
can send
events using StateAwareResponse.setEvent(javax.xml.namespace.QName, java.io.Serializable)
processAction
in interface javax.portlet.Portlet
processAction
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
IOException
PortletEventService#broadcastToPortletListeners
,
#processRequest(PortletRequest, PortletResponse, String, String)
public void serveResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response) throws javax.portlet.PortletException, IOException
#processRequest(PortletRequest, PortletResponse, String, String)
.
serveResource
in interface javax.portlet.ResourceServingPortlet
serveResource
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
IOException
#processRequest(PortletRequest, PortletResponse, String, String)
protected void processRequest(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, String pageType) throws javax.portlet.PortletException, IOException
request
- response
- requestType
- pageType
-
javax.portlet.PortletException
IOException
protected void processActionResponseState(String wicketURL, String wicketFilterPath, String wicketFilterQuery, javax.portlet.PortletRequest request, javax.portlet.ActionResponse response, WicketResponseState responseState) throws javax.portlet.PortletException, IOException
wicketURL
- wicketFilterPath
- wicketFilterQuery
- request
- response
- responseState
-
javax.portlet.PortletException
IOException
IRequestCycleSettings.REDIRECT_TO_RENDER
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |