Package org.damour.base.client.objects

Examples of org.damour.base.client.objects.User


    return referrals;
  }

  public Page<PermissibleObject> getPage(PermissibleObject parent, String pageClassType, String sortField, boolean sortDescending, int pageNumber, int pageSize)
      throws SimpleMessageException {
    User authUser = getAuthenticatedUser(session.get());
    try {
      Class<?> clazz = Class.forName(pageClassType);
      return PageHelper.getPage(session.get(), parent, clazz, authUser, sortField, sortDescending, pageNumber, pageSize);
    } catch (Throwable t) {
      Logger.log(t);
View Full Code Here


    }
  }

  public PageInfo getPageInfo(PermissibleObject parent, String pageClassType, int pageSize) throws SimpleMessageException {
    try {
      User authUser = getAuthenticatedUser(session.get());
      Class<?> clazz = Class.forName(pageClassType);
      return PageHelper.getPageInfo(session.get(), parent, clazz, authUser, pageSize);
    } catch (Throwable t) {
      Logger.log(t);
      throw new SimpleMessageException(t.getMessage());
View Full Code Here

      throw new SimpleMessageException(t.getMessage());
    }
  }

  public FileUploadStatus getFileUploadStatus() throws SimpleMessageException {
    User authUser = getAuthenticatedUser(session.get());
    if (authUser == null) {
      throw new SimpleMessageException("User is not authenticated.");
    }
    try {
      FileUploadStatus status = fileUploadStatusMap.get(authUser);
View Full Code Here

    }
  }

  public List<PermissibleObjectTreeNode> searchPermissibleObjects(PermissibleObject parent, String query, String sortField, boolean sortDescending,
      String searchObjectType, boolean searchNames, boolean searchDescriptions, boolean searchKeywords, boolean useExactPhrase) throws SimpleMessageException {
    User user = getAuthenticatedUser(session.get());
    // return all permissible objects which match the name/description
    try {
      Class<?> clazz = Class.forName(searchObjectType);
      return PermissibleObjectHelper.search(session.get(), user, getVoterGUID(), clazz, query, sortField, sortDescending, searchNames, searchDescriptions,
          searchKeywords, useExactPhrase);
View Full Code Here

    // TODO Auto-generated method stub
    return null;
  }

  public void createTag(String tagName, String tagDescription, Tag parentTag) throws SimpleMessageException {
    User authUser = getAuthenticatedUser(session.get());
    if (authUser == null) {
      throw new SimpleMessageException("User is not authenticated.");
    }

    if (StringUtils.isEmpty(tagName)) {
View Full Code Here

      throw new SimpleMessageException(t.getMessage());
    }
  }

  public void deleteTag(final Tag tag) throws SimpleMessageException {
    User authUser = getAuthenticatedUser(session.get());
    if (authUser == null) {
      throw new SimpleMessageException("User is not authenticated.");
    }

    if (tag == null) {
View Full Code Here

    if (tagMembership.getPermissibleObject() == null) {
      throw new SimpleMessageException("PermissibleObject not provided.");
    }

    User authUser = getAuthenticatedUser(session.get());
    if (authUser == null) {
      throw new SimpleMessageException("User is not authenticated.");
    }

    // assumption is that the membership does not exist but the category / permissible object do
View Full Code Here

  public void removeTagMembership(final TagMembership tagMembership) throws SimpleMessageException {
    removeFromTag(tagMembership.getTag(), tagMembership.getPermissibleObject());
  }

  public void removeFromTag(final Tag tag, final PermissibleObject permissibleObject) throws SimpleMessageException {
    User authUser = getAuthenticatedUser(session.get());
    if (authUser == null) {
      throw new SimpleMessageException("User is not authenticated.");
    }

    if (tag == null) {
View Full Code Here

      throw new SimpleMessageException(t.getMessage());
    }
  }

  public void sendEmail(PermissibleObject permissibleObject, final String subject, final String message, String fromAddress, String fromName, String toAddresses) {
    User user = null;
    try {
      user = getAuthenticatedUser();
    } catch (Throwable t) {
    }
    if (user != null) {
      fromName = user.getFirstname() + " " + user.getLastname();
    }
    StringTokenizer st = new StringTokenizer(toAddresses, ";");
    while (st.hasMoreTokens()) {
      String toAddress = st.nextToken();
      String toName = st.nextToken();
View Full Code Here

  }

  public User submitAccountValidation(String username, String validationCode) throws SimpleMessageException {
    Transaction tx = session.get().beginTransaction();
    try {
      User user = UserHelper.getUser(session.get(), username);
      if (user != null && !user.isValidated()) {
        MD5 md5 = new MD5();
        md5.Update(user.getEmail());
        md5.Update(user.getPasswordHash());
        if (validationCode.equals(md5.asHex())) {
          // validation successful
          user.setValidated(true);
          login(session.get(), getThreadLocalRequest(), getThreadLocalResponse(), username, user.getPasswordHash(), true);
          tx.commit();
        } else {
          throw new SimpleMessageException("Account could not be activated, validation code does not match our records.");
        }
      } else {
View Full Code Here

TOP

Related Classes of org.damour.base.client.objects.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.