|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.portlet.GenericPortlet
com.gentics.api.portalnode.plugin.AbstractGenticsPlugin
public abstract class AbstractGenticsPlugin
Abstract class that provides a default implementation of the most important plugin methods and should be used as base class for creating new plugins
Nested Class Summary | |
---|---|
protected class |
AbstractGenticsPlugin.SubPluginEventBrokerProvider
Internal helper class to provide the event broker for nested plugins |
Field Summary | |
---|---|
protected org.apache.log4j.Logger |
logger
logger object |
Constructor Summary | |
---|---|
AbstractGenticsPlugin()
|
Method Summary | |
---|---|
void |
addEventListener(EventHandler handler,
java.lang.String eventPath)
Add the given event handler as listener for the given event path |
void |
afterProcessAction(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
This method is called by the portal after calling Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
on this plugin. |
void |
afterProcessPluginAction(java.lang.String PluginID,
javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse)
process the afterProcessAction of the given plugin |
boolean |
canResolve()
Check whether the resolvable is capable of resolving properties right now. |
java.lang.Object |
get(java.lang.String key)
Get the property named by key or null if the property does not exist or is not set. |
java.util.Map |
getContainerRuntimeOptions()
|
EventBroker |
getEventBroker()
Returns the current event broker of this plugin |
FileUploadProvider |
getFileUploadProvider()
Get an instance of a FileUploadProvider. |
java.lang.String |
getFullPluginName()
Get the full plugin name (including the portletapplication prefix) |
GenticsPortletContext |
getGenticsPortletContext()
Returns the specific GenticsPortletContext of this plugin |
java.lang.String |
getId()
Get the plugin id |
GenticsImpInterface |
getImp(java.lang.String impId)
Get an imp |
GenticsPortlet |
getModule()
Get the module which registeres and uses this plugin |
java.lang.Object |
getParameter(java.lang.String parameter)
Get a parameter of this plugin |
GenticsPlugin |
getPlugin(java.lang.String Id)
returns a plugin from the server (if registered), or else null |
java.lang.Object |
getProperty(java.lang.String key)
Get the property named by key or null if the property does not exist or is not set. |
protected java.lang.String |
getSessionPropertyName(java.lang.String propertyName)
Get the session property name for the given property name (prefix it with the form name) |
TemplateProcessor |
getTemplateProcessor(javax.portlet.RenderRequest renderRequest,
javax.portlet.RenderResponse renderResponse)
Get a template processor that can be used to render the plugin based on the given renderRequest and renderResponse. |
void |
handleEvent(ActionEvent e)
Method to handle the given actionevent |
I18nString |
i18n(java.lang.String key)
Get a localized string. |
protected void |
initSessionPropertyNames()
Initialize the session property names |
void |
logdebug(java.lang.Object message)
log fine-grained informational events that are most useful to debug an application. |
void |
logdebug(java.lang.Object message,
java.lang.Throwable t)
log fine-grained informational events that are most useful to debug an application. |
void |
logerror(java.lang.Object message)
log error events that might still allow the application to continue running. |
void |
logError(java.lang.Object message,
java.lang.Throwable t)
log error events that might still allow the application to continue running. |
void |
logFatal(java.lang.Object message)
log very severe error events that will presumably lead the application to abort. |
void |
logFatal(java.lang.Object message,
java.lang.Throwable t)
log very severe error events that will presumably lead the application to abort. |
void |
loginfo(java.lang.Object message)
log informational messages that highlight the progress of the application at coarse-grained level. |
void |
loginfo(java.lang.Object message,
java.lang.Throwable t)
log informational messages that highlight the progress of the application at coarse-grained level. |
void |
logwarn(java.lang.Object message)
log potentially harmful situations. |
void |
logwarn(java.lang.Object message,
java.lang.Throwable t)
log potentially harmful situations. |
void |
onPluginEvent(EventRequest eventRequest,
EventResponse eventResponse)
onPluginEvent will be called everytime a plugin triggers an event |
void |
processAction(javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse)
Copied from Java Portlet API: Called by the portlet container to allow the portlet to process an action request. |
void |
processPluginAction(java.lang.String pluginID,
javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse)
processes a plugin action the pluginserver needs to distribute actions to its plugins |
void |
registerPlugin(java.lang.String Id,
GenticsPlugin plugin)
allows to register plugins to the server so he can further distribute events and forward actions as well as provide rendering facility |
java.lang.String |
renderPlugin(java.lang.String Id,
javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
renders a plugin specified by the pluginid it provides the plugin with a adapted request and response so it can only see its own variables |
void |
returnFileUploadProvider()
Return the FileUploadProvider which was previously fetched with getFileUploadProvider() to its source (the context) |
void |
returnTemplateProcessor(TemplateProcessor proc)
Return the template processor previously fetched via getTemplateProcessor(RenderRequest, RenderResponse) . |
void |
setEventBrokerProvider(EventBrokerProvider eventBrokerProvider)
Set the event broker provider |
void |
setId(java.lang.String ID)
Set the id of the plugin. |
void |
setModule(GenticsPortlet module)
Set the module which registeres and uses this plugin. |
void |
setParameter(java.lang.String parameter,
java.lang.Object value)
Sets a parameter of this plugin |
void |
setPluginName(java.lang.String applicationPrefix,
java.lang.String pluginName)
Set the plugin name |
java.lang.String |
toString()
|
protected void |
triggerPluginEvent(ActionEvent e)
Trigger a plugin event using the event broker |
void |
unregisterPlugin(java.lang.String id)
Unregister the plugin with the given id. |
Methods inherited from class javax.portlet.GenericPortlet |
---|
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, init, processEvent, render, serveResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.portlet.Portlet |
---|
destroy, init, render |
Methods inherited from interface javax.portlet.PortletConfig |
---|
getDefaultNamespace, getInitParameter, getInitParameterNames, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales |
Field Detail |
---|
protected org.apache.log4j.Logger logger
Constructor Detail |
---|
public AbstractGenticsPlugin()
Method Detail |
---|
protected void initSessionPropertyNames()
protected java.lang.String getSessionPropertyName(java.lang.String propertyName)
propertyName
- property name
public boolean canResolve()
Resolvable
Resolvable.getProperty(String)
or Resolvable.get(String)
will return null.
canResolve
in interface Resolvable
public java.lang.Object getProperty(java.lang.String key)
Resolvable
Resolvable.get(String)
.
getProperty
in interface Resolvable
key
- key of the property
public java.lang.Object get(java.lang.String key)
Resolvable
get
in interface Resolvable
key
- key of the property
public void handleEvent(ActionEvent e)
EventHandler
handleEvent
in interface EventHandler
e
- event to be handledpublic void addEventListener(EventHandler handler, java.lang.String eventPath)
handler
- event handlereventPath
- event path the handler is listeningpublic EventBroker getEventBroker()
getEventBroker
in interface EventBrokerProvider
getEventBroker
in interface GenticsPlugin
public void setEventBrokerProvider(EventBrokerProvider eventBrokerProvider)
GenticsPlugin
setEventBrokerProvider
in interface GenticsPlugin
public void setParameter(java.lang.String parameter, java.lang.Object value)
parameter
- name of the parametervalue
- parameter valuepublic java.lang.Object getParameter(java.lang.String parameter)
parameter
- name of the parameter
public void processAction(javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException, java.io.IOException
processAction
in interface javax.portlet.Portlet
processAction
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
java.io.IOException
Portlet.processAction(javax.portlet.ActionRequest,
javax.portlet.ActionResponse)
public void afterProcessAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
GenticsPlugin
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
on this plugin. The plugin implementation of this method may do some
cleanup after processing the action.
afterProcessAction
in interface GenticsPlugin
request
- action requestresponse
- action responseprotected void triggerPluginEvent(ActionEvent e)
e
- the event to be triggeredpublic void processPluginAction(java.lang.String pluginID, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException, java.io.IOException
GenticsPluginServer
processPluginAction
in interface GenticsPluginServer
pluginID
- pluginidactionRequest
- requestactionResponse
- response
javax.portlet.PortletException
- any processing problem
java.io.IOException
- any i/o problempublic void afterProcessPluginAction(java.lang.String PluginID, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException, java.io.IOException
GenticsPluginServer
afterProcessPluginAction
in interface GenticsPluginServer
PluginID
- pluginidactionRequest
- requestactionResponse
- response
javax.portlet.PortletException
java.io.IOException
public void registerPlugin(java.lang.String Id, GenticsPlugin plugin)
GenticsPluginServer
registerPlugin
in interface GenticsPluginServer
Id
- the pluginidplugin
- the pluginpublic void unregisterPlugin(java.lang.String id)
GenticsPluginServer
unregisterPlugin
in interface GenticsPluginServer
id
- id of the plugin to unregisterpublic void onPluginEvent(EventRequest eventRequest, EventResponse eventResponse)
GenticsPluginServer
onPluginEvent
in interface GenticsPluginServer
eventRequest
- the event requesteventResponse
- the event responsepublic GenticsPlugin getPlugin(java.lang.String Id)
GenticsPluginServer
getPlugin
in interface GenticsPluginServer
Id
- pluginid
public java.lang.String renderPlugin(java.lang.String Id, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, java.io.IOException
GenticsPluginServer
renderPlugin
in interface GenticsPluginServer
Id
- plugin idrequest
- the request of the module callingresponse
- the response of the calling module
javax.portlet.PortletException
- an exception if anything in terms of processing
goes wrong
java.io.IOException
- any i/o problemspublic void setId(java.lang.String ID)
GenticsPlugin
setId
in interface GenticsPlugin
ID
- id of the pluginpublic GenticsImpInterface getImp(java.lang.String impId)
impId
- id of the imp
public java.lang.String getId()
public GenticsPortletContext getGenticsPortletContext()
public FileUploadProvider getFileUploadProvider()
returnFileUploadProvider()
.
getFileUploadProvider
in interface GenticsPlugin
public void returnFileUploadProvider()
getFileUploadProvider()
to its source (the context)
returnFileUploadProvider
in interface GenticsPlugin
public void setModule(GenticsPortlet module)
GenticsPlugin
AbstractGenticsPortlet.registerPlugin(String, GenticsPlugin)
and need not be called from outside.
setModule
in interface GenticsPlugin
module
- module using this pluginpublic GenticsPortlet getModule()
GenticsPlugin
getModule
in interface GenticsPlugin
public TemplateProcessor getTemplateProcessor(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse)
returnTemplateProcessor(TemplateProcessor)
after usage.
renderRequest
- render requestrenderResponse
- render response
public void returnTemplateProcessor(TemplateProcessor proc)
getTemplateProcessor(RenderRequest, RenderResponse)
.
proc
- template processorpublic void logFatal(java.lang.Object message, java.lang.Throwable t)
message
- the message object to log.t
- the exception to log, including its stack trace.public void logFatal(java.lang.Object message)
message
- the message object to log.public void logError(java.lang.Object message, java.lang.Throwable t)
message
- the message object to log.t
- the exception to log, including its stack trace.public void logerror(java.lang.Object message)
message
- the message object to log.public void logwarn(java.lang.Object message, java.lang.Throwable t)
message
- the message object to log.t
- the exception to log, including its stack trace.public void logwarn(java.lang.Object message)
message
- the message object to log.public void loginfo(java.lang.Object message, java.lang.Throwable t)
message
- the message object to log.t
- the exception to log, including its stack trace.public void loginfo(java.lang.Object message)
message
- the message object to log.public void logdebug(java.lang.Object message, java.lang.Throwable t)
message
- the message object to log.t
- the exception to log, including its stack trace.public void logdebug(java.lang.Object message)
message
- the message object to log.public I18nString i18n(java.lang.String key)
key
- the key of the i18n item. the syntax is [a-z0-9.]+, and will
generate a warning if violated.
public java.lang.String getFullPluginName()
GenticsPlugin
getFullPluginName
in interface GenticsPlugin
public void setPluginName(java.lang.String applicationPrefix, java.lang.String pluginName)
GenticsPlugin
setPluginName
in interface GenticsPlugin
applicationPrefix
- application prefixpluginName
- plugin namepublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map getContainerRuntimeOptions()
getContainerRuntimeOptions
in interface javax.portlet.PortletConfig
getContainerRuntimeOptions
in class javax.portlet.GenericPortlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |