Class RelatedItemColumn.Specification
java.lang.Object
net.sf.basedb.clients.web.extensions.list.RelatedItemColumn.Specification
- Enclosing class:
- RelatedItemColumn
public static class RelatedItemColumn.Specification extends Object
Represents a specification for loading a related parent or child item.
The general format is: /DIRECTION/ITEMTYPE/subtype-id/property
where
DIRECTION: PARENT or CHILD
ITEMTYPE: Item.name() value for the related item
subtype-id: Id of an
ItemSubtype
or a RawDataType
property: a specification of what value to retrieve from the related item.
It can have different formats:
- #annotationtype-id: Id of an annotation type
- !extension-id#action-id: Id of an extension and ListColumnAction
to use for loading the value
Otherwise it is interpreted as a property that is defined on the targeted instance.- Since:
- 3.19.4
-
Field Summary
Fields Modifier and Type Field Description (package private) String
actionId
(package private) boolean
allowDoublingBack
(package private) int
annotationId
(package private) SyncFilter.SourceItemTransform
direction
(package private) String
directionRaw
(package private) String
expression
(package private) String
extensionId
(package private) boolean
multiHop
(package private) String
property
(package private) Item
sourceType
(package private) String
subtype
(package private) String
subtypeName
(package private) Item
targetType
-
Constructor Summary
Constructors Constructor Description Specification()
-
Method Summary
Modifier and Type Method Description Restriction
createTargetTypeRestriction(DbControl dc)
String
generateTitle(String title)
Generates a title using target item type and subtype as prefix.String
generateTooltip(String tooltip)
Generates a tooltip using target item type and subtype as prefix.String
getActionId()
Get the action id from the expression.int
getAnnotationId()
Get the annotation id from the expression.SyncFilter.SourceItemTransform
getDirection()
Get the parsed value of the DIRECTION.String
getDirectionRaw()
Get the raw value of the DIRECTION.String
getExpression()
Get the full expression that defines the targeted item and property.String
getExtensionId()
Get the extension id from the expression.ItemSubtype
getItemSubtype(DbControl dc)
String
getProperty()
Get the property from the expression.RawDataType
getRawDataType()
Item
getSourceType()
Get the source item type.String
getSubtype()
Get the target subtype from the expression.String
getSubtypeName()
Get the name of the targeted subtype.Item
getTargetType()
Get the target ITEMTYPE from the expression.boolean
isDoublingBackAllowed()
Enabled on a multi-hop path if the path down to the related child from the parent item is allowed to traverse the same items as the path up from the source child item to the parent.boolean
isMultiHop()
If the property starts with a '/' it is a multi-hop specification.static RelatedItemColumn.Specification
parse(Item sourceType, String expression)
private String
withPrefix(String prefix, String s)
Return prefix+string if string is not null or the empty string otherwise.
-
Field Details
-
expression
String expression -
directionRaw
String directionRaw -
direction
SyncFilter.SourceItemTransform direction -
allowDoublingBack
boolean allowDoublingBack -
sourceType
Item sourceType -
targetType
Item targetType -
subtype
String subtype -
subtypeName
String subtypeName -
property
String property -
annotationId
int annotationId -
extensionId
String extensionId -
actionId
String actionId -
multiHop
boolean multiHop
-
-
Constructor Details
-
Specification
public Specification()
-
-
Method Details
-
parse
-
getExpression
Get the full expression that defines the targeted item and property. -
getDirectionRaw
Get the raw value of the DIRECTION. -
getDirection
Get the parsed value of the DIRECTION. -
isDoublingBackAllowed
public boolean isDoublingBackAllowed()Enabled on a multi-hop path if the path down to the related child from the parent item is allowed to traverse the same items as the path up from the source child item to the parent. -
getSourceType
Get the source item type. This is not part of the expression, but is taken from the current list. -
getTargetType
Get the target ITEMTYPE from the expression. -
getSubtype
Get the target subtype from the expression. -
getSubtypeName
Get the name of the targeted subtype. This may not always be available. -
getProperty
Get the property from the expression. -
getAnnotationId
public int getAnnotationId()Get the annotation id from the expression. Only available if the property represents an annotation (it starts with '#'). -
getExtensionId
Get the extension id from the expression. Only available if the property represents an extension (it starts with '!'). -
getActionId
Get the action id from the expression. Only available if the property represents an extension (it starts with '!'). -
isMultiHop
public boolean isMultiHop()If the property starts with a '/' it is a multi-hop specification. A multi-hop specification must be from child->parent->child and must not have more than two hops. -
generateTitle
Generates a title using target item type and subtype as prefix. -
generateTooltip
Generates a tooltip using target item type and subtype as prefix. -
withPrefix
Return prefix+string if string is not null or the empty string otherwise. -
getItemSubtype
-
getRawDataType
-
createTargetTypeRestriction
-