org.openxava.actions
Class SimpleTemplaterAction

java.lang.Object
  extended by org.openxava.actions.BaseAction
      extended by org.openxava.actions.ViewBaseAction
          extended by org.openxava.actions.TabBaseAction
              extended by org.openxava.actions.SimpleTemplaterAction
All Implemented Interfaces:
IAction, IChangeModeAction, IModelAction, IModuleContextAction, IRequestAction
Direct Known Subclasses:
SimpleHTMLReportAction

public class SimpleTemplaterAction
extends TabBaseAction
implements IModelAction

Author:
Laurent Wibaux

Field Summary
static java.lang.String COLLECTION
           
protected static int MAX_DEPTH
           
 
Fields inherited from interface org.openxava.actions.IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT
 
Constructor Summary
SimpleTemplaterAction()
           
 
Method Summary
 void execute()
           
protected  java.util.Map<java.lang.String,java.lang.String> getClassParameters(java.lang.Class<?> aClass, int maxDepth)
          Get a map of [name, ""] for the passed class
protected static java.util.Vector<java.util.Map<java.lang.String,java.lang.String>> getCollectionParametersList(java.util.Collection<?> collection)
          Get a list of maps of [name, value] for each one of the objects in the passed collection
protected static java.util.Vector<java.util.Map<java.lang.String,java.lang.String>> getCollectionParametersList(java.util.Collection<?> collection, int maxDepth)
          Get a list of maps of [name, value] for each one of the objects in the passed collection
 java.lang.String getCollectionTable(java.lang.Class<?> collectionEntityClass, java.lang.String collectionName)
           
 java.lang.String getCollectionTable(java.lang.Class<?> collectionEntityClass, java.lang.String collectionName, int maxDepth)
           
 java.lang.String getDepth()
           
protected static java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity)
          Get a map of [name, value] for the passed object
protected  java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity, int maxDepth)
          Get a map of [name, value] for the passed object
protected  java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity, java.lang.String parentName, int maxDepth)
          Get a map of [name, value] for the passed object
 java.lang.String getFieldsTable(java.lang.Object entity, int depth)
           
protected  java.util.Map<java.lang.String,java.lang.Object> getParameters()
           
 java.lang.String getTemplate()
           
 java.lang.String getValuesTable(java.lang.Object entity, int depth)
           
 void setDepth(java.lang.String depth)
           
 void setModel(java.lang.String modelName)
           
 void setTemplate(java.lang.String template)
           
 
Methods inherited from class org.openxava.actions.TabBaseAction
getCollection, getRow, getSelected, getTab, setCollection, setRow, setViewObject
 
Methods inherited from class org.openxava.actions.ViewBaseAction
closeDialog, getModelName, getPreviousView, getPreviousViews, getView, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showDialog, showNewView, showView
 
Methods inherited from class org.openxava.actions.BaseAction
addActions, addError, addErrors, addInfo, addMessage, addMessages, addWarning, clearActions, executeAfter, executeBefore, getContext, getEnvironment, getErrors, getLocale, getManager, getMessages, getNextMode, getRequest, removeActions, returnToPreviousControllers, setContext, setDefaultControllers, setEnvironment, setErrors, setMessages, setNextMode, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openxava.actions.IAction
getErrors, getMessages, setEnvironment, setErrors, setMessages
 

Field Detail

COLLECTION

public static final java.lang.String COLLECTION
See Also:
Constant Field Values

MAX_DEPTH

protected static final int MAX_DEPTH
See Also:
Constant Field Values
Constructor Detail

SimpleTemplaterAction

public SimpleTemplaterAction()
Method Detail

execute

public void execute()
             throws java.lang.Exception
Specified by:
execute in interface IAction
Throws:
java.lang.Exception

getParameters

protected java.util.Map<java.lang.String,java.lang.Object> getParameters()
                                                                  throws java.lang.Exception
Throws:
java.lang.Exception

setModel

public void setModel(java.lang.String modelName)
Specified by:
setModel in interface IModelAction

getFieldsTable

public java.lang.String getFieldsTable(java.lang.Object entity,
                                       int depth)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getValuesTable

public java.lang.String getValuesTable(java.lang.Object entity,
                                       int depth)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getCollectionTable

public java.lang.String getCollectionTable(java.lang.Class<?> collectionEntityClass,
                                           java.lang.String collectionName)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getCollectionTable

public java.lang.String getCollectionTable(java.lang.Class<?> collectionEntityClass,
                                           java.lang.String collectionName,
                                           int maxDepth)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getTemplate

public java.lang.String getTemplate()

setTemplate

public void setTemplate(java.lang.String template)

setDepth

public void setDepth(java.lang.String depth)

getDepth

public java.lang.String getDepth()

getEntityParameters

protected static java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity)
                                                                               throws java.lang.Exception
Get a map of [name, value] for the passed object

Parameters:
entity - - the Object to parse
maxDepth - - the maximum depth while parsing the ManyToOne fields
Returns:
the map of field names and values
Throws:
java.lang.Exception

getEntityParameters

protected java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity,
                                                                               int maxDepth)
                                                                        throws java.lang.Exception
Get a map of [name, value] for the passed object

Parameters:
entity - - the Object to parse
maxDepth - - the maximum depth while parsing the ManyToOne fields
Returns:
the map of field names and values
Throws:
java.lang.Exception

getEntityParameters

protected java.util.Map<java.lang.String,java.lang.String> getEntityParameters(java.lang.Object entity,
                                                                               java.lang.String parentName,
                                                                               int maxDepth)
                                                                        throws java.lang.Exception
Get a map of [name, value] for the passed object

Parameters:
entity - - the Object to parse
parentName - - the prefix to put in front of every name
maxDepth - - the maximum depth while parsing the ManyToOne fields
Returns:
the map of field names and values
Throws:
java.lang.Exception

getClassParameters

protected java.util.Map<java.lang.String,java.lang.String> getClassParameters(java.lang.Class<?> aClass,
                                                                              int maxDepth)
                                                                       throws java.lang.Exception
Get a map of [name, ""] for the passed class

Parameters:
class - - the Class to parse
maxDepth - - the maximum depth while parsing the ManyToOne fields
Returns:
the map of field names and values
Throws:
java.lang.Exception

getCollectionParametersList

protected static java.util.Vector<java.util.Map<java.lang.String,java.lang.String>> getCollectionParametersList(java.util.Collection<?> collection)
                                                                                                         throws java.lang.Exception
Get a list of maps of [name, value] for each one of the objects in the passed collection

Parameters:
collection - - the Collection to parse
Returns:
the list of maps
Throws:
java.lang.Exception

getCollectionParametersList

protected static java.util.Vector<java.util.Map<java.lang.String,java.lang.String>> getCollectionParametersList(java.util.Collection<?> collection,
                                                                                                                int maxDepth)
                                                                                                         throws java.lang.Exception
Get a list of maps of [name, value] for each one of the objects in the passed collection

Parameters:
collection - - the Collection to parse
maxDepth - - the maximum depth while parsing the ManyToOne fields
Returns:
the list of maps
Throws:
java.lang.Exception