Class AssetBasketDO

All Implemented Interfaces:
IBaseDO<Basket>

public class AssetBasketDO extends AbstractBasketDO<AssetBasketItem,Asset>
  • Constructor Details

    • AssetBasketDO

      public AssetBasketDO()
  • Method Details

    • getItemObjectClass

      public Class<Asset> getItemObjectClass()
    • removeObject

      public boolean removeObject(Basket basket, Asset ce) throws ApplicationException
      Description copied from class: AbstractBasketDO
      removes object from given basket, but only if basket unlocked
      Overrides:
      removeObject in class AbstractBasketDO<AssetBasketItem,Asset>
      Throws:
      ApplicationException
    • rebuildFile

      public boolean rebuildFile(Basket basket) throws ApplicationException
      Throws:
      ApplicationException
    • export

      public void export(Basket basket, mc.core.system.asset.export.AssetExport.AssetExportType assetExportType) throws ApplicationException
      Throws:
      ApplicationException
    • setDerivates

      public void setDerivates(Basket basket, Asset asset, List<AssetDerivate> derivates, boolean includeOriginal) throws ApplicationException
      selects which derivates for asset should be included in the given Basket.
      Asset must already been added to basket.
      Overwrites any previous selection of derivates for this asset in the basket.
      Throws:
      ApplicationException
    • getForExternalUser

      public mc.core.system.util.misc.Pair<Basket,BasketReceiver> getForExternalUser(String receiverKey) throws UserException, ApplicationException
      Retrieve a pair containing the basket and the basket receiver for a given receiver key.
      Parameters:
      receiverKey - GUID as in BasketReceiver.Field.externalKey.
      Returns:
      Pair containing the basket and the basket receiver
      Throws:
      UserException - if basket has no file, or share not valid, or receiver with key not exist
      ApplicationException
    • notifyBasketOwnerOfExternalAccess

      public void notifyBasketOwnerOfExternalAccess(BasketReceiver bRes)
      Create a notification and send to the owner for the given basket receiver.
      Important: The method stores a flag in the session attribute SESSION_ATTR_BASKET_NOTIFY_SENT and only sends one notification per session (assumption: we only care once per session, but we do care if opened multiple times and / or if the selection was shared. It also does not notify if the owner is the person registered as the basket receiver (testing?)
      Parameters:
      bRes - the basket receiver that just retrieved the basket.
    • isPendingWf

      public boolean isPendingWf(Basket basket)
      check if workflow instance is pending (in running or queued state) for given basket
      Parameters:
      basket - mandatory, persistent
      Returns:
      true if workflow is pending, else false
    • getObjectTypes

      public List<? extends ComplexTypeEntity> getObjectTypes(Basket basket)
      Specified by:
      getObjectTypes in class AbstractBasketDO<AssetBasketItem,Asset>
    • getAssetDerivateList

      public List<AssetDerivate> getAssetDerivateList(List<? extends BasketItem> basketItems)
      WARNING: the visibility be not checked! use for getBasketItem the getVisibleBasketItems(Basket basket)
      WARNING: do not use for list larger than 900 basketItems (DB and memory issues). use paging!
    • setTransientInfo

      public Basket setTransientInfo(Basket basket) throws ApplicationException
      calculate selected originals and derivates (count) and
      set size of basket ZIP file if already generated
      some if this information is transient, so call this before informations is displayed.
      Overrides:
      setTransientInfo in class AbstractBasketDO<AssetBasketItem,Asset>
      Parameters:
      basket - mandatory
      Returns:
      basket with summary information
      Throws:
      ApplicationException
    • setFileSize

      public Basket setFileSize(Basket basket) throws ApplicationException
      calculate file size of basket = file size of original + all file size of derivates from each item
      PERFORMANCE : critical for list, performance killer (copyright si)!
      Throws:
      ApplicationException
    • setFileSizePacked

      public Basket setFileSizePacked(Basket basket) throws ApplicationException
      set size of basket ZIP file if already generated
      Parameters:
      basket - mandatory
      Returns:
      basket with file size or with null as file size, if not generated
      Throws:
      ApplicationException
    • copySelection

      public void copySelection(Basket basket, Asset sourceAsset) throws ApplicationException
      copy selection from sourceAsset (includeOriginal and selected asset derivates) to all another assets in this basket.
      Parameters:
      basket - mandatory, must be attached
      sourceAsset - mandatory
      Throws:
      ApplicationException
    • copySelection

      public void copySelection(Basket source, Basket target, List<Asset> selectedAssets) throws ApplicationException
      copy selection for selected assets from item in source basket to item in target basket
      Parameters:
      source - mandatory
      target - mandatory
      selectedAssets - optional, if empty, for all assets in target basket
      Throws:
      ApplicationException