Examples of loadDocument()


Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

        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);
    }

    public void xtestPutDocumentPageOutBig() throws XQueryException, DbException,
            FileNotFoundException {
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

        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);
    }

    public void testRunNormalDTM_Q1() throws FileNotFoundException, XPathException, SAXException,
            IOException, XQueryException, URISyntaxException {
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

        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);
    }

    public void xtestPutDocumentBig() throws XQueryException, DbException, FileNotFoundException {
        DbCollection xmark = DbCollection.getRootCollection().createCollection(COL_NAME);
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

        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);
    }

    @Test
    public void testPutDocumentPageOutBig() throws XQueryException, DbException,
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

        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);
    }

    @Test
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

    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;
    }

    private static IDocumentTable preferedDocumentTable(DbCollection col, File docFile, long filesize) {
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

                throw new DynamicError("Openning a document failed: " + unescaped, e);
            }
            final boolean resolveEntity = unescaped.startsWith("http");
            final DocumentTableModel dtm = new DocumentTableModel(parseAsHtml, resolveEntity);
            try {
                dtm.loadDocument(is, dynEnv);
            } catch (XQueryException e) {
                throw new DynamicError("loading a document failed: " + unescaped, e);
            }
            xqdoc = dtm.documentNode();
            xqdoc.setDocumentUri(unescaped);
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

                                String docName = name + ".xml";
                                DTMDocument testDataDoc = _docCache.get(name);
                                if(testDataDoc == null) {
                                    File testDataFile = new File(xqtsDir, docName);
                                    DocumentTableModel dtm = new DocumentTableModel(false);
                                    dtm.loadDocument(new FileInputStream(testDataFile));
                                    testDataDoc = dtm.documentNode();
                                    _docCache.put(name, testDataDoc);
                                }
                                defaultCollectionMap.put(docName, testDataDoc);
                                // import namespace decl
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

                                + contextItemRef + "']", catalog);
                        DTMDocument contextItemDoc = _docCache.get(contextItemRef);
                        if(contextItemDoc == null) {
                            File contextItemFile = new File(xqtsDir, contextItemFileRef);
                            DocumentTableModel dtm = new DocumentTableModel(false);
                            dtm.loadDocument(new FileInputStream(contextItemFile));
                            contextItemDoc = dtm.documentNode();
                            _docCache.put(contextItemRef, contextItemDoc);
                        }
                        contextItem = contextItemDoc;
                    }
View Full Code Here

Examples of xbird.xquery.dm.instance.DocumentTableModel.loadDocument()

                        DTMDocument testDataDoc = _docCache.get(testDataId);
                        if(testDataDoc == null) {
                            File testDataFile = new File(xqtsDir, testFileRelDir);
                            // load test data
                            DocumentTableModel dtm = new DocumentTableModel(false);
                            dtm.loadDocument(new FileInputStream(testDataFile));
                            testDataDoc = dtm.documentNode();
                            _docCache.put(testDataId, testDataDoc);
                        }
                        // import namespace decl
                        Map<String, String> nsmap = testDataDoc.documentTable().getDeclaredNamespaces();
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.