org.infoglue.cms.applications.common.actions
Class ModelAction

java.lang.Object
  extended by org.infoglue.cms.applications.common.actions.WebworkAbstractAction
      extended by org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction
          extended by org.infoglue.cms.applications.common.actions.ModelAction
All Implemented Interfaces:
java.io.Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.ServletRequestAware, webwork.action.ServletResponseAware
Direct Known Subclasses:
CategoryAction, ContentCategoryAction, PropertiesCategoryAction

public abstract class ModelAction
extends InfoGlueAbstractAction

Base class to provide Actions with some common semantics for dealing with a specific domain object (model) and collections of domain objects (models).

Author:
Frank Febbraro (frank@phase2technology.com)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction
colorScheme
 
Fields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ModelAction()
           
 
Method Summary
protected abstract  Persistent createModel()
          Template method used by subclasses to provide a new instance of the model.
protected  java.lang.String doExecute()
          Default implementation for WebworkAbstractAction, subclasses shold feel free to override
 Persistent getModel()
           
 java.util.Collection getModels()
           
protected  void setModel(Persistent o)
           
protected  void setModels(java.util.Collection c)
           
protected  void validateModel()
          Perform the validation operation on the model
 
Methods inherited from class org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction
beginTransaction, closeDatabase, closeTransaction, commitTransaction, encode, getAllowPublicationEventFilter, getAnonymousPrincipal, getCMSBaseUrl, getColorScheme, getComponentRendererAction, getComponentRendererUrl, getCurrentURL, getDisableImageEditor, getInfoGluePrincipal, getLanguageCode, getLocale, getLogoutURL, getOriginalFullURL, getParameter, getPrincipalPropertyHashValues, getPrincipalPropertyValue, getPrincipalPropertyValue, getSessionTimeout, getSingleParameter, getThis, getToolId, getToolLocales, getURLBase, getUserName, hasAccessTo, hasAccessTo, rollbackTransaction, setColorScheme, setLanguageCode, setToolId
 
Methods inherited from class org.infoglue.cms.applications.common.actions.WebworkAbstractAction
doDefault, execute, getBrowserBean, getCurrentUrl, getError, getErrors, getHttpSession, getInfoGluePrincipal, getLocalizedString, getRequest, getResponse, getRoot, getSession, setCommand, setError, setServletRequest, setServletResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelAction

public ModelAction()
Method Detail

getModel

public Persistent getModel()

setModel

protected void setModel(Persistent o)

getModels

public java.util.Collection getModels()

setModels

protected void setModels(java.util.Collection c)

createModel

protected abstract Persistent createModel()
Template method used by subclasses to provide a new instance of the model.

Returns:
a new PersistentObject

validateModel

protected void validateModel()
                      throws ConstraintException
Perform the validation operation on the model

Throws:
ConstraintException - If a validation error exists

doExecute

protected java.lang.String doExecute()
                              throws java.lang.Exception
Default implementation for WebworkAbstractAction, subclasses shold feel free to override

Specified by:
doExecute in class WebworkAbstractAction
Throws:
java.lang.Exception


Copyright © 2005 InfoGlue.org All Rights Reserved.