public class ViewPlugin extends AbstractGenticsPlugin implements Changeable
AbstractGenticsPlugin.SubPluginEventBrokerProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAXB_CONTEXTPATH
context path for the JAXB context
|
protected static java.io.FilenameFilter |
VIEW_DEFINITION_FILES
filename filter for views files
|
protected static java.lang.String |
VIEWS_CACHE_REGION
region for the views cache
|
protected static java.lang.String |
VIEWS_PROPERTIES
name of the view.properties file
|
logger
Constructor and Description |
---|
ViewPlugin() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkViewFiles()
Check all view files separately for configuration errors
|
protected void |
checkViewNode(org.w3c.dom.Node viewNode)
Check a single view node for configuration errors
|
java.lang.Boolean |
getDoubleClickProtection()
Get whether doubleclickprotection is on for all views
|
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.io.File |
getViewbasedir()
Returns the configured viewbasedir.
|
java.lang.Object |
getViewData(java.lang.String viewId,
java.lang.String componentId)
Convenience method to get the value of the specified component of the
specified view
|
java.util.Map |
getViewDataAsMap(java.lang.String viewId)
Get app data from the components of the given view
|
protected org.w3c.dom.Document |
getViewDocument(javax.xml.parsers.DocumentBuilder docBuilder,
java.io.File viewFile)
Get the view document either from the cache or parse the file content
|
protected com.gentics.portalnode.genericmodules.object.generator.Views |
getViews()
Method to get the currently set views in a threadsafe way.
|
void |
init() |
protected org.w3c.dom.Document |
parseFile(javax.xml.parsers.DocumentBuilder docBuilder,
java.io.File viewFile)
Parse the given file into a Document
|
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.
|
protected void |
removeViewDocumentFromCache(java.io.File viewFile)
Remove the view document from the cache (if present)
|
void |
render(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response) |
void |
serveResource(javax.portlet.ResourceRequest request,
javax.portlet.ResourceResponse response) |
void |
setActiveView(java.lang.String viewName)
set the active view by name.
|
void |
setDoubleclickprotection(java.lang.String doubleClickProtection)
Set the doubleclickprotection
|
void |
setModule(GenticsPortlet module)
Set the module which registeres and uses this plugin.
|
boolean |
setProperty(java.lang.String name,
java.lang.Object value)
Set (modify) the property name to resolve to the given value
|
void |
setViewbasedir(java.lang.String baseDirPath)
Set the path to the baseDir of te views definition files
|
boolean |
setViewData(java.lang.String viewId,
java.lang.String componentId,
java.lang.Object value)
Convenience method to set the value of the specified component of the
specified view
|
void |
setViews(org.w3c.dom.Node viewsDefinition)
Set the views configuration as Node.
|
addEventListener, afterProcessAction, afterProcessPluginAction, canResolve, get, getContainerRuntimeOptions, getEventBroker, getFileUploadProvider, getFullPluginName, getGenticsPortletContext, getId, getImp, getModule, getParameter, getPlugin, getSessionPropertyName, getTemplateProcessor, handleEvent, i18n, initSessionPropertyNames, logdebug, logdebug, logerror, logError, logFatal, logFatal, loginfo, loginfo, logwarn, logwarn, onPluginEvent, processPluginAction, registerPlugin, renderPlugin, returnFileUploadProvider, returnTemplateProcessor, setEventBrokerProvider, setId, setParameter, setPluginName, toString, triggerPluginEvent, unregisterPlugin
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processEvent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolve, get
protected static final java.lang.String VIEWS_PROPERTIES
protected static final java.lang.String VIEWS_CACHE_REGION
protected static final java.io.FilenameFilter VIEW_DEFINITION_FILES
public static final java.lang.String JAXB_CONTEXTPATH
public void render(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws javax.portlet.PortletException, java.io.IOException
render
in interface javax.portlet.Portlet
render
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
java.io.IOException
public void processAction(javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException, java.io.IOException
AbstractGenticsPlugin
processAction
in interface javax.portlet.Portlet
processAction
in class AbstractGenticsPlugin
javax.portlet.PortletException
java.io.IOException
Portlet.processAction(javax.portlet.ActionRequest,
javax.portlet.ActionResponse)
public void init() throws javax.portlet.PortletException
init
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
public void setViews(org.w3c.dom.Node viewsDefinition)
viewsDefinition
- views configurationpublic void setModule(GenticsPortlet module)
GenticsPlugin
AbstractGenticsPortlet.registerPlugin(String, GenticsPlugin)
and need not be called from outside.setModule
in interface GenticsPlugin
setModule
in class AbstractGenticsPlugin
module
- module using this pluginpublic java.lang.Object getProperty(java.lang.String key)
Resolvable
Resolvable.get(String)
.getProperty
in interface Resolvable
getProperty
in class AbstractGenticsPlugin
key
- key of the propertypublic boolean setProperty(java.lang.String name, java.lang.Object value) throws InsufficientPrivilegesException
Changeable
setProperty
in interface Changeable
name
- name of the property to set/modifyvalue
- (new) value to setInsufficientPrivilegesException
- when the property may not be
changedpublic java.lang.Object getViewData(java.lang.String viewId, java.lang.String componentId)
viewId
- id of the viewcomponentId
- id of the componentpublic boolean setViewData(java.lang.String viewId, java.lang.String componentId, java.lang.Object value)
viewId
- id of the viewcomponentId
- id of the componentvalue
- new value of the component. the object class depends on the
type of the component.public java.util.Map getViewDataAsMap(java.lang.String viewId)
viewId
- id of the viewpublic void setActiveView(java.lang.String viewName)
viewName
- name of the view.public void setViewbasedir(java.lang.String baseDirPath)
baseDirPath
- path to the views definition filespublic void setDoubleclickprotection(java.lang.String doubleClickProtection)
doubleClickProtection
- flag for doubleclickprotectionpublic java.lang.Boolean getDoubleClickProtection()
protected java.io.File getViewbasedir()
protected org.w3c.dom.Document getViewDocument(javax.xml.parsers.DocumentBuilder docBuilder, java.io.File viewFile) throws org.xml.sax.SAXException, java.io.IOException
docBuilder
- document builderviewFile
- org.xml.sax.SAXException
java.io.IOException
protected void removeViewDocumentFromCache(java.io.File viewFile)
viewFile
- view fileprotected org.w3c.dom.Document parseFile(javax.xml.parsers.DocumentBuilder docBuilder, java.io.File viewFile) throws org.xml.sax.SAXException, java.io.IOException
docBuilder
- document builderviewFile
- file to parseorg.xml.sax.SAXException
java.io.IOException
protected boolean checkViewFiles()
protected void checkViewNode(org.w3c.dom.Node viewNode) throws javax.xml.bind.JAXBException
viewNode
- view nodejavax.xml.bind.JAXBException
protected com.gentics.portalnode.genericmodules.object.generator.Views getViews()
public void serveResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response) throws javax.portlet.PortletException, java.io.IOException
serveResource
in interface javax.portlet.ResourceServingPortlet
serveResource
in class javax.portlet.GenericPortlet
javax.portlet.PortletException
java.io.IOException
Copyright © 2022 Gentics Software. All Rights Reserved.