Package com.impetus.kundera.datakeeper.entities

Examples of com.impetus.kundera.datakeeper.entities.DocumentInfo


        UploadedFile file = event.getFile();

        if (file != null)
        {
            DocumentInfo dataInfo = new DocumentInfo();
            dataInfo.setData(file.getContents());
            dataInfo.setDocumentName(file.getFileName());
            dataInfo.setSize(file.getSize());
            dataInfo.setOwnerName(employee.getEmployeeName());
            dataInfo.setOwnerId(employee.getEmployeeId());
            dataInfo.setUplodedDate(new Date());

            service.insertData(dataInfo);

            FacesMessage msg = new FacesMessage("Succesful", file.getFileName() + " is uploaded.");
            FacesContext.getCurrentInstance().addMessage(null, msg);
View Full Code Here


       
       
        DataKeeperService service = DataKeeperUtils.getService();

        setDocumentId(Integer.parseInt(FacesUtils.getRequest().getParameter("documentId")));
        DocumentInfo document = service.findDocumentByDocumentId(getDocumentId());

        final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance()
                .getExternalContext().getResponse();

        ServletOutputStream out = null;
        try
        {
            out = response.getOutputStream();
            out.write(document.getData(), 0, 4096);
        }
        catch (IOException e)
        {

        }
View Full Code Here

    @Override
    public DocumentInfo findDocumentByDocumentId(int documentId)
    {
        log.info("Finding document by id.");
        DocumentInfo document = dao.findById(DocumentInfo.class, documentId);
        return document;
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.datakeeper.entities.DocumentInfo

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.