Examples of addDocument()


Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

    @Test
    public void testParseAdd() throws Exception {
        MultiDocument md = new MultiDocument();
        Document doc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(doc.getDocumentGroup());
        md.addDocument(doc);
        MultiDocument parsed = multiDocumentParser.parse(md);
        baseDao.update(parsed);
        assertTrue(parsed.getDocuments().size() == 1);
        assertEquals(parsed, parsed.getDocuments().iterator().next().getDocumentGroup());
        assertFalse(parsed.getDocuments().iterator().next().isTemporal());
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        md.setId(bmd.getId());
        for (Document doc : bmd.getDocuments()) {
            Document ndoc = new Document();
            ndoc.setId(doc.getId());
            ndoc.setIdentifier(doc.getIdentifier());
            md.addDocument(ndoc);
        }
        Document mod = md.getDocuments().iterator().next();
        mod.setIdentifier("newimageid");
        MultiDocument parsed = multiDocumentParser.parse(md);
        baseDao.update(parsed);
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

            if (add) {
                Document ndoc = new Document();
                ndoc.setTemporal(true);
                ndoc.setId(doc.getId());
                ndoc.setIdentifier(doc.getIdentifier());
                md.addDocument(ndoc);
            } else add = true;
        }
        MultiDocument parsed = multiDocumentParser.parse(md);
        baseDao.update(parsed);
        assertFalse(CollectionUtils.isEmpty(parsed.getDocuments()));
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        MultiDocument md = new MultiDocument();
        md.setId(bmd.getId());
        Iterator<Document> it = bmd.getDocuments().iterator();
        it.next();
        Document d = it.next();
        md.addDocument(d);
        md.addDocument(it.next());
        d.setIdentifier("newimageid");
        Document ndoc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(ndoc.getDocumentGroup());
        md.addDocument(ndoc);
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        md.setId(bmd.getId());
        Iterator<Document> it = bmd.getDocuments().iterator();
        it.next();
        Document d = it.next();
        md.addDocument(d);
        md.addDocument(it.next());
        d.setIdentifier("newimageid");
        Document ndoc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(ndoc.getDocumentGroup());
        md.addDocument(ndoc);
        MultiDocument parsed = multiDocumentParser.parse(md);
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        md.addDocument(d);
        md.addDocument(it.next());
        d.setIdentifier("newimageid");
        Document ndoc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(ndoc.getDocumentGroup());
        md.addDocument(ndoc);
        MultiDocument parsed = multiDocumentParser.parse(md);
        baseDao.update(parsed);
        assertTrue(parsed.getDocuments().size() == 3);
        for (Document pdoc : parsed.getDocuments())
            if (pdoc.getId().equals(d.getId()))
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        SimpleEntity entity = baseDao.first(SimpleEntity.class);
        MultiDocument bmd = entity.getPhotos();
        assertTrue(bmd.getDocuments().size() == 4);
        MultiDocument md = new MultiDocument();
        md.setId(bmd.getId());
        md.addDocument(new Document());
        md.getDocuments().iterator().next().setId(bmd.getDocuments().iterator().next().getId());
        Document doc2 = new Document();
        doc2.setTemporal(false);
        doc2.setIdentifier("void image");
        doc2.setWidth(1);
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        doc2.setHeight(1);
        doc2.setCreation(new Date());
        doc2.setMimeType("image/gif");
        doc2.setAuthor((UserImpl) securityDAO.findUser("adminuser"));
        doc2.setContents(FileCopyUtils.copyToByteArray(getClass().getResourceAsStream("/void.gif")));
        md.addDocument(doc2);
        Document doc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(doc.getDocumentGroup());
        Document t = new Document();
        t.setId(doc.getId());
        md.addDocument(t);
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

        md.addDocument(doc2);
        Document doc = baseDao.find(Document.class, generatedDocIDs.get(0));
        assertNull(doc.getDocumentGroup());
        Document t = new Document();
        t.setId(doc.getId());
        md.addDocument(t);
        entity.setPhotos(multiDocumentParser.parse(md));
        baseDao.update(entity);
        assertTrue(entity.getPhotos().getDocuments().size() == 2);
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.MultiDocument.addDocument()

                    MultiDocument old = getDao().find(MultiDocument.class, id);
                    old.removeAll();
                    for (Document doc : up.getDocuments()) {
                        Document parsed = documentParser.parse(doc);
                        parsed.setDocumentGroup(old);
                        old.addDocument(parsed);
                    }
                    if (old.getDocuments().size() == 0) {
                        getDao().remove(old);
                        return null;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.