fileVO.setTo(getTimestamp(endDay,endMonth,endYear,timeZone));
}
}
// get file
FormFile fileUpload = ((FileForm)form).getFile();
// set file vo
fileVO.setName(fileUpload.getFileName());
fileVO.setFileSize(fileUpload.getFileSize());
fileVO.setPhysicalFolder(Integer.parseInt(((FileForm)form).getUploadfolderid()));
fileVO.setTitle(((FileForm)form).getTitle());
fileVO.setDescription(((FileForm)form).getDescription());
if(((FileForm)form).getAuthorid() != null && ((FileForm)form).getAuthorid().length() > 0)
fileVO.setAuthorId(Integer.parseInt(((FileForm)form).getAuthorid()));
if(((FileForm)form).getEntityid() != null && ((FileForm)form).getEntityid().length() > 0)
fileVO.setRelateEntity(Integer.parseInt(((FileForm)form).getEntityid()));
if(((FileForm)form).getIndividualid() != null && ((FileForm)form).getIndividualid().length() > 0)
fileVO.setRelateIndividual(Integer.parseInt(((FileForm)form).getIndividualid()));
fileVO.setRelatedFieldID(((FileForm)form).getRelatedFieldID());
fileVO.setRelatedFieldValue(((FileForm)form).getRelatedFieldValue());
fileVO.setRelatedTypeID(((FileForm)form).getRelatedTypeID());
fileVO.setRelatedTypeValue(((FileForm)form).getRelatedTypeValue());
fileVO.setVisibility(((FileForm)form).getAccess());
fileVO.setCustomerView(((FileForm)form).getCustomerview());
fileVO.setCompanyNews(((FileForm)form).getCompanynews());
int userId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
fileVO.setCreatedBy(userId);
fileVO.setOwner(userId);
// call to file facade
CvFileFacade fileFacade = new CvFileFacade();
// set request back to jsp
request.setAttribute(FileConstantKeys.TYPEOFFILE, FileConstantKeys.FILE);
request.setAttribute(FileConstantKeys.CURRENTTAB, FileConstantKeys.DETAIL);
request.setAttribute(FileConstantKeys.TYPEOFOPERATION, FileConstantKeys.ADD);
request.setAttribute(FileConstantKeys.WINDOWID, "1");
if (request.getParameter("closeornew").equals("close"))
{
request.setAttribute("closeWindow","true");
}
else
{
request.setAttribute("closeWindow","false");
}
FORWARD_final = FORWARD_savefile;
try
{
int recordID=fileFacade.addFile(userId, fileVO.getPhysicalFolder(), fileVO, fileUpload.getInputStream(), dataSource);
rowID=recordID;
}
catch(CvFileException e)
{
System.out.println("[Exception][SaveNewFileHandler.execute] Exception Thrown: "+e);