Package com.xmultra.processor.db.cms.content

Examples of com.xmultra.processor.db.cms.content.PhotoPackage


      cp = new ContentPackage();
      cp.setArticle(ba);

      if (this.contentContainsPhotoPkg(pkgContentElem)) {
        String fileName = ba.getFileName();
        PhotoPackage pp = new PhotoPackage();
        pp.setCategoryId(ba.getCategoryId());
        pp.setCreateBy("Insert process");
        // CMS limits photo package "name" to 50 characters.
        pp.setDescription(fileName.substring(0, Math.min(fileName.length(), 41)) +
                          "_" + ba.getStartTimeAsMMDDYYYYString());
        pp.setStartTime(ba.getStartTime());
        Date startTime = ba.getStartTime();
        Calendar cal = Calendar.getInstance();
        cal.setTime(startTime);
        // Make end time one month later than start time.
        cal.add(Calendar.MONTH, 1);
        Date endTime = cal.getTime();
        pp.setEndTime(endTime);
        pp.setKeywords(fileName.substring(0, Math.min(fileName.length(), 100)));
        pp.setNational(false);
        pp.setPubId(ba.getPubId());

        Element photoPkgElem =
            this.xmlParseUtils.getSingletonElement(pkgContentElem, "PhotoPackage");
        NodeList photoNodes = photoPkgElem.getElementsByTagName("Photo");
        int numPhotos = 0;
        Photo currentPhoto = null;
        if (photoNodes != null) {
          numPhotos = photoNodes.getLength();
        }
        for (int i = 0; i < numPhotos; i++) {
          currentPhoto = this.getPhotoFromPhotoElem((Element)photoNodes.item(i));
          pp.addPhoto(currentPhoto);
        }
        cp.setPhotoPackage(pp);
      }
    }
    return cp;
View Full Code Here


      contentPackage.setSiteId(pi.getSiteId());
      contentPackage.setPubId(pi.getPubId());
    }

    if (contentPackage.hasPhotoPackage()) {
      PhotoPackage currentPhotoPkg = contentPackage.getPhotoPackage();
      currentPhotoPkg.setPubId(contentPackage.getPubId());
      try {
        photoPkgId = PhotoPackageCSHelper.storePhotoPackage(currentPhotoPkg, con);
      }
      catch (SQLException se) {
        PhotoPackagePersistenceException ppe =
            new PhotoPackagePersistenceException(se.getMessage(),
                                                 "Error trying to create photo package");
        exceptionArrayList.add(ppe);
        throw new ContentPersistenceExceptions(exceptionArrayList);
      }
      Console.displayDev("ContentPersistenceHandler",
                         "Photo package ID is: " + photoPkgId, true, "scb");
      currentPhotoPkg.setPackageId(photoPkgId);
      Iterator photos = currentPhotoPkg.getPhotos();
      Photo currentPhoto = null;
      int currentPhotoId = 0;
      while (photos.hasNext()) {
        currentPhoto = (Photo) photos.next();
        currentPhoto.setPubId(contentPackage.getPubId());
View Full Code Here

TOP

Related Classes of com.xmultra.processor.db.cms.content.PhotoPackage

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.