Examples of ContentVersion


Examples of org.infoglue.cms.entities.content.ContentVersion

        final List<ContentVersionVO> contentVersionsList2Retain =
            contentVersionController.getLatestActiveContentVersionsForHitSize(contentId, languageId, hitSize, db);
        // If none of them is published, fetch the latest published to this list also
        if (!hasState(contentVersionsList2Retain, ContentVersionVO.PUBLISHED_STATE))
        {
            final ContentVersion latestPublished =
                contentVersionController.getLatestPublishedContentVersion(contentId, languageId, db);
            if (latestPublished != null)
            {
                contentVersionsList2Retain.add(latestPublished.getValueObject());
            }
        }
        commitTransaction(db);
        return contentVersionsList2Retain;
    }
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

  private ContentVersion getContentVersion(Integer siteNodeId, Integer contentId, Integer languageId, Database db, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws SystemException, Exception
  {
    if(contentId == null || contentId.intValue() < 1)
      return null;
   
    ContentVersion contentVersion = null;
   
    //MediumContentImpl content = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, contentId, db);
    ContentVO content = ContentController.getContentController().getSmallContentVOWithId(contentId, db, deliveryContext);
   
    boolean isValidContent = isValidContent(infoGluePrincipal, content, languageId, useLanguageFallback, false, db, deliveryContext);
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

   * This method gets a contentVersion with a state and a language which is active.
   */

  private ContentVersion getContentVersion(ContentVO content, Integer languageId, Integer operatingMode, DeliveryContext deliveryContext, Database db) throws Exception
    {
      ContentVersion contentVersion = null;
   
      String versionKey = "" + content.getId() + "_" + languageId + "_" + operatingMode + "_contentVersionId";
      //logger.info("versionKey:" + versionKey);
   
    Object object = CacheController.getCachedObjectFromAdvancedCache("contentVersionIdCache", versionKey);
    if(object instanceof NullObject)
    {
      logger.info("There was an cached parentSiteNodeVO but it was null:" + object);
    }
    else if(object != null)
    {
      Integer contentVersionId = (Integer)object;
      contentVersion = (ContentVersion)getObjectWithId(ContentVersionImpl.class, contentVersionId, db);
        //logger.info("Loaded the version from cache instead of querying it:" + contentVersionId);
    }
    else
    {
      //logger.info("Querying for verson: " + versionKey);
     
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.contentId = $1 AND cv.language.languageId = $2 AND cv.stateId >= $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
        oql.bind(content.getId());
        oql.bind(languageId);
        oql.bind(operatingMode);
        oql.bind(true);
 
        QueryResults results = oql.execute(Database.READONLY);

      if (results.hasMore())
          {
            contentVersion = (ContentVersion)results.next();
        CacheController.cacheObjectInAdvancedCache("contentVersionIdCache", versionKey, contentVersion.getId(), new String[]{CacheController.getPooledString(2, contentVersion.getId()), CacheController.getPooledString(1, contentVersion.getValueObject().getContentId())}, true);
          }
      else
      {
        CacheController.cacheObjectInAdvancedCache("contentVersionIdCache", versionKey, new NullObject(), new String[]{CacheController.getPooledString(1, content.getId())}, true);
      }

      results.close();
      oql.close();
    }
   
    if(contentVersion != null)
        deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));

    return contentVersion;
    }
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

   
          QueryResults results = oql.execute(Database.READONLY);
         
        if (results.hasMore())
            {
          ContentVersion contentVersion = (ContentVersion)results.next();
              contentVersionVO = contentVersion.getValueObject();

          CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
            }
        else
        {
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

      oql.bind(operatingMode);
      oql.bind(true);

      QueryResults results = oql.execute(Database.READONLY);
   
      ContentVersion contentVersion;
     
    while(results.hasMore())
        {
          contentVersion = (ContentVersion)results.next();

          if(contentVersion != null)
            deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));

        contentVersionVOList.add(contentVersion.getValueObject());
        }

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

Examples of org.infoglue.cms.entities.content.ContentVersion

      oql.bind(operatingMode);
      oql.bind(true);

      QueryResults results = oql.execute(Database.READONLY);
   
      ContentVersion contentVersion;
     
    while(results.hasMore())
        {
          contentVersion = (ContentVersion)results.next();

          if(contentVersion != null)
            deliveryContext.addUsedContentVersion(CacheController.getPooledString(2, contentVersion.getId()));

        contentVersionVOList.add(contentVersion.getValueObject());
        }

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

Examples of org.infoglue.cms.entities.content.ContentVersion

    List versions = findContentVersionsForCategories(results, db);

    // Weed out irrelevant versions
    for (Iterator iter = versions.iterator(); iter.hasNext();)
    {
      ContentVersion version = (ContentVersion) iter.next();
      if(!isValidContentVersion(version, infoGluePrincipal, siteNodeId, languageId, useLanguageFallback, db, deliveryContext))
        iter.remove();
    }

    return toVOList(versions);
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

  public List getAssignedCategoryVOsForContentVersionId(Database db, Integer contentId, Integer languageId, String categoryKey, Integer siteNodeId, boolean useLanguageFallback, DeliveryContext deliveryContext, InfoGluePrincipal infoGluePrincipal) throws Exception
  {
    List assignedCategoryVOList = new ArrayList();
   
    ContentVersion contentVersion = getContentVersion(siteNodeId, contentId, languageId, db, useLanguageFallback, deliveryContext, infoGluePrincipal);
   
    List assignedContentCategories = ContentCategoryController.getController().findByContentVersionAttribute(categoryKey, contentVersion, db);
    //List assignedContentCategories = findContentCategoriesForContentVersionId(db, contentVersionVO.getId(), categoryKey, deliveryContext);
    if((assignedCategoryVOList == null || assignedCategoryVOList.size() == 0) && useLanguageFallback)
    {
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

 
    public static ContentVersionVO changeState(Integer oldContentVersionId, Integer stateId, String versionComment, boolean overrideVersionModifyer, InfoGluePrincipal infoGluePrincipal, Integer contentId, Database db, List resultingEvents) throws ConstraintException, SystemException
    {
      ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId, db);
   
      ContentVersion newContentVersion = changeState(oldContentVersionId, contentVO, stateId, versionComment, overrideVersionModifyer, null, infoGluePrincipal, contentId, db, resultingEvents);
     
      return newContentVersion.getValueObject();
    }  
View Full Code Here

Examples of org.infoglue.cms.entities.content.ContentVersion

      if(contentId == null)
      {
        SmallestContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getSmallestContentVersionVOWithId(oldContentVersionId, db);
        contentId = contentVersionVO.getContentId();
      }
      ContentVersion newContentVersion = changeState(oldContentVersionId, contentVO, stateId, versionComment, overrideVersionModifyer, recipientFilter, infoGluePrincipal, contentId, db, resultingEvents);
      if(newContentVersion != null)
        newContentVersionVO = newContentVersion.getValueObject();
     
      commitRegistryAwareTransaction(db);
        }
        catch(ConstraintException ce)
        {
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.