Package org.infoglue.cms.webservices.elements

Examples of org.infoglue.cms.webservices.elements.RemoteAttachment


    else
    {
        throw new JspException("Must state either bytes, a file or a fileItem");
    }
   
    RemoteAttachment attachment = new RemoteAttachment(this.assetKey, this.fileName, this.filePath, this.contentType, this.bytes);
   
    ((ContentVersionParameterInterface) parent).addDigitalAsset(attachment);
  }
View Full Code Here


          if(digitalAssets != null)
          {
              Iterator digitalAssetIterator = digitalAssets.iterator();
              while(digitalAssetIterator.hasNext())
              {
                  RemoteAttachment remoteAttachment = (RemoteAttachment)digitalAssetIterator.next();
                logger.info("digitalAssets in ws:" + remoteAttachment);
                //logger.info("remoteAttachment:" + remoteAttachment.getName() + ":" + remoteAttachment.getSize() + ":" + remoteAttachment.getFilePath());
               
                DigitalAssetVO newAsset = new DigitalAssetVO();
          newAsset.setAssetContentType(remoteAttachment.getContentType());
          newAsset.setAssetKey(remoteAttachment.getName());
          newAsset.setAssetFileName(remoteAttachment.getFileName());
          newAsset.setAssetFilePath(remoteAttachment.getFilePath());
          newAsset.setAssetFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));
          //is = new FileInputStream(renamedFile);
          InputStream is = new ByteArrayInputStream(remoteAttachment.getBytes());

          Iterator existingDigitalAssetVOListIterator = existingDigitalAssetVOList.iterator();
          while(existingDigitalAssetVOListIterator.hasNext())
          {
            DigitalAssetVO assetVO = (DigitalAssetVO)existingDigitalAssetVOListIterator.next();
View Full Code Here

                if(digitalAssets != null)
                {
                  Iterator digitalAssetIterator = digitalAssets.iterator();
                  while(digitalAssetIterator.hasNext())
                  {
                      RemoteAttachment remoteAttachment = (RemoteAttachment)digitalAssetIterator.next();
                    logger.info("digitalAssets in ws:" + remoteAttachment);
                   
                    FormEntryAssetVO newAsset = new FormEntryAssetVO();
              newAsset.setContentType(remoteAttachment.getContentType());
              newAsset.setAssetKey(remoteAttachment.getName());
              newAsset.setFileName(remoteAttachment.getFileName());
              newAsset.setFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));
              byte[] bytes = remoteAttachment.getBytes();
              InputStream is = new ByteArrayInputStream(bytes);
   
              formEntryController.createAsset(newAsset, newFormEntry, is, newFormEntry.getId(), principal, db2);
                }  
                }
View Full Code Here

            if(digitalAssets != null)
            {
              Iterator<RemoteAttachment> digitalAssetIterator = digitalAssets.iterator();
              while(digitalAssetIterator.hasNext())
              {
                RemoteAttachment remoteAttachment = digitalAssetIterator.next();
                logger.info("digitalAssets in ws:" + remoteAttachment);

                DigitalAssetVO newAsset = new DigitalAssetVO();
                newAsset.setAssetContentType(remoteAttachment.getContentType());
                newAsset.setAssetKey(remoteAttachment.getName());
                newAsset.setAssetFileName(remoteAttachment.getFileName());
                newAsset.setAssetFilePath(remoteAttachment.getFilePath());
                newAsset.setAssetFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));
                //is = new FileInputStream(renamedFile);
                InputStream is = new ByteArrayInputStream(remoteAttachment.getBytes());

                DigitalAssetVO newDigitalAssetVO = DigitalAssetController.create(newAsset, is, newContentVersionId, principal);
                if(newDigitalAssetVO != null)
                  statusBean.getCreatedBeans().add(new CreatedEntityBean(DigitalAssetVO.class.getName(), new Long(newDigitalAssetVO.getId())));
              }
View Full Code Here

      {
        logger.info("digitalAssets:" + digitalAssets.size());
        Iterator<RemoteAttachment> digitalAssetIterator = digitalAssets.iterator();
        while(digitalAssetIterator.hasNext())
        {
          RemoteAttachment remoteAttachment = digitalAssetIterator.next();
          logger.info("digitalAssets in ws:" + remoteAttachment);

          InputStream is = new ByteArrayInputStream(remoteAttachment.getBytes());

          DigitalAssetVO existingAssetVO = DigitalAssetController.getLatestDigitalAssetVO(contentVersionVO.getId(), remoteAttachment.getName());
          if(updateExistingAssets && existingAssetVO != null)
          {
            ContentVersionController.getContentVersionController().deleteDigitalAssetRelation(contentVersionVO.getId(), existingAssetVO.getId(), principal);

            DigitalAssetVO digitalAssetVO = new DigitalAssetVO();
            digitalAssetVO.setAssetContentType(remoteAttachment.getContentType());
            digitalAssetVO.setAssetKey(remoteAttachment.getName());
            digitalAssetVO.setAssetFileName(remoteAttachment.getFileName());
            digitalAssetVO.setAssetFilePath(remoteAttachment.getFilePath());
            digitalAssetVO.setAssetFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));

            DigitalAssetController.create(digitalAssetVO, is, contentVersionVO.getContentVersionId(), principal);
          }
          else
          {
            DigitalAssetVO newAsset = new DigitalAssetVO();
            newAsset.setAssetContentType(remoteAttachment.getContentType());
            newAsset.setAssetKey(remoteAttachment.getName());
            newAsset.setAssetFileName(remoteAttachment.getFileName());
            newAsset.setAssetFilePath(remoteAttachment.getFilePath());
            newAsset.setAssetFileSize(new Integer(new Long(remoteAttachment.getBytes().length).intValue()));

            DigitalAssetController.create(newAsset, is, contentVersionVO.getContentVersionId(), principal);
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.webservices.elements.RemoteAttachment

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.