Package org.cipres.treebase.domain.admin

Examples of org.cipres.treebase.domain.admin.User


    }

    // 1. create a new submission:
    String newName = testName + " test " + Math.random();

    User submitter = (User) loadObject(User.class);
    assertTrue("Empty user table.", submitter != null);

    Study s = new Study();
    s.setName(newName);
View Full Code Here


    }

    // 1. create a new submission:
    String newName = testName + " test " + Math.random();

    User submitter = (User) loadObject(User.class);
    assertTrue("Empty user table.", submitter != null);

    Study s = new Study();
    s.setName(newName);
View Full Code Here

    }

    // 1. create a new submission:
    String newName = testName + " test " + Math.random();

    User submitter = (User) loadObject(User.class);
    assertTrue("Empty user table.", submitter != null);

    Study s = new Study();
    s.setName(newName);
View Full Code Here

    }

    // 1. create a new submission:
    String newName = testName + " test " + Math.random();

    User submitter = (User) loadObject(User.class);
    assertTrue("Empty user table.", submitter != null);

    Study s = new Study();
    s.setName(newName);
View Full Code Here

  /**
   *
   * @see org.cipres.treebase.domain.admin.UserService#deleteUser(java.lang.String)
   */
  public void deleteUser(String pUserName) {
    User user = findUserByName(pUserName);
    if (user == null) {
      throw new EntityNotFoundException("Delete User: cannot find user " + pUserName);
    } else {
      getUserHome().delete(user);
    }
View Full Code Here

    if (TreebaseUtil.isEmpty(pSourceUsername) || TreebaseUtil.isEmpty(pTargetUsername)
      || pSourceUsername.equals(pTargetUsername)) {
      return 0;
    }

    User userSource = findUserByName(pSourceUsername);
    User userTarget = findUserByName(pTargetUsername);

    if (userSource.getSubmissionCount() == 0) {
      return 0;
    }

    Collection<Submission> subCopy = userSource.getSubmissionsCopy();

    int count = 0;
    for (Submission aSubmission : subCopy) {

      userSource.removeSubmission(aSubmission);
      userTarget.addSubmission(aSubmission);

      count++;
    }

    return count;
View Full Code Here

    // If there are two user accounts, then both are pointing to the same target person.
    // Merge author/editor records
    // delete the source person record.
   
    int changedCount = 0;
    User userSrc = getUserHome().findByPerson(personSrc);
    if (userSrc != null) {
      userSrc.setPerson(personTarget);

      User userTarget = getUserHome().findByPerson(personTarget);
      if (userTarget != null && userSrc.getSubmissionCount() > 0) {
        // Move all submissions:
        Collection<Submission> subCopy = userSrc.getSubmissionsCopy();

        for (Submission aSubmission : subCopy) {

          userSrc.removeSubmission(aSubmission);
          userTarget.addSubmission(aSubmission);

          changedCount++;
        }
      }
View Full Code Here

    }

    if (sub == null) {
      return TBPermission.NONE;
    }
    User user = getUserHome().findByUserName(pUsername);

    return sub.getPermission(user);
  }
View Full Code Here

    }

    String pName = (String) command;
   
    //TODO: move following logic to userservice.deleteUser() !!
    User pUser = getUserService().findUserByName(pName);
    Iterator<Submission> submissionIterator = pUser.getSubmissionsCopy().iterator();

    int submissioncount = pUser.getSubmissionCount();
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("NUMBER OF SUBMISSIONS: " + submissioncount);
    }

    while (submissionIterator.hasNext()) {
View Full Code Here

    BindException bindExp) throws Exception {

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Entering RegisterUserController:onsubmit()...");
    }
    User user = (User) command;

    if (!checkPasswords(request, user)) {
      return setAttributeAndShowForm(
        request,
        response,
        bindExp,
        "errors",
        "Passwords, you typed are not identical.");

    }

    if (request.getParameter(ACTION_SUBMIT) != null) {
      // TODO: need code to encrypt and decrypt password
      // user.setPassword(StringUtil.encodePassword(user.getPassword(),Constants.ENCRYPTION_ALGORITHM));
      StringUtil.encodePassword(user.getPassword(), Constants.ENCRYPTION_ALGORITHM);

      ExecutionResult execResult = getUserService().createUser(user);

      if (!execResult.isSuccessful()) {
        // possible reason: e.g. the username or the email address is already taken.
View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.admin.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.