Package xbird.xquery.dm.instance

Examples of xbird.xquery.dm.instance.DocumentTableModel


    @Ignore
    public void xtestPutDocument() throws XQueryException, DbException, FileNotFoundException {
        StopWatch sw = new StopWatch("testPutDocument");
        DbCollection xmark = DbCollection.getRootCollection().createCollection(COL_NAME);
        assert (xmark.getDirectory().exists());
        final DocumentTableModel dtm = new DocumentTableModel(false);
        File file = new File(TEST_FILE);
        dtm.loadDocument(new FileInputStream(file));
        IDocumentTable doc = dtm.getDocumentTable();
        //DbCollection coll = new DbCollection(true);
        xmark.putDocument(new Transaction(), file.getName(), doc);
        System.err.println(sw);
    }
View Full Code Here


            FileNotFoundException {
        DbCollection xmark = DbCollection.getRootCollection().createCollection(COL_NAME);
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new DocumentTable.PersistentDocumentTable(xmark, FileUtils.getFileName(file));
        final DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

    public void xtestPutDocument() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtm");
        assert (xmark.getDirectory().exists());
        DocumentTableModel dtm = new DocumentTableModel(false);
        File file = new File(TEST_FILE);
        dtm.loadDocument(new FileInputStream(file));
        IDocumentTable doc = dtm.getDocumentTable();
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new DocumentTable.PersistentDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtm");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable();
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        DbCollection xmarkCol = DbCollection.getCollection("/test/xmark");
        DbCollection xmark = xmarkCol.createCollection("big_dtms");
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable.PersistentBigDocumentTable(xmark, FileUtils.getFileName(file));
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

    public void xtestPutDocumentBig() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmark = DbCollection.getRootCollection().createCollection(COL_NAME);
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable();
        final DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
    }
View Full Code Here

        StopWatch sw = new StopWatch("testPutDocumentPageOutBig");
        DbCollection xmark = DbCollection.getRootCollection().createCollection(COL_NAME);
        assert (xmark.getDirectory().exists());
        File file = new File(TEST_FILE);
        IDocumentTable doc = new BigDocumentTable.PersistentBigDocumentTable(xmark, FileUtils.getFileName(file));
        final DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(file));
        xmark.putDocument(new Transaction(), file.getName(), doc);
        System.err.println(sw);
    }
View Full Code Here

        Map<String, DTMDocument> map = col.listDocuments(DynamicContext.DUMMY);
        for(Map.Entry<String, DTMDocument> entry : map.entrySet()) {
            String docName = entry.getKey();
            DTMDocument doc = entry.getValue();
            IDocumentTable doctbl = doc.documentTable();
            DocumentTableModel dtm = doc.getDataModel();
            PropertyMap props = col.getCollectionProperties();
            LabelingHandler handler = new LabelingHandler(doctbl, col, docName, props);
            dtm.export(0L, handler);
            doctbl.close();
        }
        return true;
    }
View Full Code Here

    public static IDocumentTable loadDocument(DbCollection col, File docFile)
            throws FileNotFoundException, XQueryException, DbException {
        long fileSize = docFile.length();
        IDocumentTable doc = preferedDocumentTable(col, docFile, fileSize);
        DocumentTableModel dtm = new DocumentTableModel(doc);
        dtm.loadDocument(new FileInputStream(docFile));
        col.putDocument(new Transaction(), docFile.getName(), doc);
        return doc;
    }
View Full Code Here

TOP

Related Classes of xbird.xquery.dm.instance.DocumentTableModel

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.