org.exoplatform.services.wsrp.consumer.impl
Class WSRPConsumerPlugin

java.lang.Object
  extended by org.exoplatform.services.wsrp.consumer.impl.WSRPConsumerPlugin
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin, PortletContainerPlugin

public class WSRPConsumerPlugin
extends Object
implements PortletContainerPlugin

Based on WSRPConsumerPortlet written by Benjamin Mestrallet Author: Roman Pedchenko roman.pedchenko@exoplatform.com.ua Author: Alexey Zavizionov alexey.zavizionov@exoplatform.com.ua


Field Summary
protected  WSRPAdminPortletDataImp adminPortlet
           
static String[] SUPPORTED_LOCALES
           
static String USER_SESSIONS_KEY
           
 
Constructor Summary
WSRPConsumerPlugin(org.exoplatform.container.ExoContainerContext context, ConsumerEnvironment consumer, PortletContainerService pcService, URLTemplateComposer templateComposer, PortletContainerConf pcConf, WSRPConfiguration conf)
           
 
Method Summary
 Map<String,PortletData> getAllPortletMetaData()
          Get all portlet metadata.
 ResourceBundle getBundle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String portletAppName, String portletName, Locale locale)
          Get bundle.
 String getDescription()
           
 String getName()
           
 String[] getPortalManagedPortletModes(String portletAppName, String portletName)
          Get portal managed portlet modes.
 PortletApp getPortletApp(String portletAppName)
          Get portlet app.
 Collection<String> getPortletAppNames()
          Get portlet app names.
 Collection<javax.portlet.PortletMode> getPortletModes(String portletAppName, String portletName, String markup)
          Get portlet modes.
 Map<String,String[]> getPortletPreference(Input input)
          Get portlet preference.
 javax.portlet.PortletPreferences getPortletPreferences(Input input)
          Get portlet preferences.
 Collection<javax.portlet.PortletMode> getSupportedPortletModes()
          Get supported portlet modes.
 Collection<javax.portlet.WindowState> getSupportedWindowStates()
          Get supported window states.
 Collection<javax.portlet.WindowState> getWindowStates(String portletAppName, String portletName, String markup)
          Get window states.
protected  void initConsumer()
           
 boolean isEventPayloadTypeMatches(String portletAppName, QName eventName, Serializable payload)
          Is event payload type matches.
 boolean isModeSuported(String portletAppName, String portletName, String markup, javax.portlet.PortletMode mode)
          Is mode suported.
 boolean isStateSupported(String portletAppName, String portletName, String markup, javax.portlet.WindowState state)
          Is state supported.
 ActionOutput processAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionInput input)
          Process action.
 EventOutput processEvent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, EventInput input)
          Process event.
 RenderOutput render(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RenderInput input)
          Render.
 void sendAttrs(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> attrs, String portletApplicationName)
          Send attrs.
 ResourceOutput serveResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ResourceInput input)
          Serve resource.
 void setDescription(String description)
          Overridden method.
 void setMajorVersion(int majorVersion)
          Set major version.
 void setMinorVersion(int minorVersion)
          Set minor version.
 void setName(String name)
          Overridden method.
 void setPortletPreference(Input input, Map<String,String> preferences)
          Set portlet preference.
 void setPortletPreference2(Input input, Map<String,String[]> preferences)
          Set portlet preference with string array.
 void setPortletPreferences(Input input, javax.portlet.PortletPreferences preferences)
          Set portlet preferences.
 void setProperties(Map properties)
          Set properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED_LOCALES

public static final String[] SUPPORTED_LOCALES

adminPortlet

protected WSRPAdminPortletDataImp adminPortlet

USER_SESSIONS_KEY

public static final String USER_SESSIONS_KEY
See Also:
Constant Field Values
Constructor Detail

WSRPConsumerPlugin

public WSRPConsumerPlugin(org.exoplatform.container.ExoContainerContext context,
                          ConsumerEnvironment consumer,
                          PortletContainerService pcService,
                          URLTemplateComposer templateComposer,
                          PortletContainerConf pcConf,
                          WSRPConfiguration conf)
Method Detail

setName

public void setName(String name)
Description copied from interface: PortletContainerPlugin
Overridden method.

Specified by:
setName in interface org.exoplatform.container.component.ComponentPlugin
Specified by:
setName in interface PortletContainerPlugin
Parameters:
name - name
See Also:
ComponentPlugin.setName(java.lang.String)

getName

public String getName()
Specified by:
getName in interface org.exoplatform.container.component.ComponentPlugin

setDescription

public void setDescription(String description)
Description copied from interface: PortletContainerPlugin
Overridden method.

Specified by:
setDescription in interface org.exoplatform.container.component.ComponentPlugin
Specified by:
setDescription in interface PortletContainerPlugin
Parameters:
description - description
See Also:
ComponentPlugin.setDescription(java.lang.String)

getDescription

public String getDescription()
Specified by:
getDescription in interface org.exoplatform.container.component.ComponentPlugin

setMajorVersion

public void setMajorVersion(int majorVersion)
Description copied from interface: PortletContainerPlugin
Set major version.

Specified by:
setMajorVersion in interface PortletContainerPlugin
Parameters:
majorVersion - major version

setMinorVersion

public void setMinorVersion(int minorVersion)
Description copied from interface: PortletContainerPlugin
Set minor version.

Specified by:
setMinorVersion in interface PortletContainerPlugin
Parameters:
minorVersion - minor vesrion

setProperties

public void setProperties(Map properties)
Description copied from interface: PortletContainerPlugin
Set properties.

Specified by:
setProperties in interface PortletContainerPlugin
Parameters:
properties - properties

initConsumer

protected void initConsumer()

getSupportedPortletModes

public Collection<javax.portlet.PortletMode> getSupportedPortletModes()
Description copied from interface: PortletContainerPlugin
Get supported portlet modes.

Specified by:
getSupportedPortletModes in interface PortletContainerPlugin
Returns:
app supported portlet modes

getSupportedWindowStates

public Collection<javax.portlet.WindowState> getSupportedWindowStates()
Description copied from interface: PortletContainerPlugin
Get supported window states.

Specified by:
getSupportedWindowStates in interface PortletContainerPlugin
Returns:
all supported window states

getPortletModes

public Collection<javax.portlet.PortletMode> getPortletModes(String portletAppName,
                                                             String portletName,
                                                             String markup)
Description copied from interface: PortletContainerPlugin
Get portlet modes.

Specified by:
getPortletModes in interface PortletContainerPlugin
Parameters:
portletAppName - app name
portletName - portlet name
markup - markup
Returns:
supported portlet modes

isModeSuported

public boolean isModeSuported(String portletAppName,
                              String portletName,
                              String markup,
                              javax.portlet.PortletMode mode)
Description copied from interface: PortletContainerPlugin
Is mode suported.

Specified by:
isModeSuported in interface PortletContainerPlugin
Parameters:
portletAppName - app name
portletName - portlet name
markup - markup
mode - portlet mode
Returns:
either the mode supported

getPortalManagedPortletModes

public final String[] getPortalManagedPortletModes(String portletAppName,
                                                   String portletName)
Description copied from interface: PortletContainerPlugin
Get portal managed portlet modes.

Specified by:
getPortalManagedPortletModes in interface PortletContainerPlugin
Returns:

getWindowStates

public Collection<javax.portlet.WindowState> getWindowStates(String portletAppName,
                                                             String portletName,
                                                             String markup)
Description copied from interface: PortletContainerPlugin
Get window states.

Specified by:
getWindowStates in interface PortletContainerPlugin
Parameters:
portletAppName - app name
portletName - portlet name
markup - markup
Returns:
supported window states

isStateSupported

public boolean isStateSupported(String portletAppName,
                                String portletName,
                                String markup,
                                javax.portlet.WindowState state)
Description copied from interface: PortletContainerPlugin
Is state supported.

Specified by:
isStateSupported in interface PortletContainerPlugin
Parameters:
portletAppName - app name
portletName - portlet name
markup - markup
state - window state
Returns:
either the state supported

isEventPayloadTypeMatches

public boolean isEventPayloadTypeMatches(String portletAppName,
                                         QName eventName,
                                         Serializable payload)
                                  throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Is event payload type matches.

Specified by:
isEventPayloadTypeMatches in interface PortletContainerPlugin
Parameters:
portletAppName - app name
eventName - event name
payload - payload
Returns:
either payload is of correct type
Throws:
PortletContainerException - exception

getAllPortletMetaData

public Map<String,PortletData> getAllPortletMetaData()
Description copied from interface: PortletContainerPlugin
Get all portlet metadata.

Specified by:
getAllPortletMetaData in interface PortletContainerPlugin
Returns:
all portlet metadata

getPortletApp

public PortletApp getPortletApp(String portletAppName)
Description copied from interface: PortletContainerPlugin
Get portlet app.

Specified by:
getPortletApp in interface PortletContainerPlugin
Parameters:
portletAppName - app name
Returns:
app object

getBundle

public ResourceBundle getBundle(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                String portletAppName,
                                String portletName,
                                Locale locale)
                         throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Get bundle.

Specified by:
getBundle in interface PortletContainerPlugin
Parameters:
request - request
response - response
portletAppName - app name
portletName - portlet name
locale - locale
Returns:
resource bundle
Throws:
PortletContainerException - exception

setPortletPreference

public void setPortletPreference(Input input,
                                 Map<String,String> preferences)
                          throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Set portlet preference.

Specified by:
setPortletPreference in interface PortletContainerPlugin
Parameters:
input - input
preferences - preferences
Throws:
PortletContainerException - exception

getPortletPreference

public Map<String,String[]> getPortletPreference(Input input)
Description copied from interface: PortletContainerPlugin
Get portlet preference.

Specified by:
getPortletPreference in interface PortletContainerPlugin
Parameters:
input - input
Returns:
portlet preferences

getPortletPreferences

public javax.portlet.PortletPreferences getPortletPreferences(Input input)
Description copied from interface: PortletContainerPlugin
Get portlet preferences.

Specified by:
getPortletPreferences in interface PortletContainerPlugin
Parameters:
input - input
Returns:
portlet preferences

setPortletPreference2

public void setPortletPreference2(Input input,
                                  Map<String,String[]> preferences)
                           throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Set portlet preference with string array.

Specified by:
setPortletPreference2 in interface PortletContainerPlugin
Parameters:
input - input
preferences - preferences
Throws:
PortletContainerException - exception

setPortletPreferences

public void setPortletPreferences(Input input,
                                  javax.portlet.PortletPreferences preferences)
                           throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Set portlet preferences.

Specified by:
setPortletPreferences in interface PortletContainerPlugin
Parameters:
input - input
preferences - preferences
Throws:
PortletContainerException - exception

processAction

public ActionOutput processAction(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  ActionInput input)
                           throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Process action.

Specified by:
processAction in interface PortletContainerPlugin
Parameters:
request - request
response - response
input - input
Returns:
output
Throws:
PortletContainerException - exception

processEvent

public EventOutput processEvent(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                EventInput input)
                         throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Process event.

Specified by:
processEvent in interface PortletContainerPlugin
Parameters:
request - request
response - response
input - input
Returns:
output
Throws:
PortletContainerException - exception

serveResource

public ResourceOutput serveResource(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    ResourceInput input)
                             throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Serve resource.

Specified by:
serveResource in interface PortletContainerPlugin
Parameters:
request - request
response - response
input - input
Returns:
output
Throws:
PortletContainerException - exception

render

public RenderOutput render(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           RenderInput input)
                    throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Render.

Specified by:
render in interface PortletContainerPlugin
Parameters:
request - request
response - response
input - input
Returns:
output
Throws:
PortletContainerException - exception

sendAttrs

public void sendAttrs(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      Map<String,Object> attrs,
                      String portletApplicationName)
               throws PortletContainerException
Description copied from interface: PortletContainerPlugin
Send attrs.

Specified by:
sendAttrs in interface PortletContainerPlugin
Parameters:
request - request
response - response
attrs - attrs
portletApplicationName - app name
Throws:
PortletContainerException - exception

getPortletAppNames

public final Collection<String> getPortletAppNames()
Get portlet app names.

Specified by:
getPortletAppNames in interface PortletContainerPlugin
Returns:
collection of string


Copyright © 2009 eXo Platform SAS. All Rights Reserved.