Package com.casamind.adware.server.domain

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


    new ObjectifyGenericDAO<Publisher>(Publisher.class).delete(getPublisherById(id));
  }

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


                      }
                    }
                  }
                  Long pbId = product.getPublisherId();
                  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>");
                          sb.append("\n</Publisher>");
                          sb.append("\n<Product>");
                          sb.append("\n<Id>" + product.getUUID() + "</Id>");
                          sb.append("\n<Name>" + ad.getProduct() + "</Name>");
                          sb.append("\n<Text>" + ad.getText() + "</Text>");
View Full Code Here

                  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);
                  if (publisher != null) {
                    log.info("Found publisher with login: " + publisher.getFirstname() + " " + publisher.getLastname());
                    Slot slot = new Slot();
                    slot.setOwnerId(publisher.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 publisher:" + publisher.getFirstname() + " " + publisher.getLastname());
                    log.info(entity.toString());
                  } else {
                    log.warning("Could not find publisher: " + login);
                  }
                }
View Full Code Here

TOP

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

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.