• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ProjectManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.atlassian.jira.project.ProjectManager的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager类的具体用法?Java ProjectManager怎么用?Java ProjectManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectManager类属于com.atlassian.jira.project包,在下文中一共展示了ProjectManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: DvcsStreamsActivityProvider

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public DvcsStreamsActivityProvider(@ComponentImport I18nResolver i18nResolver,
        @ComponentImport ApplicationProperties applicationProperties,
        @ComponentImport UserProfileAccessor userProfileAccessor,
        IssueLinker issueLinker,
        @ComponentImport TemplateRenderer templateRenderer,
        @ComponentImport PermissionManager permissionManager,
        @ComponentImport JiraAuthenticationContext jiraAuthenticationContext,
        @ComponentImport ProjectManager projectManager,
        ChangesetService changesetService,
        RepositoryService repositoryService,
        IssueAndProjectKeyManager issueAndProjectKeyManager)
{
    this.applicationProperties = applicationProperties;
    this.i18nResolver = i18nResolver;
    this.userProfileAccessor = userProfileAccessor;
    this.issueLinker = issueLinker;
    this.templateRenderer = checkNotNull(templateRenderer);
    this.permissionManager = permissionManager;
    this.jiraAuthenticationContext = jiraAuthenticationContext;
    this.projectManager = projectManager;
    this.changesetService = changesetService;
    this.repositoryService = repositoryService;
    this.issueAndProjectKeyManager = issueAndProjectKeyManager;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:25,代码来源:DvcsStreamsActivityProvider.java


示例2: hasHazardPermission

import com.atlassian.jira.project.ProjectManager; //导入依赖的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


示例3: getProjectsForUser

import com.atlassian.jira.project.ProjectManager; //导入依赖的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


示例4: setUp

import com.atlassian.jira.project.ProjectManager; //导入依赖的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


示例5: HubJiraConfigController

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public HubJiraConfigController(final UserManager userManager, final PluginSettingsFactory pluginSettingsFactory, final TransactionTemplate transactionTemplate, final ProjectManager projectManager, final HubMonitor hubMonitor,
        final GroupPickerSearchService groupPickerSearchService, final FieldManager fieldManager) {
    this.userManager = userManager;
    this.pluginSettingsFactory = pluginSettingsFactory;
    this.transactionTemplate = transactionTemplate;
    this.projectManager = projectManager;
    this.hubMonitor = hubMonitor;
    this.groupPickerSearchService = groupPickerSearchService;
    this.fieldManager = fieldManager;

    i18nProperties = new Properties();
    populateI18nProperties();
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:14,代码来源:HubJiraConfigController.java


示例6: getJiraServices

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
private JiraServices getJiraServices(final WorkflowManager workflowManager,
        final WorkflowSchemeManager workflowSchemeManager, final UserManager userManager,
        final ProjectManager projectManager, final AvatarManager avatarManager,
        final ConstantsManager constantsManager, final IssueTypeSchemeManager issueTypeSchemeManager,
        final FieldLayoutManager fieldLayoutManager,
        final IssueTypeScreenSchemeManager issueTypeScreenSchemeManager, final Collection<IssueType> issueTypes,
        final UserUtil userUtil, final CustomFieldManagerMock customFieldManager,
        final FieldManagerMock fieldManager, final FieldScreenManagerMock fieldScreenManager,
        final FieldScreenSchemeManagerMock fieldScreenSchemeManager) {

    JiraServicesMock jiraServices = new JiraServicesMock();
    jiraServices.setWorkflowManager(workflowManager);
    jiraServices.setWorkflowSchemeManager(workflowSchemeManager);
    jiraServices.setUserManager(userManager);
    jiraServices.setProjectManager(projectManager);
    jiraServices.setAvatarManager(avatarManager);
    jiraServices.setConstantsManager(constantsManager);
    jiraServices.setIssueTypeSchemeManager(issueTypeSchemeManager);
    jiraServices.setFieldLayoutManager(fieldLayoutManager);
    jiraServices.setIssueTypes(issueTypes);
    jiraServices.setUserUtil(userUtil);
    jiraServices.setIssueTypeScreenSchemeManager(issueTypeScreenSchemeManager);
    jiraServices.setCustomFieldManager(customFieldManager);
    jiraServices.setFieldManager(fieldManager);
    jiraServices.setFieldScreenManager(fieldScreenManager);
    jiraServices.setFieldScreenSchemeManager(fieldScreenSchemeManager);

    jiraServices = Mockito.spy(jiraServices);

    Mockito.when(jiraServices.getResourceAsStream(Mockito.anyString())).then(new Answer<InputStream>() {
        @Override
        public InputStream answer(final InvocationOnMock invocation) throws Throwable {
            final Object[] arguments = invocation.getArguments();

            return getClass().getResourceAsStream((String) arguments[0]);
        }
    });

    return jiraServices;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:41,代码来源:JiraTaskSetupTest.java


示例7: mockJiraServices

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
static JiraServices mockJiraServices() throws HubIntegrationException {

        final ConstantsManager constantsManager = Mockito.mock(ConstantsManager.class);
        final Collection<IssueType> issueTypes = new ArrayList<>();
        final IssueType policyIssueType = Mockito.mock(IssueType.class);
        Mockito.when(policyIssueType.getName()).thenReturn(HubJiraConstants.HUB_POLICY_VIOLATION_ISSUE);
        Mockito.when(policyIssueType.getId()).thenReturn("policyIssueTypeId");
        issueTypes.add(policyIssueType);
        final IssueType vulnerabilityIssueType = Mockito.mock(IssueType.class);
        Mockito.when(vulnerabilityIssueType.getName()).thenReturn(HubJiraConstants.HUB_VULNERABILITY_ISSUE);
        Mockito.when(vulnerabilityIssueType.getId()).thenReturn("vulnerabilityIssueTypeId");
        issueTypes.add(vulnerabilityIssueType);

        Mockito.when(constantsManager.getAllIssueTypeObjects()).thenReturn(issueTypes);

        final JiraServices jiraServices = Mockito.mock(JiraServices.class);
        Mockito.when(jiraServices.getConstantsManager()).thenReturn(constantsManager);
        final ProjectManager jiraProjectManager = createJiraProjectManager();
        Mockito.when(jiraServices.getJiraProjectManager()).thenReturn(jiraProjectManager);

        final List<JiraProject> mockJiraProjects = ConverterTestUtils.getTestJiraProjectObjects("assigneeUserId");
        for (final JiraProject mockJiraProject : mockJiraProjects) {
            Mockito.when(jiraServices.getJiraProject(mockJiraProject.getProjectId())).thenReturn(mockJiraProject);
        }

        return jiraServices;
    }
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:28,代码来源:ConverterTestUtils.java


示例8: IssueAndProjectKeyManagerImpl

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
@Autowired
@SuppressWarnings("SpringJavaAutowiringInspection")
public IssueAndProjectKeyManagerImpl(@ComponentImport final IssueManager issueManager,
        @ComponentImport final ChangeHistoryManager changeHistoryManager,
        @ComponentImport final ProjectManager projectManager,
        @ComponentImport final PermissionManager permissionManager,
        @ComponentImport final JiraAuthenticationContext authenticationContext)
{
    this.issueManager = checkNotNull(issueManager);
    this.changeHistoryManager = checkNotNull(changeHistoryManager);
    this.projectManager = checkNotNull(projectManager);
    this.permissionManager = checkNotNull(permissionManager);
    this.authenticationContext = checkNotNull(authenticationContext);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:15,代码来源:IssueAndProjectKeyManagerImpl.java


示例9: BitbucketLinkerImpl

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public BitbucketLinkerImpl(BitbucketClientBuilderFactory bitbucketClientBuilderFactory,
        ApplicationProperties applicationProperties, ProjectManager projectManager,
        final RepositoryService repositoryService)
{
    this.bitbucketClientBuilderFactory = bitbucketClientBuilderFactory;
    this.applicationProperties = applicationProperties;
    this.projectManager = projectManager;
    this.repositoryService = repositoryService;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:10,代码来源:BitbucketLinkerImpl.java


示例10: getAllProjectKeys

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public static Set<String> getAllProjectKeys(ProjectManager projectManager, Project project)
{
    if (GET_ALL_PROJECT_KEYS_EXISTS)
    {
        return projectManager.getAllProjectKeys(project.getId());
    }
    else
    {
        return Collections.singleton(project.getKey());
    }
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:12,代码来源:SystemUtils.java


示例11:

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
/**
 * Constructor.
 * @param eventPublisher
 *            injected {@code EventPublisher} implementation.
 */
public IrcNotificationPlugin // {{{
(
	EventPublisher eventPublisher,
	PluginSettingsFactory pluginSettingsFactory,
	VelocityRequestContextFactory velocityRequestContextFactory,
	ProjectManager projectManager
)
{
	this.eventPublisher = eventPublisher;
	this.pluginSettingsFactory = pluginSettingsFactory;
	this.velocityRequestContextFactory = velocityRequestContextFactory;
	this.projectManager = projectManager;
	this.irc = null;
}
 
开发者ID:jmaurice,项目名称:jira-irc-plugin,代码行数:20,代码来源:IrcNotificationPlugin.java


示例12: getAllHazardsByMissionID

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
@GET
@Path("hazards/{missionID}")
@Produces({ MediaType.APPLICATION_JSON })
public Response getAllHazardsByMissionID(@PathParam("missionID") Long missionID) {

	ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getUser();
	if (user == null) {
		return ResponseHelper.notLoggedIn();
	}

	if (missionID == null) {
		return ResponseHelper.badRequest("Invalid missionID");
	}

	if (!hazardService.hasHazardPermission(missionID, user)) {
		return ResponseHelper.forbidden("User does not have permission to access hazard reports for that project");
	}

	List<HazardMinimal> hazards = Lists.newArrayList();
	ProjectManager projectManager = ComponentAccessor.getProjectManager();
	IssueManager issueManager = ComponentAccessor.getIssueManager();
	for (Hazards hazard : hazardService.getHazardsByProjectId(missionID)) {
		hazards.add(HazardMinimal.create(hazard, projectManager.getProjectObj(hazard.getProjectID()),
				issueManager.getIssueObject(hazard.getIssueID())));
	}

	return Response.ok(hazards).build();

}
 
开发者ID:FraunhoferCESE,项目名称:HazardTrackingSystem,代码行数:30,代码来源:MissionRestService.java


示例13: getJiraProjectManager

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public ProjectManager getJiraProjectManager() {
    return ComponentAccessor.getProjectManager();
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java


示例14: setProjectManager

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public void setProjectManager(final ProjectManager projectManager) {
    this.projectManager = projectManager;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServicesMock.java


示例15: getJiraProjectManager

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
@Override
public ProjectManager getJiraProjectManager() {
    return projectManager;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:5,代码来源:JiraServicesMock.java


示例16: createJiraProjectManager

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
private static ProjectManager createJiraProjectManager() {
    final ProjectManagerMock projectManager = new ProjectManagerMock();
    projectManager.setProjectObjects(projectManager.getTestProjectObjectsWithTaskIssueType());
    return projectManager;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:6,代码来源:ConverterTestUtils.java


示例17: To_06_GithubRepositories

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public To_06_GithubRepositories(final ProjectManager projectManager, final PluginSettingsFactory pluginSettingsFactory)
{
    this.projectManager = projectManager;
    this.pluginSettingsFactory = pluginSettingsFactory;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:To_06_GithubRepositories.java


示例18: PasswordReEncryptor

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
@Autowired
public PasswordReEncryptor(@ComponentImport ProjectManager projectManager)
{
    this.projectManager = checkNotNull(projectManager);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:PasswordReEncryptor.java


示例19: PropertyMigrator

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public PropertyMigrator(ProjectManager projectManager, BitbucketProjectSettings settings)
{
    this.projectManager = projectManager;
    this.settings = settings;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:PropertyMigrator.java


示例20: CleanupPluginSettings

import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public CleanupPluginSettings(final ProjectManager projectManager, final PluginSettingsFactory pluginSettingsFactory)
{
    this.projectManager = projectManager;
    this.pluginSettingsFactory = pluginSettingsFactory;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:CleanupPluginSettings.java



注:本文中的com.atlassian.jira.project.ProjectManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnumConstantDeclaration类代码示例发布时间:2022-05-22
下一篇:
Java Response类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap