Package org.openxava.actions
Class SimpleTemplaterAction
- java.lang.Object
-
- org.openxava.actions.BaseAction
-
- org.openxava.actions.ViewBaseAction
-
- org.openxava.actions.TabBaseAction
-
- 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
Fields Modifier and Type Field Description 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
Constructors Constructor Description SimpleTemplaterAction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 classprotected 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 collectionprotected 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 collectionjava.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 objectprotected 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 objectprotected 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 objectjava.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, getSelectedKeys, getTab, setCollection, setRow, setViewObject
-
Methods inherited from class org.openxava.actions.ViewBaseAction
changeThisPropertyByViewValue, closeDialog, getModelName, getPreviousView, getPreviousViews, getView, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showDialog, showNewView, showView, validateViewValues
-
Methods inherited from class org.openxava.actions.BaseAction
addActions, addError, addErrors, addInfo, addMessage, addMessages, addWarning, clearActions, commit, executeAction, executeAfter, executeBefore, getContext, getEnvironment, getErrors, getLocale, getManager, getMessages, getNextMode, getQualifiedActionIfAvailable, getRequest, removeActions, returnToPreviousControllers, rollback, 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
-
-
Method Detail
-
execute
public void execute() 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 interfaceIModelAction
-
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 parsemaxDepth
- - 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 parsemaxDepth
- - 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 parseparentName
- - the prefix to put in front of every namemaxDepth
- - 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 parsemaxDepth
- - 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 parsemaxDepth
- - the maximum depth while parsing the ManyToOne fields- Returns:
- the list of maps
- Throws:
java.lang.Exception
-
-