Package org.infoglue.cms.entities.content.impl.simple

Examples of org.infoglue.cms.entities.content.impl.simple.SmallestContentVersionImpl


      oql.bind(50);

      QueryResults results = oql.execute(Database.READONLY);
      while(results.hasMore())
            {
        SmallestContentVersionImpl contentVersion = (SmallestContentVersionImpl)results.next();
        ContentVO contentVO = getContentVOWithId(contentVersion.getValueObject().getContentId(), db);
        boolean isValid = true;
        for(int i=0; i<excludedContentTypes.length; i++)
        {
          String contentTypeDefinitionNameToExclude = excludedContentTypes[i];
          ContentTypeDefinitionVO ctdVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName(contentTypeDefinitionNameToExclude, db);
View Full Code Here


      {
        logger.info("Changing version modifier from '" + currentModifier + "' to '" + newModifier + "' for number of ContentVerison: " + results.size());
      }
    while (results.hasMore())
        {
      SmallestContentVersionImpl cv = (SmallestContentVersionImpl)results.nextElement();
      cv.setVersionModifier(newModifier);
      if (logger.isDebugEnabled())
        {
          logger.debug("Changing version modifier from '" + currentModifier + "' to '" + newModifier + "' for ContentVerison with ID: " + cv.getContentVersionId());
        }
    }

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

      int processedItems = 0;
      Integer previousContentId = null;
      while (results.hasMore())
      {
        SmallestContentVersionImpl smallestContentVersionImpl = (SmallestContentVersionImpl)results.next();
        if(previousContentId == null || !previousContentId.equals(smallestContentVersionImpl.getContentId()))
        {
          List digitalAssetVOList = DigitalAssetController.getDigitalAssetVOList(smallestContentVersionImpl.getId(), db);
          if(digitalAssetVOList.size() > 0)
          {
            logger.info("digitalAssetVOList:" + digitalAssetVOList.size());
            Iterator digitalAssetVOListIterator = digitalAssetVOList.iterator();
            while(digitalAssetVOListIterator.hasNext())
            {
              DigitalAssetVO assetVO = (DigitalAssetVO)digitalAssetVOListIterator.next();
              if(assetVO.getAssetFileSize() < 10000000) //Do not index large files
              {
                NotificationMessage assetNotificationMessage = new NotificationMessage("LuceneController", DigitalAssetImpl.class.getName(), "SYSTEM", NotificationMessage.TRANS_UPDATE, assetVO.getId(), "dummy");
                notificationMessages.add(assetNotificationMessage);
              }
            }
          }

          NotificationMessage notificationMessage = new NotificationMessage("LuceneController", ContentVersionImpl.class.getName(), "SYSTEM", NotificationMessage.TRANS_UPDATE, smallestContentVersionImpl.getId(), "dummy");
          notificationMessages.add(notificationMessage);
          previousContentId = smallestContentVersionImpl.getContentId();
        }
        newLastContentVersionId = smallestContentVersionImpl.getId().intValue();
        lastCommitedContentVersionId = newLastContentVersionId;
        processedItems++;
        logger.info("previousContentId:" + previousContentId + "/" + processedItems);
        if(processedItems > batchSize)
        {
View Full Code Here

         
          QueryResults results = oql.execute(Database.READONLY);
       
        while(results.hasMore())
            {
              SmallestContentVersionImpl cv = (SmallestContentVersionImpl)results.next();
              versions.add(cv.getValueObject());
            }
        //t.printElapsedTime("getContentVersionVOListConnectedToAssetWithId:" + versions.size());
       
        results.close();
        oql.close();
View Full Code Here

      oql.bind(entityId);

    QueryResults results = oql.execute(Database.READONLY);
    while (results.hasMore())
    {
      SmallestContentVersionImpl contentVersion = (SmallestContentVersionImpl)results.next();
      contentVersionVOList.add(contentVersion.getValueObject());
    }

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

     
      QueryResults results = oql.execute(Database.READONLY);
   
      while (results.hasMore())
        {
      SmallestContentVersionImpl version = (SmallestContentVersionImpl)results.next();
      contentVersionsIdList.add(version.getValueObject());
        }
       
    results.close();
    oql.close();
       
View Full Code Here

          List<SmallestContentVersionVO> versionInitialSuggestions = new ArrayList<SmallestContentVersionVO>();
          List<SmallestContentVersionVO> versionNonPublishedSuggestions = new ArrayList<SmallestContentVersionVO>();

          while (results.hasMore())
            {
        SmallestContentVersionImpl version = (SmallestContentVersionImpl)results.next();
        if(previousContentId != null && previousContentId.intValue() != version.getContentId().intValue())
        {
          if(minimumTimeBetweenVersionsDuringClean != -1 && versionInitialSuggestions.size() >= numberOfVersionsToKeep)
          {
            Iterator potentialContentVersionVOListIterator = potentialContentVersionVOList.iterator();
            while(potentialContentVersionVOListIterator.hasNext())
            {
              SmallestContentVersionVO potentialContentVersionVO = (SmallestContentVersionVO)potentialContentVersionVOListIterator.next();
             
              SmallestContentVersionVO firstInitialSuggestedContentVersionVO = null;
              Iterator versionInitialSuggestionsIterator = versionInitialSuggestions.iterator();
              while(versionInitialSuggestionsIterator.hasNext())
              {
                SmallestContentVersionVO initialSuggestedContentVersionVO = (SmallestContentVersionVO)versionInitialSuggestionsIterator.next();
                if(initialSuggestedContentVersionVO.getStateId().equals(ContentVersionVO.PUBLISHED_STATE))
                {
                  firstInitialSuggestedContentVersionVO = initialSuggestedContentVersionVO;
                  break;
                }
              }
             
              if(firstInitialSuggestedContentVersionVO != null)
              {
                keptContentVersionVOList.remove(potentialContentVersionVO);
                keptContentVersionVOList.add(firstInitialSuggestedContentVersionVO);
                versionInitialSuggestions.remove(firstInitialSuggestedContentVersionVO);
                versionInitialSuggestions.add(potentialContentVersionVO);
              }
            }
          }
                   
          //System.out.println("versionNonPublishedSuggestions:" + versionNonPublishedSuggestions.size());
          //System.out.println("versionInitialSuggestions:" + versionInitialSuggestions.size());
          contentVersionsIdList.addAll(versionNonPublishedSuggestions);
          contentVersionsIdList.addAll(versionInitialSuggestions);
          potentialContentVersionVOList.clear();
          versionInitialSuggestions.clear();
          versionNonPublishedSuggestions.clear();
          keptContentVersionVOList.clear();
         
          numberOfLaterVersions = 0;
          previousDate = null;
          difference = -1;
          potentialContentVersionVOList = new ArrayList();
        }
        else if(previousDate != null)
        {
          difference = previousDate.getTime() - version.getModifiedDateTime().getTime();
        }

        if(numberOfLaterVersions >= numberOfVersionsToKeep || (keepOnlyOldPublishedVersions && numberOfLaterVersions > 0 && !version.getStateId().equals(ContentVersionVO.PUBLISHED_STATE)))
              {
          if(version.getStateId().equals(ContentVersionVO.PUBLISHED_STATE))
          {
            versionInitialSuggestions.add(version.getValueObject());
          }
          else
          {
            versionNonPublishedSuggestions.add(version.getValueObject());
          }
              }
        else if(previousDate != null && difference != -1 && difference < minimumTimeBetweenVersionsDuringClean)
        {
          keptContentVersionVOList.add(version.getValueObject());
          potentialContentVersionVOList.add(version.getValueObject());   
          numberOfLaterVersions++;
        }
        else
        {
          keptContentVersionVOList.add(version.getValueObject());
          previousDate = version.getModifiedDateTime();
          numberOfLaterVersions++;
        }

        previousContentId = version.getContentId();
            }
           
      if(minimumTimeBetweenVersionsDuringClean != -1 && versionInitialSuggestions.size() >= numberOfVersionsToKeep)
      {
        //System.out.println("Inside again....");
View Full Code Here

      QueryResults results = oql.execute(Database.READONLY);
     
    if (results.hasMore())
        {
      SmallestContentVersionImpl contentVersion = (SmallestContentVersionImpl)results.next();
          contentVersionVO = contentVersion.getValueObject();
        }
   
    return contentVersionVO;
  }
View Full Code Here

    }
   
    QueryResults results = oql.execute(Database.READONLY);
      if (results.hasMore())
    {
      SmallestContentVersionImpl contentVersion = (SmallestContentVersionImpl)results.next();
      result = contentVersion.getValueObject();
    }

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

    }
   
    QueryResults results = oql.execute(Database.READONLY);
      if (results.hasMore())
    {
      SmallestContentVersionImpl contentVersion = (SmallestContentVersionImpl)results.next();
      result = contentVersion.getValueObject();
    }

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

TOP

Related Classes of org.infoglue.cms.entities.content.impl.simple.SmallestContentVersionImpl

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.