Package com.centraview.file

Examples of com.centraview.file.CvFileFacade


        fileVO.setIsTemporary(CvFileVO.FIT_YES);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBody.getBytes());

        try {
          CvFileFacade fileFacade = new CvFileFacade();
          newFileID = fileFacade.addFile(individualID, attachmentFolderID, fileVO, inputStream, dataSource);
        } catch (CvFileException cfe) {
          // I guess do nothing
        }

        if (newFileID > 0) {
View Full Code Here


        // if file ID is set on the form properly, then set
        // the int representation for use in the code below
        fileID = formFileID.intValue();
      }
     
      CvFileFacade fileFacade = new CvFileFacade();
      CvFileVO fileVO = fileFacade.getFile(individualID, fileID, dataSource);

      fileForm.set("title", fileVO.getTitle());
      fileForm.set("fileName", fileVO.getName());
      fileForm.set("description", fileVO.getDescription());
     
View Full Code Here

        FormFile ff = (FormFile) fileform.getFile();
        String fileName = ff.getFileName();
        InputStream im = ff.getInputStream();

        CvFileFacade cvfile = new CvFileFacade();
        CvFileVO flvo = new CvFileVO();
        flvo.setTitle(fileName); //file name

        Calendar c = Calendar.getInstance();
        java.util.Date dt = c.getTime();
        DateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm_ss");
        String dateStamp = df.format(dt);

        flvo.setName("attachment_" + dateStamp +"_"+ fileName);
        flvo.setCreatedBy(userid);
        flvo.setOwner(userid);
        flvo.setAuthorId(userid);
        flvo.setFileSize((float) ff.getFileSize());

        CvFolderVO homeFolder = cvfile.getHomeFolder(userid, dataSource);
        int fileId = cvfile.addFile(userid, homeFolder.getFolderId(), flvo, im, dataSource);
        ArrayList fileList = new ArrayList();
        fileList.add(new DDNameValue(fileId+"#"+fileName,fileName));

        String[] files = fileform.getFileList();
        if(files != null){
View Full Code Here

    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    try {
      CvFileFacade fileFacade = new CvFileFacade();
      for (int i=0; i<rowId.length; i++) {
        fileFacade.deleteFile(individualId, Integer.parseInt(rowId[i]), dataSource);
      }
    } catch(Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new CommunicationException(e.getMessage());
    }
View Full Code Here

      ListPreference listpreference= userobjectd.getListPreference("File");
      FileList displaylistSession=null;


      FileList DL = new FileList() ;
      CvFileFacade fileFacade = new CvFileFacade();
      FileListElement fle = fileFacade.getParentFolder(individualID, strFolderId, dataSource);

      if (fle != null) {
        StringBuffer stringbuffer = new StringBuffer("00000000000");
        stringbuffer.setLength(11);
        String s3 = (new Integer(DL.getBeginIndex())).toString();
View Full Code Here

      // So if you intend to modify this code, please consult the rest
      // of the team to see if it makes sense to make that change now.
      // Also, if you make a change here, you must make sure the
      // attachment handling code in ForwardHandler reflects your changes.
      if (attachmentFileIDs != null && attachmentFileIDs.size() > 0) {
        CvFileFacade fileRemote  = new CvFileFacade();
       
        for (int i = 0; i < attachmentFileIDs.size(); i++) {
          int fileID = ((Integer) attachmentFileIDs.get(i)).intValue();
          // get the CvFileVO from the EJB layer
          CvFileVO fileVO = fileRemote.getFile(individualID, fileID, dataSource);
          if (fileVO != null) {
            // add this attachment to the messageVO
            messageVO.addAttachedFiles(fileVO);
          }
        }   // end while (attachIter.hasNext())
View Full Code Here

          // create a MailMessageVO
          MailMessageVO messageVO = new MailMessageVO();

          if (attachmentFileIDs != null && attachmentFileIDs.size() > 0) {
            CvFileFacade fileRemote = new CvFileFacade();

            for (int i = 0; i < attachmentFileIDs.size(); i++) {
              int fileID = ((Integer)attachmentFileIDs.get(i)).intValue();
              // get the CvFileVO from the EJB layer
              CvFileVO fileVO = fileRemote.getFile(individualID, fileID, dataSource);
              if (fileVO != null) {
                // add this attachment to the messageVO
                messageVO.addAttachedFiles(fileVO);
              }
            }
          }

          // Send Email to all the Individual with the updated information of
          // the Template
          PrintTemplateHome PTHome = (PrintTemplateHome)CVUtility.getHomeObject(
              "com.centraview.printtemplate.PrintTemplateHome", "Printtemplate");
          PrintTemplate PTRemote = PTHome.create();
          PTRemote.setDataSource(dataSource);

          if (ptfrom != null && !ptfrom.equals("") && !ptfrom.equals("null")) {
            int accountID = Integer.parseInt(ptfrom);
            Message[0] = PTRemote.sendPTEmail(individualID, accountID, emailList, ptSubject,
                ptContent, messageVO);
          }
        } else {
          // generate the Previewed Template into a File.
          try {
            CvFileFacade cvf = new CvFileFacade();

            CvFileHome homeFile = (CvFileHome)CVUtility.getHomeObject(
                "com.centraview.file.CvFileHome", "CvFile");
            CvFile remoteFile = homeFile.create();
            remoteFile.setDataSource(dataSource);

            CvFolderVO homeFld = remoteFile.getHomeFolder(individualID);

            int rn = (new Random()).nextInt();
            Calendar c = Calendar.getInstance();
            java.util.Date dt = c.getTime();
            DateFormat df = new SimpleDateFormat("MM_dd_yyyy");
            String dateStamp = df.format(dt);

            CvFileVO flvo = new CvFileVO();
            flvo.setTitle("Print Template_" + rn);
            flvo.setName("Template_" + "_" + rn + "_" + dateStamp + ".html");
            Message[1] = "Template_" + "_" + rn + "_" + dateStamp + ".html";

            flvo.setPhysicalFolder(homeFld.getFolderId());
            flvo.setIsTemporary("NO");
            flvo.setOwner(individualID);
            flvo.setPhysical(CvFileVO.FP_PHYSICAL);
            StringBuffer documentContent = new StringBuffer();

            for (int i = 0; i < ptContent.size(); i++) {
              documentContent.append(ptContent.get(i));
              if (i != (ptContent.size() - 1)) {
                documentContent.append("<br><<Page Break>><br>");
              }
            }
            ByteArrayInputStream inputStream = new ByteArrayInputStream(documentContent.toString()
                .getBytes());
            // Add the File to the Files Module so that we can download it...
            int fileId = cvf.addFile(individualID, homeFld.getFolderId(), flvo, inputStream,
                dataSource);
            Message[2] = String.valueOf(fileId);
          } catch (Exception e) {
            logger.error("[execute] Exception thrown.", e);
          }
View Full Code Here

      // So if you intend to modify this code, please consult the rest
      // of the team to see if it makes sense to make that change now.
      // Also, if you make a change here, you must make sure the
      // attachment handling code in ForwardHandler reflects your changes.
      if (attachmentFileIDs != null && attachmentFileIDs.size() > 0) {
        CvFileFacade fileRemote = new CvFileFacade();

        for (int i = 0; i < attachmentFileIDs.size(); i++) {
          int fileID = ((Integer)attachmentFileIDs.get(i)).intValue();
          // get the CvFileVO from the EJB layer
          CvFileVO fileVO = fileRemote.getFile(individualID, fileID, dataSource);
          if (fileVO != null) {
            // add this attachment to the messageVO
            messageVO.addAttachedFiles(fileVO);
          }
        } // end while (attachIter.hasNext())
View Full Code Here

        fileVO.setIsTemporary(CvFileVO.FIT_YES);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBody.getBytes());

        try {
          CvFileFacade fileFacade = new CvFileFacade();
          newFileID = fileFacade.addFile(individualID, attachmentFolderID, fileVO, inputStream, dataSource);
        }catch(CvFileException cfe){
          // I guess do nothing
        }

        if (newFileID > 0) {
View Full Code Here

      // So if you intend to modify this code, please consult the rest
      // of the team to see if it makes sense to make that change now.
      // Also, if you make a change here, you must make sure the
      // attachment handling code in ForwardHandler reflects your changes.
      if (attachmentFileIDs != null && attachmentFileIDs.size() > 0) {
        CvFileFacade fileRemote = new CvFileFacade();

        for (int i = 0; i < attachmentFileIDs.size(); i++) {
          int fileID = ((Integer)attachmentFileIDs.get(i)).intValue();
          // get the CvFileVO from the EJB layer
          CvFileVO fileVO = fileRemote.getFile(individualID, fileID, dataSource);
          if (fileVO != null) {
            // add this attachment to the messageVO
            messageVO.addAttachedFiles(fileVO);
          }
        } // end while (attachIter.hasNext())
View Full Code Here

TOP

Related Classes of com.centraview.file.CvFileFacade

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.