Class ParentItemColumn
- java.lang.Object
-
- net.sf.basedb.clients.web.extensions.list.AbstractListColumnBean<Annotatable,Object>
-
- net.sf.basedb.clients.web.extensions.list.ParentItemColumn
-
- All Implemented Interfaces:
ListColumnAction<Annotatable,Object>
,Action
- Direct Known Subclasses:
ParentItemAnnotationColumn
,ParentItemPropertyColumn
public abstract class ParentItemColumn extends AbstractListColumnBean<Annotatable,Object>
A column action implementation that finds a parent item of a given subtype and then get an annotation value from it. NOTE! Preliminary implementation. Need caching, lazy-loading, snapashot manager, support for bioplate, support for "name", etc.- Since:
- 3.16
- Author:
- nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private Filter<Annotatable>
filter
private ParentItemHelper
helper
private int
index
private static Map<String,String>
pathTitles
-
Constructor Summary
Constructors Constructor Description ParentItemColumn(int index, String id, Filter<Annotatable> filter, ParentItemHelper helper)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ParentItemColumn
create(DbControl dc, int index, String expr, ParentItemHelper helper)
For now, we assume that 'expr' is /ITEMTYPE/subtype-id/#annotationtype-id or /ITEMTYPE/subtype-id/propertyObject
getExportValue(DbControl dc, Annotatable item)
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions.protected Set<Annotatable>
getParentItems(Annotatable item)
Get all parent items to the requested item that mathces the specified filter.private String
getProxyTag(Annotatable item)
Generate a proxy tag that is returned instead of actual data.protected abstract Object
getValue(ParentItemHelper helper, Annotatable item)
Alternate implementation for loading data.Object
getValue(DbControl dc, Annotatable item)
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions.private static String
pathToTitle(String path)
Convert some paths to a more user-friendly title instead.-
Methods inherited from class net.sf.basedb.clients.web.extensions.list.AbstractListColumnBean
getClazz, getEnumeration, getExportFormatter, getExportProperty, getFilterProperty, getFormatter, getId, getProperty, getSortProperty, getStyle, getTitle, getTooltip, getValueType, isExportable, isFilterable, isSortable, setClazz, setEnumeration, setExportable, setExportFormatter, setExportProperty, setFilterable, setFilterProperty, setFormatter, setId, setProperty, setSortable, setSortProperty, setStyle, setTitle, setTooltip, setValueType
-
-
-
-
Field Detail
-
index
private final int index
-
filter
private final Filter<Annotatable> filter
-
helper
private final ParentItemHelper helper
-
-
Constructor Detail
-
ParentItemColumn
ParentItemColumn(int index, String id, Filter<Annotatable> filter, ParentItemHelper helper)
-
-
Method Detail
-
create
public static ParentItemColumn create(DbControl dc, int index, String expr, ParentItemHelper helper)
For now, we assume that 'expr' is /ITEMTYPE/subtype-id/#annotationtype-id or /ITEMTYPE/subtype-id/property
-
pathToTitle
private static String pathToTitle(String path)
Convert some paths to a more user-friendly title instead.
-
getValue
public final Object getValue(DbControl dc, Annotatable item)
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions. Subclasses should implementgetValue(ParentItemHelper, Annotatable)
to return the requested value from the item and use the DbControl fromParentItemHelper.dc
.- Parameters:
dc
- An open DbControl than can be used to query the databaseitem
- The current item- Returns:
- The value that should be displayed
-
getProxyTag
private String getProxyTag(Annotatable item)
Generate a proxy tag that is returned instead of actual data. A JavaScript in 'lazy-parent-items.js' will scan the table and inject the actual data in batches.
-
getExportValue
public final Object getExportValue(DbControl dc, Annotatable item)
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions. Subclasses should implementgetValue(ParentItemHelper, Annotatable)
to return the requested value from the item and use the DbControl fromParentItemHelper.dc
.- Specified by:
getExportValue
in interfaceListColumnAction<Annotatable,Object>
- Overrides:
getExportValue
in classAbstractListColumnBean<Annotatable,Object>
- Parameters:
dc
- An open DbControl than can be used to query the databaseitem
- The current item- Returns:
- The value that should be exported
-
getValue
protected abstract Object getValue(ParentItemHelper helper, Annotatable item)
Alternate implementation for loading data.
-
getParentItems
protected Set<Annotatable> getParentItems(Annotatable item)
Get all parent items to the requested item that mathces the specified filter.
-
-