Package org.infoglue.cms.entities.content

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


        oql.bind(contentId);
        oql.bind(languageId);
        final QueryResults results = oql.execute();
        while (results.hasMore())
        {
            final ContentVersion contentVersion = (ContentVersion) results.next();
            resultList.add(contentVersion);
        }
        results.close();
        oql.close();
        return toVOList(resultList);
View Full Code Here


     */
    public void forceDelete(final ContentVersionVO contentVersionVO) throws SystemException {
        final Database db = CastorDatabaseService.getDatabase();
        beginTransaction(db);
        try {
            final ContentVersion contentVersion = getContentVersionWithId(contentVersionVO.getContentVersionId(), db);
            contentCategoryController.deleteByContentVersion(contentVersion, db);
            final Content content = contentVersion.getOwningContent();
            if (content != null)
            {
                content.getContentVersions().remove(contentVersion);
            }
            db.remove(contentVersion);
View Full Code Here

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

        try
        {     
          ContentVersion contentVersion = checkStateAndChangeIfNeeded(contentVersionId, principal, db);
         
          resultingContentVersionVO = contentVersion.getValueObject();
         
            commitTransaction(db);
        }
        catch(Exception e)
        {
View Full Code Here

  /**
   * This method deletes the relation to a digital asset - not the asset itself.
   */
  public DigitalAssetVO checkStateAndChangeIfNeeded(Integer contentVersionId, Integer digitalAssetId, InfoGluePrincipal principal, Database db) throws ConstraintException, SystemException, Bug, Exception
    {
      ContentVersion contentVersion = null;
      ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(contentVersionId, db);
      DigitalAssetVO digitalAssetVO = DigitalAssetController.getController().getDigitalAssetVOWithId(digitalAssetId, db);
      if(!contentVersionVO.getStateId().equals(ContentVersionVO.WORKING_STATE))
    {
        List events = new ArrayList();
      ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersionVO.getContentId(), db);
      contentVersion = ContentStateController.changeState(contentVersionVO.getId(), contentVO, ContentVersionVO.WORKING_STATE, "new working version", false, null, principal, contentVersionVO.getContentId(), db, events);
      digitalAssetVO = DigitalAssetController.getController().getLatestDigitalAssetVO(contentVersion.getId(), digitalAssetVO.getAssetKey(), db);
    }
         
      return digitalAssetVO;
    }
View Full Code Here

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

            String versionKey = "" + contentVersionVO.getContentId() + "_" + languageId + "_" + operatingMode + "_contentVersionVO";
            CacheController.cacheObjectInAdvancedCache("contentVersionCache", versionKey, contentVersionVO, new String[]{CacheController.getPooledString(2, contentVersionVO.getId()), CacheController.getPooledString(1, contentVersionVO.getContentId())}, true);
          }
     
View Full Code Here

          logger.info("Going to index all version of " + content.getName());
         
          Iterator versionsIterator = content.getContentVersions().iterator();
        while(versionsIterator.hasNext())
        {
            ContentVersion contentVersion = (ContentVersion)versionsIterator.next();
            registryController.updateContentVersion(contentVersion.getValueObject(), db);
        }
      }
           
      db.commit();
    }
View Full Code Here

  {
    if(getContentVersionVO() != null)
    {
      try
      {
        final ContentVersion contentVersion = ContentVersionController.getContentVersionController().getReadOnlyContentVersionWithId(getContentVersionVO().getContentVersionId(), getDatabase());
        if(contentVersion != null)
        {
          return contentVersion.getDigitalAssets();
        }
      }
      catch(Exception e)
      {
        throwException(e);
View Full Code Here

    resultList.addAll(contentVersions);
     
    Iterator contentVersionsIterator = contentVersions.iterator();
      while(contentVersionsIterator.hasNext())
      {
          ContentVersion contentVersion = (ContentVersion)contentVersionsIterator.next();
          List relatedEntities = RegistryController.getController().getMatchingRegistryVOListForReferencingEntity(ContentVersion.class.getName(), contentVersion.getId().toString(), db);
          Iterator relatedEntitiesIterator = relatedEntities.iterator();
         
          while(relatedEntitiesIterator.hasNext())
          {
              RegistryVO registryVO = (RegistryVO)relatedEntitiesIterator.next();
View Full Code Here

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

    QueryResults results = oql.execute(Database.READONLY);
   
    // New improved
    while (results.hasMore())
    {
      ContentVersion contentVersion = (ContentVersion)results.next();
      logger.info("contentVersion found: " + contentVersion.getId());

      if(contentVersion.getIsActive().booleanValue())
      {
          if((contentVersion.getStateId().compareTo(stateId)==0) && (!langCheck.contains(contentVersion.getLanguage().getLanguageId())))
        {
          resultList.add(contentVersion);
          logger.info("contentVersion added: " + contentVersion.getId());
          langCheck.add(contentVersion.getLanguage().getLanguageId());
        }
       
          if(mustBeFirst)
          langCheck.add(contentVersion.getLanguage().getLanguageId());
      }
    }
     
    results.close();
    oql.close();
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.