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 Details

  • Constructor Details

    • Specification

      public Specification()
  • Method Details

    • parse

      public static RelatedItemColumn.Specification parse​(Item sourceType, String expression)
    • getExpression

      public String getExpression()
      Get the full expression that defines the targeted item and property.
    • getDirectionRaw

      public String getDirectionRaw()
      Get the raw value of the DIRECTION.
    • getDirection

      public SyncFilter.SourceItemTransform getDirection()
      Get the parsed value of the DIRECTION.
    • getSourceType

      public Item getSourceType()
      Get the source item type. This is not part of the expression, but is taken from the current list.
    • getTargetType

      public Item getTargetType()
      Get the target ITEMTYPE from the expression.
    • getSubtype

      public String getSubtype()
      Get the target subtype from the expression.
    • getSubtypeName

      public String getSubtypeName()
      Get the name of the targeted subtype. This may not always be available.
    • getProperty

      public String 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

      public String getExtensionId()
      Get the extension id from the expression. Only available if the property represents an extension (it starts with '!').
    • getActionId

      public String 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

      public String generateTitle​(String title)
      Generates a title using target item type and subtype as prefix.
    • generateTooltip

      public String generateTooltip​(String tooltip)
      Generates a tooltip using target item type and subtype as prefix.
    • withPrefix

      private String withPrefix​(String prefix, String s)
      Return prefix+string if string is not null or the empty string otherwise.
    • getItemSubtype

      public ItemSubtype getItemSubtype​(DbControl dc)
    • getRawDataType

      public RawDataType getRawDataType()
    • createTargetTypeRestriction

      public Restriction createTargetTypeRestriction​(DbControl dc)