Package com.log4ic.entity

Examples of com.log4ic.entity.DocumentRelation


    private DocumentRelationDao relationDao = new DocumentRelationDao();

    public IDocAttachment getDocAttachmentById(int id) {
        //TODO  获取文档
        try {
            DocumentRelation relation = relationDao.getRelation(id);
            DocAttachment docAttachment = new DocAttachment(new File(relation.getLocation()));
            docAttachment.setName(relation.getFileName());
            return docAttachment;
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
View Full Code Here


            if (uploaderFileList.size() > 0) {
                String path = this.getClass().getResource("/").getPath();
                for (UploaderFile file : uploaderFileList) {
                    File newFile = new File(path + File.separator + "documents" + File.separator + file.getName());
                    FileUtils.copyFile(file, newFile);
                    DocumentRelation relation = new DocumentRelation();
                    relation.setFileName(file.getUploadName());
                    relation.setLocation(newFile.getPath());
                    relation.setCreateDate(new Timestamp(System.currentTimeMillis()));
                    relationDao.save(relation);
                    if(DocViewer.isSupport(FilenameUtils.getExtension(file.getUploadName()))){
                        relation = relationDao.getRelationByLocation(relation.getLocation());
                        DocViewer.addConvertWorker(relation.getId());
                    }
                }

                response.sendRedirect("/continue.jsp");
            }
View Full Code Here

        List<DocumentRelation> relationList = new FastList<DocumentRelation>();
        try {
            stmt = conn.prepareStatement("select * from documentrelation order by createdate desc");
            ResultSet resultSet = stmt.executeQuery();
            while (resultSet.next()) {
                com.log4ic.entity.DocumentRelation relation = new DocumentRelation();
                relation.setFileName(resultSet.getString("filename"));
                relation.setLocation(resultSet.getString("location"));
                relation.setId(resultSet.getInt("id"));
                relation.setCreateDate(resultSet.getTimestamp("createDate"));
                relationList.add(relation);
            }

        } finally {
            if (stmt != null) {
View Full Code Here

        try {
            stmt = conn.prepareStatement("select * from documentrelation where id = ?");
            stmt.setInt(1, id);
            ResultSet resultSet = stmt.executeQuery();
            if (resultSet.next()) {
                com.log4ic.entity.DocumentRelation relation = new DocumentRelation();
                relation.setFileName(resultSet.getString("filename"));
                relation.setLocation(resultSet.getString("location"));
                relation.setId(resultSet.getInt("id"));
                relation.setCreateDate(resultSet.getTimestamp("createDate"));
                return relation;
            }

        } finally {
            if (stmt != null) {
View Full Code Here

TOP

Related Classes of com.log4ic.entity.DocumentRelation

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.