|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.bc.project.DefaultProjectService
public class DefaultProjectService
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.project.ProjectService |
---|
ProjectService.AbstractProjectResult, ProjectService.AbstractProjectValidationResult, ProjectService.CreateProjectResult, ProjectService.CreateProjectValidationResult, ProjectService.DeleteProjectResult, ProjectService.DeleteProjectValidationResult, ProjectService.GetProjectResult, ProjectService.UpdateProjectSchemesValidationResult, ProjectService.UpdateProjectValidationResult |
Field Summary |
---|
Fields inherited from interface com.atlassian.jira.bc.project.ProjectService |
---|
PROJECT_DESCRIPTION, PROJECT_KEY, PROJECT_LEAD, PROJECT_NAME, PROJECT_URL |
Constructor Summary | |
---|---|
DefaultProjectService(JiraAuthenticationContext jiraAuthenticationContext,
ProjectManager projectManager,
ApplicationProperties applicationProperties,
PermissionManager permissionManager,
PermissionSchemeManager permissionSchemeManager,
NotificationSchemeManager notificationSchemeManager,
IssueSecuritySchemeManager issueSecuritySchemeManager,
SchemeFactory schemeFactory,
WorkflowSchemeManager workflowSchemeManager,
IssueTypeScreenSchemeManager issueTypeScreenSchemeManager,
CustomFieldManager customFieldManager,
com.atlassian.core.ofbiz.association.AssociationManager associationManager,
VersionManager versionManager,
ProjectComponentManager projectComponentManager,
SearchRequestAdminService searchRequestAdminService,
CacheManager cacheManager,
SharePermissionDeleteUtils sharePermissionDeleteUtils,
PortalPageManager portalPageManager,
AvatarManager avatarManager)
|
Method Summary | |
---|---|
Project |
createProject(ProjectService.CreateProjectValidationResult result)
Using the validation result from ProjectService.validateCreateProject(com.opensymphony.user.User, String, String,
String, String, String, Long) a new project will be created. |
ProjectService.DeleteProjectResult |
deleteProject(com.opensymphony.user.User user,
ProjectService.DeleteProjectValidationResult result)
Deletes the project provided by the deleteProjectValidationResult. |
ProjectService.GetProjectResult |
getProjectById(com.opensymphony.user.User user,
java.lang.Long id)
Used to retrieve a Project object by id. |
ProjectService.GetProjectResult |
getProjectByKey(com.opensymphony.user.User user,
java.lang.String key)
Used to retrieve a Project object by key. |
java.lang.String |
getProjectKeyDescription()
Get the project key description from the properties file. |
protected JiraServiceContext |
getServiceContext(com.opensymphony.user.User user,
ErrorCollection errorCollection)
|
boolean |
isValidAllProjectData(JiraServiceContext serviceContext,
java.lang.String name,
java.lang.String key,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType)
Will validate all project fields setting the appropriate errors in the JiraServiceContext if any errors occur. |
boolean |
isValidAllProjectData(JiraServiceContext serviceContext,
java.lang.String name,
java.lang.String key,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType,
java.lang.Long avatarId)
Will validate all project fields setting the appropriate errors in the JiraServiceContext if any errors occur. |
boolean |
isValidRequiredProjectData(JiraServiceContext serviceContext,
java.lang.String name,
java.lang.String key,
java.lang.String lead)
Will validate the fields required for creating a project and setting the appropriate validation errors in the JiraServiceContext if any errors occur. |
Project |
updateProject(ProjectService.UpdateProjectValidationResult result)
Using the validation result from ProjectService.validateUpdateProject(com.opensymphony.user.User, String, String,
String, String, String, Long) this method performs the actual update on the project. |
void |
updateProjectSchemes(ProjectService.UpdateProjectSchemesValidationResult result,
Project project)
Updates the project schemes for a particular project, given a validation result and project to update. |
ProjectService.CreateProjectValidationResult |
validateCreateProject(com.opensymphony.user.User user,
java.lang.String name,
java.lang.String key,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType)
This method needs to be called before creating a project to ensure all parameters are correct. |
ProjectService.CreateProjectValidationResult |
validateCreateProject(com.opensymphony.user.User user,
java.lang.String name,
java.lang.String key,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType,
java.lang.Long avatarId)
This method needs to be called before creating a project to ensure all parameters are correct. |
ProjectService.DeleteProjectValidationResult |
validateDeleteProject(com.opensymphony.user.User user,
java.lang.String key)
Validation to delete a project is quite straightforward. |
ProjectService.UpdateProjectValidationResult |
validateUpdateProject(com.opensymphony.user.User user,
java.lang.String name,
java.lang.String key,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType)
Validates updating a project's details. |
ProjectService.UpdateProjectValidationResult |
validateUpdateProject(com.opensymphony.user.User user,
java.lang.String name,
java.lang.String key,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType,
java.lang.Long avatarId)
Validates updating a project's details. |
ProjectService.UpdateProjectSchemesValidationResult |
validateUpdateProjectSchemes(com.opensymphony.user.User user,
java.lang.Long permissionSchemeId,
java.lang.Long notificationSchemeId,
java.lang.Long issueSecuritySchemeId)
If the scheme ids are not null or -1 (-1 is often used to reset schemes), then an attempt will be made to retrieve the scheme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultProjectService(JiraAuthenticationContext jiraAuthenticationContext, ProjectManager projectManager, ApplicationProperties applicationProperties, PermissionManager permissionManager, PermissionSchemeManager permissionSchemeManager, NotificationSchemeManager notificationSchemeManager, IssueSecuritySchemeManager issueSecuritySchemeManager, SchemeFactory schemeFactory, WorkflowSchemeManager workflowSchemeManager, IssueTypeScreenSchemeManager issueTypeScreenSchemeManager, CustomFieldManager customFieldManager, com.atlassian.core.ofbiz.association.AssociationManager associationManager, VersionManager versionManager, ProjectComponentManager projectComponentManager, SearchRequestAdminService searchRequestAdminService, CacheManager cacheManager, SharePermissionDeleteUtils sharePermissionDeleteUtils, PortalPageManager portalPageManager, AvatarManager avatarManager)
Method Detail |
---|
public ProjectService.CreateProjectValidationResult validateCreateProject(com.opensymphony.user.User user, java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType)
ProjectService
validateCreateProject
in interface ProjectService
user
- The user trying to create a projectname
- The name of the new projectkey
- The project key of the new projectdescription
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the new projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.
public ProjectService.CreateProjectValidationResult validateCreateProject(com.opensymphony.user.User user, java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
ProjectService
JiraKeyUtils.validProjectKey(String)
and JiraKeyUtils.isReservedKeyword(String)
). A validation error will also be added if no
user exists for the lead username provided.
Optional validation will be done for the url, assigneetype and avatarId parameters. The url needs to be a valid
URL and the assigneeType needs to be either AssigneeTypes.PROJECT_LEAD
or
AssigneeTypes.UNASSIGNED
. UNASSIGNED will also only be valid, if unassigned
issues are enabled in the General Configuration.
The method will return a ProjectService.CreateProjectValidationResult
which
contains an ErrorCollection with any potential errors and all the project's details.
validateCreateProject
in interface ProjectService
user
- The user trying to create a projectname
- The name of the new projectkey
- The project key of the new projectdescription
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the new projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.avatarId
- the id of an avatar.
protected JiraServiceContext getServiceContext(com.opensymphony.user.User user, ErrorCollection errorCollection)
public Project createProject(ProjectService.CreateProjectValidationResult result)
ProjectService
ProjectService.validateCreateProject(com.opensymphony.user.User, String, String,
String, String, String, Long)
a new project will be created. This method will throw an IllegalStateException if
the validation result contains any errors.
Project creation involves creating the project itself and setting some defaults for workflow schemes and issue
type screen schemes.
createProject
in interface ProjectService
result
- Result from the validation, which also contains all the project's details.
public ProjectService.UpdateProjectValidationResult validateUpdateProject(com.opensymphony.user.User user, java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType)
ProjectService
ProjectService.validateCreateProject(com.opensymphony.user.User,
String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.
validateUpdateProject
in interface ProjectService
user
- The user trying to update a projectname
- The name of the new projectkey
- The project key of the project to update.description
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.
public ProjectService.UpdateProjectValidationResult validateUpdateProject(com.opensymphony.user.User user, java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
ProjectService
ProjectService.validateCreateProject(com.opensymphony.user.User,
String, String, String, String, String, Long)
method. The only difference is that the project key will obviously
not be validated.
A project can be updated by any user with the global admin permission or project admin permission for the project
in question.
validateUpdateProject
in interface ProjectService
user
- The user trying to update a projectname
- The name of the new projectkey
- The project key of the project to update.description
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.avatarId
- the id of an existing avatar.
public Project updateProject(ProjectService.UpdateProjectValidationResult result)
ProjectService
ProjectService.validateUpdateProject(com.opensymphony.user.User, String, String,
String, String, String, Long)
this method performs the actual update on the project.
updateProject
in interface ProjectService
result
- Result from the validation, which also contains all the project's details.
public ProjectService.UpdateProjectSchemesValidationResult validateUpdateProjectSchemes(com.opensymphony.user.User user, java.lang.Long permissionSchemeId, java.lang.Long notificationSchemeId, java.lang.Long issueSecuritySchemeId)
ProjectService
validateUpdateProjectSchemes
in interface ProjectService
permissionSchemeId
- The permission scheme that the new project should usenotificationSchemeId
- The notification scheme that the new project should use. Optional.issueSecuritySchemeId
- The issue security scheme that the new project should use. Optional.
public void updateProjectSchemes(ProjectService.UpdateProjectSchemesValidationResult result, Project project)
ProjectService
updateProjectSchemes
in interface ProjectService
result
- Result from the validation, which also contains all the schemes details.project
- The project which will have its schemes updated.public boolean isValidAllProjectData(JiraServiceContext serviceContext, java.lang.String name, java.lang.String key, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType)
ProjectService
JiraServiceContext
if any errors occur.
isValidAllProjectData
in interface ProjectService
serviceContext
- containing the errorCollection that will be populated with any validation errors that are
encounteredname
- the name of the project @NotNullkey
- the key of the project @NotNulllead
- the project lead @NotNullurl
- the project URL (optional)assigneeType
- the default assignee type (optional - only appears on some forms)
public boolean isValidAllProjectData(JiraServiceContext serviceContext, java.lang.String name, java.lang.String key, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
ProjectService
JiraServiceContext
if any errors occur.
isValidAllProjectData
in interface ProjectService
serviceContext
- containing the errorCollection that will be populated with any validation errors that are
encounteredname
- the name of the project @NotNullkey
- the key of the project @NotNulllead
- the project lead @NotNullurl
- the project URL (optional)assigneeType
- the default assignee type (optional - only appears on some forms)avatarId
- the id of the avatar (null indicates default avatar)
public boolean isValidRequiredProjectData(JiraServiceContext serviceContext, java.lang.String name, java.lang.String key, java.lang.String lead)
ProjectService
JiraServiceContext
if any errors occur.
isValidRequiredProjectData
in interface ProjectService
serviceContext
- containing the errorCollection that will be populated with any validation errors that are
encounteredname
- the name of the project @NotNullkey
- the key of the project @NotNulllead
- the project lead @NotNull
public java.lang.String getProjectKeyDescription()
ProjectService
getProjectKeyDescription
in interface ProjectService
public ProjectService.GetProjectResult getProjectById(com.opensymphony.user.User user, java.lang.Long id)
ProjectService
Project
object by id. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the id
specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
getProjectById
in interface ProjectService
user
- The user retrieving the project.id
- The id of the project.
public ProjectService.GetProjectResult getProjectByKey(com.opensymphony.user.User user, java.lang.String key)
ProjectService
Project
object by key. This method returns a ProjectService.GetProjectResult
. The project will be null if no project for the
key specified can be found, or if the user making the request does not have the BROWSE project permission for the
project. In both of these cases, the errorCollection in the result object will contain an appropriate error
message.
getProjectByKey
in interface ProjectService
user
- The user retrieving the project.key
- The key of the project.
public ProjectService.DeleteProjectValidationResult validateDeleteProject(com.opensymphony.user.User user, java.lang.String key)
ProjectService
validateDeleteProject
in interface ProjectService
user
- The user trying to delete a projectkey
- The key of the project to delete
public ProjectService.DeleteProjectResult deleteProject(com.opensymphony.user.User user, ProjectService.DeleteProjectValidationResult result)
ProjectService
deleteProject
in interface ProjectService
user
- The user trying to delete a projectresult
- Result from the validation, which also contains all the project's details.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |