Examples of PublicationVO


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

    assertEquals("Wrong next page size", 2, browser.getNextPageSize());

    int index = 0;
    for (Iterator iter = browser.getEditions().iterator(); iter.hasNext(); index++)
    {
      PublicationVO found = (PublicationVO) iter.next();
      PublicationVO expected = (PublicationVO) testEditions.get(startIndex + index);
      assertEquals("Wrong previous page size", expected.getId(), found.getId());
    }
  }
View Full Code Here

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

    }
  }

  private PublicationVO createEdition(String name, Date publicationDate, int detailCount) throws SystemException
  {
    PublicationVO edition = new PublicationVO();
    edition.setRepositoryId(TEST_REPO);
    edition.setName(name);
    edition.setDescription(getName() + " description");
    edition.setPublicationDateTime(publicationDate);
    edition.setPublisher(getName());

    for (int i = 0; i < detailCount; i++)
    {
      PublicationDetailVO detail = new PublicationDetailVO();
      detail.setName("TestPublicationDetail");
      detail.setEntityClass("TEST-CLASS");
      detail.setEntityId(new Integer(-99));
      detail.setCreationDateTime(new Date());
      detail.setCreator(getName());
      detail.setTypeId(PublicationDetailVO.PUBLISH);
      edition.getPublicationDetails().add(detail);
    }

    PublicationVO savedEdition = PublicationController.create(edition);
    testEditions.add(savedEdition);
    return savedEdition;
  }
View Full Code Here

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

              {
                logger.info("**************************************");
                logger.info("*    HERE THE MAGIC SHOULD HAPPEN    *");
                logger.info("**************************************");
               
                PublicationVO publicationVO = PublicationController.getController().getPublicationVO(new Integer(objectId));
                if(publicationVO != null)
                {
                  AssetCleanerThread assetCleaningThread = new AssetCleanerThread();
                  List publicationDetailVOList = PublicationController.getController().getPublicationDetailVOList(new Integer(objectId));
                  Iterator publicationDetailVOListIterator = publicationDetailVOList.iterator();
                  while(publicationDetailVOListIterator.hasNext())
                  {
                    PublicationDetailVO publicationDetailVO = (PublicationDetailVO)publicationDetailVOListIterator.next();
                    logger.info("publicationDetailVO.getEntityClass():" + publicationDetailVO.getEntityClass());
                    logger.info("publicationDetailVO.getEntityId():" + publicationDetailVO.getEntityId());
                 
                    if(publicationDetailVO.getEntityClass().indexOf("pageCache") > -1)
                    {
                      logger.info("publicationDetailVO.getEntityClass():" + publicationDetailVO.getEntityClass());
                     
                      if(publicationDetailVO.getEntityClass().indexOf("pageCache:") == 0)
                      {
                        String groupQualifyer = publicationDetailVO.getEntityClass().substring("pageCache:".length());
                        logger.info("This is a application pageCache-clear request... specific:" + groupQualifyer);
                        CacheController.clearCaches(publicationDetailVO.getEntityClass(), "" + publicationDetailVO.getEntityId(), null);
                      }
                      else
                      {
                        CacheController.clearCaches("pageCache", "selectiveCacheUpdateNonApplicable", null);
                      }
                     
                        //CacheController.clearCacheForGroup("pageCacheExtra", "selectiveCacheUpdateNonApplicable");
                      //CacheController.clearCacheForGroup("pageCache", "selectiveCacheUpdateNonApplicable");                     
                    }
                    else if(Class.forName(publicationDetailVO.getEntityClass()).getName().equals(ContentVersion.class.getName()))
                    {
                      logger.info("We clear all caches having references to contentVersion: " + publicationDetailVO.getEntityId());
                      try
                      {
                        Integer contentId = ContentVersionController.getContentVersionController().getContentIdForContentVersion(publicationDetailVO.getEntityId());
                        
                          ContentVO previousContentVO = ContentController.getContentController().getContentVOWithId(contentId);
                          Integer previousParentContentId = previousContentVO.getParentContentId();
                          logger.info("previousParentContentId:" + previousParentContentId);
 
                          addCacheUpdateDirective(publicationDetailVO.getEntityClass(), publicationDetailVO.getEntityId().toString(), allIGCacheCalls);
                          //CacheController.clearCaches(publicationDetailVO.getEntityClass(), publicationDetailVO.getEntityId().toString(), null);
                         
                        CacheController.clearCache(SmallContentVersionImpl.class, new Integer[]{new Integer(publicationDetailVO.getEntityId())});
                        CacheController.clearCache(SmallestContentVersionImpl.class, new Integer[]{new Integer(publicationDetailVO.getEntityId())});
 
                        logger.info("We clear all small contents as well " + contentId);
                        CacheController.clearCache(ContentImpl.class, new Integer[]{contentId});
                        CacheController.clearCache(SmallContentImpl.class, new Integer[]{contentId});
                        CacheController.clearCache(SmallishContentImpl.class, new Integer[]{contentId});
                        CacheController.clearCache(MediumContentImpl.class, new Integer[]{contentId});
                        CacheController.clearCache(SmallSiteNodeVersionImpl.class, new Integer[]{new Integer(objectId)});   
                       
                        logger.info("Handling parents....");
                       
                        ContentVO contentVOAfter = ContentController.getContentController().getContentVOWithId(contentId);
                          Integer currentParentContentId = contentVOAfter.getParentContentId();
                          logger.info("previousParentContentId:" + previousParentContentId);
                          logger.info("currentParentContentId:" + currentParentContentId);
 
                          logger.info("We should also clear the parents...");
                        if(currentParentContentId != null)
                        {
                          logger.info("contentVOAfter - clear the new:" + contentVOAfter.getName() + " / " + currentParentContentId);
                          //CacheController.clearCaches(Content.class.getName(), currentParentContentId.toString(), null);
                          addCacheUpdateDirective(Content.class.getName(), currentParentContentId.toString(), allIGCacheCalls);
                         
                            logger.info("We clear all small siteNodes as well " + currentParentContentId);
                          CacheController.clearCache(ContentImpl.class, new Integer[]{currentParentContentId});
                          CacheController.clearCache(SmallContentImpl.class, new Integer[]{currentParentContentId});
                          CacheController.clearCache(SmallishContentImpl.class, new Integer[]{currentParentContentId});
                          CacheController.clearCache(MediumContentImpl.class, new Integer[]{currentParentContentId});
                        }
 
                        if(currentParentContentId != null && previousParentContentId != null && !previousParentContentId.equals(previousParentContentId))
                        {
                          logger.info("contentVOAfter - clear the new:" + contentVOAfter.getName() + " / " + currentParentContentId);
                          //CacheController.clearCaches(Content.class.getName(), previousParentContentId.toString(), null);
                          addCacheUpdateDirective(Content.class.getName(), previousParentContentId.toString(), allIGCacheCalls);
                         
                            logger.info("We clear all small siteNodes as well " + previousParentContentId);
                          CacheController.clearCache(ContentImpl.class, new Integer[]{previousParentContentId});
                          CacheController.clearCache(SmallContentImpl.class, new Integer[]{previousParentContentId});
                          CacheController.clearCache(SmallishContentImpl.class, new Integer[]{previousParentContentId});
                          CacheController.clearCache(MediumContentImpl.class, new Integer[]{previousParentContentId});
                        }

                        if (publicationDetailVO.getTypeId().equals(PublicationDetailVO.UNPUBLISH_LATEST))
                        {
                          assetCleaningThread.addContentVersion(publicationDetailVO.getEntityId());
                        }
                      }
                      catch(Exception e)
                      {
                        logger.warn("An error occurred handling content version from publication " + publicationVO.getId() + ":" + e.getMessage());
                      }
                    }
                    else if(Class.forName(publicationDetailVO.getEntityClass()).getName().equals(SiteNodeVersion.class.getName()))
                    {
                      System.out.println("SiteNodeVersion update....:" + publicationDetailVO.getEntityId());
                      try
                      {
                        SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(publicationDetailVO.getEntityId());
                        //logger.info("siteNodeVersionVO:" + siteNodeVersionVO.getId());
                        Integer siteNodeId = siteNodeVersionVO.getSiteNodeId();
                       
                        CacheController.clearCache("pageCacheLatestSiteNodeVersions", "" + siteNodeId);
                        String versionKey = "" + siteNodeId + "_" + CmsPropertyHandler.getOperatingMode() + "_siteNodeVersionVO";   
                          CacheController.clearCache("latestSiteNodeVersionCache", versionKey);
                       
                          logger.info("We also clear the meta info content..");
 
                          SiteNodeVO previousSiteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId);
                          Integer previousParentSiteNodeId = previousSiteNodeVO.getParentSiteNodeId();
                          //System.out.println("previousParentSiteNodeId:" + previousParentSiteNodeId);
                          Object previousParentSiteNodeIdCandidate = CacheController.getCachedObject("parentSiteNodeCache", "" + siteNodeId);
                          //System.out.println("previousParentSiteNodeIdCandidate:" + previousParentSiteNodeIdCandidate);
                          if(previousParentSiteNodeIdCandidate != null && !(previousParentSiteNodeIdCandidate instanceof NullObject))
                            previousParentSiteNodeId = ((SiteNodeVO)previousParentSiteNodeIdCandidate).getId();
                          //System.out.println("previousParentSiteNodeId:" + previousParentSiteNodeId);
                           
                          //CacheController.clearCaches(publicationDetailVO.getEntityClass(), publicationDetailVO.getEntityId().toString(), null);
                        //if(siteNodeId != null)
                        //  CacheController.clearCaches(SiteNode.class.getName(), siteNodeId.toString(), null);
                         
                          logger.info("We clear all small siteNodes as well " + siteNodeId);
                        CacheController.clearCache(SiteNodeImpl.class, new Integer[]{siteNodeId});
                        CacheController.clearCache(SmallSiteNodeImpl.class, new Integer[]{siteNodeId});
                        CacheController.clearCache(SmallSiteNodeVersionImpl.class, new Integer[]{new Integer(publicationDetailVO.getEntityId())});   
 
                        logger.info("We clear all contents as well " + previousSiteNodeVO.getMetaInfoContentId());
                        Class metaInfoContentExtra = ContentImpl.class;
                        Object[] idsMetaInfoContentExtra = {previousSiteNodeVO.getMetaInfoContentId()};
                        CacheController.clearCache(metaInfoContentExtra, idsMetaInfoContentExtra);
                       
                        logger.info("We clear all small contents as well " + previousSiteNodeVO.getMetaInfoContentId());
                        Class metaInfoContentExtraSmall = SmallContentImpl.class;
                        CacheController.clearCache(metaInfoContentExtraSmall, idsMetaInfoContentExtra);
                       
                        logger.info("We clear all smallish contents as well " + previousSiteNodeVO.getMetaInfoContentId());
                        Class metaInfoContentExtraSmallish = SmallishContentImpl.class;
                        CacheController.clearCache(metaInfoContentExtraSmallish, idsMetaInfoContentExtra);
     
                        logger.info("We clear all medium contents as well " + previousSiteNodeVO.getMetaInfoContentId());
                        Class metaInfoContentExtraMedium = MediumContentImpl.class;
                        CacheController.clearCache(metaInfoContentExtraMedium, idsMetaInfoContentExtra);
                       
                        //CacheController.clearCaches(ContentImpl.class.getName(), previousSiteNodeVO.getMetaInfoContentId().toString(), null);
                        addCacheUpdateDirective(ContentImpl.class.getName(), previousSiteNodeVO.getMetaInfoContentId().toString(), allIGCacheCalls);
     
                        Database db = CastorDatabaseService.getDatabase();
                        db.begin();
                       
                        LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(previousSiteNodeVO.getRepositoryId(), db);
                        ContentVersionVO metaInfoContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(previousSiteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId(), db);
                        addCacheUpdateDirective(ContentVersionImpl.class.getName(), metaInfoContentVersionVO.getId().toString(), allIGCacheCalls);
                       
                        List contentVersionIds = new ArrayList();
                        if(previousSiteNodeVO.getMetaInfoContentId() != null)
                        {
                          List<SmallestContentVersionVO> contentVersionVOList = ContentVersionController.getContentVersionController().getSmallestContentVersionVOList(previousSiteNodeVO.getMetaInfoContentId(), db);
                          for(SmallestContentVersionVO cvVO : contentVersionVOList)
                          {
                            contentVersionIds.add(cvVO.getId());
                            logger.info("We clear the meta info contentVersion " + cvVO.getId());
                          }
                        }
                        /*
                        Content content = ContentController.getContentController().getReadOnlyContentWithId(previousSiteNodeVO.getMetaInfoContentId(), db);
                        List contentVersionIds = new ArrayList();
                        Iterator contentVersionIterator = content.getContentVersions().iterator();
                        logger.info("Versions:" + content.getContentVersions().size());
                        while(contentVersionIterator.hasNext())
                        {
                          ContentVersion contentVersion = (ContentVersion)contentVersionIterator.next();
                          contentVersionIds.add(contentVersion.getId());
                          logger.info("We clear the meta info contentVersion " + contentVersion.getId());
                        }
                        */
     
                        db.rollback();
     
                        db.close();
                       
                        Iterator contentVersionIdsIterator = contentVersionIds.iterator();
                        logger.info("Versions:" + contentVersionIds.size());
                        while(contentVersionIdsIterator.hasNext())
                        {
                          Integer contentVersionId = (Integer)contentVersionIdsIterator.next();
                          logger.info("We clear the meta info contentVersion " + contentVersionId);
                          Class metaInfoContentVersionExtra = ContentVersionImpl.class;
                          Object[] idsMetaInfoContentVersionExtra = {contentVersionId};
                          CacheController.clearCache(metaInfoContentVersionExtra, idsMetaInfoContentVersionExtra);
                          //CacheController.clearCaches(ContentVersionImpl.class.getName(), contentVersionId.toString(), null);
                          //addCacheUpdateDirective(ContentVersionImpl.class.getName(), contentVersionId.toString(), allIGCacheCalls);
                        }
                       
                        logger.info("After:" + contentVersionIds.size());
     
                        SiteNodeVersionVO previousSiteNodeVersionVO = SiteNodeVersionController.getController().getPreviousActiveSiteNodeVersionVO(siteNodeVersionVO.getSiteNodeId(), siteNodeVersionVO.getId(), new Integer(CmsPropertyHandler.getOperatingMode()));
                        //logger.info("previousSiteNodeVersionVO:" + previousSiteNodeVersionVO.getId());
 
                        addCacheUpdateDirective(publicationDetailVO.getEntityClass(), publicationDetailVO.getEntityId().toString(), allIGCacheCalls);
                        if(siteNodeId != null)
                        {
                          //logger.info("What really happened.... let's find out");
                          boolean anyRealDifferences = isThereAnyRealDifferencesBetweenSiteNodeVersions(siteNodeVersionVO, previousSiteNodeVersionVO);
                          //logger.info("anyRealDifferences:" + anyRealDifferences);
                          if(anyRealDifferences)
                            addCacheUpdateDirective(SiteNode.class.getName(), siteNodeId.toString(), allIGCacheCalls);
                          else
                          {
                            //logger.info("We'll skip it and assume that this was just a meta info update...");
                          }
                        }
 
                        //Handling access rights...
                        if(siteNodeVersionVO.getIsProtected().intValue() != SiteNodeVersionVO.INHERITED || (previousSiteNodeVersionVO != null && previousSiteNodeVersionVO.getIsProtected().intValue() != SiteNodeVersionVO.INHERITED))
                        {
                              CacheController.clearCache(AccessRightImpl.class);
                              CacheController.clearCache(AccessRightRoleImpl.class);
                              CacheController.clearCache(AccessRightGroupImpl.class);
                              CacheController.clearCache(AccessRightUserImpl.class);
 
                            CacheController.clearCache("personalAuthorizationCache");
                        }
                       
                        logger.info("Handling parents....");
                       
                        SiteNodeVO siteNodeVOAfter = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId);
                          Integer currentParentSiteNodeId = siteNodeVOAfter.getParentSiteNodeId();
                          //System.out.println("previousParentSiteNodeId:" + previousParentSiteNodeId);
                          //System.out.println("currentParentSiteNodeId:" + currentParentSiteNodeId);
 
                          logger.info("We should also clear the parents...");
                        if(currentParentSiteNodeId != null)
                        {
                          if(previousSiteNodeVersionVO == null)
                          {
                            //logger.info("Looks to be first version - let's update parent as well");
                            logger.info("siteNodeVOAfter - clear the new:" + siteNodeVOAfter.getName() + " / " + currentParentSiteNodeId);
                            addCacheUpdateDirective(SiteNode.class.getName(), currentParentSiteNodeId.toString(), allIGCacheCalls);
                          }
                         
                            logger.info("We clear all small siteNodes as well " + currentParentSiteNodeId);
                          CacheController.clearCache(SiteNodeImpl.class, new Integer[]{currentParentSiteNodeId});
                          CacheController.clearCache(SmallSiteNodeImpl.class, new Integer[]{currentParentSiteNodeId});
                        }
 
                        if(currentParentSiteNodeId != null && previousParentSiteNodeId != null && !previousParentSiteNodeId.equals(currentParentSiteNodeId))
                        {
                          System.out.println("siteNodeVOAfter was not the same - lets clear the old:" + siteNodeVOAfter.getName() + " / " + currentParentSiteNodeId);
                          //CacheController.clearCaches(SiteNode.class.getName(), previousParentSiteNodeId.toString(), null);
                          addCacheUpdateDirective(SiteNode.class.getName(), currentParentSiteNodeId.toString(), allIGCacheCalls);
                          addCacheUpdateDirective(SiteNode.class.getName(), previousParentSiteNodeId.toString(), allIGCacheCalls);
                         
                            logger.info("We clear all small siteNodes as well " + previousParentSiteNodeId);
                          CacheController.clearCache(SiteNodeImpl.class, new Integer[]{previousParentSiteNodeId});
                          CacheController.clearCache(SmallSiteNodeImpl.class, new Integer[]{previousParentSiteNodeId});
                        }
                       
                        if(publicationDetailVO.getTypeId().intValue() == PublicationDetailVO.MOVED.intValue())
                            CacheController.clearCache("childSiteNodesCache");

                      }
                      catch (Exception e)
                      {
                        logger.warn("An error occurred handling sitenode version from publication " + publicationVO.getId() + ":" + e.getMessage());
                      }
                    }
                  }

                  assetCleaningThread.startIfNotEmpty();
View Full Code Here

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

      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

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

        p.getPublicationDetails().add(pd);
      }

      db.create(p);

      PublicationVO returnPub = p.getValueObject();
      returnPub.setPublicationDetails(toVOList(p.getPublicationDetails()));

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

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

  /**
   * This method returns a list of all details a publication has.
   */
  public PublicationVO getPublicationVO(Integer publicationId) throws SystemException
  {
    PublicationVO publicationVO = null;
   
        try
        {
          publicationVO = getPublicationVOWithId(publicationId);
        }
View Full Code Here

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

              {
                String applicationStartupDateTimeString = response.substring(response.indexOf("serverStartDateTime:") + 20).trim();
                logger.info("applicationStartupDateTimeString:" + applicationStartupDateTimeString);
                VisualFormatter visualFormatter = new VisualFormatter();
                Date serverStartupDate = visualFormatter.parseDate(applicationStartupDateTimeString, "yyyy-MM-dd HH:mm:ss");
                PublicationVO publicationVO = PublicationController.getController().getPublicationVO(publicationId);
                if(publicationVO.getPublicationDateTime().before(serverStartupDate))
                  publicationDetails.add(new String[]{"" + deliverUrl, "N/A", "Application restarted after the publication: " + applicationStartupDateTimeString});             
                else
                  publicationDetails.add(new String[]{"" + deliverUrl, "N/A", "No information found"});             
              }
              else
View Full Code Here

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

   * This is a method that gives the user back an newly initialized ValueObject for this entity that the controller
   * is handling.
   */
  public BaseEntityVO getNewVO()
  {
    return new PublicationVO();
  }
View Full Code Here

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

    {
      List events = new ArrayList();

      ContentStateController.changeState(updateContentVersionVO.getId(), ContentVersionVO.PUBLISH_STATE, "Auto publish", false, null, this.getInfoGluePrincipal(), updateContentVersionVO.getContentId(), events);

        PublicationVO publicationVO = new PublicationVO();
        publicationVO.setName("Direct publication by " + this.getInfoGluePrincipal().getName());
        publicationVO.setDescription("Direct publication");
        publicationVO.setRepositoryId(pagePartContentVO.getRepositoryId());
        publicationVO = PublicationController.getController().createAndPublish(publicationVO, events, false, this.getInfoGluePrincipal());
    }
   
        return Action.SUCCESS;
    }
View Full Code Here

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

              if(liveAddress != null)
                addActionLink(userSessionKey, new LinkBean("publishedPageUrl", getLocalizedString(getLocale(), "tool.common.publishing.publishingInlineOperationViewPublishedPageLinkText"), getLocalizedString(getLocale(), "tool.common.publishing.publishingInlineOperationViewPublishedPageTitleText"), getLocalizedString(getLocale(), "tool.common.publishing.publishingInlineOperationViewPublishedPageTitleText"), liveAddress, false, "", "_blank"));
              else
                addActionLink(userSessionKey, new LinkBean("publishedPageUrl", "No public servers stated in cms", "No public servers stated in cms", "No public servers stated in cms", "#", false, "", "_blank"));
               
          PublicationVO publicationVO = new PublicationVO();
            publicationVO.setName("Direct publication by " + this.getInfoGluePrincipal().getName());
            publicationVO.setDescription(getVersionComment());
            publicationVO.setRepositoryId(repositoryId);
          publicationVO = PublicationController.getController().createAndPublish(publicationVO, events, newsiteNodeMap, newContentMap, overrideVersionModifyer, this.getInfoGluePrincipal());
     
          processBean.updateProcess("Creating publication"/*getLocalizedString(getLocale(), "tool.structuretool.publicationProcess.gettingItems")*/);
        }
        else
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.