Package org.intermine.web.logic.results
Class InlineResultsTable
- java.lang.Object
-
- org.intermine.web.logic.results.InlineResultsTable
-
- Direct Known Subclasses:
BagUploadConfirmInlineResultsTable
public class InlineResultsTable extends java.lang.Object
An inline table created from a Collection This table has one object per row- Author:
- Radek Stepan, Mark Woodbridge
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<?>
columnFullNames
protected static org.apache.log4j.Logger
LOG
protected Model
model
protected java.util.Collection<?>
results
protected java.util.List<?>
resultsAsList
protected java.util.List<java.lang.Object>
rowObjects
protected int
size
protected WebConfig
webConfig
-
Constructor Summary
Constructors Constructor Description InlineResultsTable(java.util.Collection<?> results, Model model, WebConfig webConfig, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, int size, boolean ignoreDisplayers, java.util.List<java.lang.Class<?>> listOfTypes)
Construct a new InlineResultsTable objectInlineResultsTable(java.util.Collection<?> results, Model model, WebConfig webConfig, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, int size, boolean ignoreDisplayers, java.util.List<java.lang.Class<?>> listOfTypes, java.lang.String parentType, FieldDescriptor fd)
Construct with parent type and a field descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addResultElementToTableRow(java.lang.Object resultElement, java.lang.Object tableRowObject)
Add a result element (RE or "" String), used for type safety as overriden on BagUploadConfirmprotected java.util.List<FieldConfig>
getClassFieldConfigs(ClassDescriptor cd)
Find the FieldConfig objects for the the given ClassDescriptor.java.lang.Integer
getColumnsSize()
FieldDescriptor
getFieldDescriptor()
Get the fields descriptor this list represents.java.lang.Boolean
getHasMoreThanOneType()
java.util.List<java.lang.Class<?>>
getListOfTypes()
java.lang.String
getParentType()
Get the parent's typejava.util.List<java.lang.Object>
getResultElementRows()
Main method used from report to resolve a tablefull of ResultElementsjava.util.List<?>
getResultsAsList()
java.util.List<FieldConfig>
getTableFieldConfigs()
protected java.lang.Object
returnNewTableRow()
Create a table row object, overriden on BagUploadConfirm where we go customprotected void
saveObjectIdOnTableRow(java.lang.Integer id, java.lang.Object tableRowObject)
Used on BagUploadConfirmprotected void
setClassNameOnTableRow(java.lang.String className, java.lang.Object tableRowObject)
Set a class name on table row, used for type safety as overriden on BagUploadConfirm
-
-
-
Field Detail
-
results
protected java.util.Collection<?> results
-
resultsAsList
protected java.util.List<?> resultsAsList
-
rowObjects
protected java.util.List<java.lang.Object> rowObjects
-
columnFullNames
protected java.util.List<?> columnFullNames
-
model
protected Model model
-
size
protected int size
-
webConfig
protected WebConfig webConfig
-
LOG
protected static final org.apache.log4j.Logger LOG
-
-
Constructor Detail
-
InlineResultsTable
public InlineResultsTable(java.util.Collection<?> results, Model model, WebConfig webConfig, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, int size, boolean ignoreDisplayers, java.util.List<java.lang.Class<?>> listOfTypes)
Construct a new InlineResultsTable object- Parameters:
results
- the List to display objectmodel
- the current ModelwebConfig
- the WebConfig object for this webappclassKeys
- Map of class name to set of keyssize
- the maximum number of rows to list from the collection, or -1 if we shouldignoreDisplayers
- if true don't include any columns that have jsp displayers definedlistOfTypes
- resolved using PathQueryResultHelper.queryForTypesInCollection on a Collection, a Reference object will have null instead and its Type will be resolved using getListOfTypes()
-
InlineResultsTable
public InlineResultsTable(java.util.Collection<?> results, Model model, WebConfig webConfig, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, int size, boolean ignoreDisplayers, java.util.List<java.lang.Class<?>> listOfTypes, java.lang.String parentType, FieldDescriptor fd)
Construct with parent type and a field descriptor.- Parameters:
results
- the List to display objectmodel
- the current ModelwebConfig
- the WebConfig object for this webappclassKeys
- Map of class name to set of keyssize
- the maximum number of rows to list from the collection, or -1 if we shouldignoreDisplayers
- if true don't include any columns that have jsp displayers definedlistOfTypes
- resolved using PathQueryResultHelper.queryForTypesInCollection on a Collection, a Reference object will have null instead and its Type will be resolved using getListOfTypes()parentType
- The type of the parent for this listfd
- The field descriptor this list represents.
-
-
Method Detail
-
getResultsAsList
public java.util.List<?> getResultsAsList()
- Returns:
- the results as a list.
-
getParentType
public java.lang.String getParentType()
Get the parent's type- Returns:
- the type of the parent
-
getFieldDescriptor
public FieldDescriptor getFieldDescriptor()
Get the fields descriptor this list represents.- Returns:
- a field descriptor.
-
getListOfTypes
public java.util.List<java.lang.Class<?>> getListOfTypes()
- Returns:
- a list of types in a Collection or a Reference contained in this table
- See Also:
reason for retrieving types for Reference here is that PathQueryResultHelper.queryForTypesInCollection() does not work for References (obviously)
-
getHasMoreThanOneType
public java.lang.Boolean getHasMoreThanOneType()
- Returns:
- true if the table has more than one Type of object
- See Also:
in mind that this method will return true if there are different Types in the whole table, not just the "30" odd rows subset!
-
getTableFieldConfigs
public java.util.List<FieldConfig> getTableFieldConfigs()
- Returns:
- a list of (all) FieldConfigs/Columns for this table
-
getClassFieldConfigs
protected java.util.List<FieldConfig> getClassFieldConfigs(ClassDescriptor cd)
Find the FieldConfig objects for the the given ClassDescriptor.- Parameters:
cd
- a ClassDescriptor- Returns:
- the FieldConfig objects for the the given ClassDescriptor
-
returnNewTableRow
protected java.lang.Object returnNewTableRow()
Create a table row object, overriden on BagUploadConfirm where we go custom- Returns:
- an InlineResultsTableRow (default)
-
setClassNameOnTableRow
protected void setClassNameOnTableRow(java.lang.String className, java.lang.Object tableRowObject)
Set a class name on table row, used for type safety as overriden on BagUploadConfirm- Parameters:
className
- string name of the class of the objecttableRowObject
- InlineResultsTableRow (default)
-
addResultElementToTableRow
protected void addResultElementToTableRow(java.lang.Object resultElement, java.lang.Object tableRowObject)
Add a result element (RE or "" String), used for type safety as overriden on BagUploadConfirm- Parameters:
resultElement
- to be saved in the listtableRowObject
- InlineResultsTableRow (default)
-
saveObjectIdOnTableRow
protected void saveObjectIdOnTableRow(java.lang.Integer id, java.lang.Object tableRowObject)
Used on BagUploadConfirm- Parameters:
id
- imObjtableRowObject
- InlineResultsTableRow (default)
-
getResultElementRows
public java.util.List<java.lang.Object> getResultElementRows()
Main method used from report to resolve a tablefull of ResultElements- Returns:
- a list of lists of ResultElements
-
getColumnsSize
public java.lang.Integer getColumnsSize()
- Returns:
- the number of columns in each table, based on all FieldConfigs for all objects
-
-