Package mc.core.domain.project.dobj
Class ProjectDO
java.lang.Object
mc.core.system.base.BaseBean
-
Nested Class Summary
Nested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy(Project source, Collection targetCollection) voidNOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!determineProjectPermission(ProjectPrincipal projectPrincipal) Specifies the rights, that are set on projectgetActiveForUser(User user) getAllForUser(User user, boolean onlyActive, List<ProjectPrincipal.ProjectPrincipalRole> roles) searches for projects in which is user in one of given rolesgetAllForUser(User user, boolean onlyActive, ProjectPrincipal.ProjectPrincipalRole... roles) getEntitySwimlanes(ComplexEntity targetEntity) getProjectSwimlanes(Project project) booleanto overridemove(Project source, Collection targetCollection) principalAdd(Project project, ProjectPrincipal.ProjectPrincipalRole projectPrincipalRole, Principal principal, User deputyUser) voidprincipalRemove(Project project, ProjectPrincipal projectPrincipal) principalSave(Project project, ProjectPrincipal projectPrincipal, User deputyUser) voidprojectSetPermissions(Project project, Principal principal, RightType rightType) resourceAdd(Project project, ComplexEntity resourceEntity) voidresourceRemove(ProjectResource resource) voidresourceRemove(Project project, ComplexEntity resourceEntity) voidresourceSetActive(Project project, ComplexEntity resourceEntity, boolean active) resourcesGetLatestForUser(User user, int count, Class<? extends ComplexEntity> entityClass) map data to entity if any, validate and savevoidsetActiveForUser(Project project, User user) voidupdateTaskProjectPrincipal(Project project, ProjectPrincipal projectPrincipal) update tasksmc.core.domain.project.dobj.ProjectDO.ProjectValidatorfor persistent entity copy constructor be used, the copy of entity be mapped and validated
WARNING: in error case param map be changed! non valid fields be deleted from it
all error be collect as ValidationResults in ValidationException and throw only by validate() call
Examples to use:
1.Methods inherited from class mc.core.domain.base.dobj.AbstractComplexEntityDO
addDefaultSearchCriteria, assertPermission, assertPermission, attributes, copy, copyDataSync, copyToCollection, doRecursiveActionAsync, edit, entityProfileApply, entityProfileApply, filter, getCollectionHierarchies, getCollectionsAll, getFromExternalKey, getFromKeySearchFilter, getUserRole, lifecycle, newComplexEntityEvent, onChange, parameter, permissions, prepareSearchFilter, relations, secondaryCollectionAdd, secondaryCollectionCopy, secondaryCollectionMove, secondaryCollectionRemove, setRightInheritanceDisabled, states, translate, versions, watchesMethods inherited from class mc.core.domain.base.dobj.AbstractEntityBaseDO
getFromInternalDescription, sendEvent, sendEventMethods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
delete, getAll, getAllActive, getEntityDisplay, getFromId, getFromKey, getOne, map, map, save
-
Constructor Details
-
ProjectDO
public ProjectDO()
-
-
Method Details
-
insert
- Overrides:
insertin classAbstractComplexEntityDO<Project>- Throws:
ApplicationException
-
save
Description copied from interface:IBaseDOmap data to entity if any, validate and save- Specified by:
savein interfaceIBaseDO<Project>- Overrides:
savein classAbstractEntityBaseDO<Project>- Parameters:
project- mandatorydataMap- optional- Returns:
- mapped entity
- Throws:
ApplicationException
-
delete
Description copied from class:AbstractBaseDONOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!- Overrides:
deletein classAbstractComplexEntityDO<Project>- Parameters:
entity- mandatoryforce- if true delete without usage check, which can result in db constraints error unless references are taken care of- Throws:
ApplicationException
-
move
- Throws:
ApplicationException
-
copy
- Throws:
ApplicationException
-
getProjectSwimlanes
-
getEntitySwimlanes
-
principalAdd
public ProjectPrincipal principalAdd(Project project, ProjectPrincipal.ProjectPrincipalRole projectPrincipalRole, Principal principal, User deputyUser) throws ApplicationException - Throws:
ApplicationException
-
projectSetPermissions
public void projectSetPermissions(Project project, Principal principal, RightType rightType) throws ApplicationException - Throws:
ApplicationException
-
resourceAdd
public ProjectResource resourceAdd(Project project, ComplexEntity resourceEntity) throws ApplicationException - Throws:
ApplicationException
-
resourceRemove
public void resourceRemove(Project project, ComplexEntity resourceEntity) throws ApplicationException - Throws:
ApplicationException
-
resourceRemove
- Throws:
ApplicationException
-
resourceSetActive
public void resourceSetActive(Project project, ComplexEntity resourceEntity, boolean active) throws ApplicationException - Throws:
ApplicationException
-
principalSave
public ProjectPrincipal principalSave(Project project, ProjectPrincipal projectPrincipal, User deputyUser) throws ApplicationException - Throws:
ApplicationException
-
principalRemove
public void principalRemove(Project project, ProjectPrincipal projectPrincipal) throws ApplicationException - Throws:
ApplicationException
-
updateTaskProjectPrincipal
update tasks -
determineProjectPermission
Specifies the rights, that are set on project- Returns:
- Permissions to be set for user on project's.
-
getActiveForUser
-
setActiveForUser
-
getAllForUser
public List<Project> getAllForUser(User user, boolean onlyActive, ProjectPrincipal.ProjectPrincipalRole... roles) -
getAllForUser
public List<Project> getAllForUser(User user, boolean onlyActive, List<ProjectPrincipal.ProjectPrincipalRole> roles) searches for projects in which is user in one of given roles- Parameters:
user- User mandatoryonlyActive- if true only searches for projects where dateEnded is nullroles- optional: if null searches for projects that have given user in any role- Returns:
- list of Project
-
resourcesGetLatestForUser
public List<IProjectResource> resourcesGetLatestForUser(User user, int count, Class<? extends ComplexEntity> entityClass) -
isCreateNewProjectAllowed
public boolean isCreateNewProjectAllowed()to override -
validator
public mc.core.domain.project.dobj.ProjectDO.ProjectValidator validator(Project project, DataMap map) throws ApplicationException Description copied from class:AbstractBaseDOfor persistent entity copy constructor be used, the copy of entity be mapped and validated
WARNING: in error case param map be changed! non valid fields be deleted from it
all error be collect as ValidationResults in ValidationException and throw only by validate() call
Examples to use:
1. validator( navigationHrc, dataMap).thatValidField( NavigationHrc.Field.navigationHrcType).validate(); 2. validator( navigation, dataMap).thatValidField( Navigation.Field.navigationType, Navigation.Field.navigationHrc) .thatNotNullIf( HrcEntity.Field.parent, n -> n.getNavigationType().getParentNavigationType() != null).validate(); 3. validator( entity, dataMap).thatValidField( Country.Field.iso2Code, "message.validate.Country.iso2Code.missing").thatUnique( Country.Field.iso2Code).validate();- Overrides:
validatorin classAbstractBaseDO<Project>- Parameters:
project- mandatorymap- optional- Returns:
- the validator
- Throws:
ApplicationException- the application exception
-