当前位置: 首页>>代码示例>>Java>>正文


Java JiraHelper类代码示例

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


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

示例1: getContextMap

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
public Map getContextMap(User user, JiraHelper jiraHelper) {
  Map contextMap = jiraHelper.getContextParams();

  Issue issue = (Issue) contextMap.get("issue");
  
  ExternalObject exObj = this.jamClient.getExternalObject(issue);
  
  contextMap.put("name", exObj.Name);
  contextMap.put("exidHtml", exObj.Exid);
  contextMap.put("objectTypeHtml", exObj.ObjectType);
  contextMap.put("linkHtml", exObj.ODataLink);
  contextMap.put("metadataHtml", exObj.ODataMetadata);
  contextMap.put("permalinkHtml", exObj.Permalink);
  contextMap.put("annotationsHtml", exObj.ODataAnnotations);
  
  contextMap.put("loginToken", jamClient.getSingleUseToken());

  contextMap.put("jamUrl", jamClient.getJamUrl());

  return contextMap;
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:22,代码来源:FeedPanelContextProvider.java

示例2: shouldDisplay

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
public boolean shouldDisplay(User user, Issue issue, JiraHelper jiraHelper) {
  ProjectRoleManager roleManager = (ProjectRoleManager)ComponentAccessor.getComponentOfType(ProjectRoleManager.class); 
  Collection<ProjectRole> roles = roleManager.getProjectRoles(user, jiraHelper.getProjectObject());

  // Check if the user has the required role.
  boolean hasJamRole = false;
  for (ProjectRole role : roles) {
    if (role.getName().equals(JamUser)) {
      hasJamRole = true;
      break;
    }
  }

  if (!hasJamRole) {
    return false;
  }

  // Check if we are filtering based on creation time or not.
  if (displayIfNewerThanJam) {
    Long jamTs = JamClient.getProjectJamTimestamp(issue.getProjectObject());
    Long issueTs = issue.getCreated().getTime();
    return (jamTs <= issueTs);
  }

  return true;
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:27,代码来源:CanAccessJamPluginCondition.java

示例3: shouldDisplay

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
@Override
public boolean shouldDisplay(ApplicationUser arg0, JiraHelper jiraHelper) {
    final Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
    if (currentIssue.getIssueType().getName().equals(HubJiraConstants.HUB_VULNERABILITY_ISSUE)) {
        return true;
    } else if (currentIssue.getIssueType().getName().equals(HubJiraConstants.HUB_POLICY_VIOLATION_ISSUE)) {
        return true;
    }
    return false;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:11,代码来源:HubIssuePanelCondition.java

示例4: getContextMap

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
public Map getContextMap(User user, JiraHelper jiraHelper) {
  Map contextMap = jiraHelper.getContextParams();
  Issue issue = (Issue)contextMap.get("issue");

  List<Group> groups = jamClient.getIssueGroups(issue);
  contextMap.put("groups", groups);

  return contextMap;
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:10,代码来源:GroupListingContextProvider.java

示例5: getContextMap

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
@Override
public Map<String, String> getContextMap(final ApplicationUser user, final JiraHelper jiraHelper) {
    final Map<String, String> contextMap = new HashMap<>();
    final Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
    if (currentIssue != null) {
        final String hubProject = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_PROJECT);
        if (hubProject != null) {
            contextMap.put("bdsHubProject", hubProject);
        }
        final String hubProjectVersion = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_PROJECT_VERSION);
        if (hubProjectVersion != null) {
            contextMap.put("bdsHubProjectVersion", hubProjectVersion);
        }
        final String hubComponent = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_COMPONENT);
        if (hubComponent != null) {
            contextMap.put("bdsHubComponent", hubComponent);
        }
        final String hubComponentVersion = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_COMPONENT_VERSION);
        if (hubComponentVersion != null) {
            contextMap.put("bdsHubComponentVersion", hubComponentVersion);
        }
        final String hubPolicyRule = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_POLICY_RULE);
        if (hubPolicyRule != null) {
            contextMap.put("bdsHubPolicyRule", hubPolicyRule);
        }
        final String hubLicenses = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_LICENSE_NAMES);
        if (hubLicenses != null) {
            contextMap.put("bdsHubLicenses", hubLicenses);
        }

        final String hubComponentUsage = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_COMPONENT_USAGE);
        if (hubComponentUsage != null) {
            contextMap.put("bdsHubComponentUsage", hubComponentUsage);
        }
        final String hubComponentOrigin = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_COMPONENT_ORIGIN);
        if (hubComponentOrigin != null) {
            contextMap.put("bdsHubComponentOrigin", hubComponentOrigin);
        }
        final String hubComponentOriginId = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_COMPONENT_ORIGIN_ID);
        if (hubComponentOriginId != null) {
            contextMap.put("bdsHubComponentOriginId", hubComponentOriginId);
        }
        final String hubProjectVersionNickname = getCustomFieldValue(currentIssue, customFieldManager,
                HubJiraConstants.HUB_CUSTOM_FIELD_PROJECT_VERSION_NICKNAME);
        if (hubProjectVersionNickname != null) {
            contextMap.put("bdsHubProjectVersionNickname", hubProjectVersionNickname);
        }
    }
    return contextMap;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:60,代码来源:HubIssuePanel.java

示例6: getContextMap

import com.atlassian.jira.plugin.webfragment.model.JiraHelper; //导入依赖的package包/类
public Map getContextMap(User user, JiraHelper jiraHelper) {
    // dont know why, but user and jiraHelper are always null
    return null;
}
 
开发者ID:SecSign,项目名称:SecSign-ID-JIRA-Plugin,代码行数:5,代码来源:SecSignIDJiraUserInfoProvider.java


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