Package org.internna.iwebmvc.model

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


        doc5.setCreation(new Date());
        doc5.setMimeType("image/gif");
        doc5.setAuthor((UserImpl) securityDAO.findUser("adminuser"));
        doc5.setContents(contents);
        SimpleEntity entity = new SimpleEntity("john");
        entity.setPhotos(md.addDocument(doc).addDocument(doc3).addDocument(doc4).addDocument(doc5));
        baseDao.create(entity);
        assertNotNull(baseDao.first(SimpleEntity.class));
        assertNotNull(baseDao.first(MultiDocument.class));
    }
View Full Code Here


    @Test
    public void testParseNulls() throws Exception {
        assertNull(multiDocumentParser.parse(null));
        MultiDocument md = new MultiDocument();
        assertNull(multiDocumentParser.parse(md));
        md.addDocument(new Document());
        md.addDocument(new Document());
        assertNull(multiDocumentParser.parse(md));
        SimpleEntity entity = baseDao.first(SimpleEntity.class);
        md = baseDao.first(MultiDocument.class);
        md.removeAll();
View Full Code Here

    public void testParseNulls() throws Exception {
        assertNull(multiDocumentParser.parse(null));
        MultiDocument md = new MultiDocument();
        assertNull(multiDocumentParser.parse(md));
        md.addDocument(new Document());
        md.addDocument(new Document());
        assertNull(multiDocumentParser.parse(md));
        SimpleEntity entity = baseDao.first(SimpleEntity.class);
        md = baseDao.first(MultiDocument.class);
        md.removeAll();
        MultiDocument parsed = multiDocumentParser.parse(md);
View Full Code Here

    @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

        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

            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

        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

        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

        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

        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

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.