|
||||||||||
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.portlet.AbstractGenticsPortlet
public abstract class AbstractGenticsPortlet
AbstractGenticsPortlet is the base class for all gentics portlets. It implements basic functionality and should be extended to create new gentics portlets.
Nested Class Summary | |
---|---|
protected class |
AbstractGenticsPortlet.SubPluginEventBrokerProvider
Internal helper class to provide the event broker for nested plugins |
Field Summary | |
---|---|
static java.lang.String |
EVENT_ONCHANGE
constant for the name of the onChange event. |
protected org.apache.log4j.Logger |
logger
module logger object for generating log messages in different log-levels |
Constructor Summary | |
---|---|
AbstractGenticsPortlet(java.lang.String moduleId)
basic constructor that initializes the gentics portlet. |
Method Summary | |
---|---|
protected void |
addListener(java.lang.String eventPath)
Deprecated. use addListener(String, String) instead |
protected void |
addListener(java.lang.String eventPath,
java.lang.String actionCommand)
adds this module as listener to the portal |
protected void |
addPluginListener(java.lang.String pluginId,
EventHandler handler,
java.lang.String actionCommand)
adds an event handler to the plugin with the given id |
void |
afterProcessAction(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
perform required actions after GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
(cleaning up, etc.) |
void |
afterProcessPluginAction(java.lang.String pluginId,
javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse)
This method is called by the portal after processPluginAction(String, javax.portlet.ActionRequest, javax.portlet.ActionResponse) . |
boolean |
canResolve()
returns whether the module can resolve properties via calls to getProperty(String) . |
void |
destroy()
|
protected void |
doDispatch(javax.portlet.RenderRequest renderRequest,
javax.portlet.RenderResponse renderResponse)
|
protected void |
doEditPNode(javax.portlet.RenderRequest renderRequest,
javax.portlet.RenderResponse renderResponse)
This method is called when the gentics portlet is rendered in PortletMode GenticsPortletMode.EDITPNODE . |
protected void |
doFull(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
This method is called when the gentics portlet shall be rendered in portlet mode GenticsPortletMode.FULL . |
java.lang.Object |
get(java.lang.String key)
alias for getProperty(String) |
java.util.Map |
getContainerRuntimeOptions()
|
Datasource |
getDatasource(java.lang.String id)
Get a datasource by id. |
FileUploadProvider |
getFileUploadProvider()
Get a file upload provider for the module. |
java.lang.String |
getFullModuleType()
Get the full module type (including the application prefix) |
GenticsPortletContext |
getGenticsPortletContext()
returns the specific GenticsPortletContext of this Module |
GenticsImpInterface |
getImp(java.lang.String impId)
Get an instance of the imp with the given id. |
java.lang.String |
getModuleId()
return the unique if of this module |
java.lang.String |
getModuleType()
get the module type |
GenticsPlugin |
getPlugin(java.lang.String id)
returns the plugin that was registered via registerPlugin(String, GenticsPlugin) with the
given id |
protected java.lang.Object |
getPortalProperty(java.lang.String propertyPath)
returns the portal property (not implemented in abstractmodule) |
PropertyResolver |
getPortalPropertyResolver()
Get a property resolver for resolving portal properties |
javax.portlet.PortletRequest |
getPortletRequest()
get the current PortletRequest |
java.lang.Object |
getProperty(java.lang.String key)
resolve the given property key to a property. |
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)
Deprecated. use GenticsPortletContext.getTemplateProcessor(GenticsPortlet, PortletConfig) instead. |
java.lang.String |
getTitle(javax.portlet.RenderRequest renderRequest)
get the module title as defined in the pnode of the module |
void |
handleEvent(ActionEvent e)
handle an event this module listenes at |
protected void |
handlePortalEvent(EventRequest request,
EventResponse response)
event handler method that can be overwritten by classes extending AbstractGenticsPortlet. |
I18nString |
i18n(java.lang.String key)
Get a localized string for the given key. |
void |
init(javax.portlet.PortletConfig config)
|
protected void |
initSessionPropertyNames()
Initialize the session property names |
protected void |
onChanged()
this is the primitive brother of onParameterChanged() it is called by the default implementation of onParameterChanged and should update what the module is about to render, because one of its parameters has changed. |
protected void |
onLoad()
onload is called when the module is loaded for the first time. |
protected void |
onParameterChanged(java.lang.String parameterName,
ActionEvent e)
onParameterChanged() is called, whenever one of the paramters defined in the module-description's parameter section changes. |
void |
onPluginEvent(EventRequest eventRequest,
EventResponse eventResponse)
is called whenever a plugin is performing an event |
protected void |
onPrepareRender()
onPrepareRender() is called every time the portal is displayed - after action handling but before render stage (doView, doHelp, doFull, ....) this is the last chance for a portlet to change what the render method will display, and the last chance to trigger events. |
protected void |
onSessionCreate()
onSessionCreate() is called when the user enters the portal. |
void |
processPluginAction(java.lang.String pluginId,
javax.portlet.ActionRequest actionRequest,
javax.portlet.ActionResponse actionResponse)
Processes a plugins action. |
void |
propertyModified(java.lang.String path,
java.lang.String property,
java.lang.Object value)
This method is called by the PropertySetter when one of the
(sub-)properties of this object is modified |
void |
registerPlugin(java.lang.String id,
GenticsPlugin plugin)
registers a plugin to this module. |
void |
reloadModule()
This method is called if a module has to be reloaded. |
protected void |
removeListener(java.lang.String eventPath)
removes this module from the listeners collection |
java.lang.String |
renderPlugin(java.lang.String id,
javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
renders a specific plugin that was registered via registerPlugin(String, GenticsPlugin) before |
void |
returnFileUploadProvider()
return a previously via getFileUploadProvider() fetched file
upload provider to the portal. |
void |
returnTemplateProcessor(TemplateProcessor proc)
return an exclusive templateprocessor that was previously fetched via getTemplateProcessor(RenderRequest, RenderResponse) . |
void |
setModuleType(java.lang.String applicationPrefix,
java.lang.String moduleType)
Set the application prefix and portlet name |
boolean |
setProperty(java.lang.String propertyName,
java.lang.Object prop)
sets a specified property of the module. |
void |
setRequest(javax.portlet.PortletRequest request)
set the current PortletRequest. |
java.lang.String |
toString()
|
protected void |
triggerEvent(javax.portlet.PortletRequest request,
ActionEvent e)
convenience method to trigger a module event. |
void |
unregisterPlugin(java.lang.String id)
Unregister the plugin with the given id. |
Methods inherited from class javax.portlet.GenericPortlet |
---|
doEdit, doHeaders, doHelp, doView, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, init, processAction, processEvent, render, serveResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.gentics.api.portalnode.portlet.GenticsPortlet |
---|
getPortletConfig, getPortletContext |
Methods inherited from interface javax.portlet.Portlet |
---|
processAction, render |
Methods inherited from interface javax.portlet.ResourceServingPortlet |
---|
serveResource |
Field Detail |
---|
public static final java.lang.String EVENT_ONCHANGE
protected org.apache.log4j.Logger logger
Constructor Detail |
---|
public AbstractGenticsPortlet(java.lang.String moduleId) throws javax.portlet.PortletException
moduleId
- the module id of this module
javax.portlet.PortletException
- a portlet exception if anything problem during
execution occursMethod Detail |
---|
protected void initSessionPropertyNames()
protected java.lang.String getSessionPropertyName(java.lang.String propertyName)
propertyName
- property name
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 setRequest(javax.portlet.PortletRequest request)
setRequest
in interface GenticsPortlet
request
- PortletRequestpublic javax.portlet.PortletRequest getPortletRequest()
getPortletRequest
in interface GenticsPortlet
public java.lang.String getModuleId()
getModuleId
in interface GenticsPortlet
public java.lang.String getTitle(javax.portlet.RenderRequest renderRequest)
getTitle
in class javax.portlet.GenericPortlet
renderRequest
- a request for rendering this module
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface Resolvable
key
- the object key
public java.lang.Object get(java.lang.String key)
getProperty(String)
get
in interface Resolvable
key
- the object key
public boolean canResolve()
getProperty(String)
. this implementation always returns true
canResolve
in interface Resolvable
public boolean setProperty(java.lang.String propertyName, java.lang.Object prop)
setProperty
in interface Changeable
propertyName
- property nameprop
- property value
protected void doDispatch(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse) throws javax.portlet.PortletException, java.io.IOException
doDispatch
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
java.io.IOException
protected void doFull(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, java.io.IOException
GenticsPortletMode.FULL
.
request
- render requestresponse
- render response
javax.portlet.PortletException
java.io.IOException
public GenticsPortletContext getGenticsPortletContext()
getGenticsPortletContext
in interface GenticsPortlet
protected java.lang.Object getPortalProperty(java.lang.String propertyPath) throws UnknownPropertyException
propertyPath
- the path for the property
UnknownPropertyException
- is thrown if there is no such propertyprotected void removeListener(java.lang.String eventPath)
eventPath
- for this event pathprotected void addListener(java.lang.String eventPath)
addListener(String, String)
instead
eventPath
- event pathprotected void addListener(java.lang.String eventPath, java.lang.String actionCommand)
eventPath
- event pathactionCommand
- action command like "onSave" "onChange"protected void addPluginListener(java.lang.String pluginId, EventHandler handler, java.lang.String actionCommand)
pluginId
- id of the pluginhandler
- event handleractionCommand
- action command of the handled eventsprotected void triggerEvent(javax.portlet.PortletRequest request, ActionEvent e)
request
- portlet requeste
- event to be triggeredpublic final void handleEvent(ActionEvent e)
handleEvent
in interface EventHandler
e
- event to be handledprotected void handlePortalEvent(EventRequest request, EventResponse response) throws NoEventsAllowedException
handleEvent(ActionEvent)
.
request
- event requestresponse
- event response
NoEventsAllowedException
- is thrown if there are no events
currently allowedprotected void onPrepareRender()
protected void onLoad()
protected void onParameterChanged(java.lang.String parameterName, ActionEvent e)
parameterName
- the parameter that has changede
- the eventprotected void onChanged()
public GenticsPlugin getPlugin(java.lang.String id)
registerPlugin(String, GenticsPlugin)
with the
given id
getPlugin
in interface GenticsPluginServer
id
- plugin id
public void registerPlugin(java.lang.String id, GenticsPlugin plugin)
registerPlugin
in interface GenticsPluginServer
id
- id of the pluginplugin
- the new pluginpublic void unregisterPlugin(java.lang.String id)
GenticsPluginServer
unregisterPlugin
in interface GenticsPluginServer
id
- id of the plugin to unregisterpublic java.lang.String renderPlugin(java.lang.String id, javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, java.io.IOException
registerPlugin(String, GenticsPlugin)
before
renderPlugin
in interface GenticsPluginServer
id
- plugin idrequest
- portlet requestresponse
- portlet response
javax.portlet.PortletException
- is thrown if there is an error during execution
of processing
java.io.IOException
- is thrown if there is any i/o errorprotected void onSessionCreate()
public void onPluginEvent(EventRequest eventRequest, EventResponse eventResponse)
onPluginEvent
in interface GenticsPluginServer
eventRequest
- event requesteventResponse
- event responsepublic final void processPluginAction(java.lang.String pluginId, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException, java.io.IOException
processPluginAction
in interface GenticsPluginServer
pluginId
- plugin idactionRequest
- action requestactionResponse
- action response
javax.portlet.PortletException
- is thrown if there is any error during
processing
java.io.IOException
- is thrown if there is any i/o errorpublic void afterProcessPluginAction(java.lang.String pluginId, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse)
processPluginAction(String, javax.portlet.ActionRequest, javax.portlet.ActionResponse)
.
The call is forwarded to
GenticsPlugin.afterProcessAction(ActionRequest, ActionResponse)
of the addressed plugin
afterProcessPluginAction
in interface GenticsPluginServer
pluginId
- id of the pluginactionRequest
- action requestactionResponse
- action responsepublic void afterProcessAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
(cleaning up, etc.)
afterProcessAction
in interface GenticsPortlet
request
- action requestresponse
- action responsepublic FileUploadProvider getFileUploadProvider()
getFileUploadProvider
in interface GenticsPortlet
public void returnFileUploadProvider()
getFileUploadProvider()
fetched file
upload provider to the portal. This method is called in
afterProcessAction(ActionRequest, ActionResponse)
, so there is
no need to call it from within the module.
returnFileUploadProvider
in interface GenticsPortlet
public I18nString i18n(java.lang.String key)
i18n
in interface GenticsPortlet
key
- the key of the i18n item. the syntax is [a-z0-9.]+, and will
generate a warning if violated.
public PropertyResolver getPortalPropertyResolver()
public java.lang.String toString()
toString
in class java.lang.Object
public GenticsImpInterface getImp(java.lang.String impId)
impId
- id of the imp to get
protected void doEditPNode(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse) throws javax.portlet.PortletException, java.io.IOException
GenticsPortletMode.EDITPNODE
. This implementation shows a form
with a big textfield to modify the pnode
renderRequest
- render requestrenderResponse
- render response
javax.portlet.PortletException
java.io.IOException
public TemplateProcessor getTemplateProcessor(javax.portlet.RenderRequest renderRequest, javax.portlet.RenderResponse renderResponse)
GenticsPortletContext.getTemplateProcessor(GenticsPortlet, PortletConfig)
instead.
returnTemplateProcessor(TemplateProcessor)
after usage
getTemplateProcessor
in interface GenticsPortlet
renderRequest
- render requestrenderResponse
- render response
public void returnTemplateProcessor(TemplateProcessor proc)
getTemplateProcessor(RenderRequest, RenderResponse)
.
proc
- an recently fetched templateprocessor, which is not needed
any more.public Datasource getDatasource(java.lang.String id)
getDatasource
in interface GenticsPortlet
id
- id of Datasource as defined in portalconfiguration.
public void reloadModule()
GenticsPortlet
reloadModule
in interface GenticsPortlet
public java.lang.String getModuleType()
GenticsPortlet
getModuleType
in interface GenticsPortlet
public java.lang.String getFullModuleType()
GenticsPortlet
getFullModuleType
in interface GenticsPortlet
public void setModuleType(java.lang.String applicationPrefix, java.lang.String moduleType)
GenticsPortlet
setModuleType
in interface GenticsPortlet
applicationPrefix
- application prefixmoduleType
- module type (portlet name)public void destroy()
destroy
in interface javax.portlet.Portlet
destroy
in class javax.portlet.GenericPortlet
public java.util.Map getContainerRuntimeOptions()
getContainerRuntimeOptions
in interface javax.portlet.PortletConfig
getContainerRuntimeOptions
in class javax.portlet.GenericPortlet
public void propertyModified(java.lang.String path, java.lang.String property, java.lang.Object value)
PropertyModificationListener
PropertySetter
when one of the
(sub-)properties of this object is modified
propertyModified
in interface PropertyModificationListener
path
- path of the changed property (not containing the actual name of the property)property
- name of the changed propertyvalue
- new value of the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |