Package com.casamind.adware.server.domain

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


    new ObjectifyGenericDAO<Company>(Company.class).delete(getCompanyById(id));
  }

  public static Company createCompany(Company entity) {
    ObjectifyGenericDAO<Company> dao = new ObjectifyGenericDAO<Company>(Company.class);
    Company datastoreItem = null;
    if (entity != null) {
      Key<Company> key = dao.put(entity);
      try {
        datastoreItem = dao.get(key);
      } catch (EntityNotFoundException e) {
View Full Code Here


      return user;
    return null;
  }

  public static UserAccount getOwnerById(Long ownerId) {
    Company company = getCompanyById(ownerId);
    if (company != null){
      return company;
    } else {
      return getPublisherById(ownerId);     
    }
View Full Code Here

                  if (pbId != null) {
                    Publisher publisher = DatastoreProxy.getPublisherById(pbId);
                    if (publisher != null) {
                      Long cpId = publisher.getCompanyId();
                      if (cpId != null) {
                        Company company = DatastoreProxy.getCompanyById(cpId);
                        if (company != null) {
                          Ad ad = new Ad(startTime, endTime, company.getLastname(), product.getName(), product.getSlogan(), product.getText(), product.getLink(), resourcesURLs, true, new Double(1));
                          adDAO.put(ad);
                          schedule.getAdIds().add(ad.getId());
                          startTime = calendar.getTime();
                          sb.append("\n<AdDTO>");
                          sb.append("\n<Id>" + ad.getUUID() + "</Id>");
                          sb.append("\n<Company>");
                          sb.append("\n<Id>" + company.getUUID() + "</Id>");
                          sb.append("\n<Name>" + ad.getCompany() + "</Name>");
                          sb.append("\n</Company>");
                          sb.append("\n<Publisher>");
                          sb.append("\n<Id>" + publisher.getUUID() + "</Id>");
                          sb.append("\n<Name>" + publisher.getFirstname() + " " + publisher.getLastname() + "</Name>");
View Full Code Here

              }
              if (attendee != null) {
                log.info("Extracted attendee: " + login);
                SimpleDateFormat icalFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
                SimpleDateFormat logFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm Z");
                Company company = DatastoreProxy.getCompanyByLogin(login);
                if (company != null) {
                  log.info("Found company: " + company.getLastname());
                  Slot slot = new Slot();
                  slot.setOwnerId(company.getId());
                  log.info("DTSTART :" + startDate.getValue());
                  Date parsedStartDate = icalFormatter.parse(startDate.getValue());
                  log.info("Parsed start date :" + logFormatter.format(parsedStartDate));
                  log.info("DTEND :" + endDate.getValue());
                  Date parsedEndDate = icalFormatter.parse(endDate.getValue());
                  log.info("Parsed end date :" + logFormatter.format(parsedEndDate));
                  slot.setStartDate(parsedStartDate);
                  slot.setEndDate(parsedEndDate);
                  slot.setStatus(SlotStatus.Ordered);
                  long slotInterval = parsedEndDate.getTime() - parsedStartDate.getTime();
                  log.info("Interval in miliseconds: " + slotInterval);
                  long slotDurationInMilisecondes = (long) duration * 60 * 1000;
                  log.info("Default slot duration in miliseconds: " + slotDurationInMilisecondes);
                  long nbSlots = slotInterval / slotDurationInMilisecondes;
                  log.info("Number of slots (Long): " + nbSlots);
                  slot.setNbSlots((int) nbSlots);
                  slot.setPrice(price);
                  Slot entity = DatastoreProxy.createSlot(slot);
                  log.info("Created new slot for company:" + company.getLastname());
                  log.info(entity.toString());
                } else {
                  log.info("Did not find a company with login: " + login);
                  log.info("Trying to a find a publisher with login: " + login);
                  Publisher publisher = DatastoreProxy.getPublisherByLogin(login);
View Full Code Here

      duration = Integer.parseInt(getInitParameter("duration"));
      price = Integer.parseInt(getInitParameter("price"));
      log.info("Extracted attendee: " + attendee);
      SimpleDateFormat icalFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
      SimpleDateFormat logFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm Z");
      Company company = DatastoreProxy.getCompanyByLogin(attendee);
      if (company != null) {
        log.info("Found company: " + company.getLastname());
        Slot slot = new Slot();
        slot.setOwnerId(company.getId());
        log.info("DTSTART :" + startDate);
        Date parsedStartDate = icalFormatter.parse(startDate);
        log.info("Parsed start date :" + logFormatter.format(parsedStartDate));
        log.info("DTEND :" + endDate);
        Date parsedEndDate = icalFormatter.parse(endDate);
        log.info("Parsed end date :" + logFormatter.format(parsedEndDate));
        slot.setStartDate(parsedStartDate);
        slot.setEndDate(parsedEndDate);
        slot.setStatus(SlotStatus.Ordered);
        long slotInterval = parsedEndDate.getTime() - parsedStartDate.getTime();
        log.info("Interval in miliseconds: " + slotInterval);
        long slotDurationInMilisecondes = (long) duration * 60 * 1000;
        log.info("Default slot duration in miliseconds: " + slotDurationInMilisecondes);
        long nbSlots = slotInterval / slotDurationInMilisecondes;
        log.info("Number of slots (Long): " + nbSlots);
        slot.setNbSlots((int) nbSlots);
        slot.setPrice(price);
        Slot entity = DatastoreProxy.createSlot(slot);
        log.info("Created new slot for company:" + company.getLastname());
        log.info(entity.toString());
      } else {
        log.warning("Did not find a company with attendee: " + attendee);
        log.info("Trying to a find a publisher with attendee: " + attendee);
        Publisher publisher = DatastoreProxy.getPublisherByLogin(attendee);
View Full Code Here

TOP

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

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.