Package com.atlassian.crowd.embedded.api

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


  @PUT
  @Path("/activate")
  public Response activeUserWrapper(@FormParam("active") boolean active)
  {
    User user = jiraAuthenticationContext.getLoggedInUser();
    userWrapperDaoService.activate(user, active);

    return Response.ok().build();
  }
View Full Code Here


  @PUT
  @Path("{ref}")
  public Response setValue(@PathParam("ref") String ref,
                           @FormParam("value") String value)
  {
    User user = jiraAuthenticationContext.getLoggedInUser();
    if (!permissionManager.hasPermission(Permissions.ADMINISTER, user))
    {
      return Response.status(Response.Status.FORBIDDEN).build();
    }
   
View Full Code Here

  @PUT
  @Path("{id}/config")
  public Response activeAchievement(@PathParam("id") int achievementId,
                                    @FormParam("active") boolean active)
  {
    User user = jiraAuthenticationContext.getLoggedInUser();
    if (!permissionManager.hasPermission(Permissions.ADMINISTER, user))
    {
      return Response.serverError().status(Response.Status.FORBIDDEN).build();
    }
View Full Code Here

    List<Issue> matchingIssues = searchIssuesMatchingQuery();
    for (Issue issue : matchingIssues)
    {
      Project project = issue.getProjectObject();
      User reporterUser = issue.getReporterUser();
      if (reporterUser == null)
      {
        continue;
      }
     
      String user = reporterUser.getName();
      updateUserStatistic(resolvedByUser, user);
      updateProjectStatistic(resolvedByUserByProject, project, user);
      updateComponentsStatistic(resolvedByUserByComponent, project, issue.getComponentObjects(), user);
      updateVersionsStatistic(resolvedByUserByVersion, project, issue.getAffectedVersions(), user);
    }
View Full Code Here

    this.achievementManager = achievementManager;
  }

  public UserWrapper getCurrentUserWrapper()
  {
    User user = jiraAuthenticationContext.getLoggedInUser();

    return get(user);
  }
View Full Code Here

    return createUserWrapper("bob", "Sponge Bog");
  }

  private UserWrapper createUserWrapper(String name, String displayName)
  {
    User user = new ImmutableUser(0, name, displayName, null, true);
    return userWrapperDaoService.create(user);
  }
View Full Code Here

    List<Issue> issues =
            issueSearcher.searchIssues(searchQuery);

    for (Issue issue : issues)
    {
      User reporterUser = issue.getReporterUser();
      if (reporterUser == null)
      {
        continue;
      }

      String username = reporterUser.getName();
      checkTime(issue.getCreated(), username, AchievementRefEnum.INSOMNIAC_USER);
      checkTime(issue.getCreated(), username, AchievementRefEnum.EXPRESSO_USER);
      checkTime(issue.getResolutionDate(), getResolverName(issue), AchievementRefEnum.INSOMNIAC_DEVELOPER);
      checkTime(issue.getResolutionDate(), getResolverName(issue), AchievementRefEnum.EXPRESSO_DEVELOPER);
    }
View Full Code Here

                }
                jqlQuery = jqlQuery.replace(Consts.ISSUE_RLINK, issue.getKey());
            }
        }

        User user = ComponentManager.getInstance().getJiraAuthenticationContext().getLoggedInUser();
        SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlQuery);
        if (parseResult.isValid())
        {
            params.put("jqlNotValid", Boolean.FALSE);
            Query query = parseResult.getQuery();
            try
            {
                Map<String, IssueData> cfVals = new LinkedHashMap<String, IssueData>();
                SearchResults results = searchService.search(user, query, PagerFilter.getUnlimitedFilter());
                List<Issue> issues = results.getIssues();
                for (Issue i : issues)
                {
                    StringBuilder sb = new StringBuilder();
                    if (options.contains("status"))
                    {
                        sb.append(getI18nBean().getText("queryfields.opt.status")).append(": ").append(i.getStatusObject().getName());
                    }
                    if (options.contains("assignee") && i.getAssigneeUser() != null)
                    {
                        if (sb.length() > 0)
                        {
                            sb.append(", ");
                        }
                        User aUser = i.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") && i.getPriorityObject() != null)
                    {
                        if (sb.length() > 0)
                        {
View Full Code Here

        else
        {
            jqlData = qfMgr.getQueryFieldData(field.getIdAsLong(), Long.valueOf(prId));
        }

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

    public static List<Issue> executeJQLQuery(String jqlQuery)
    {
        List<Issue> result = null;

        User user = ComponentManager.getInstance()
            .getJiraAuthenticationContext().getLoggedInUser();
        SearchService.ParseResult parseResult = searchService.parseQuery(user,
            jqlQuery);

        if (parseResult.isValid())
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.