Package org.infoglue.cms.entities.content

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


      for(int i=0; i<contentVersionIds.length; i++)
      {
          String contentVersionId = contentVersionIds[i];
          logger.info("contentVersionId:" + contentVersionId);
          ContentVersion contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(new Integer(contentVersionIds[i]), db);
          if(contentVersion.getStateId().intValue() != ContentVersionVO.WORKING_STATE.intValue())
          {
                List events = new ArrayList();
               ContentVersionVO contentVersionVO = ContentStateController.changeState(contentVersion.getId(), ContentVersionVO.WORKING_STATE, "Automatic by the replace function", true, infoGluePrincipal, contentVersion.getValueObject().getContentId(), db, events);
              contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(contentVersionVO.getId(), db);
            logger.info("Setting the version to working before replacing string...");
          }
         
          String value = contentVersion.getVersionValue();
         
          logger.info("searchString:" + searchString);
         
          if(!caseSensitive)         
            searchString = "(?i)" + searchString;
          logger.info("searchString:" + searchString);
         
          value = value.replaceAll(searchString, replaceString);
           
          contentVersion.setVersionValue(value);

          replacements++;
      }
     
      commitTransaction(db);
View Full Code Here


                    {
              isBroken = true;
              isValid = false;
              try
              {
                ContentVersion contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(event.getEntityId(), db);
                ContentVersionController.getContentVersionController().delete(contentVersion, db);
              }
              catch (Exception e)
              {
                logger.error("Error deleting contentVersion which lacked content:" + e.getMessage(), e);
View Full Code Here

   
    try
    {
      beginTransaction(db);
   
      ContentVersion contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(contentVersionVO.getContentVersionId(), db);
      updateContentVersion(contentVersion.getValueObject(), db);
       
      commitTransaction(db);
    }
    catch (Exception e)   
    {
View Full Code Here

                Database db = beginTransaction();

                try
                {
                  ContentVersion latestContentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(newContentVersionVO.getId(), db);
                  logger.info("Adding categoryKey:" + categoryKey + " to " + newContentVersionVO.getId() + ":" + categoryVO);
                  //ContentCategoryController.getController().create(categoryVOList, newContentVersionVO, categoryKey);
                  final List<Category> categories = categoryVOListToCategoryList(categoryVOList, db);
                  ContentCategoryController.getController().create(categories, latestContentVersion, categoryKey, db);
View Full Code Here

               
                Database db = beginTransaction();

            try
            {
              ContentVersion latestContentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(contentVersionVO.getId(), db);

              logger.info("Adding categoryKey:" + categoryKey + " to " + contentVersionVO.getId() + ":" + categoryVO);
                  //ContentCategoryController.getController().create(categoryVOList, newContentVersionVO, categoryKey);
            final List<Category> categories = (List<Category>)categoryVOListToCategoryList(categoryVOList, db);
              ContentCategoryController.getController().create(categories, latestContentVersion, categoryKey, db);
View Full Code Here

      if(contentId == null || languageId == null)
      {
        DigitalAsset asset = DigitalAssetController.getMediumDigitalAssetWithIdReadOnly(digitalAssetVO.getId(), db);
        if(asset.getContentVersions() != null && asset.getContentVersions().size() > 0)
        {
          ContentVersion cv = (ContentVersion)asset.getContentVersions().iterator().next();
          contentId = cv.getValueObject().getContentId();
          languageId = cv.getValueObject().getLanguageId();
        }
      }
     
      String assetFileName = digitalAssetVO.getAssetFileName();
      String suffix = "";
View Full Code Here

      {
        //Timer t = new Timer();
        //logger.info("As no contentId was sent - we check for the first version we find that uses it. Should not matter which:" + digitalAsset.getContentVersions());
        if(digitalAsset.getContentVersions() != null && digitalAsset.getContentVersions().size() > 0)
        {
          ContentVersion cv = (ContentVersion)digitalAsset.getContentVersions().iterator().next();
          contentId = cv.getValueObject().getContentId();
          languageId = cv.getValueObject().getLanguageId();
        }
        //t.printElapsedTime("Finding content and language for an asset took");
      }
     
      String assetFileName = digitalAsset.getAssetFileName();
View Full Code Here

        //Timer t = new Timer();
        DigitalAsset asset = DigitalAssetController.getMediumDigitalAssetWithIdReadOnly(digitalAssetVO.getId(), db);
        //logger.info("As no contentId was sent - we check for the first version we find that uses it. Should not matter which:" + asset.getContentVersions());
        if(asset.getContentVersions() != null && asset.getContentVersions().size() > 0)
        {
          ContentVersion cv = (ContentVersion)asset.getContentVersions().iterator().next();
          contentId = cv.getValueObject().getContentId();
          languageId = cv.getValueObject().getLanguageId();
        }
        //t.printElapsedTime("Finding content and language for an asset took");
      }
     
      if(contentId != null)
View Full Code Here

      {
        //Timer t = new Timer();
        //logger.info("As no contentId was sent - we check for the first version we find that uses it. Should not matter which:" + digitalAsset.getContentVersions());
        if(digitalAsset.getContentVersions() != null && digitalAsset.getContentVersions().size() > 0)
        {
          ContentVersion cv = (ContentVersion)digitalAsset.getContentVersions().iterator().next();
          contentId = cv.getValueObject().getContentId();
          languageId = cv.getValueObject().getLanguageId();
        }
        //t.printElapsedTime("Finding content and language for an asset took");
      }

      folderName = "" + (contentId / 1000);
View Full Code Here

   
    try
    {
        if(entity.equalsIgnoreCase("ContentVersion"))
        {
        ContentVersion contentVersion = ContentVersionController.getContentVersionController().getContentVersionWithId(entityId, db);
        Collection contentVersions = new ArrayList();
        contentVersions.add(contentVersion);
        logger.info("Added contentVersion:" + contentVersion.getId());
        
        digitalAsset = new DigitalAssetImpl();
        digitalAsset.setValueObject(digitalAssetVO);
        if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
          digitalAsset.setAssetBlob(is);
        digitalAsset.setContentVersions(contentVersions);

        db.create(digitalAsset);
         
        contentVersion.getDigitalAssets().add(digitalAsset);           
        }
        else if(entity.equalsIgnoreCase(UserProperties.class.getName()))
        {
        UserProperties userProperties = UserPropertiesController.getController().getUserPropertiesWithId(entityId, db);
        Collection userPropertiesList = new ArrayList();
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.