Package qurtext.domain

Examples of qurtext.domain.Profile


  @SuppressWarnings("unchecked")
  public Profile getProfile(String email) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      String query = "select from " + Profile.class.getName() + " where email=='" + email + "'";
      Profile result = ((Collection<Profile>) pm.newQuery(query)
          .execute()).iterator().next();
      return result;
    } catch (NoSuchElementException e) {
      Profile result=new Profile(email);
      pm.makePersistent(result);
      return result;
    } finally {
      pm.close();
    }
View Full Code Here


  public void saveProgress(String email, String sectionRead,
      String lastSection) {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
      String query = "select from " + Profile.class.getName() + " where email=='" + email + "'";
      Profile result = ((Collection<Profile>) pm.newQuery(query)
          .execute()).iterator().next();
      result.setSectionRead(sectionRead);
      result.setCurrentHistory(lastSection);
    } catch (NoSuchElementException e) {
      Profile result=new Profile(email);
      result.setSectionRead(sectionRead);
      result.setCurrentHistory(lastSection);
      pm.makePersistent(result);
    } finally {
      pm.close();
    }
  }
View Full Code Here

  }

  public ClientUser getCurrentUser(String destinationURL) {
    if (userService.isUserLoggedIn()) {
      User user = userService.getCurrentUser();
      Profile profile = profileFactory.getProfile(user.getEmail());
      return new ClientUser(user.getEmail(),userService.createLogoutURL(destinationURL), userService.isUserAdmin() || user.getEmail().equals("aburizal"+"@gmail.com"), profile.getSectionRead(), profile.getCurrentHistory());
    } else {
      return new ClientUser(null,userService.createLoginURL(destinationURL), false, null, null);
    }
  }
View Full Code Here

TOP

Related Classes of qurtext.domain.Profile

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.