本文整理汇总了Java中com.atlassian.jira.project.ProjectManager类的典型用法代码示例。如果您正苦于以下问题:Java ProjectManager类的具体用法?Java ProjectManager怎么用?Java ProjectManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectManager类属于com.atlassian.jira.project包,在下文中一共展示了ProjectManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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());
}
}
示例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;
}
示例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();
}
示例13: getJiraProjectManager
import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public ProjectManager getJiraProjectManager() {
return ComponentAccessor.getProjectManager();
}
示例14: setProjectManager
import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
public void setProjectManager(final ProjectManager projectManager) {
this.projectManager = projectManager;
}
示例15: getJiraProjectManager
import com.atlassian.jira.project.ProjectManager; //导入依赖的package包/类
@Override
public ProjectManager getJiraProjectManager() {
return projectManager;
}