Package org.infoglue.cms.entities.publishing

Examples of org.infoglue.cms.entities.publishing.Publication


          QueryResults results = oql.execute(Database.READONLY);

      while (results.hasMore())
            {
              Publication publication = (Publication)results.next();
              res.add(publication.getValueObject());
            }

      results.close();
      oql.close();
View Full Code Here


          QueryResults results = oql.execute(Database.READONLY);

      while (results.hasMore())
            {
              Publication publication = (Publication)results.next();
              res.add(publication.getValueObject());
            }

      results.close();
      oql.close();
View Full Code Here

      EditionBrowser browser = new EditionBrowser(allEditions.size(), pageSize, startIndex);

      List editionVOs = new ArrayList();
      for (Iterator iter = page.iterator(); iter.hasNext();)
      {
        Publication pub = (Publication) iter.next();
        PublicationVO pubVO = pub.getValueObject();
        //pubVO.setPublicationDetails(toVOList(pub.getPublicationDetails()));
        editionVOs.add(pubVO);
      }

      browser.setEditions(editionVOs);
View Full Code Here

    {
       logger.info("*********************************");
      logger.info("Creating edition ");
      logger.info("*********************************");

        Publication publication = new PublicationImpl();
        publicationVO.setPublicationDateTime(Calendar.getInstance().getTime());
        publication.setValueObject(publicationVO);
    publication.setPublisher(infoGluePrincipal.getName());

    Iterator<EventVO> eventIterator = events.iterator();
    while(eventIterator.hasNext())
    {
      EventVO event = eventIterator.next();
View Full Code Here

    {
       logger.info("*********************************");
      logger.info("Creating edition ");
      logger.info("*********************************");

        Publication publication = new PublicationImpl();
        publicationVO.setPublicationDateTime(Calendar.getInstance().getTime());
        publication.setValueObject(publicationVO);
    publication.setPublisher("SYSTEM");

    for(PublicationDetailVO publicationDetailVO : publicationDetailVOList)
    {
      createPublicationInformation(publication, publicationDetailVO, db);
    }
View Full Code Here

    Database db = CastorDatabaseService.getDatabase();
    beginTransaction(db);

        try
        {
          Publication publication = getPublicationWithId(publicationId, db);
          Collection<PublicationDetailVO> details = publication.getPublicationDetails();
            publicationDetails = toVOList(details);

      commitTransaction(db);
        }
        catch(Exception e)
View Full Code Here

   */
  public List<PublicationDetailVO> getPublicationDetailVOList(Integer publicationId, Database db) throws SystemException
  {
    List<PublicationDetailVO> publicationDetails = new ArrayList<PublicationDetailVO>();

      Publication publication = getPublicationWithId(publicationId, db);
      Collection<PublicationDetailVO> details = publication.getPublicationDetails();
        publicationDetails = toVOList(details);

        return publicationDetails;
  }
View Full Code Here

  public static PublicationVO unPublish(Integer publicationId, InfoGluePrincipal infoGluePrincipal) throws SystemException
  {
    logger.info("Starting unpublishing operation...");

    Database db = CastorDatabaseService.getDatabase();
    Publication publication = null;

        beginTransaction(db);

        try
        {
      publication = getPublicationWithId(publicationId, db);
      Collection publicationDetails = publication.getPublicationDetails();

      Iterator i = publicationDetails.iterator();
      while (i.hasNext())
      {
        PublicationDetail publicationDetail = (PublicationDetail)i.next();
        logger.info("publicationDetail:" + publicationDetail.getId() + ":" + publicationDetail.getTypeId());
        //We unpublish them as long as they are not unpublish-requests.
        if(publicationDetail.getTypeId().intValue() != PublicationDetailVO.UNPUBLISH_LATEST.intValue())
        {
          unpublishEntity(publicationDetail, infoGluePrincipal, db);
        }
        else
        {
            republishEntity(publicationDetail, infoGluePrincipal, db);
        }
      }

            db.remove(publication);

      commitTransaction(db);
      logger.info("Done unpublishing operation...");
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not completes the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }

        try
    {
      logger.info("Starting replication operation...");
      ReplicationMySqlController.updateSlaveServer();
      logger.info("Done replication operation...");
    }
    catch (Exception e)
    {
      logger.error("An error occurred when we tried to replicate the data:" + e.getMessage(), e);
    }

    //Update live site!!!
    try
    {
      logger.info("Notifying the entire system about an unpublishing...");
      NotificationMessage notificationMessage = new NotificationMessage("PublicationController.unPublish():", PublicationImpl.class.getName(), infoGluePrincipal.getName(), NotificationMessage.UNPUBLISHING, publication.getId(), publication.getName());
          ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          RemoteCacheUpdater.pushAndClearSystemNotificationMessages(infoGluePrincipal);
          //RemoteCacheUpdater.clearSystemNotificationMessages();
          logger.info("Finished Notifying...");
    }
    catch (Exception e)
    {
      logger.error("An error occurred when we tried to replicate the data:" + e.getMessage(), e);
    }

        return publication.getValueObject();
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.publishing.Publication

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.