org.ow2.weblab.portlet
Class WebLabPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.ow2.weblab.portlet.WebLabPortlet
All Implemented Interfaces:
javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet

public abstract class WebLabPortlet
extends javax.portlet.GenericPortlet

The Class WebLabPortlet.


Field Summary
static java.lang.String PORTLET_ACTION_NAMESPACE
          The Constant PORTLET_ACTION_NAMESPACE.
static java.lang.String PORTLET_REACTION_NAMESPACE
          The Constant PORTLET_REACTION_NAMESPACE.
static java.lang.String PORTLET_REDIRECT_NAMESPACE
          The Constant PORTLET_REDIRECT_NAMESPACE.
 
Constructor Summary
WebLabPortlet()
           
 
Method Summary
 void addRedirection(javax.xml.namespace.QName qn, java.lang.String url)
          Adds the redirection url to a specified action name.
 void deleteRedirection(javax.xml.namespace.QName qn)
          Delete redirection.
 java.util.Map<javax.xml.namespace.QName,javax.xml.namespace.QName> getActionEventMap()
          Gets the action event map.
 java.io.File getFile(java.lang.String localPath)
          Gets an accessible file from the Portlet context.
 javax.xml.namespace.QName getReaction(javax.xml.namespace.QName specifiedQName)
          Gets the reaction associated to the QName of the event received (from file portlet.xml in your project).
 java.util.Map<javax.xml.namespace.QName,javax.xml.namespace.QName> getReactionEventMap()
          Gets the reaction event map.
 java.util.Map<javax.xml.namespace.QName,java.lang.String> getRedirectEventMap()
          Gets the redirect event map.
 java.net.URL getURL(java.lang.String localPath)
          Gets the uRL.
 void init()
           
 void modifyRedirection(javax.xml.namespace.QName qn, java.lang.String url)
          Modify redirection.
 void sendEventForAction(java.lang.String action, org.ow2.weblab.core.model.Resource resource, javax.portlet.ActionResponse actionResponse)
          Send event for action.
 void sendEventForAction(java.lang.String action, org.ow2.weblab.core.model.Resource resource, javax.portlet.EventResponse eventResponse)
          Send event for action.
 void sendEventForActionAndRedirect(java.lang.String action, org.ow2.weblab.core.model.Resource resource, javax.portlet.ActionResponse actionResponse)
          Send event for action.
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processAction, processEvent, render, serveResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORTLET_ACTION_NAMESPACE

public static final java.lang.String PORTLET_ACTION_NAMESPACE
The Constant PORTLET_ACTION_NAMESPACE.

See Also:
Constant Field Values

PORTLET_REACTION_NAMESPACE

public static final java.lang.String PORTLET_REACTION_NAMESPACE
The Constant PORTLET_REACTION_NAMESPACE.

See Also:
Constant Field Values

PORTLET_REDIRECT_NAMESPACE

public static final java.lang.String PORTLET_REDIRECT_NAMESPACE
The Constant PORTLET_REDIRECT_NAMESPACE.

See Also:
Constant Field Values
Constructor Detail

WebLabPortlet

public WebLabPortlet()
Method Detail

init

public void init()
          throws javax.portlet.PortletException
Overrides:
init in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException

getReactionEventMap

public java.util.Map<javax.xml.namespace.QName,javax.xml.namespace.QName> getReactionEventMap()
Gets the reaction event map.

Returns:
the reaction event map

getActionEventMap

public java.util.Map<javax.xml.namespace.QName,javax.xml.namespace.QName> getActionEventMap()
Gets the action event map.

Returns:
the action event map

getRedirectEventMap

public java.util.Map<javax.xml.namespace.QName,java.lang.String> getRedirectEventMap()
Gets the redirect event map.

Returns:
the redirect event map

getReaction

public javax.xml.namespace.QName getReaction(javax.xml.namespace.QName specifiedQName)
Gets the reaction associated to the QName of the event received (from file portlet.xml in your project).

Parameters:
specifiedQName - the specified q name
Returns:
the reaction

sendEventForAction

public void sendEventForAction(java.lang.String action,
                               org.ow2.weblab.core.model.Resource resource,
                               javax.portlet.ActionResponse actionResponse)
Send event for action.

Parameters:
action - the action associated to a QName in the portlet.xml file
resource - the resource to send in the event
actionResponse - the response of the processAction
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

sendEventForAction

public void sendEventForAction(java.lang.String action,
                               org.ow2.weblab.core.model.Resource resource,
                               javax.portlet.EventResponse eventResponse)
Send event for action.

Parameters:
action - the action associated to a QName in the portlet.xml file
resource - the resource to send in the event
eventResponse - the response of the processEvent
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

sendEventForActionAndRedirect

public void sendEventForActionAndRedirect(java.lang.String action,
                                          org.ow2.weblab.core.model.Resource resource,
                                          javax.portlet.ActionResponse actionResponse)
                                   throws java.io.IOException
Send event for action.

Parameters:
action - the action associated to a QName in the portlet.xml file
resource - the resource to send in the event
actionResponse - the response of the processAction WARNING : the method used for auto redirection is sendRedirect, then it is not allow to setRenderParameter for instance. For more information look for Exceptions that sendRedirect can launch.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

addRedirection

public void addRedirection(javax.xml.namespace.QName qn,
                           java.lang.String url)
Adds the redirection url to a specified action name.

Parameters:
qn - the qn (PORTLET_REDIRECT_NAMESPACE+action)
url - the url (url of the page in the portal)

modifyRedirection

public void modifyRedirection(javax.xml.namespace.QName qn,
                              java.lang.String url)
Modify redirection. If the QName already exists the url is overwrited, otherwise an error is logged

Parameters:
qn - the qn (PORTLET_REDIRECT_NAMESPACE+action)
url - the url (url of the page in the portal)

deleteRedirection

public void deleteRedirection(javax.xml.namespace.QName qn)
Delete redirection. If the QName already exists the url is deleted, otherwise an error is logged

Parameters:
qn - the qn

getFile

public java.io.File getFile(java.lang.String localPath)
                     throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Gets an accessible file from the Portlet context.

Parameters:
localPath - the local path
Returns:
the file
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException - the web lab checked exception

getURL

public java.net.URL getURL(java.lang.String localPath)
                    throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Gets the uRL.

Parameters:
localPath - the local path
Returns:
the uRL
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException - the web lab checked exception


Copyright © 2004-2011. All Rights Reserved.