Package mc.core.domain.asset.dobj
Class AssetBasketDO
java.lang.Object
mc.core.system.base.BaseBean
mc.core.domain.base.dobj.AbstractBaseDO<T>
mc.core.domain.base.dobj.AbstractEntityBaseDO<T>
mc.core.domain.base.dobj.AbstractSimpleEntityDO<Basket>
mc.core.domain.system.dobj.AbstractBasketDO<AssetBasketItem,Asset>
mc.core.domain.asset.dobj.AssetBasketDO
-
Nested Class Summary
Nested classes/interfaces inherited from class mc.core.domain.system.dobj.AbstractBasketDO
AbstractBasketDO.BasketDOStrategy, AbstractBasketDO.BasketItemEvent, AbstractBasketDO.TemplateParameterNested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopySelection(Basket basket, Asset sourceAsset) copy selection from sourceAsset (includeOriginal and selected asset derivates) to all another assets in this basket.voidcopySelection(Basket source, Basket target, List<Asset> selectedAssets) copy selection for selected assets from item in source basket to item in target basketvoidgetAssetDerivateList(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).mc.core.system.util.misc.Pair<Basket,BasketReceiver> getForExternalUser(String receiverKey) Retrieve a pair containing the basket and the basket receiver for a given receiver key.List<? extends ComplexTypeEntity>getObjectTypes(Basket basket) booleanisPendingWf(Basket basket) check if workflow instance is pending (in running or queued state) for given basketvoidCreate a notification and send to the owner for the given basket receiver.booleanrebuildFile(Basket basket) booleanremoveObject(Basket basket, Asset ce) removes object from given basket, but only if basket unlockedvoidsetDerivates(Basket basket, Asset asset, List<AssetDerivate> derivates, boolean includeOriginal) selects which derivates for asset should be included in the given Basket.
Asset must already been added to basket.setFileSize(Basket basket) 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)!setFileSizePacked(Basket basket) set size of basket ZIP file if already generatedsetTransientInfo(Basket basket) 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.Methods inherited from class mc.core.domain.system.dobj.AbstractBasketDO
activeForUser, addObject, addObject, addReceiver, assertItemObjectClass, buildSearchFilterForSharedBaskets, copy, delete, edit, exportDCM, getAllForUser, getBasketItem, getBasketReceiver, getBasketReceiver, getItemObjectCount, getItemObjects, getItemObjects, getObjectIdsInBasket, getShareUri, getUserRole, getVisibleBasketItems, importDCM, insert, insert, isObjectInBasket, newBasket, removeObject, removeReceiver, reSend, setActive, toggleLockMethods inherited from class mc.core.domain.base.dobj.AbstractSimpleEntityDO
changeOrder, getAllActive, toggleActivationMethods inherited from class mc.core.domain.base.dobj.AbstractEntityBaseDO
addDefaultSearchCriteria, copyToCollection, getFromInternalDescription, prepareSearchFilter, save, sendEvent, sendEventMethods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
delete, getAll, getEntityDisplay, getFromId, getFromKey, getOne, map, map, save, validator
-
Constructor Details
-
AssetBasketDO
public AssetBasketDO()
-
-
Method Details
-
getItemObjectClass
-
removeObject
Description copied from class:AbstractBasketDOremoves object from given basket, but only if basket unlocked- Overrides:
removeObjectin classAbstractBasketDO<AssetBasketItem,Asset> - Throws:
ApplicationException
-
rebuildFile
- 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 inBasketReceiver.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 existApplicationException
-
notifyBasketOwnerOfExternalAccess
Create a notification and send to the owner for the given basket receiver.
Important: The method stores a flag in the session attributeSESSION_ATTR_BASKET_NOTIFY_SENTand 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
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
- Specified by:
getObjectTypesin classAbstractBasketDO<AssetBasketItem,Asset>
-
getAssetDerivateList
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
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:
setTransientInfoin classAbstractBasketDO<AssetBasketItem,Asset> - Parameters:
basket- mandatory- Returns:
- basket with summary information
- Throws:
ApplicationException
-
setFileSize
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
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
copy selection from sourceAsset (includeOriginal and selected asset derivates) to all another assets in this basket.- Parameters:
basket- mandatory, must be attachedsourceAsset- 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- mandatorytarget- mandatoryselectedAssets- optional, if empty, for all assets in target basket- Throws:
ApplicationException
-