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

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


     public static DigitalAssetVO create(DigitalAssetVO digitalAssetVO, InputStream is, List<ContentVersion> contentVersions, Database db) throws SystemException, Exception
     {
    DigitalAsset digitalAsset = null;
   
    digitalAsset = new DigitalAssetImpl();
    digitalAsset.setValueObject(digitalAssetVO.createCopy());
    if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
      digitalAsset.setAssetBlob(is);
    digitalAsset.setContentVersions(contentVersions);
View Full Code Here


        beginTransaction(db);
       
        try
        {
            digitalAsset = new DigitalAssetImpl();
            digitalAsset.setValueObject(digitalAssetVO);
            digitalAsset.setAssetBlob(is);

            db.create(digitalAsset);
View Full Code Here

     */
    public Object getValue( Object object ) throws IllegalStateException
    {
      byte[] returnArray = null;
     
      DigitalAssetImpl asset = (DigitalAssetImpl)object;
      if((getMaxSize() != -1 && asset.getAssetFileSize() > getMaxSize())/* || asset.getAssetFileSize() == 0*/)
      {
        returnArray = "archived".getBytes();
      }
      else
        returnArray = asset.getAssetBytes();
     
      if(returnArray == null)
      {
        logger.warn("returnArray:" + returnArray + " for " + asset.getId() + "-" + asset.getAssetKey());
          returnArray = "archived".getBytes();
          logger.warn("fixed returnArray:" + returnArray + " for " + asset.getId() + "-" + asset.getAssetKey());
      }
     
      return returnArray;
    }
View Full Code Here

     * @thorws IllegalArgumentException The value passed is not of
     *  a supported type
     */
    public void setValue( Object object, Object value ) throws IllegalStateException, IllegalArgumentException
    {
      DigitalAssetImpl asset = (DigitalAssetImpl)object;
      if(value != null)
        asset.setAssetBytes((byte[])value);
      else
        asset.setAssetBytes("archived".getBytes());
    }
View Full Code Here

        beginTransaction(db);
       
        try
        {
            digitalAsset = new DigitalAssetImpl();
            digitalAsset.setValueObject(digitalAssetVO);
            digitalAsset.setAssetBlob(is);

            db.create(digitalAsset);
View Full Code Here

        beginTransaction(db);
       
        try
        {
            digitalAsset = new DigitalAssetImpl();
            digitalAsset.setValueObject(digitalAssetVO);
            digitalAsset.setAssetBlob(is);

            db.create(digitalAsset);
View Full Code Here

        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();
        userPropertiesList.add(userProperties);
        logger.info("Added userProperties:" + userProperties.getId());
        
        digitalAsset = new DigitalAssetImpl();
        digitalAsset.setValueObject(digitalAssetVO);
        if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
          digitalAsset.setAssetBlob(is);
        digitalAsset.setUserProperties(userPropertiesList);
       
        db.create(digitalAsset);
         
        userProperties.getDigitalAssets().add(digitalAsset);           
        }
        else if(entity.equalsIgnoreCase(RoleProperties.class.getName()))
        {
            RoleProperties roleProperties = RolePropertiesController.getController().getRolePropertiesWithId(entityId, db);
        Collection rolePropertiesList = new ArrayList();
        rolePropertiesList.add(roleProperties);
        logger.info("Added roleProperties:" + roleProperties.getId());
        
        digitalAsset = new DigitalAssetImpl();
        digitalAsset.setValueObject(digitalAssetVO);
        if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
          digitalAsset.setAssetBlob(is);
        digitalAsset.setRoleProperties(rolePropertiesList);
       
        db.create(digitalAsset);
         
        roleProperties.getDigitalAssets().add(digitalAsset);                       
        }
        else if(entity.equalsIgnoreCase(GroupProperties.class.getName()))
        {
            GroupProperties groupProperties = GroupPropertiesController.getController().getGroupPropertiesWithId(entityId, db);
        Collection groupPropertiesList = new ArrayList();
        groupPropertiesList.add(groupProperties);
        logger.info("Added groupProperties:" + groupProperties.getId());
        
        digitalAsset = new DigitalAssetImpl();
        digitalAsset.setValueObject(digitalAssetVO);
        if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
          digitalAsset.setAssetBlob(is);
        digitalAsset.setGroupProperties(groupPropertiesList);
       
View Full Code Here

      * The asset is send in as an InputStream which castor inserts automatically.
      */

     public DigitalAsset create(Database db, DigitalAssetVO digitalAssetVO, InputStream is) throws SystemException, Exception
     {
    DigitalAsset digitalAsset = new DigitalAssetImpl();
    digitalAsset.setValueObject(digitalAssetVO);
    digitalAsset.setAssetBlob(is);

    db.create(digitalAsset);
       
        return digitalAsset;
     }
View Full Code Here

    digitalAssetVO.setAssetFileName(oldDigitalAsset.getAssetFileName());
    digitalAssetVO.setAssetFilePath(oldDigitalAsset.getAssetFilePath());
    digitalAssetVO.setAssetFileSize(oldDigitalAsset.getAssetFileSize());
    digitalAssetVO.setAssetKey(newAssetKey);
   
    DigitalAsset digitalAsset = new DigitalAssetImpl();
    digitalAsset.setValueObject(digitalAssetVO);
    digitalAsset.setAssetBlob(oldDigitalAsset.getAssetBlob());
    digitalAsset.setContentVersions(contentVersions);
   
    try
    {
      db.create(digitalAsset);
    }
    catch(Exception e)
    {
      logger.error("An error occurred so we should not complete the transaction:" + e, e);
      throw new SystemException(e.getMessage());
    }
    //contentVersion.getDigitalAssets().add(digitalAsset);
   
    return digitalAsset.getValueObject();
  }
View Full Code Here

TOP

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

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.