本文整理汇总了Java中com.atlassian.jira.project.Project类的典型用法代码示例。如果您正苦于以下问题:Java Project类的具体用法?Java Project怎么用?Java Project使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Project类属于com.atlassian.jira.project包,在下文中一共展示了Project类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: upgrade
import com.atlassian.jira.project.Project; //导入依赖的package包/类
@Override
public void upgrade(ModelVersion currentVersion, ActiveObjects activeObjects)
{
log.debug("upgrade [ " + getModelVersion() + " ]");
activeObjects.migrate(ProjectMapping.class, IssueMapping.class);
List<Project> projects = projectManager.getProjectObjects();
for (Project project : projects)
{
String projectKey = project.getKey();
log.debug(" === migrating repositories for project [{}] === ", projectKey);
List<String> repositoriesUrls = getRepositories(projectKey);
for (String repositoryUrl : repositoriesUrls)
{
log.debug("migrating repository [{}]", repositoryUrl);
ProjectMapping pm = migrateRepository(activeObjects, projectKey, repositoryUrl);
migrateIssueMappings(activeObjects, projectKey, repositoryUrl, pm);
}
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:21,代码来源:To_06_GithubRepositories.java
示例2: associateIssueTypesWithFieldConfigurationsOnProjectFieldConfigurationScheme
import com.atlassian.jira.project.Project; //导入依赖的package包/类
/**
* Returns true if this setup had already been done.
*/
public boolean associateIssueTypesWithFieldConfigurationsOnProjectFieldConfigurationScheme(final Project project,
final FieldLayoutScheme bdsFieldConfigurationScheme, final List<IssueType> issueTypes,
final FieldLayout fieldConfiguration) {
boolean wasAlreadySetUp = true;
final FieldConfigurationScheme projectFieldConfigurationScheme = getProjectFieldConfigScheme(project);
if (projectFieldConfigurationScheme == null) {
logger.debug("Project " + project.getName() + ": Field Configuration Scheme: <null> (Default)");
logger.debug("\tReplacing the project's Field Configuration Scheme with "
+ bdsFieldConfigurationScheme.getName());
jiraServices.getFieldLayoutManager().addSchemeAssociation(project, bdsFieldConfigurationScheme.getId());
wasAlreadySetUp = false;
} else {
logger.debug("Project " + project.getName() + ": Field Configuration Scheme: "
+ projectFieldConfigurationScheme.getName());
wasAlreadySetUp = modifyProjectFieldConfigurationScheme(issueTypes, fieldConfiguration, projectFieldConfigurationScheme);
}
return wasAlreadySetUp;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:22,代码来源:HubIssueTypeSetup.java
示例3: getProjectFieldConfigScheme
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private FieldConfigurationScheme getProjectFieldConfigScheme(final Project project) {
FieldConfigurationScheme projectFieldConfigScheme = null;
try {
logger.debug("Getting field configuration scheme for project " + project.getName() + " [ID: "
+ project.getId() + "]");
projectFieldConfigScheme = jiraServices.getFieldLayoutManager()
.getFieldConfigurationSchemeForProject(project.getId());
logger.debug("\tprojectFieldConfigScheme: " + projectFieldConfigScheme);
} catch (final Exception e) {
logger.error(e.getMessage());
}
if (projectFieldConfigScheme == null) {
logger.debug("Project " + project.getName() + " field config scheme: Default Field Configuration Scheme");
} else {
logger.debug(
"Project " + project.getName() + " field config scheme: " + projectFieldConfigScheme.getName());
}
return projectFieldConfigScheme;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:21,代码来源:HubIssueTypeSetup.java
示例4: getJiraProject
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public JiraProject getJiraProject(final long jiraProjectId) throws HubIntegrationException {
final com.atlassian.jira.project.Project atlassianJiraProject = getJiraProjectManager()
.getProjectObj(jiraProjectId);
if (atlassianJiraProject == null) {
throw new HubIntegrationException("Error: JIRA Project with ID " + jiraProjectId + " not found");
}
final String jiraProjectKey = atlassianJiraProject.getKey();
final String jiraProjectName = atlassianJiraProject.getName();
final JiraProject bdsJiraProject = new JiraProject();
bdsJiraProject.setProjectId(jiraProjectId);
bdsJiraProject.setProjectKey(jiraProjectKey);
bdsJiraProject.setProjectName(jiraProjectName);
bdsJiraProject.setAssigneeUserId(getAssigneeUserId(atlassianJiraProject));
return bdsJiraProject;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:17,代码来源:JiraServices.java
示例5: getTestProjectObjectsWithoutIssueTypes
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public List<Project> getTestProjectObjectsWithoutIssueTypes() throws DataAccessException {
final List<Project> jiraProjects = new ArrayList<Project>();
final ProjectMock jiraProject1 = new ProjectMock();
jiraProject1.setId(0L);
jiraProject1.setName("Project1");
final ProjectMock jiraProject2 = new ProjectMock();
jiraProject2.setId(153L);
jiraProject2.setName("Project2");
for (int i = 0; i < 5; i++) {
final ProjectMock jiraProject = new ProjectMock();
jiraProject.setId(JIRA_PROJECT_ID_BASE + i);
jiraProject.setName(JIRA_PROJECT_PREFIX + i);
jiraProjects.add(jiraProject);
}
jiraProjects.add(jiraProject1);
jiraProjects.add(jiraProject2);
return jiraProjects;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:23,代码来源:ProjectManagerMock.java
示例6: getTestProjectObjectsWithTaskIssueType
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public List<Project> getTestProjectObjectsWithTaskIssueType() throws DataAccessException {
final List<Project> jiraProjects = getTestProjectObjectsWithoutIssueTypes();
final IssueTypeMock issueType1 = new IssueTypeMock();
issueType1.setName("Bug");
final IssueTypeMock issueType2 = new IssueTypeMock();
issueType2.setName("Task");
final IssueTypeMock issueType3 = new IssueTypeMock();
issueType3.setName("Issue");
for (final Project project : jiraProjects) {
final ProjectMock pMock = (ProjectMock) project;
pMock.addIssueType(issueType1);
pMock.addIssueType(issueType2);
pMock.addIssueType(issueType3);
}
return jiraProjects;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:19,代码来源:ProjectManagerMock.java
示例7: cleanupBitbucketRecords
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private void cleanupBitbucketRecords()
{
List<Project> projects = projectManager.getProjectObjects();
for (Project project : projects)
{
String projectKey = project.getKey();
List<String> repositoriesUrls = getBitbucketRepositories(projectKey);
if (repositoriesUrls != null)
{
for (String repositoryUrl : repositoriesUrls)
{
removeBitbucketIssueMappings(projectKey, repositoryUrl);
removeBitbucketCredentials(projectKey, repositoryUrl);
}
}
removeBitbucketRepositories(projectKey);
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:19,代码来源:CleanupPluginSettings.java
示例8: cleanupGithubRecords
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private void cleanupGithubRecords()
{
List<Project> projects = projectManager.getProjectObjects();
for (Project project : projects)
{
String projectKey = project.getKey();
List<String> repositoriesUrls = getGithubRepositories(projectKey);
if (repositoriesUrls != null)
{
for (String repositoryUrl : repositoriesUrls)
{
removeGithubIssueMappings(projectKey, repositoryUrl);
}
}
removeGithubRepositories(projectKey);
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:18,代码来源:CleanupPluginSettings.java
示例9: getProjectJamTimestamp
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public static Long getProjectJamTimestamp(Project project) {
AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
ActiveObjects activeObjects = aoWrapper.getActiveObjects();
JamPluginTimestamp[] mappings = activeObjects.find(JamPluginTimestamp.class, "PROJECT_ID = ?", project.getId());
if ( mappings.length > 0) {
return mappings[0].getJamTimestamp();
}
Long now = System.currentTimeMillis();
activeObjects.create(
JamPluginTimestamp.class,
new DBParam("JAM_TIMESTAMP", now),
new DBParam("PROJECT_ID", project.getId())
);
return now;
}
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:19,代码来源:JamClient.java
示例10: hasHazardPermission
import com.atlassian.jira.project.Project; //导入依赖的package包/类
/**
* Determine if a user has permission to access a specified JIRA project.
* Permission is defined as having {@link ProjectPermissions#CREATE_ISSUES}
* {@link ProjectPermission#EDIT_ISSUES}.
*
* @param projectID
* the JIRA project id to be checked
* @param user
* the ApplicationUser object whose permission is checked.
* @return <code>true</code> if the user has create or edit permission on
* the project, <code>false</code> otherwise.
*/
public boolean hasHazardPermission(long projectID, ApplicationUser user) {
checkNotNull(user);
boolean hasPermission = false;
ProjectManager projectManager = ComponentAccessor.getProjectManager();
Project jiraProject = projectManager.getProjectObj(projectID);
if (jiraProject != null) {
PermissionManager permissionManager = ComponentAccessor.getPermissionManager();
if (permissionManager.hasPermission(Permissions.CREATE_ISSUE, jiraProject, user)
|| permissionManager.hasPermission(Permissions.EDIT_ISSUE, jiraProject, user)) {
hasPermission = true;
}
}
return hasPermission;
}
开发者ID:FraunhoferCESE,项目名称:HazardTrackingSystem,代码行数:28,代码来源:HazardService.java
示例11: getProjectsForUser
import com.atlassian.jira.project.Project; //导入依赖的package包/类
@GET
@Path("/user")
@Produces({ MediaType.APPLICATION_JSON })
public Response getProjectsForUser() {
JiraAuthenticationContext jiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext();
if (jiraAuthenticationContext.isLoggedInUser()) {
Map<Long, JIRAProject> userProjects = Maps.newHashMap();
ProjectManager projectManager = ComponentAccessor.getProjectManager();
for (Hazards hazard : hazardService.getUserHazards(jiraAuthenticationContext.getUser())) {
if (userProjects.get(hazard.getProjectID()) == null) {
Project project = projectManager.getProjectObj(hazard.getProjectID());
userProjects.put(hazard.getProjectID(), JIRAProject.create(project));
}
}
return Response.ok(Lists.newArrayList(userProjects.values())).build();
} else {
return ResponseHelper.notLoggedIn();
}
}
开发者ID:FraunhoferCESE,项目名称:HazardTrackingSystem,代码行数:22,代码来源:MissionRestService.java
示例12: setUp
import com.atlassian.jira.project.Project; //导入依赖的package包/类
@Before
public void setUp() {
mockHazardService = mock(HazardService.class);
mockHazardCauseService = mock(CauseService.class);
mockHazardControlService = mock(ControlService.class);
initializeMockCauses();
initializeMockControls();
initializeMockVerifications();
initializeTransfers();
Project mockProject1 = mock(Project.class);
when(mockProject1.getName()).thenReturn("Project named AAAAA");
Project mockProject2 = mock(Project.class);
when(mockProject2.getName()).thenReturn("Project named BBBBB");
mockProjectManager = mock(ProjectManager.class);
when(mockProjectManager.getProjectObj(new Long(1111))).thenReturn(mockProject1);
when(mockProjectManager.getProjectObj(new Long(0000))).thenReturn(mockProject2);
}
开发者ID:FraunhoferCESE,项目名称:HazardTrackingSystem,代码行数:20,代码来源:HazardReportGeneratorTest.java
示例13: getFirstValidAssignee
import com.atlassian.jira.project.Project; //导入依赖的package包/类
/**
* Given an array of addresses, returns the first valid assignee for the appropriate project.
*
* @param addresses the addresses
* @param project the project
* @return the first valid assignee for <code>project</code>
*/
public static User getFirstValidAssignee(Address[] addresses, Project project)
{
if (addresses == null || addresses.length == 0) {
return null;
}
for (int i = 0; i < addresses.length; i++) {
if (addresses[i] instanceof InternetAddress) {
InternetAddress email = (InternetAddress) addresses[i];
User validUser = UserUtils.getUserByEmail(email.getAddress());
if (validUser != null) {
log.error("The user meant no be an assignee is unknown.");
} else {
if (isValidAssignee(project, validUser)) {
return validUser;
}
}
}
}
return null;
}
开发者ID:bcopy,项目名称:JMH,代码行数:32,代码来源:AdvancedCreateIssueHandler.java
示例14: getJiraProjects
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private List<JiraProject> getJiraProjects(final List<Project> jiraProjects) {
final List<JiraProject> newJiraProjects = new ArrayList<>();
if (jiraProjects != null && !jiraProjects.isEmpty()) {
for (final Project oldProject : jiraProjects) {
final JiraProject newProject = new JiraProject();
newProject.setProjectName(oldProject.getName());
newProject.setProjectId(oldProject.getId());
newJiraProjects.add(newProject);
}
}
return newJiraProjects;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:14,代码来源:HubJiraConfigController.java
示例15: addIssueTypesToProjectIssueTypeScreenSchemes
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public void addIssueTypesToProjectIssueTypeScreenSchemes(final Project project,
final Map<IssueType, FieldScreenScheme> screenSchemesByIssueType) {
final IssueTypeScreenScheme issueTypeScreenScheme = jiraServices.getIssueTypeScreenSchemeManager()
.getIssueTypeScreenScheme(project);
logger.debug("addIssueTypesToProjectIssueTypeScreenSchemes(): Project " + project.getName()
+ ": Issue Type Screen Scheme: " + issueTypeScreenScheme.getName());
final List<IssueType> origIssueTypes = getExistingIssueTypes(issueTypeScreenScheme);
final List<IssueTypeScreenSchemeEntity> entitiesToRemove = new ArrayList<>();
final List<IssueTypeScreenSchemeEntity> entitiesToAdd = new ArrayList<>();
for (final IssueType issueType : screenSchemesByIssueType.keySet()) {
if (origIssueTypes.contains(issueType)) {
logger.debug("Issue Type " + issueType.getName() + " is already on Issue Type Screen Scheme "
+ issueTypeScreenScheme.getName() + "; Will check its accuracy");
}
final FieldScreenScheme fieldScreenScheme = screenSchemesByIssueType.get(issueType);
logger.debug("Associating issue type " + issueType.getName() + " with screen scheme "
+ fieldScreenScheme.getName() + " on issue type screen scheme " + issueTypeScreenScheme.getName());
final boolean entityExists = checkForExistingEntity(fieldScreenScheme, issueTypeScreenScheme.getEntities(),
issueType,
entitiesToRemove);
if (!entityExists) {
logger.debug("Associating issueType " + issueType.getName() + " with FieldScreenScheme "
+ fieldScreenScheme.getName());
final IssueTypeScreenSchemeEntity issueTypeScreenSchemeEntity = buildIssueTypeScreenSchemeEntity(
issueType, fieldScreenScheme);
entitiesToAdd.add(issueTypeScreenSchemeEntity);
}
}
final boolean changesMade = adjustEntities(issueTypeScreenScheme, entitiesToRemove, entitiesToAdd);
if (changesMade) {
logger.debug("Performing store() on " + issueTypeScreenScheme.getName());
issueTypeScreenScheme.store();
} else {
logger.debug("Issue Type Screen Scheme " + issueTypeScreenScheme.getName()
+ " already had the correct Black Duck IssueType associations");
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:39,代码来源:HubIssueTypeSetup.java
示例16: addWorkflowToProjectsWorkflowScheme
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public void addWorkflowToProjectsWorkflowScheme(final JiraWorkflow hubWorkflow, final Project project,
final List<IssueType> issueTypes) {
try {
final AssignableWorkflowScheme projectWorkflowScheme = jiraServices.getWorkflowSchemeManager()
.getWorkflowSchemeObj(project);
if (projectWorkflowScheme != null) {
final AssignableWorkflowScheme.Builder projectWorkflowSchemeBuilder = projectWorkflowScheme.builder();
boolean needsToBeUpdated = false;
if (issueTypes != null && !issueTypes.isEmpty()) {
for (final IssueType issueType : issueTypes) {
needsToBeUpdated = mapIssueTypeToBdsWorkflow(project, hubWorkflow, projectWorkflowScheme, projectWorkflowSchemeBuilder,
issueType, needsToBeUpdated);
}
}
if (needsToBeUpdated) {
jiraServices.getWorkflowSchemeManager().updateWorkflowScheme(projectWorkflowSchemeBuilder.build());
}
} else {
final String errorMessage = "Could not find the workflow scheme for the JIRA project : "
+ project.getName();
logger.error(errorMessage);
settingService.addHubError(errorMessage, null, null, project.getName(), null, null,
"addWorkflowToProjectsWorkflowScheme");
}
} catch (final Exception e) {
logger.error("Failed to add the Hub JIRA worflow to the Hub scheme.", e);
settingService.addHubError(e, null, null, project.getName(), null, null, "addWorkflowToProjectsWorkflowScheme");
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:31,代码来源:HubWorkflowSetup.java
示例17: mapIssueTypeToBdsWorkflow
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private boolean mapIssueTypeToBdsWorkflow(final Project project, final JiraWorkflow hubWorkflow,
final AssignableWorkflowScheme projectWorkflowScheme, final AssignableWorkflowScheme.Builder projectWorkflowSchemeBuilder,
final IssueType issueType, boolean needsToBeUpdated) {
final String configuredWorkflowName = projectWorkflowScheme.getConfiguredWorkflow(issueType.getId());
final String actualWorkflowName = projectWorkflowScheme.getActualWorkflow(issueType.getId());
logger.debug("Configured workflow: " + configuredWorkflowName);
logger.debug("Actual workflow: " + actualWorkflowName);
if ((StringUtils.isBlank(actualWorkflowName)) || (!actualWorkflowName.equals(hubWorkflow.getName()))) {
projectWorkflowSchemeBuilder.setMapping(issueType.getId(), hubWorkflow.getName());
logger.debug("Updating JIRA Project : " + project.getName() + ", Issue Type : "
+ issueType.getName() + ", to the Hub workflow '" + hubWorkflow.getName() + "'");
needsToBeUpdated = true;
}
return needsToBeUpdated;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:16,代码来源:HubWorkflowSetup.java
示例18: getAssigneeUserId
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private String getAssigneeUserId(final Project jiraProject) {
final Long assigneeType = jiraProject.getAssigneeType();
if (assigneeType == null) {
return jiraProject.getProjectLead().getKey();
} else if (assigneeType.equals(AssigneeTypes.UNASSIGNED)) {
return null;
}
// There other AssigneeTypes, but we use Project Lead for all of
// them
return jiraProject.getProjectLead().getKey();
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:12,代码来源:JiraServices.java
示例19: adjustProjectsConfig
import com.atlassian.jira.project.Project; //导入依赖的package包/类
private void adjustProjectsConfig(final JiraServices jiraServices, final String projectMappingJson, final HubIssueTypeSetup issueTypeSetup,
final List<IssueType> issueTypes, final Map<IssueType, FieldScreenScheme> screenSchemesByIssueType, final EditableFieldLayout fieldConfiguration,
final FieldLayoutScheme fieldConfigurationScheme, final HubWorkflowSetup workflowSetup, final JiraWorkflow workflow) {
if (projectMappingJson != null && issueTypes != null && !issueTypes.isEmpty()) {
final HubJiraConfigSerializable config = new HubJiraConfigSerializable();
// Converts Json to list of mappings
config.setHubProjectMappingsJson(projectMappingJson);
if (!config.getHubProjectMappings().isEmpty()) {
for (final HubProjectMapping projectMapping : config.getHubProjectMappings()) {
if (projectMapping.getJiraProject() != null
&& projectMapping.getJiraProject().getProjectId() != null) {
// Get jira Project object by Id
// from the JiraProject in the mapping
final Project jiraProject = jiraServices.getJiraProjectManager()
.getProjectObj(projectMapping.getJiraProject().getProjectId());
if (jiraProject != null) {
// add issuetypes to this project
issueTypeSetup.addIssueTypesToProjectIssueTypeScheme(jiraProject, issueTypes);
issueTypeSetup.addIssueTypesToProjectIssueTypeScreenSchemes(jiraProject,
screenSchemesByIssueType);
final boolean wasAlreadySetUp = issueTypeSetup.associateIssueTypesWithFieldConfigurationsOnProjectFieldConfigurationScheme(
jiraProject, fieldConfigurationScheme, issueTypes, fieldConfiguration);
if (wasAlreadySetUp) {
logger.debug("It appears the project's WorkflowScheme has already been configured; leaving it unchanged");
} else {
workflowSetup.addWorkflowToProjectsWorkflowScheme(workflow, jiraProject, issueTypes);
}
}
}
}
}
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:34,代码来源:JiraTaskTimed.java
示例20: getTestProjectObjectsWithoutTaskIssueType
import com.atlassian.jira.project.Project; //导入依赖的package包/类
public List<Project> getTestProjectObjectsWithoutTaskIssueType() throws DataAccessException {
final List<Project> jiraProjects = getTestProjectObjectsWithoutIssueTypes();
final IssueTypeMock issueType1 = new IssueTypeMock();
issueType1.setName("Issue");
final IssueTypeMock issueType2 = new IssueTypeMock();
issueType2.setName("Bug");
for (final Project project : jiraProjects) {
final ProjectMock pMock = (ProjectMock) project;
pMock.addIssueType(issueType1);
pMock.addIssueType(issueType2);
}
return jiraProjects;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:16,代码来源:ProjectManagerMock.java
注:本文中的com.atlassian.jira.project.Project类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论