Package com.atlassian.crowd.embedded.api

Examples of com.atlassian.crowd.embedded.api.User


                {
                    if (sb.length() > 0)
                    {
                        sb.append(", ");
                    }
                    User aUser = mi.getAssigneeUser();
                    String encodedUser;
                    try
                    {
                        encodedUser = URLEncoder.encode(aUser.getName(),
                            "UTF-8");
                    }
                    catch (UnsupportedEncodingException e)
                    {
                        // --> impossible
                        encodedUser = aUser.getName();
                    }

                    sb.append(getI18nBean().getText("queryfields.opt.assignee"))
                        .append(": ").append("<a class='user-hover' rel='")
                        .append(aUser.getName())
                        .append("' id='issue_summary_assignee_'")
                        .append(aUser.getName())
                        .append("' href='/secure/ViewProfile.jspa?name='")
                        .append(encodedUser).append("'>")
                        .append(aUser.getDisplayName()).append("</a>");
                }
                if (options.contains("priority")
                    && mi.getPriorityObject() != null)
                {
                    if (sb.length() > 0)
                    {
                        sb.append(", ");
                    }
                    sb.append(getI18nBean().getText("queryfields.opt.priority"))
                        .append(": ").append(mi.getPriorityObject().getName());
                }
                if (options.contains("due") && mi.getDueDate() != null)
                {
                    if (sb.length() > 0)
                    {
                        sb.append(", ");
                    }
                    sb.append(getI18nBean().getText("queryfields.opt.due"))
                        .append(": ")
                        .append(
                            ComponentAccessor.getJiraAuthenticationContext()
                                .getOutlookDate().format(mi.getDueDate()));
                }

                if (sb.length() > 0)
                {
                    sb.insert(0, " (");
                    sb.append(")");
                }

                IssueData issueData;
                if (options.contains("justDesc"))
                {
                    String descr = mi.getDescription();
                    if (Utils.isValidStr(descr))
                    {
                        issueData = new IssueData(descr, sb.toString());
                    }
                    else
                    {
                        issueData = new IssueData(mi.getSummary(), sb.toString());
                    }
                }
                else if (options.contains("key"))
                {
                    issueData = new IssueData(mi.getKey().concat(":")
                        .concat(mi.getSummary()), sb.toString());
                }
                else
                {
                    issueData = new IssueData(mi.getSummary(), sb.toString());
                }
                params.put("fullValue", issueData);
            }
        }

        if (!Utils.isValidStr(jqlData))
        {
            params.put("jqlNotSet", Boolean.TRUE);
            return params;
        }
        params.put("jqlNotSet", Boolean.FALSE);
        params.put("options", options);

        if (options.contains("editKey"))
        {
            params.put("hasKey", Boolean.TRUE);
        }

        User user = ComponentManager.getInstance()
            .getJiraAuthenticationContext().getLoggedInUser();
        SearchService.ParseResult parseResult = searchService.parseQuery(user,
            jqlData);
        if (parseResult.isValid())
        {
View Full Code Here


    public Response getCfVals(@Context HttpServletRequest req)
    {
        JiraAuthenticationContext authCtx = ComponentManager.getInstance()
            .getJiraAuthenticationContext();
        I18nHelper i18n = authCtx.getI18nHelper();
        User user = authCtx.getLoggedInUser();
        if (user == null)
        {
            log.error("QueryAutocompleteService::getCfVals - User is not logged");
            return Response
                .ok(i18n.getText("queryfields.service.user.notlogged"))
View Full Code Here

    public Response getIssueTemplate(@Context HttpServletRequest req)
    {
        JiraAuthenticationContext authCtx = ComponentManager.getInstance()
            .getJiraAuthenticationContext();
        I18nHelper i18n = authCtx.getI18nHelper();
        User user = authCtx.getLoggedInUser();
        if (user == null)
        {
            log.error("QueryAutocompleteService::validateInput - User is not logged");
            return Response
                .ok(i18n.getText("queryfields.service.user.notlogged"))
View Full Code Here

  }

  public static String getTextInCurrentUserLocale(String key, Object... parameters) {
    JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
    if (context == null) logger.warn("No JIRA auth context: maybe it is a plugin system 2 plugin now? Text will be formatted in the JIRA default locale.");
    User user = context == null ? null : context.getLoggedInUser();
    return getText(null, user, key, parameters);
  }
View Full Code Here

  }

  public static String getTextInCurrentUserLocale(String key, Object... parameters) {
    JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
    if (context == null) logger.warn("No JIRA auth context: maybe it is a plugin system 2 plugin now? Text will be formatted in the JIRA default locale.");
    User user = context == null ? null : context.getLoggedInUser();
    return getText(null, user, key, parameters);
  }
View Full Code Here

  }

  public static String getTextInCurrentUserLocale(String key, Object... parameters) {
    JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
    if (context == null) logger.warn("No JIRA auth context: maybe it is a plugin system 2 plugin now? Text will be formatted in the JIRA default locale.");
    User user = context == null ? null : context.getLoggedInUser();
    return getText(null, user, key, parameters);
  }
View Full Code Here

  }

  public static String getTextInCurrentUserLocale(String key, Object... parameters) {
    JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
    if (context == null) logger.warn("No JIRA auth context: maybe it is a plugin system 2 plugin now? Text will be formatted in the JIRA default locale.");
    User user = context == null ? null : context.getLoggedInUser();
    return getText(null, user, key, parameters);
  }
View Full Code Here

  }

  public static String getTextInCurrentUserLocale(String key, Object... parameters) {
    JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
    if (context == null) logger.warn("No JIRA auth context: maybe it is a plugin system 2 plugin now? Text will be formatted in the JIRA default locale.");
    User user = context == null ? null : context.getLoggedInUser();
    return getText(null, user, key, parameters);
  }
View Full Code Here

    return ComponentAccessor.getUserManager().getUser(userName);
  }

  @Nullable
  public static String getUserNameByKey(@Nullable String userKey) {
    User user = getUserByKey(userKey);
    return user == null ? null : user.getName();
  }
View Full Code Here

TOP

Related Classes of com.atlassian.crowd.embedded.api.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.