Interface ProjectComponentManager
- All Known Implementing Classes:
DefaultProjectComponentManager
,MockProjectComponentManager
@PublicApi
public interface ProjectComponentManager
Methods for accessing and persisting project components.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsName
(String name, Long projectId) Implement this method in order to check whether component with specified name is stored.org.ofbiz.core.entity.GenericValue
convertToGenericValue
(ProjectComponent projectComponent) Deprecated.don't use GenericValue use the ProjectComponent instead.Collection<org.ofbiz.core.entity.GenericValue>
convertToGenericValues
(Collection<ProjectComponent> projectComponents) Deprecated.don't use GenericValue use the ProjectComponent instead.Implement this method to create a new ProjectComponent object associated with the project with the ID specified and with the values given.void
Implement this method to delete the component.void
deleteAllComponents
(Long projectId) Deletes all components in given project.Implement this method to find the component with the specified ID.findAll()
Implement this method to find all components.findAllActiveForProject
(Long projectId) Returns all active components for given project.findAllArchivedForProject
(Long projectId) Returns all archived components for given project.findAllForProject
(Long projectId) Implement this method to find all components associated with the project with the ID specified.findAllUniqueNamesForProjectObjects
(Collection<Project> projects) Returns all unique names of the components that belong to the passed projects.findAllUniqueNamesForProjects
(Collection<Long> projectIds) Returns all unique names of components associated with all the projects with the ID-s specified.findByComponentName
(Long projectId, String componentName) Finds the ProjectComponent with the given name in the project with the given id.findByComponentNameCaseInSensitive
(String componentName) Finds all ProjectComponents with the given name with comparisons case insenstive.findComponentsByIssue
(Issue issue) Collection<org.ofbiz.core.entity.GenericValue>
findComponentsByIssueGV
(Issue issue) Deprecated.use findComponentsByIssue that returns a Collectioninstead findComponentsByLead
(String userName) Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.findProjectIdForComponent
(Long componentId) Implement this method to look up the project ID for the given component ID.getComponents
(List<Long> ids) Creates a list of ProjectComponent objects from the given list of IDs.getIssueIdsWithComponent
(ProjectComponent component) Returns a list of all Issue IDs with the given component.getProjectComponent
(Long projectComponentId) Returns the component with the given ID or null if not found.int
update
(MutableProjectComponent component) Implement this method to update the component specified with the values given.updateIssueProjectComponents
(Issue issue, Collection<ProjectComponent> newValue) Updates the list of components in issue
-
Field Details
-
NO_COMPONENTS
Used to represent empty component fields.- See Also:
-
-
Method Details
-
create
ProjectComponent create(String name, String description, String lead, long assigneeType, Long projectId) throws IllegalArgumentException Implement this method to create a new ProjectComponent object associated with the project with the ID specified and with the values given. It should also validate the values - store and return the ProjectComponent if validation succeeds. Otherwise, throwValidationErrorsException
.- Parameters:
name
- name of componentdescription
- description of componentlead
- user name associated with componentassigneeType
- assignee typeprojectId
- ID of project that component is associated with- Returns:
- new instance of ProjectComponent with the values specified
- Throws:
IllegalArgumentException
- if one or more arguments have invalid values
-
find
Implement this method to find the component with the specified ID.- Parameters:
id
- component ID to search for- Returns:
- ProjectComponent with the specified ID
- Throws:
EntityNotFoundException
- if the component is not found
-
getProjectComponent
Returns the component with the given ID or null if not found.- Parameters:
projectComponentId
- component ID- Returns:
- the component with the given ID or null if not found.
-
findAllForProject
Implement this method to find all components associated with the project with the ID specified.- Parameters:
projectId
- ID of project to search for- Returns:
- collection of ProjectComponent objects associated with the project with the ID specified
-
findAllActiveForProject
Returns all active components for given project.- Parameters:
projectId
- id of the project- Returns:
- collection of active components.
-
findAllArchivedForProject
Returns all archived components for given project.- Parameters:
projectId
- id of the project- Returns:
- collection of archived components.
-
findAllUniqueNamesForProjects
Returns all unique names of components associated with all the projects with the ID-s specified.- Parameters:
projectIds
- ID-s of project to search for- Returns:
- collection of unique names of components associated with all the projects with the ID-s specified.
-
findAll
Collection<ProjectComponent> findAll()Implement this method to find all components.- Returns:
- collection of all ProjectComponent objects
-
getTotalComponentCount
int getTotalComponentCount()- Returns:
- count of all components.
-
findAllUniqueNamesForProjectObjects
Returns all unique names of the components that belong to the passed projects.- Parameters:
projects
- projects to search in- Returns:
- collection of unique names of all components.
-
getComponents
Creates a list of ProjectComponent objects from the given list of IDs.- Parameters:
ids
- The List of ProjectComponent IDs.- Returns:
- a list of ProjectComponent objects from the given list of IDs.
- Throws:
EntityNotFoundException
- if no ProjectComponent exists for any of the given IDs.
-
update
Implement this method to update the component specified with the values given.- Parameters:
component
- component to be updated- Returns:
- ProjectComponent with updated values as specified
- Throws:
EntityNotFoundException
- if component is not found
-
updateIssueProjectComponents
List<ChangeItemBean> updateIssueProjectComponents(Issue issue, Collection<ProjectComponent> newValue) Updates the list of components in issue- Parameters:
issue
- updated issuenewValue
- list of components- Returns:
- list of ChangeItemBean
-
delete
Implement this method to delete the component.- Parameters:
componentId
- component id- Throws:
EntityNotFoundException
- if the component is not found
-
deleteAllComponents
Deletes all components in given project. Note that this method will not fire a ProjectComponentDeleted upon deletion of a component.- Parameters:
projectId
- id of the project in which components will be deleted.
-
containsName
Implement this method in order to check whether component with specified name is stored.- Parameters:
name
- component name, null will cause IllegalArgumentExceptionprojectId
- project ID- Returns:
- true if new name is stored
-
findProjectIdForComponent
Implement this method to look up the project ID for the given component ID. If project is not found, throws EntityNotFoundException.- Parameters:
componentId
- component ID- Returns:
- project ID
- Throws:
EntityNotFoundException
- if component with the specified id cannot be found
-
convertToGenericValue
Deprecated.don't use GenericValue use the ProjectComponent instead.Converts the ProjectComponent to GenericValue form, provided as a transitional measure until GenericValue is eradicated from the front end.- Parameters:
projectComponent
- project component- Returns:
- the ProjectComponent as a GenericValue.
-
convertToGenericValues
Collection<org.ofbiz.core.entity.GenericValue> convertToGenericValues(Collection<ProjectComponent> projectComponents) Deprecated.don't use GenericValue use the ProjectComponent instead.Temporary method to allow conversion of a collection of ProjectComponent objects to a collection of GenericValues representing a project component.- Parameters:
projectComponents
- a collection of project components- Returns:
- Collection of GenericValues representing the collection of ProjectComponent objects passed in
-
findByComponentName
Finds the ProjectComponent with the given name in the project with the given id.- Parameters:
projectId
- id of the project.componentName
- name of the component.- Returns:
- the ProjectComponent or null if there is no such ProjectComponent.
-
findByComponentNameCaseInSensitive
Finds all ProjectComponents with the given name with comparisons case insenstive.- Parameters:
componentName
- name of the component.- Returns:
- all ProjectComponents with the given name or an empty collection if there is no such ProjectComponent.
-
findComponentsByLead
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.- Parameters:
userName
- the lead user name- Returns:
- collection of components - where the lead of each component is the specified user
-
findComponentsByIssue
- Parameters:
issue
- find components on this issue- Returns:
- collection of project components associated with this issue
- Since:
- 4.2
-
getIssueIdsWithComponent
Returns a list of all Issue IDs with the given component.- Parameters:
component
- the component- Returns:
- a not null list of all Issue IDs with the given component.
-
findComponentsByIssueGV
Deprecated.use findComponentsByIssue that returns a Collectioninstead This code used to live directly in the IssueImpl but it has been refactored into the ProjectComponentManager to make things a little cleaner. That's why it is "new in 4.2" but immediately marked as deprecated- Parameters:
issue
- find components for this issue- Returns:
- collection of generic values representing the components assigned to the issue
- Since:
- 4.2
-