com.atlassian.jira.bc.project
Class DefaultProjectService

java.lang.Object
  extended by com.atlassian.jira.bc.project.DefaultProjectService
All Implemented Interfaces:
ProjectService

public class DefaultProjectService
extends Object
implements ProjectService


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)
           
 
Method Summary
 String getProjectKeyDescription()
          Get the project key description from the properties file.
 boolean isValidAllProjectData(JiraServiceContext serviceContext, String name, String key, String lead, String url, Long assigneeType)
          Will validate all project fields setting the appropriate errors in the JiraServiceContext if any errors occur.
 boolean isValidRequiredProjectData(JiraServiceContext serviceContext, String name, String key, String lead)
          Will validate the fields required for creating a project and setting the appropriate validation errors in the JiraServiceContext if any errors occur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProjectService

public DefaultProjectService(JiraAuthenticationContext jiraAuthenticationContext,
                             ProjectManager projectManager,
                             ApplicationProperties applicationProperties)
Method Detail

isValidAllProjectData

public boolean isValidAllProjectData(JiraServiceContext serviceContext,
                                     String name,
                                     String key,
                                     String lead,
                                     String url,
                                     Long assigneeType)
Description copied from interface: ProjectService
Will validate all project fields setting the appropriate errors in the JiraServiceContext if any errors occur.

Specified by:
isValidAllProjectData in interface ProjectService
Parameters:
serviceContext - containing the errorCollection that will be populated with any validation errors that are encountered
name - the name of the project @NotNull
key - the key of the project @NotNull
lead - the project lead @NotNull
url - the project URL (optional)
assigneeType - the default assignee type (optional - only appears on some forms)
Returns:
true if project data is valid, false otherwise

isValidRequiredProjectData

public boolean isValidRequiredProjectData(JiraServiceContext serviceContext,
                                          String name,
                                          String key,
                                          String lead)
Description copied from interface: ProjectService
Will validate the fields required for creating a project and setting the appropriate validation errors in the JiraServiceContext if any errors occur.

Specified by:
isValidRequiredProjectData in interface ProjectService
Parameters:
serviceContext - containing the errorCollection that will be populated with any validation errors that are encountered
name - the name of the project @NotNull
key - the key of the project @NotNull
lead - the project lead @NotNull
Returns:
true if project data is valid, false otherwise

getProjectKeyDescription

public String getProjectKeyDescription()
Description copied from interface: ProjectService
Get the project key description from the properties file. If the user has specified a custom regex that project keys must conform to and a description for that regex, this method should return the description. If the user has not specified a custom regex, this method will return the default project key description: "Usually the key is just 3 letters - i.e. if your project name is Foo Bar Raz, a key of FBR would make sense.
The key must contain only uppercase alphabetic characters, and be at least 2 characters in length.
It is recommended to use only ASCII characters, as other characters may not work."

Specified by:
getProjectKeyDescription in interface ProjectService
Returns:
a String description of the project key format


Copyright © 2002-2009 Atlassian. All Rights Reserved.