Package com.atlassian.jira.workflow
Class EagerWorkflowSchemeManager
java.lang.Object
com.atlassian.jira.scheme.AbstractSchemeManager
com.atlassian.jira.workflow.EagerWorkflowSchemeManager
- All Implemented Interfaces:
Startable,SchemeManager,WorkflowSchemeManager
public class EagerWorkflowSchemeManager
extends AbstractSchemeManager
implements WorkflowSchemeManager, Startable
-
Field Summary
Fields inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
eventPublisher, groupManager, projectManager, schemeFactory, securityTypeManagerFields inherited from interface com.atlassian.jira.scheme.SchemeManager
PROJECT_ASSOCIATION -
Constructor Summary
ConstructorsConstructorDescriptionEagerWorkflowSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, SchemeFactory schemeFactory, WorkflowManager workflowManager, ConstantsManager constantsManager, OfBizDelegator ofBizDelegator, com.atlassian.event.api.EventPublisher eventPublisher, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, DraftWorkflowSchemeStore draftWorkflowSchemeStore, JiraAuthenticationContext context, UserManager userManager, I18nHelper.BeanFactory i18nFactory, AssignableWorkflowSchemeStore assignableWorkflowSchemeStore, com.atlassian.cache.CacheManager cacheManager, com.atlassian.beehive.ClusterLockService clusterLockService, QueryDslAccessor queryDslAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultSchemeToProject(Project project) Adds the default scheme to a particular projectvoidaddDefaultSchemeToProject(org.ofbiz.core.entity.GenericValue project) Adds the default scheme to a particular projectvoidaddSchemeToProject(Project project, Scheme scheme) Adds a scheme to a particular projectvoidaddSchemeToProject(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue scheme) Adds a scheme to a particular projectvoidaddWorkflowToScheme(org.ofbiz.core.entity.GenericValue scheme, String workflowName, String issueTypeId) Return a builder that can be used to create a newAssignableWorkflowScheme.cleanUpSchemeDraft(Project project, ApplicationUser user) If the project's workflow scheme is only used by one project and if this scheme has a draft, then the draft is copied to a separate scheme and deleted.voidcopyDraft(DraftWorkflowScheme draft, ApplicationUser user, String newDescription) copyScheme(Scheme oldScheme) Copys a scheme, giving the new scheme the same entities as the original oneorg.ofbiz.core.entity.GenericValuecopyScheme(org.ofbiz.core.entity.GenericValue oldScheme) Copys a scheme, giving the new scheme the same entities as the original onecreateDraft(ApplicationUser creator, DraftWorkflowScheme workflowScheme) Create the passed draft workflow scheme.createDraftOf(ApplicationUser creator, AssignableWorkflowScheme workflowScheme) Create a draft for the passed workflow scheme.createScheme(AssignableWorkflowScheme workflowScheme) Create a new workflow scheme.org.ofbiz.core.entity.GenericValuecreateScheme(String name, String description) Creates a new schemeprotected AbstractSchemeAddedToProjectEventcreateSchemeAddedToProjectEvent(Scheme scheme, Project project) createSchemeAndEntities(Scheme scheme) protected AbstractSchemeCopiedEventcreateSchemeCopiedEvent(Scheme oldScheme, Scheme newScheme) protected AbstractSchemeEventcreateSchemeCreatedEvent(Scheme scheme) org.ofbiz.core.entity.GenericValuecreateSchemeEntity(long schemeId, SchemeEntity schemeEntity) org.ofbiz.core.entity.GenericValuecreateSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) protected ObjectcreateSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity) protected org.ofbiz.core.entity.GenericValuecreateSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) protected org.ofbiz.core.entity.GenericValuecreateSchemeNoEvent(String name, String description) createSchemeObject(String name, String description) Creates a new schemeprotected AbstractSchemeRemovedFromProjectEventcreateSchemeRemovedFromProjectEvent(Scheme scheme, Project project) protected AbstractSchemeUpdatedEventcreateSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme) voiddeleteEntities(Iterable<Long> ids) Deletes a collection of entities from the database.voiddeleteEntity(Long id) Deletes an entity with the given id from the database.voiddeleteScheme(Long id) Deletes a scheme from the databasebooleandeleteWorkflowScheme(WorkflowScheme scheme) Delete the passed workflow scheme.draftBuilder(AssignableWorkflowScheme parent) Return a builder that can be used to create a newDraftWorkflowSchemefor the passed workflow scheme.protected voidReturn all the assignable workflow schemes.org.ofbiz.core.entity.GenericValuegetDefaultEntity(org.ofbiz.core.entity.GenericValue scheme) getDraft(long id) Return the draft workflow scheme with the given id.Return the draft workflow scheme for the passed workflow scheme.List<org.ofbiz.core.entity.GenericValue>getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) Inherited from SchemeManager.List<org.ofbiz.core.entity.GenericValue>getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId, String parameter) Inherited from SchemeManager.List<org.ofbiz.core.entity.GenericValue>getEntities(org.ofbiz.core.entity.GenericValue scheme, String issuetype) Inherited from SchemeManager.List<org.ofbiz.core.entity.GenericValue>getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long entityTypeId) Inherited from SchemeManager.List<org.ofbiz.core.entity.GenericValue>getNonDefaultEntities(org.ofbiz.core.entity.GenericValue scheme) getParentForDraft(long draftSchemeId) Return the original workflow scheme for the passed draft workflow scheme.getProjectsUsing(AssignableWorkflowScheme workflowScheme) Return the list of projects that use the passed workflow scheme.Collection<org.ofbiz.core.entity.GenericValue>getSchemesForWorkflow(JiraWorkflow workflow) Returns all workflow schemes that the passed workflow is assigned to, not including draft schemes.Returns all workflow schemes that the passed workflow is assigned to, including draft schemes.getWorkflowMap(Project project) Returns a map representation of a workflow scheme for a passed project.getWorkflowName(Project project, String issueTypeId) Get the name of the workflow associated with the passed project and issue type.getWorkflowName(org.ofbiz.core.entity.GenericValue scheme, String issueTypeId) Get the name of the workflow from the passed scheme associated with the passed issue type.org.ofbiz.core.entity.GenericValuegetWorkflowScheme(Project project) org.ofbiz.core.entity.GenericValuegetWorkflowScheme(org.ofbiz.core.entity.GenericValue project) getWorkflowSchemeObj(long id) Return the workflow scheme with the passed id.getWorkflowSchemeObj(Project project) Return the workflow scheme associated with the passed project.getWorkflowSchemeObj(String name) Return the workflow scheme with the passed name.booleanhasDraft(AssignableWorkflowScheme scheme) Tells the caller if the passed workflow scheme has a draft.booleanisActive(WorkflowScheme scheme) Return true if the passed workflow scheme is being used by a project.booleanisUsingDefaultScheme(Project project) Tells the caller if the passed project is using the default workflow scheme.protected SchemeEntitymakeSchemeEntity(org.ofbiz.core.entity.GenericValue entity) voidonClearCache(ClearCacheEvent event) booleanremoveEntities(String type, String parameter) Removes all scheme entities with this parameter and typebooleanremoveEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) Retrieves all the entites for this permission and then removes them.voidremoveSchemesFromProject(Project project) Removes all schemes from a projectvoidremoveSchemesFromProject(org.ofbiz.core.entity.GenericValue project) Removes all schemes from a projectvoidvoidstart()This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.updateDraftWorkflowScheme(ApplicationUser user, DraftWorkflowScheme scheme) Save changes to the passed draft workflow scheme.voidupdateScheme(Scheme scheme) Updates any changes to the scheme object.voidupdateScheme(org.ofbiz.core.entity.GenericValue entity) Updates any changes to the given schemevoidupdateSchemesForRenamedWorkflow(String oldWorkflowName, String newWorkflowName) Updates Workflow Schemes's such that schemes associated to the workflow with name oldWorkflowName will be changed to newWorkflowName.updateWorkflowScheme(AssignableWorkflowScheme workflowScheme) Save changes to the passed workflow scheme.<T> TwaitForUpdatesToFinishAndExecute(AssignableWorkflowScheme scheme, Callable<T> task) If the passed workflow scheme is currently being edited, then this method blocks until the editing is finished.Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
createDefaultScheme, createSchemeGenericValue, getApplicationI18n, getAssociatedSchemes, getAssociationType, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getNameForCopy, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, schemeExists, swapParameterForEntitiesOfTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.scheme.SchemeManager
createDefaultScheme, getAssociatedSchemes, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, schemeExists, swapParameterForEntitiesOfTypeMethods inherited from interface com.atlassian.jira.workflow.WorkflowSchemeManager
getAssociationType, getEntities
-
Constructor Details
-
EagerWorkflowSchemeManager
public EagerWorkflowSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, SchemeFactory schemeFactory, WorkflowManager workflowManager, ConstantsManager constantsManager, OfBizDelegator ofBizDelegator, com.atlassian.event.api.EventPublisher eventPublisher, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, DraftWorkflowSchemeStore draftWorkflowSchemeStore, JiraAuthenticationContext context, UserManager userManager, I18nHelper.BeanFactory i18nFactory, AssignableWorkflowSchemeStore assignableWorkflowSchemeStore, com.atlassian.cache.CacheManager cacheManager, com.atlassian.beehive.ClusterLockService clusterLockService, QueryDslAccessor queryDslAccessor)
-
-
Method Details
-
start
public void start()Description copied from interface:StartableThis method will be called after the plugin system is fully initialised and all components added to the dependency injection framework. -
onClearCache
- Overrides:
onClearCachein classAbstractSchemeManager
-
getSchemeEntityName
- Specified by:
getSchemeEntityNamein interfaceWorkflowSchemeManager- Specified by:
getSchemeEntityNamein classAbstractSchemeManager
-
getEntityName
- Specified by:
getEntityNamein interfaceWorkflowSchemeManager- Specified by:
getEntityNamein classAbstractSchemeManager
-
clearWorkflowCache
public void clearWorkflowCache()- Specified by:
clearWorkflowCachein interfaceWorkflowSchemeManager
-
getSchemeDesc
- Specified by:
getSchemeDescin interfaceWorkflowSchemeManager- Specified by:
getSchemeDescin classAbstractSchemeManager
-
getDefaultNameKey
- Specified by:
getDefaultNameKeyin classAbstractSchemeManager
-
getDefaultDescriptionKey
- Specified by:
getDefaultDescriptionKeyin classAbstractSchemeManager
-
getWorkflowScheme
public org.ofbiz.core.entity.GenericValue getWorkflowScheme(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getWorkflowSchemein interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getWorkflowScheme
public org.ofbiz.core.entity.GenericValue getWorkflowScheme(Project project) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getWorkflowSchemein interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
hasDraft
Description copied from interface:WorkflowSchemeManagerTells the caller if the passed workflow scheme has a draft.- Specified by:
hasDraftin interfaceWorkflowSchemeManager- Parameters:
scheme- the workflow scheme to check. It is illegal to pass a draft workflow scheme to this method.- Returns:
- true if the passed workflow has a draft false otherwise.
-
createScheme
@Nonnull public AssignableWorkflowScheme createScheme(@Nonnull AssignableWorkflowScheme workflowScheme) Description copied from interface:WorkflowSchemeManagerCreate a new workflow scheme.- Specified by:
createSchemein interfaceWorkflowSchemeManager- Parameters:
workflowScheme- the workflow scheme to create a draft of. It cannot be a draft, the default scheme, a scheme that already has a draft or a scheme that is not already in the database (i.e. does not have an ID).- Returns:
- the new draft scheme.
-
createSchemeEntity
public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
createSchemeEntityin interfaceSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
createSchemeEntityNoEvent
protected org.ofbiz.core.entity.GenericValue createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
createSchemeEntityNoEventin classAbstractSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
createSchemeEntity
public org.ofbiz.core.entity.GenericValue createSchemeEntity(long schemeId, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String issuetype) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:WorkflowSchemeManagerInherited from SchemeManager.- Specified by:
getEntitiesin interfaceSchemeManager- Specified by:
getEntitiesin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getWorkflowMap
Description copied from interface:WorkflowSchemeManagerReturns a map representation of a workflow scheme for a passed project. The returned map stores {issuetype -> workflowName}. A null issuetype points out the default workflow for the scheme.- Specified by:
getWorkflowMapin interfaceWorkflowSchemeManager- Parameters:
project- the project whose scheme should be returned.- Returns:
- the map representation of a workflow scheme. Each key represents an issuetype which its associated value the name of the workflow assigned to that issue type. A null issuetype points out the default workflow for that scheme.
-
getWorkflowName
Description copied from interface:WorkflowSchemeManagerGet the name of the workflow associated with the passed project and issue type.- Specified by:
getWorkflowNamein interfaceWorkflowSchemeManager- Parameters:
project- the project used in the search.issueTypeId- the ID of issue type used in the search.- Returns:
- the name of the workflow associated with the passed project and issue type.
-
getWorkflowName
Description copied from interface:WorkflowSchemeManagerGet the name of the workflow from the passed scheme associated with the passed issue type.- Specified by:
getWorkflowNamein interfaceWorkflowSchemeManager- Parameters:
scheme- the scheme to search.issueTypeId- the ID of issue type used in the search.- Returns:
- the name of the workflow associated with the scheme and issue type.
-
isUsingDefaultScheme
Description copied from interface:WorkflowSchemeManagerTells the caller if the passed project is using the default workflow scheme.- Specified by:
isUsingDefaultSchemein interfaceWorkflowSchemeManager- Parameters:
project- the project to check.- Returns:
- true if the passed project is using the default scheme, false otherwise.
-
getEntities
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:WorkflowSchemeManagerInherited from SchemeManager.- Specified by:
getEntitiesin interfaceSchemeManager- Specified by:
getEntitiesin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId, String parameter) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:WorkflowSchemeManagerInherited from SchemeManager.- Specified by:
getEntitiesin interfaceSchemeManager- Specified by:
getEntitiesin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:WorkflowSchemeManagerInherited from SchemeManager.- Specified by:
getEntitiesin interfaceSchemeManager- Specified by:
getEntitiesin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getDefaultEntity
public org.ofbiz.core.entity.GenericValue getDefaultEntity(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getDefaultEntityin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getDefaultWorkflowScheme
- Specified by:
getDefaultWorkflowSchemein interfaceWorkflowSchemeManager
-
getNonDefaultEntities
public List<org.ofbiz.core.entity.GenericValue> getNonDefaultEntities(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getNonDefaultEntitiesin interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getActiveWorkflowNames
public Collection<String> getActiveWorkflowNames() throws org.ofbiz.core.entity.GenericEntityException, WorkflowException- Specified by:
getActiveWorkflowNamesin interfaceWorkflowSchemeManager- Returns:
- A collection of all workflow names currently active (ie assigned to schemes & associated with projects).
- Throws:
org.ofbiz.core.entity.GenericEntityExceptionWorkflowException
-
addWorkflowToScheme
public void addWorkflowToScheme(org.ofbiz.core.entity.GenericValue scheme, String workflowName, String issueTypeId) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
addWorkflowToSchemein interfaceWorkflowSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
createDraftOf
@Nonnull public DraftWorkflowScheme createDraftOf(ApplicationUser creator, @Nonnull AssignableWorkflowScheme workflowScheme) Description copied from interface:WorkflowSchemeManagerCreate a draft for the passed workflow scheme. It is illegal to pass:- A scheme that already has a draft.
- A scheme that is not currently in the database.
- The default workflow scheme
- A draft workflow scheme.
- Specified by:
createDraftOfin interfaceWorkflowSchemeManager- Parameters:
creator- the user that is going to create the draft. This user is recorded as the person who last modified the new draftscheme.workflowScheme- the workflow scheme to create a draft of. It cannot be a draft, the default scheme, a scheme that already has a draft or a scheme that is not already in the database (i.e. does not have an ID).- Returns:
- the new draft scheme.
-
createDraft
@Nonnull public DraftWorkflowScheme createDraft(ApplicationUser creator, @Nonnull DraftWorkflowScheme workflowScheme) Description copied from interface:WorkflowSchemeManagerCreate the passed draft workflow scheme. A draft can be created using theWorkflowSchemeManager.draftBuilder(AssignableWorkflowScheme)method.- A scheme that already has a draft.
- A scheme that is not currently in the database.
- The default workflow scheme
- A draft workflow scheme.
- Specified by:
createDraftin interfaceWorkflowSchemeManager- Parameters:
creator- the user that is going to create the draft. This user is recorded as the person who last modified the new draftscheme.workflowScheme- the workflow scheme to create.- Returns:
- the new draft scheme.
-
getAssignableSchemes
Description copied from interface:WorkflowSchemeManagerReturn all the assignable workflow schemes.- Specified by:
getAssignableSchemesin interfaceWorkflowSchemeManager- Returns:
- a list of all the assignable workflow schemes.
-
updateSchemesForRenamedWorkflow
Description copied from interface:WorkflowSchemeManagerUpdates Workflow Schemes's such that schemes associated to the workflow with name oldWorkflowName will be changed to newWorkflowName.Note: There is no validation performed by this method to determine if the provided oldWorkflowName or newWorkflowName are valid workflow names or if the workflow is active/inactive. These validations must be done by the caller.
- Specified by:
updateSchemesForRenamedWorkflowin interfaceWorkflowSchemeManager- Parameters:
oldWorkflowName- name of the workflow to re-assign all its associated schemes fromnewWorkflowName- name of the workflow to assign all the schemes associated to targetWorkflow
-
getSchemesForWorkflow
Description copied from interface:WorkflowSchemeManagerReturns all workflow schemes that the passed workflow is assigned to, not including draft schemes.- Specified by:
getSchemesForWorkflowin interfaceWorkflowSchemeManager- Parameters:
workflow- the workflow whose schemes must be returned- Returns:
- workflow schemes that the passed workflow is assigned to, not including draft schemes.
-
getSchemesForWorkflowIncludingDrafts
Description copied from interface:WorkflowSchemeManagerReturns all workflow schemes that the passed workflow is assigned to, including draft schemes.- Specified by:
getSchemesForWorkflowIncludingDraftsin interfaceWorkflowSchemeManager- Parameters:
workflow- the workflow whose schemes must be returned- Returns:
- workflow schemes that the passed workflow is assigned to, including draft schemes.
-
deleteEntity
Description copied from interface:SchemeManagerDeletes an entity with the given id from the database.- Specified by:
deleteEntityin interfaceSchemeManager- Overrides:
deleteEntityin classAbstractSchemeManager- Parameters:
id- The id of the entity to be deleted- Throws:
DataAccessException
-
deleteEntities
Description copied from interface:SchemeManagerDeletes a collection of entities from the database.- Specified by:
deleteEntitiesin interfaceSchemeManager- Overrides:
deleteEntitiesin classAbstractSchemeManager- Parameters:
ids- a collection entity ids to be deleted.
-
makeSchemeEntity
- Specified by:
makeSchemeEntityin classAbstractSchemeManager
-
createSchemeEntityDeletedEvent
- Specified by:
createSchemeEntityDeletedEventin classAbstractSchemeManager
-
removeEntities
public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) throws RemoveException Description copied from interface:SchemeManagerRetrieves all the entites for this permission and then removes them.- Specified by:
removeEntitiesin interfaceSchemeManager- Overrides:
removeEntitiesin classAbstractSchemeManager- Parameters:
scheme- to remove entites from must NOT be nullentityTypeId- to remove- Returns:
- True all the time (legacy)
- Throws:
RemoveException- if the delete fails (DB error)
-
createScheme
public org.ofbiz.core.entity.GenericValue createScheme(String name, String description) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerCreates a new scheme- Specified by:
createSchemein interfaceSchemeManager- Overrides:
createSchemein classAbstractSchemeManager- Parameters:
name- The name of the new schemedescription- The description of the new scheme- Returns:
- The new scheme object
- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
createSchemeCreatedEvent
- Specified by:
createSchemeCreatedEventin classAbstractSchemeManager
-
createSchemeCopiedEvent
@Nonnull protected AbstractSchemeCopiedEvent createSchemeCopiedEvent(@Nonnull Scheme oldScheme, @Nonnull Scheme newScheme) - Specified by:
createSchemeCopiedEventin classAbstractSchemeManager
-
deleteScheme
Description copied from interface:SchemeManagerDeletes a scheme from the database- Specified by:
deleteSchemein interfaceSchemeManager- Overrides:
deleteSchemein classAbstractSchemeManager- Parameters:
id- Id of the scheme to be deleted
-
createSchemeAddedToProjectEvent
@Nonnull protected AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project) - Specified by:
createSchemeAddedToProjectEventin classAbstractSchemeManager
-
flushProjectSchemes
protected void flushProjectSchemes()- Overrides:
flushProjectSchemesin classAbstractSchemeManager
-
getWorkflowSchemeObj
Description copied from interface:WorkflowSchemeManagerReturn the workflow scheme with the passed id.- Specified by:
getWorkflowSchemeObjin interfaceWorkflowSchemeManager- Parameters:
id- the id to search.- Returns:
- the workflow scheme with the given id or null if no such scheme exists.
-
getWorkflowSchemeObj
Description copied from interface:WorkflowSchemeManagerReturn the workflow scheme with the passed name.- Specified by:
getWorkflowSchemeObjin interfaceWorkflowSchemeManager- Parameters:
name- the name to search.- Returns:
- the workflow scheme with the given name or null if no such scheme exists.
-
getDraftForParent
Description copied from interface:WorkflowSchemeManagerReturn the draft workflow scheme for the passed workflow scheme.- Specified by:
getDraftForParentin interfaceWorkflowSchemeManager- Parameters:
scheme- the workflow scheme whose draft is being sought.- Returns:
- the draft of the passed workflow scheme or null if it does not exist.
-
getDraft
Description copied from interface:WorkflowSchemeManagerReturn the draft workflow scheme with the given id.- Specified by:
getDraftin interfaceWorkflowSchemeManager- Parameters:
id- the id of the draft workflow scheme to be returned- Returns:
- the draft with the given id or null if it does not exist.
-
getParentForDraft
Description copied from interface:WorkflowSchemeManagerReturn the original workflow scheme for the passed draft workflow scheme.- Specified by:
getParentForDraftin interfaceWorkflowSchemeManager- Parameters:
draftSchemeId- the id of the draft workflow scheme whose parent is being sought.- Returns:
- the parent of the passed draft workflow scheme.
-
isActive
Description copied from interface:WorkflowSchemeManagerReturn true if the passed workflow scheme is being used by a project.- Specified by:
isActivein interfaceWorkflowSchemeManager- Parameters:
scheme- the workflow scheme to test.- Returns:
- true if the passed workflow scheme us being used by a project; false otherwise.
-
deleteWorkflowScheme
Description copied from interface:WorkflowSchemeManagerDelete the passed workflow scheme. It is illegal to delete an active scheme, the default scheme or a scheme that is not already in the database.- Specified by:
deleteWorkflowSchemein interfaceWorkflowSchemeManager- Parameters:
scheme- the scheme to delete. Cannot be the default scheme, active scheme or a scheme that is not already in the database.- Returns:
- true if the scheme was deleted; false otherwise.
-
updateDraftWorkflowScheme
public DraftWorkflowScheme updateDraftWorkflowScheme(ApplicationUser user, @Nonnull DraftWorkflowScheme scheme) Description copied from interface:WorkflowSchemeManagerSave changes to the passed draft workflow scheme.- Specified by:
updateDraftWorkflowSchemein interfaceWorkflowSchemeManager- Parameters:
user- the user making the changes.scheme- the draft scheme to change.- Returns:
- the draft scheme as now stored in the database.
-
updateWorkflowScheme
public AssignableWorkflowScheme updateWorkflowScheme(@Nonnull AssignableWorkflowScheme workflowScheme) Description copied from interface:WorkflowSchemeManagerSave changes to the passed workflow scheme.- Specified by:
updateWorkflowSchemein interfaceWorkflowSchemeManager- Parameters:
workflowScheme- the scheme to change.- Returns:
- the scheme that is now stored in the database.
-
updateScheme
Description copied from interface:SchemeManagerUpdates any changes to the scheme object. This does not include changes to the scheme entities.- Specified by:
updateSchemein interfaceSchemeManager- Overrides:
updateSchemein classAbstractSchemeManager- Parameters:
scheme- The modified scheme object- Throws:
DataAccessException
-
createSchemeRemovedFromProjectEvent
@Nonnull protected AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project) - Specified by:
createSchemeRemovedFromProjectEventin classAbstractSchemeManager
-
createSchemeUpdatedEvent
- Specified by:
createSchemeUpdatedEventin classAbstractSchemeManager
-
waitForUpdatesToFinishAndExecute
public <T> T waitForUpdatesToFinishAndExecute(AssignableWorkflowScheme scheme, Callable<T> task) throws Exception Description copied from interface:WorkflowSchemeManagerIf the passed workflow scheme is currently being edited, then this method blocks until the editing is finished. Executes the passed Callable task in the end and returns its result. Workflow scheme editing will be blocked until the task execution finishes.- Specified by:
waitForUpdatesToFinishAndExecutein interfaceWorkflowSchemeManager- Type Parameters:
T- return type of the task.- Parameters:
scheme- the workflow scheme.task- task to execute.- Returns:
- the value returned by the passed task.
- Throws:
Exception- any exception occurred during task execution.
-
getWorkflowSchemeObj
Description copied from interface:WorkflowSchemeManagerReturn the workflow scheme associated with the passed project.- Specified by:
getWorkflowSchemeObjin interfaceWorkflowSchemeManager- Parameters:
project- the project whose scheme is to be returned.- Returns:
- the scheme the passed project is using. Never null.
-
getProjectsUsing
Description copied from interface:WorkflowSchemeManagerReturn the list of projects that use the passed workflow scheme.- Specified by:
getProjectsUsingin interfaceWorkflowSchemeManager- Parameters:
workflowScheme- the workflow scheme to check.- Returns:
- the list of projects that use the passed workflow scheme.
-
cleanUpSchemeDraft
Description copied from interface:WorkflowSchemeManagerIf the project's workflow scheme is only used by one project and if this scheme has a draft, then the draft is copied to a separate scheme and deleted.- Specified by:
cleanUpSchemeDraftin interfaceWorkflowSchemeManager- Parameters:
project- project who's workflow scheme draft is to be copied to a separate scheme.user- the user making the changes.- Returns:
- copied scheme or null if it was not created.
-
copyDraft
public AssignableWorkflowScheme copyDraft(DraftWorkflowScheme draft, ApplicationUser user, String newDescription) - Specified by:
copyDraftin interfaceWorkflowSchemeManager
-
replaceSchemeWithDraft
- Specified by:
replaceSchemeWithDraftin interfaceWorkflowSchemeManager
-
assignableBuilder
Description copied from interface:WorkflowSchemeManagerReturn a builder that can be used to create a newAssignableWorkflowScheme.- Specified by:
assignableBuilderin interfaceWorkflowSchemeManager- Returns:
- the builder that can be used to create the new workflow scheme.
-
draftBuilder
Description copied from interface:WorkflowSchemeManagerReturn a builder that can be used to create a newDraftWorkflowSchemefor the passed workflow scheme.- Specified by:
draftBuilderin interfaceWorkflowSchemeManager- Returns:
- the builder that can be used to create the new workflow scheme.
-
copyScheme
public org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue oldScheme) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerCopys a scheme, giving the new scheme the same entities as the original one- Specified by:
copySchemein interfaceSchemeManager- Overrides:
copySchemein classAbstractSchemeManager- Parameters:
oldScheme- The permission scheme to be copied- Returns:
- The new permission scheme
- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
copyScheme
Description copied from interface:SchemeManagerCopys a scheme, giving the new scheme the same entities as the original one- Specified by:
copySchemein interfaceSchemeManager- Overrides:
copySchemein classAbstractSchemeManager- Parameters:
oldScheme- The permission scheme to be copied- Returns:
- The new permission scheme
-
updateScheme
public void updateScheme(org.ofbiz.core.entity.GenericValue entity) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerUpdates any changes to the given scheme- Specified by:
updateSchemein interfaceSchemeManager- Overrides:
updateSchemein classAbstractSchemeManager- Parameters:
entity- The modified scheme- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
removeSchemesFromProject
Description copied from interface:SchemeManagerRemoves all schemes from a project- Specified by:
removeSchemesFromProjectin interfaceSchemeManager- Overrides:
removeSchemesFromProjectin classAbstractSchemeManager- Parameters:
project- The project that all schemes are to be deleted from- Throws:
DataAccessException
-
removeSchemesFromProject
public void removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerRemoves all schemes from a project- Specified by:
removeSchemesFromProjectin interfaceSchemeManager- Overrides:
removeSchemesFromProjectin classAbstractSchemeManager- Parameters:
project- The project that all schemes are to be deleted from- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
addDefaultSchemeToProject
public void addDefaultSchemeToProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerAdds the default scheme to a particular project- Specified by:
addDefaultSchemeToProjectin interfaceSchemeManager- Overrides:
addDefaultSchemeToProjectin classAbstractSchemeManager- Parameters:
project- The project that the scheme is to be added to- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
addDefaultSchemeToProject
Description copied from interface:SchemeManagerAdds the default scheme to a particular project- Specified by:
addDefaultSchemeToProjectin interfaceSchemeManager- Overrides:
addDefaultSchemeToProjectin classAbstractSchemeManager- Parameters:
project- The project that the scheme is to be added to- Throws:
DataAccessException
-
addSchemeToProject
public void addSchemeToProject(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SchemeManagerAdds a scheme to a particular project- Specified by:
addSchemeToProjectin interfaceSchemeManager- Overrides:
addSchemeToProjectin classAbstractSchemeManager- Parameters:
project- The project that the scheme is to be added toscheme- The scheme to be added- Throws:
org.ofbiz.core.entity.GenericEntityException- If a DB error occurs
-
addSchemeToProject
Description copied from interface:SchemeManagerAdds a scheme to a particular project- Specified by:
addSchemeToProjectin interfaceSchemeManager- Overrides:
addSchemeToProjectin classAbstractSchemeManager- Parameters:
project- The project that the scheme is to be added toscheme- The scheme to be added- Throws:
DataAccessException
-
createSchemeAndEntities
- Specified by:
createSchemeAndEntitiesin interfaceSchemeManager- Overrides:
createSchemeAndEntitiesin classAbstractSchemeManager- Throws:
DataAccessException
-
removeEntities
Description copied from interface:SchemeManagerRemoves all scheme entities with this parameter and type- Specified by:
removeEntitiesin interfaceSchemeManager- Overrides:
removeEntitiesin classAbstractSchemeManager- Parameters:
type- the 'type' of entity you are deleting, eg 'group', 'user', 'projectrole'parameter- must NOT be null- Returns:
- true always (legacy)
- Throws:
RemoveException- if the delete fails (DB error)
-
createSchemeNoEvent
protected org.ofbiz.core.entity.GenericValue createSchemeNoEvent(String name, String description) throws org.ofbiz.core.entity.GenericEntityException - Overrides:
createSchemeNoEventin classAbstractSchemeManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
createSchemeObject
Description copied from interface:SchemeManagerCreates a new scheme- Specified by:
createSchemeObjectin interfaceSchemeManager- Overrides:
createSchemeObjectin classAbstractSchemeManager- Parameters:
name- The name of the new schemedescription- The description of the new scheme- Returns:
- The new scheme object
-