Class AnyToAnyDataLoader

All Implemented Interfaces:

public class AnyToAnyDataLoader
extends Object
implements DataLoader<BasicItem>
Data loader implementation that load any-to-any links. This implementation can also be used in standalone mode on list page. Use create(String, Item, String) to create an instance and then getLinkedItem(DbControl, BasicItem).
  • Field Details

  • Constructor Details

    • AnyToAnyDataLoader

      public AnyToAnyDataLoader​(String linkName, Item linkType, Metadata.PropertyPath<BasicItem,​?> propertyPath)
      Load links with the specified name and target type. If not link type or property path is given, only the ID of the target item is returned.
      linkName - Name of the any-to-any link (required)
      linkType - Target item type of the link (optional)
      propertyPath - Property of the target item to load (optional)
  • Method Details

    • create

      public static AnyToAnyDataLoader create​(String linkName, Item linkType, String linkProperty)
      Create a new data loader that load a value from an any-to-any link.
      linkName - Name of the any-to-any link (required)
      linkType - Target item type of the link (optional)
      linkProperty - Property of the target item to load (optional)
    • getData

      public Object getData​(DbControl dc, ExportedProperty exportedProperty, BasicItem item)
      Description copied from interface: DataLoader
      Get the value for the specified property.
      Specified by:
      getData in interface DataLoader<BasicItem>
      exportedProperty - The property to get the value for
      item - The item that holds the value
    • getLinkedItem

      public BasicItem getLinkedItem​(DbControl dc, BasicItem item)
      Get the item that is linked to by this any-to-any link definition.
      The linked item or null if no item exists or if the item is not of the correct target type