Package org.infoglue.cms.entities.content

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


    {
      AssetKeyDefinition assetKeyDefinition = (AssetKeyDefinition)assetKeysIterator.next();
      if(assetKeyDefinition.getIsMandatory().booleanValue())
      {
        hasMandatoryAssets = true;
        DigitalAssetVO asset = DigitalAssetController.getController().getDigitalAssetVO(createContentWizardInfoBean.getContentVO().getId(), languageId, assetKeyDefinition.getAssetKey(), false);
        if(asset == null)
        {
          mandatoryAssetKey = assetKeyDefinition.getAssetKey();
          mandatoryAssetMaximumSize = "" + assetKeyDefinition.getMaximumSize();
          missingAsset = true;
View Full Code Here


  public String doExecute() throws Exception
  {
    InputStream is = null;
    File renamedFile = null;
    DigitalAssetVO digitalAssetVO = null;
   
    try
    {
      MultiPartRequestWrapper mpr = ActionContext.getContext().getMultiPartRequest();
      if(mpr != null)
      {
        String fromEncoding = CmsPropertyHandler.getUploadFromEncoding();
        if(fromEncoding == null)
          fromEncoding = "iso-8859-1";
       
        String toEncoding = CmsPropertyHandler.getUploadToEncoding();
        if(toEncoding == null)
          toEncoding = "utf-8";
       
        this.digitalAssetKey = new String(this.digitalAssetKey.getBytes(fromEncoding), toEncoding);

        Enumeration names = mpr.getFileNames();
        while (names.hasMoreElements())
        {
          String name       = (String)names.nextElement();
          String contentType    = mpr.getContentType(name);
          String fileSystemName = mpr.getFilesystemName(name);
         
          File file = mpr.getFile(name);
          String fileName = fileSystemName;
          //String fileName = digitalAssetKey + "_" + System.currentTimeMillis() + "_" + fileSystemName;
          //String tempFileName = "tmp_" + fileName;
          //tempFileName = new VisualFormatter().replaceNonAscii(fileName, '_');
         
          String filePath = CmsPropertyHandler.getDigitalAssetPath();
          //fileSystemName = filePath + File.separator + tempFileName;
                fileName = formatter.replaceNiceURINonAsciiWithSpecifiedChars(fileName, CmsPropertyHandler.getNiceURIDefaultReplacementCharacter());

          if(file != null)
          {
            DigitalAssetVO newAsset = new DigitalAssetVO();
            newAsset.setAssetContentType(contentType);
            newAsset.setAssetKey(digitalAssetKey);
            newAsset.setAssetFileName(fileName);
            newAsset.setAssetFilePath(filePath);
            newAsset.setAssetFileSize(new Integer(new Long(file.length()).intValue()));
            //is = new FileInputStream(renamedFile);
            is = new FileInputStream(file);
            //DigitalAssetController.create(newAsset, is, this.contentVersionId);
            //CreateContentWizardInfoBean createContentWizardInfoBean = this.getCreateContentWizardInfoBean();
            //createContentWizardInfoBean.getDigitalAssets().put(digitalAssetKey + "_" + this.languageId, newAsset);
View Full Code Here

      while(assetKeysIterator.hasNext())
      {
        AssetKeyDefinition assetKeyDefinition = (AssetKeyDefinition)assetKeysIterator.next();
        if(assetKeyDefinition.getIsMandatory().booleanValue())
        {
          DigitalAssetVO asset = DigitalAssetController.getController().getDigitalAssetVO(createContentWizardInfoBean.getContentVO().getId(), languageId, assetKeyDefinition.getAssetKey(), false);
          if(asset == null)
          {
            mandatoryAssetKey = assetKeyDefinition.getAssetKey();
            mandatoryAssetMaximumSize = "" + assetKeyDefinition.getMaximumSize();
            return "inputAssets";
View Full Code Here

  public String doSimple() throws Exception
  {
    DigitalAsset digitalAsset = PortletAssetController.getPortletAssetController().getPortletRegistryAsset();
    if(digitalAsset == null)
    {
      DigitalAssetVO newAsset = new DigitalAssetVO();
      newAsset.setAssetContentType("text/xml");
      newAsset.setAssetKey("portletentityregistry.xml");
      newAsset.setAssetFileName("portletentityregistry.xml");
      newAsset.setAssetFilePath("None");
      newAsset.setAssetFileSize(new Integer(new Long("4").intValue()));
      InputStream is = new ByteArrayInputStream("".getBytes());
      digitalAsset = PortletAssetController.create(newAsset, is);
      is.close();
    }
     
View Full Code Here

          pae.addPortletEntity(pe);
        }

        // Create Digital Asset
        log.debug("Creating Digital Asset...");
        DigitalAssetVO newAsset = new DigitalAssetVO();
        newAsset.setAssetContentType(contentType);
        newAsset.setAssetKey(fileName);
        newAsset.setAssetFileName(fileName);
        newAsset.setAssetFilePath(filePath);
        newAsset.setAssetFileSize(new Integer(new Long(file.length()).intValue()));

        // Check existance of portlet and remove old ones
        List assets = PortletAssetController.getDigitalAssetByName(fileName);
        if (assets != null && assets.size() > 0)
        {
View Full Code Here

             if(filteredDigitalAssets != null && filteredDigitalAssets.size() > 0)
             {
               Iterator digitalAssetsIterator = filteredDigitalAssets.iterator();
               while(digitalAssetsIterator.hasNext())
               {
                 DigitalAssetVO assetVO = (DigitalAssetVO)digitalAssetsIterator.next();
                 //if(!assetVO.getAssetContentType().matches(this.assetTypeFilter))
                 if(!this.assetTypeFilter.equals("*") && this.assetTypeFilter.indexOf(assetVO.getAssetContentType()) == -1)
                 {
                   digitalAssetsIterator.remove();
                   //logger.info("Removed file from asset list:" + this.assetTypeFilter);
                 }
               }
             }
           }
      else if(this.contentVersionVO != null && this.contentVersionVO.getContentVersionId() != null)
           {
        this.contentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(this.contentVersionVO.getId());
       
        filteredDigitalAssets = DigitalAssetController.getDigitalAssetVOList(this.contentVersionVO.getContentVersionId());
           }

      Iterator digitalAssetsIterator = filteredDigitalAssets.iterator();
         while(digitalAssetsIterator.hasNext())
         {
           DigitalAssetVO assetVO = (DigitalAssetVO)digitalAssetsIterator.next();
          
           List<ReferenceBean> referenceBeans = RegistryController.getController().getReferencingObjectsForContentAsset(this.contentVersionVO.getContentId(), assetVO.getAssetKey(), 100, false, true, true);
           assetVO.setReferencingNumberOfObjects(referenceBeans.size());
         }
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

           if(digitalAssets != null && digitalAssets.size() > 0)
           {
             Iterator digitalAssetsIterator = digitalAssets.iterator();
             while(digitalAssetsIterator.hasNext())
             {
               DigitalAssetVO assetVO = (DigitalAssetVO)digitalAssetsIterator.next();
               logger.info("assetVO:" + assetVO.getAssetKey() + " - " + assetVO.getAssetContentType() + " VS " + this.assetTypeFilter);
               if(!this.assetTypeFilter.equals("*") && this.assetTypeFilter.indexOf(assetVO.getAssetContentType()) == -1)
               {
                 digitalAssetsIterator.remove();
               }
             }
           }
View Full Code Here

  public String getDigitalAssetThumbnailUrl(Integer contentId, Integer languageId, String assetKey) throws Exception
  {
    String imageHref = null;
    try
    {
      DigitalAssetVO assetVO = DigitalAssetController.getDigitalAssetVO(contentId, languageId, assetKey, false);
           imageHref = DigitalAssetController.getDigitalAssetThumbnailUrl(assetVO.getDigitalAssetId());
    }
    catch(Exception e)
    {
      logger.warn("We could not get the url of the thumbnail: " + e.getMessage(), e);
      imageHref = e.getMessage();
View Full Code Here

      String tempFileName = "tmp_" + System.currentTimeMillis() + "_" + fileName;
        //String filePath = file.getParentFile().getPath();
        String filePath = CmsPropertyHandler.getDigitalAssetPath();
        fileSystemName = filePath + File.separator + tempFileName;
       
        DigitalAssetVO newAsset = new DigitalAssetVO();
      newAsset.setAssetContentType(contentType);
      newAsset.setAssetKey(digitalAssetKey);
      newAsset.setAssetFileName(fileName);
      newAsset.setAssetFilePath(filePath);
      newAsset.setAssetFileSize(new Integer(new Long(file.length()).intValue()));
     
      if(CmsPropertyHandler.getEnableDiskAssets().equals("false"))
        is = new FileInputStream(file);
 
      String fileUploadMaximumSize = getPrincipalPropertyValue(this.principal, "fileUploadMaximumSize", false, true);
View Full Code Here

    if(outputFormat.equalsIgnoreCase("gif"))
      assetContentType = "image/gif";
    if(outputFormat.equalsIgnoreCase("jpg"))
      assetContentType = "image/jpeg";
   
    DigitalAssetVO digitalAssetVO = new DigitalAssetVO();
    digitalAssetVO.setAssetContentType(assetContentType);
    digitalAssetVO.setAssetFileName(outputFile.getName());
    digitalAssetVO.setAssetFilePath(outputFile.getPath());
    digitalAssetVO.setAssetFileSize(new Integer((int)outputFile.length()));
    digitalAssetVO.setAssetKey(originalAssetVO.getAssetKey() + "_" + assetSuffix);
   
    InputStream is = new FileInputStream(outputFile);
   
      List<Integer> newContentVersionIdList = new ArrayList<Integer>();
      this.digitalAssetVO = DigitalAssetController.create(digitalAssetVO, is, contentVersionId, this.getInfoGluePrincipal(), newContentVersionIdList);
View Full Code Here

TOP

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

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.