Package com.casamind.adware.server.domain

Examples of com.casamind.adware.server.domain.UserAccount


    if (userId == null)
      return null; // user not logged in

    Long id = Long.parseLong(userId.trim());

    UserAccount user = DatastoreProxy.getUserAccountById(id);

    return user;

  }
View Full Code Here


      }
    }
  }

  public UserAccount loginStarts(HttpSession session, UserAccount user, boolean isAdmin) {
    UserAccount loggedUser = DatastoreProxy.getUserAccountByUniqueId(user.getUniqueId());
    if (loggedUser != null) {
      session.setAttribute("userId", String.valueOf(loggedUser.getId()));
      if (isAdmin)
        session.setAttribute("accessLevel", 1);
      else {
        session.setAttribute("accessLevel", loggedUser.getAccessLevel());
      }
    } else {
      session.setAttribute("accessLevel", 0);
    }
    session.setAttribute("loggedin", true);
View Full Code Here

    // if it's an administrator
    if ((userId == null || userId == 0) && (fileName == null || "".equals(fileName))) {
      gdataProxy = new GDataDocumentsProxy(documentsFeedUrl, spreadsheetFeedUrl, gdataAdminLogin, gdataAdminPassword, gdataThreadSleep, gdataConnectTimeout);
      return gdataProxy.getSpreadsheetURL(adminSpreadsheet);
    }
    UserAccount user = DatastoreProxy.getUserAccountById(userId);
    if (user != null) {
      if (user.getGdataLogin() == null)
        user.setGdataLogin(gdataWebLogin);
      if (user.getGdataPassword() == null)
        user.setGdataPassword(gdataWebPassword);
      gdataProxy = new GDataDocumentsProxy(documentsFeedUrl, spreadsheetFeedUrl, user.getGdataLogin(), user.getGdataPassword(), gdataThreadSleep, gdataConnectTimeout);
      DatastoreProxy.updateUser(user);
      return gdataProxy.getSpreadsheetURL(fileName);
    }
    return null;
  }
View Full Code Here

    ObjectifyGenericDAO<Company> companyDAO = new ObjectifyGenericDAO<Company>(Company.class);
    ObjectifyGenericDAO<Publisher> publisherDAO = new ObjectifyGenericDAO<Publisher>(Publisher.class);
    ObjectifyGenericDAO<Product> productDAO = new ObjectifyGenericDAO<Product>(Product.class);
    ObjectifyGenericDAO<Resource> resourceDAO = new ObjectifyGenericDAO<Resource>(Resource.class);
    ObjectifyGenericDAO<Slot> slotDAO = new ObjectifyGenericDAO<Slot>(Slot.class);
    UserAccount admin = new UserAccount("mouncif.faqir@gmail.com", AuthTypes.GOOGLE);
    admin.setFirstname("Mouncif");
    admin.setLastname("FAQIR");
    admin.setPhone("+33607677177");
    admin.setEmail("mouncif.faqir@gmail.com");
    admin.setLastLoginOn(calendar.getTime());
    admin.setReceiveNewsLetter(true);
    admin.setReceiveNotifications(true);
    admin.setAccessLevel(AccessLevels.Administrator);
    userAccountDAO.put(admin);
    for (int i = 0; i < 2; i++) {
      Company company = new Company();
      company.setAccessLevel(AccessLevels.Company);
      company.setLogin("company" + i + "@example.com");
View Full Code Here

      log.info("Peforming slot email task...");
      Long entityId = Long.parseLong(req.getParameter("entityId"));
      if (entityId != null && !"".equals(entityId)) {
        slot = DatastoreProxy.getSlotById(entityId);
        if (slot != null) {
          UserAccount owner = DatastoreProxy.getOwnerById(slot.getOwnerId());
          if (owner != null) {
            setRecipientsBySlotId(owner);
            if (task.equals(MailTaskTypes.SLOT_OREDERED)) {
              log.info("Peforming slot order task...");
              String body = getBodyContentTemplate("WEB-INF/files/templates/email_slot_ordered.html");
View Full Code Here

import com.google.appengine.api.taskqueue.TaskOptions;
import com.googlecode.objectify.Key;

public class DatastoreProxy {
  public static UserAccount getUserAccountById(Long id) {
    UserAccount user = null;
    user = new ObjectifyGenericDAO<UserAccount>(UserAccount.class).getByProperty("id", id);
    if (user != null)
      return user;
    user = new ObjectifyGenericDAO<Company>(Company.class).getByProperty("id", id);
    if (user != null)
View Full Code Here

      return user;
    return null;
  }

  public static UserAccount getUserAccountByLogin(String login) {
    UserAccount user = null;
    user = new ObjectifyGenericDAO<UserAccount>(UserAccount.class).getByProperty("login", login);
    if (user != null)
      return user;
    user = new ObjectifyGenericDAO<Company>(Company.class).getByProperty("login", login);
    if (user != null)
View Full Code Here

    }
    return byteArray;
  }

  public static UserAccount getUserAccountByUniqueId(String uniqueId) {
    UserAccount user = null;
    user = new ObjectifyGenericDAO<UserAccount>(UserAccount.class).getByProperty("uniqueId", uniqueId);
    if (user != null)
      return user;
    user = new ObjectifyGenericDAO<Company>(Company.class).getByProperty("uniqueId", uniqueId);
    if (user != null)
View Full Code Here

TOP

Related Classes of com.casamind.adware.server.domain.UserAccount

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.