Class RelatedItemColumn
java.lang.Object
net.sf.basedb.clients.web.extensions.list.AbstractListColumnBean<Annotatable,Object>
net.sf.basedb.clients.web.extensions.list.RelatedItemColumn
- All Implemented Interfaces:
ListColumnAction<Annotatable,Object>
,Action
- Direct Known Subclasses:
RelatedItemAnnotationColumn
,RelatedItemListColumn
,RelatedItemPropertyColumn
public abstract class RelatedItemColumn extends AbstractListColumnBean<Annotatable,Object>
A column action implementation that finds a parent or child item of a given
subtype and then get an annotation or other property value from it.
- Since:
- 3.16, 3.17
- Author:
- nicklas
-
Field Summary
Fields Modifier and Type Field Description private RelatedItemHelper
helper
private int
index
private static Map<String,String>
pathTitles
private Item
sourceType
private Item
targetType
private SourceItemTransformer
transformer
private SourceItemTransformerFactory
transformerFactory
-
Constructor Summary
Constructors Constructor Description RelatedItemColumn(int index, String id, Item sourceType, Item targetType, SyncFilter.SourceItemTransform direction, Restriction targetRestriction, RelatedItemHelper helper)
-
Method Summary
Modifier and Type Method Description static RelatedItemColumn
create(DbControl dc, int index, Item sourceType, String expr, RelatedItemHelper helper)
For now, we assume that 'expr' is /DIRECTION/ITEMTYPE/subtype-id/#annotationtype-id or /DIRECTION/ITEMTYPE/subtype-id/property DIRECTION=CHILD|PARENT (PARENT is assumed if not specified) 'subtype-id' can also be the rawdatatype-id if the ITEMTYPE=Item.RAWBIOASSAYObject
getExportValue(DbControl dc, Annotatable item)
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions.private String
getProxyTag(Annotatable item)
Generate a proxy tag that is returned instead of actual data.protected Set<Annotatable>
getRelatedItems(Annotatable item)
Get all parent or child items to the requested item that matches the specified filter.protected abstract Object
getValue(RelatedItemHelper 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
getCellClass, getCellStyle, getClazz, getDisableOverflowCheck, getEnumeration, getExportFormatter, getExportProperty, getFilterProperty, getFormatter, getId, getProperty, getSortProperty, getStyle, getSubtitle, getTitle, getTooltip, getValueType, isExportable, isFilterable, isSortable, setCellClass, setCellStyle, setClazz, setDisableOverflowCheck, setEnumeration, setExportable, setExportFormatter, setExportProperty, setFilterable, setFilterProperty, setFormatter, setId, setProperty, setSortable, setSortProperty, setStyle, setSubtitle, setTitle, setTooltip, setValueType
-
Field Details
-
pathTitles
-
index
private final int index -
sourceType
-
targetType
-
helper
-
transformerFactory
-
transformer
-
-
Constructor Details
-
RelatedItemColumn
RelatedItemColumn(int index, String id, Item sourceType, Item targetType, SyncFilter.SourceItemTransform direction, Restriction targetRestriction, RelatedItemHelper helper)
-
-
Method Details
-
create
public static RelatedItemColumn create(DbControl dc, int index, Item sourceType, String expr, RelatedItemHelper helper)For now, we assume that 'expr' is /DIRECTION/ITEMTYPE/subtype-id/#annotationtype-id or /DIRECTION/ITEMTYPE/subtype-id/property DIRECTION=CHILD|PARENT (PARENT is assumed if not specified) 'subtype-id' can also be the rawdatatype-id if the ITEMTYPE=Item.RAWBIOASSAY -
pathToTitle
Convert some paths to a more user-friendly title instead. -
getValue
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions. Subclasses should implementgetValue(RelatedItemHelper, Annotatable)
to return the requested value from the item and use the DbControl fromRelatedItemHelper.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
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
We finalize this implementation to make sure that the helper implementation always get a chance to re-cycle transactions. Subclasses should implementgetValue(RelatedItemHelper, Annotatable)
to return the requested value from the item and use the DbControl fromRelatedItemHelper.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
Alternate implementation for loading data. -
getRelatedItems
Get all parent or child items to the requested item that matches the specified filter.
-