Package mc.core.domain.system.dobj
Class AbstractBasketDO<T extends BasketItem<E>,E extends ComplexEntity>
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<T,E>
- Direct Known Subclasses:
AssetBasketDO,NodeBasketDO
public abstract class AbstractBasketDO<T extends BasketItem<E>,E extends ComplexEntity>
extends AbstractSimpleEntityDO<Basket>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classimplementing session scope strategies for AbstractBasketDOstatic classstatic enumNested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintvoidaddReceiver(Basket basket, Principal principal, String receiverEmailOrList, Locale javaLocale) add new basket receiver with generated external key and by internal user with @principal if basket-principal combination not exist
by external user with email if basket-email combination not exist
send email an external user with link for download.voidassertItemObjectClass(Basket basket) mc.core.system.search.SearchFilterbuildSearchFilterForSharedBaskets(boolean onlyFullControl) return search filter for shared basket: the ceClass is the class of basket item objects receiver is current user or his group criteria for shared is true criteria for valid from : shareValidFrom <= today <= shareValidUntilcopy Basket with all objects but without shared data
and set it to activevoiddeletes Basket from database if own, else only shared link for current user be deletedvoidexportDCM(Basket basket, Locale locale, EntityProfile profile) getAllForUser(User owner) getBasketItem(Basket basket, long ceObjectId) get BasketItem with @param ceObjectId or null if not in basket
WARNINIG: the visibility be not checked!getBasketReceiver(Basket basket, Principal principal) getBasketReceiver(Basket basket, Principal principal, String receiverEmail) intgetItemObjectCount(Basket basket) count of objects from basket (only visible!)getItemObjects(Basket basket) get only visible objects in basketgetItemObjects(Basket basket, mc.core.system.search.SearchFilter sf) get only visible objects in basket according filtergetObjectIdsInBasket(Basket basket) get all objects in basket as id list
WARNINIG: don't use for load, only for check, the visibility be not filtered!abstract List<? extends ComplexTypeEntity>getObjectTypes(Basket basket) getShareUri(BasketReceiver bReceiver, Locale javaLocale) get at least needed user base role for the entity classgetVisibleBasketItems(Basket basket) get list of basket items (only visible!)voidimportDCM(Basket basket, Locale locale, InputStream is, String filename) insert()inserts empty basket, sets current user as owner, sets a default name containing current date and sets this basket active.inserts new basket, sets current user as owner, by empty name sets a default name containing current date and sets this basket active if active flag of given basket is true.booleanisObjectInBasket(Basket basket, long ceObjectId) check existence of BasketItem with @param ceObjectId
WARNINIG: the visibility be not checked!booleanremoveObject(Basket basket, E ceObject) removes object from given basket, but only if basket unlockedvoidremoveObject(Basket basket, List<E> ceObjectList) removes object list from given basket, but only if basket unlockedvoidremoveReceiver(Basket basket, BasketReceiver basketReceiver) voidreSend(Basket basket, BasketReceiver basketReceiver, Locale javaLocale) re-send this basket to the basket receiver: send again email by external user or notification by internal uservoidsets this basket active for the session user.setTransientInfo(Basket basket) TO OVERRIDE by specific info, see AssetBasketDOvoidtoggleLock(Basket basket) Methods 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
-
AbstractBasketDO
public AbstractBasketDO()
-
-
Method Details
-
getUserRole
Description copied from interface:IBaseDOget at least needed user base role for the entity class- Specified by:
getUserRolein interfaceIBaseDO<T extends BasketItem<E>>- Overrides:
getUserRolein classAbstractSimpleEntityDO<Basket>
-
getObjectTypes
-
assertItemObjectClass
-
insert
inserts empty basket, sets current user as owner, sets a default name containing current date and sets this basket active.- Returns:
- inserted basket
- Throws:
ApplicationException
-
insert
inserts new basket, sets current user as owner, by empty name sets a default name containing current date and sets this basket active if active flag of given basket is true.- Parameters:
basket- optional. if null a new basket with active flag "false" will be created- Returns:
- inserted basket
- Throws:
ApplicationException
-
setTransientInfo
TO OVERRIDE by specific info, see AssetBasketDO- Parameters:
basket-- Returns:
- basket with transient information
- Throws:
ApplicationException
-
newBasket
- Throws:
ApplicationException
-
edit
- Throws:
ApplicationException
-
delete
deletes Basket from database if own, else only shared link for current user be deleted- Overrides:
deletein classAbstractBaseDO<Basket>- Parameters:
basket- mandatoryforce- if true delete without usage check, which can result in db constraints error unless references are taken care of- Throws:
ApplicationException
-
removeObject
removes object from given basket, but only if basket unlocked- Throws:
ApplicationException
-
removeObject
removes object list from given basket, but only if basket unlocked- Throws:
ApplicationException
-
addObject
- Throws:
ApplicationException
-
addObject
- Throws:
ApplicationException
-
getVisibleBasketItems
get list of basket items (only visible!)- Parameters:
basket- mandatory- Returns:
- list of basket items only visible
-
isObjectInBasket
check existence of BasketItem with @param ceObjectId
WARNINIG: the visibility be not checked!- Parameters:
basket- mandatoryceObjectId-- Returns:
-
getBasketItem
get BasketItem with @param ceObjectId or null if not in basket
WARNINIG: the visibility be not checked!- Parameters:
basket- mandatoryceObjectId-- Returns:
-
getObjectIdsInBasket
get all objects in basket as id list
WARNINIG: don't use for load, only for check, the visibility be not filtered!- Parameters:
basket- mandatory- Returns:
- all objects in basket as id list
-
getItemObjects
get only visible objects in basket- Parameters:
basket- mandatory- Returns:
- list of objects from basket or empty list if basket is empty
-
getItemObjects
get only visible objects in basket according filter- Parameters:
basket- mandatorysf- optional. if not null use this filter for search and adding criteria basket to it- Returns:
- list of objects from basket according search filter
- See Also:
-
getItemObjectCount
count of objects from basket (only visible!)- Parameters:
basket- mandatory- Returns:
- count of objects from basket (only visible!)
-
addReceiver
public void addReceiver(Basket basket, Principal principal, String receiverEmailOrList, Locale javaLocale) throws ApplicationException add new basket receiver with generated external key and by internal user with @principal if basket-principal combination not exist
by external user with email if basket-email combination not exist
send email an external user with link for download. EitherprincipalorreceiverEmailmust not benull.- Parameters:
basket- mandatoryprincipal- optional, user or user groupreceiverEmailOrList- address of external user, can also be a list of addresses separated by ";"javaLocale- define the template language for mail and error page by external user if not set, the sessionData.getUiJavaLocale() be used as default.- Throws:
ApplicationException
-
reSend
public void reSend(Basket basket, BasketReceiver basketReceiver, Locale javaLocale) throws ApplicationException re-send this basket to the basket receiver: send again email by external user or notification by internal user- Parameters:
basket- mandatorybasketReceiver- mandatoryjavaLocale- define the template language for mail and error page by external user if not set, the sessionData.getUiJavaLocale() be used as default.- Throws:
ApplicationException
-
removeReceiver
public void removeReceiver(Basket basket, BasketReceiver basketReceiver) throws ApplicationException - Throws:
ApplicationException
-
getBasketReceiver
public BasketReceiver getBasketReceiver(Basket basket, Principal principal, String receiverEmail) throws ApplicationException - Throws:
ApplicationException
-
getBasketReceiver
public BasketReceiver getBasketReceiver(Basket basket, Principal principal) throws ApplicationException - Throws:
ApplicationException
-
copy
copy Basket with all objects but without shared data
and set it to active- Overrides:
copyin classAbstractEntityBaseDO<Basket>- Parameters:
source- mandatory- Throws:
ApplicationException
-
toggleLock
- Throws:
ApplicationException
-
setActive
sets this basket active for the session user.
Sets currently active basket, if exists, for this user to inactive
Allowed only for own non locked baskets- Parameters:
basket- mandatory- Throws:
ApplicationException
-
activeForUser
- Returns:
- the current active Basket for session user, if no Basket exists creates one and inserts in database.
- Throws:
ApplicationException
-
getAllForUser
- Returns:
- All Baskets which given user owns.
-
exportDCM
public void exportDCM(Basket basket, Locale locale, EntityProfile profile) throws ApplicationException, UserException - Throws:
ApplicationExceptionUserException
-
importDCM
public void importDCM(Basket basket, Locale locale, InputStream is, String filename) throws ApplicationException - Throws:
ApplicationException
-