Class Basket

All Implemented Interfaces:
Serializable, IBaseEntity, ICoreEntity, IEntity, ISortableEntity

@Entity public class Basket extends SimpleEntity
Entity serving to collect objects of the same type for an user in order to buy or download them. Currently only Assets are implemented as BasketItems, but Basket allows any kind of object.
owner: Principal (User or Usergroup), mandatory
basketItems: List of items in basket, BasketItem is a generic class
itemObjectClass: String, mandatory, valid class name of the object class contained in the basket
fileId: reference to packed basket file in file content store
transient information, not stored in db, set during processing of Basket: sizeInBytes, sizePackedInBytes, subItemCount.
See Also:
  • Field Details

    • FLAG_SHARED

      public static final int FLAG_SHARED
      See Also:
    • FLAG_LOCKED

      public static final int FLAG_LOCKED
      See Also:
    • FLAG_SHARED_FULL_CONTROL

      public static final int FLAG_SHARED_FULL_CONTROL
      shared with full control (insert/edit/delete/)
      See Also:
    • FLAG_EXTERNAL_COLLABORATION

      public static final int FLAG_EXTERNAL_COLLABORATION
      See Also:
  • Constructor Details

    • Basket

      public Basket()
      default constructor
  • Method Details

    • getBasketItems

      public List<BasketItem> getBasketItems()
      WARNING: return all basket items, visibility not checked!
      Returns:
      all basket items
    • setBasketItems

      public void setBasketItems(List<BasketItem> basketItems)
    • addBasketItem

      public void addBasketItem(BasketItem basketItem)
    • getEntityProfile

      public EntityProfile getEntityProfile()
    • setEntityProfile

      public void setEntityProfile(EntityProfile entityProfile)
    • getOwner

      public Principal getOwner()
    • setOwner

      public void setOwner(Principal principal)
    • getDateOfExport

      public Calendar getDateOfExport()
    • setDateOfExport

      public void setDateOfExport(Calendar dateOfExport)
    • getItemObjectClass

      public String getItemObjectClass()
    • setItemObjectClass

      public void setItemObjectClass(String objectClass)
    • getFileId

      public String getFileId()
    • setFileId

      public void setFileId(String fileId)
    • getFilename

      public String getFilename()
      Returns:
      the filename of a file, referenced by fileId and stored in the file content store.
    • setFilename

      public void setFilename(String filename)
    • getDateCreated

      public Calendar getDateCreated()
    • getDateModified

      public Calendar getDateModified()
    • isShared

      public boolean isShared()
    • isLocked

      public boolean isLocked()
    • isSharedFullControl

      public boolean isSharedFullControl()
    • setShared

      public void setShared(boolean shared)
    • setSharedFullControl

      public void setSharedFullControl(boolean fullControl)
    • isExternalCollaborated

      public boolean isExternalCollaborated()
    • setExternalCollaborated

      public void setExternalCollaborated(boolean externalCollaborated)
    • setLocked

      public void setLocked(boolean locked)
    • getShareValidFrom

      public Calendar getShareValidFrom()
    • setShareValidFrom

      public void setShareValidFrom(Calendar shareValidFrom)
    • getShareValidUntil

      public Calendar getShareValidUntil()
    • setShareValidUntil

      public void setShareValidUntil(Calendar shareValidUntil)
    • getBasketReceiver

      public List<BasketReceiver> getBasketReceiver()
    • setBasketReceiver

      public void setBasketReceiver(List<BasketReceiver> receivers)
    • addBasketReceiver

      public void addBasketReceiver(BasketReceiver receiver)
    • getReceivers

      public List<Principal> getReceivers()
      transient for mapping from entity manager and existing code
      Returns:
      list of Principal from the list of BasketReceiver
    • getSizePackedInBytes

      public long getSizePackedInBytes()
    • setSizePackedInBytes

      public void setSizePackedInBytes(long packedSizeInBytes)
    • getSizeInBytes

      public long getSizeInBytes()
    • setSizeInBytes

      public void setSizeInBytes(long sizeInBytes)
    • getSelectedItemCount

      public int getSelectedItemCount()
    • setSelectedItemCount

      public void setSelectedItemCount(int selectedItemCount)
    • getSubItemCount

      public int getSubItemCount()
    • setSubItemCount

      public void setSubItemCount(int subItemCount)
    • getExportName

      public String getExportName(Locale locale)
      basket export name with ".zip" extension (for file download)
    • getExportName

      public String getExportName(Locale locale, String postfix)
      basket export name with given postfix (for export)
    • isShareValid

      public boolean isShareValid()
    • isShareValid

      public boolean isShareValid(boolean onCreation)
    • equals

      public boolean equals(Object another)
      Overrides:
      equals in class EntityBase
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class EntityBase