Package org.infoglue.cms.entities.content

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


 
  public ContentVersion getContentVersionWithId(Integer contentVersionId) throws SystemException, Bug
    {
      Database db = CastorDatabaseService.getDatabase();
      ContentVersion contentVersion = null;

        beginTransaction(db);

        try
        {
View Full Code Here


    }


  public ContentVersion getLatestContentVersion(Integer contentId, Integer languageId, Database db) throws SystemException, Bug, Exception
    {
        ContentVersion contentVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.owningContent.contentId = $1 AND cv.language.languageId = $2 ORDER BY cv.contentVersionId desc");
      oql.bind(contentId);
      oql.bind(languageId);
     
View Full Code Here

   * This method deletes an contentversion and notifies the owning content.
   */
 
    public void delete(ContentVersionVO contentVersionVO, Database db) throws ConstraintException, SystemException, Exception
    {
    ContentVersion contentVersion = getContentVersionWithId(contentVersionVO.getContentVersionId(), db);
    delete(contentVersion, db, false);
    }       
View Full Code Here

        Collection contentVersions = Collections.synchronizedCollection(content.getContentVersions());
         Iterator contentVersionIterator = contentVersions.iterator();
     
    while (contentVersionIterator.hasNext())
        {
          ContentVersion contentVersion = (ContentVersion)contentVersionIterator.next();
                 
          Collection digitalAssetList = contentVersion.getDigitalAssets();
      Iterator assets = digitalAssetList.iterator();
      while (assets.hasNext())
            {
              DigitalAsset digitalAsset = (DigitalAsset)assets.next();
        assets.remove();
        db.remove(digitalAsset);
      }
     
          logger.info("Deleting contentVersion:" + contentVersion.getContentVersionId());
          contentVersionIterator.remove();
          delete(contentVersion, db, forceDelete);
        }
        content.setContentVersions(new ArrayList());
    }
View Full Code Here

      Database db = CastorDatabaseService.getDatabase();
        beginTransaction(db);
    try
        {
        ContentVersionVO contentVersionVO = this.getLatestActiveContentVersionVO(contentId, languageId, db);
        ContentVersion contentVersion = getContentVersionWithId(contentVersionVO.getId(), db);

        Collection digitalAssets = contentVersion.getDigitalAssets();
      Iterator assetIterator = digitalAssets.iterator();
      while(assetIterator.hasNext())
      {
        DigitalAsset currentDigitalAsset = (DigitalAsset)assetIterator.next();
        if(currentDigitalAsset.getAssetKey().equals(assetKey))
View Full Code Here

    return updatedContentVersionVO;
  }

  public ContentVersionVO update(Integer contentVersionId, ContentVersionVO contentVersionVO, InfoGluePrincipal principal, Database db) throws Exception
  {
    ContentVersion contentVersion = getMediumContentVersionWithId(contentVersionId, db);

    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersion.getValueObject().getContentId(), db);
    ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId(), db);

    contentVersion.setValueObject(contentVersionVO);
    contentVersion.getValueObject().setContentId(contentVO.getContentId());

    SiteNodeVersion latestSiteNodeVersion = null;
    if(principal != null && contentTypeDefinitionVO.getName().equalsIgnoreCase("Meta info"))
    {
      SiteNodeVO siteNode = SiteNodeController.getController().getSiteNodeVOWithMetaInfoContentId(db, contentVO.getContentId());
      if(siteNode.getMetaInfoContentId() != null && siteNode.getMetaInfoContentId().equals(contentVO.getContentId()))
      {
        latestSiteNodeVersion = SiteNodeVersionController.getController().getLatestMediumSiteNodeVersion(db, siteNode.getId(), false);
        latestSiteNodeVersion.setVersionModifier(contentVersionVO.getVersionModifier());
        latestSiteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
        SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().acUpdate(principal, latestSiteNodeVersion.getValueObject(), db);
      }
    }
    registryController.updateContentVersionThreaded(contentVersion.getValueObject(), latestSiteNodeVersion == null ? null : latestSiteNodeVersion.getValueObject());

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

       
        QueryResults results = oql.execute(Database.READONLY);
     
      while (results.hasMore())
          {
            ContentVersion contentVersion = (ContentVersion)results.next();
            contentVersionVOList.add(contentVersion.getValueObject());
          }
     
      results.close();
      oql.close();
View Full Code Here

    return contentVersionVO;
    }
   
  public ContentVersion getLatestPublishedContentVersion(Integer contentId) throws SystemException, Bug, Exception
    {
        ContentVersion contentVersion = null;
       
        Database db = CastorDatabaseService.getDatabase();
        beginTransaction(db);
        try
        {       
View Full Code Here

    }


  public ContentVersion getLatestPublishedContentVersion(Integer contentId, Integer languageId) throws SystemException, Bug, Exception
    {
        ContentVersion contentVersion = null;
       
        Database db = CastorDatabaseService.getDatabase();
        beginTransaction(db);
        try
        {       
View Full Code Here

    }


  public ContentVersion getLatestPublishedContentVersion(Integer contentId, Integer languageId, Database db) throws SystemException, Bug, Exception
    {
        ContentVersion contentVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.content.impl.simple.ContentVersionImpl cv WHERE cv.owningContent.contentId = $1 AND cv.language.languageId = $2 AND cv.stateId = $3 AND cv.isActive = $4 ORDER BY cv.contentVersionId desc");
      oql.bind(contentId);
      oql.bind(languageId);
      oql.bind(ContentVersionVO.PUBLISHED_STATE);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.content.ContentVersion

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.