Package com.centraview.file

Examples of com.centraview.file.CvFileFacade


        hm.put("SystemIncludeFlag", new Boolean(SystemIncludeFlag));

        HashMap listMap = null;

        CvFileFacade cvFFacacde = new CvFileFacade();

        try {
          returnDL = cvFFacacde.getAllCustomerFiles(userID, hm, this.dataSource);
        } catch (Exception e) {
          System.out.println("[Exception][MarketingListEJB] Exception thrown in x: " + e);
        }

        returnDL.setFileTypeRequest(fileTypeRequest);
View Full Code Here


          this.addProposalItem(ele, gid, taxJurisdictionId);
        }
      }// end of while

      dl.setSqlQueryToNull();
      CvFileFacade cvf = new CvFileFacade();
      String[] values = proposalForm.getAttachFileIds();
      if (values != null) {
        for (int i = 0; i < values.length; i++) {
          cvf.commitEmailAttachment(individualID, Integer.parseInt(values[i]), this.dataSource);
          dl.setSqlQuery("insert into proposallink(proposalid,recordtypeid,recordid) values ("
              + gid + ",33," + values[i] + ")");
          dl.executeUpdate();
        }
      }
View Full Code Here

        local.setDataSource(this.dataSource);
        float opportunityTotal = local.updateTotalAmount(opportunityID);
        local.updateForcastAmount(opportunityTotal, opportunityID);
        // do the update
      }
      CvFileFacade cvf = new CvFileFacade();
      // while updating for attached file ids, only commiting them as
      // isTemporary=NO is to be done.
      // deleting records for 'whatever user has removed from previous list'
      // files from CVFILE table and DISK
      // and Adding new records for 'whatever user has adde into list' Will be
      // Done at attachmentHandler and removeHandler
      // So when control comes here, only 'files to be kept' list will be ther
      // in array as well as in CVFILE records as well as on DISK
      dl.setSqlQuery("delete from proposallink where proposalid = "
          + proposalForm.getProposalid());
      dl.executeUpdate();
      String[] values = proposalForm.getAttachFileIds();
      if (values != null) {

        // 33 is RecordTypeId for CVFile table and it is hardcoded.
        // Later it may be taken from 'CVTable' table.
        for (int i = 0; i < values.length; i++) {
          StringTokenizer stk = new StringTokenizer(values[i], "#");
          String fileIDStr = stk.nextToken();
          if (fileIDStr != null) {
            cvf.commitEmailAttachment(userId, Integer.parseInt(fileIDStr), this.dataSource);
            dl.setSqlQuery("insert into proposallink(proposalid,recordtypeid,recordid) values ("
                + proposalForm.getProposalid() + ",33," + fileIDStr + ")");
            dl.executeUpdate();
          }
        }
View Full Code Here

      Iterator itu = col.iterator();
      if (itu.hasNext()) {
        throw new UserException(UserException.INSERT_FAILED, "A user for this individual already exists");
      }
      // first try to create the users home folder, if this fails in any way, bail out.
      CvFileFacade cvf = new CvFileFacade();
      int folderID = 0;
      try {
        folderID = cvf.addFolder(individualId, uvo.getLoginName(), this.dataSource);
        // change the owner of the folder:
        cvdl.setSqlQueryToNull();
        cvdl.setSqlQuery("UPDATE cvfolder SET owner = ? WHERE folderId = ?");
        cvdl.setInt(1, userTargetIndividualId);
        cvdl.setInt(2, folderID);
View Full Code Here

  public void saveFile(String filename, InputStream input, int userid, CVDal cvdl, int messageid) throws Exception
  {

    //System.out.println("Saving File");

    CvFileFacade cvfile = new CvFileFacade();
    CvFileVO flvo = new CvFileVO();
    flvo.setTitle("EmailAttachment"); //file name
    flvo.setName(filename);
    flvo.setCreatedBy(userid);

    int attchmentid = cvfile.addEmailAttachment(userid, flvo, input, this.dataSource);

    cvdl.setSql("email.savedraftattchment");
    cvdl.setInt(1, messageid);
    cvdl.setString(2, filename);
    cvdl.setInt(3, attchmentid);
View Full Code Here

          cvdl.setInt(3, Integer.parseInt(fileid));
          cvdl.executeUpdate();
          cvdl.clearParameters();
          i++;

          CvFileFacade cvfile  = new CvFileFacade();
          CvFileVO cvfilevo    = cvfile.getEmailAttachment(userId, Integer.parseInt(fileid), this.dataSource);

          String path          = cvfilevo.getPhysicalFolderVO().getFullPath(null, true) + cvfilevo.getName();

          DataSource source    = new FileDataSource(path);
          messageBodyPart.setDataHandler(new DataHandler(source));
View Full Code Here

      Iterator it = idVec.iterator();
      // will never know which one is new and which one is old hence commit all
      while (it.hasNext()) {
        int fileId = ((Integer)it.next()).intValue();
        try {
          CvFileFacade cvf = new CvFileFacade();
          cvf.commitEmailAttachment(userId, fileId, this.dataSource);
        } catch (Exception e) {
          System.out.println("[Exception][ActivityFacadeEJB.commitAttachment] Exception Thrown: "
              + e);
          e.printStackTrace();
        }
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.