Package xbird.xquery.dm.dtm

Examples of xbird.xquery.dm.dtm.IDocumentTable


            return nodeName().getNamespaceURI();
        }

        @Override
        public DTMNodeBase lastChild() {
            final IDocumentTable store = documentTable();
            final long cid = store.lastChild(_id);
            if(cid == -1) {
                return null;
            }
            final DocumentTableModel model = getDataModel();
            return model.createNode(store.getNodeKindAt(cid), cid);
        }
View Full Code Here


            final DocumentTableModel model = getDataModel();
            return model.createNode(store.getNodeKindAt(cid), cid);
        }

        public boolean nilled() {
            final IDocumentTable store = documentTable();
            long attid;
            for(int i = 0; (attid = getAttribute(i)) != -1; i++) {
                assert (attid != -1);
                byte attkind = store.getNodeKindAt(attid);
                if(attkind == NodeKind.ATTRIBUTE) {
                    QualifiedName qname = store.getAttributeName(attid);
                    String nsuri = qname.getNamespaceURI();
                    String attname = qname.getLocalPart();
                    if(XQueryConstants.XSI_URI.equals(nsuri) && "nil".equals(attname)) {
                        String attval = store.getText(attid);
                        if(attval == null) {
                            return false;
                        }
                        return BooleanValue.toBoolean(attval);
                    }
View Full Code Here

            return NodeKind.ELEMENT;
        }

        @Override
        public int getNameCode() {
            final IDocumentTable store = documentTable();
            return store.getNameCode(_id);
        }
View Full Code Here

            return store.getNameCode(_id);
        }

        @Override
        public QualifiedName nodeName() {
            final IDocumentTable store = documentTable();
            return store.getName(_id);
        }
View Full Code Here

        public DocumentTableModel getDocumentTableModel() {
            return dtm;
        }

        public void clear() {
            final IDocumentTable table = dtm.getDocumentTable();
            try {
                table.close();
            } catch (IOException e) {
                LOG.warn(e.getMessage(), e);
            }
            this.dtm = null;
            this.ptrsQueue = null;
View Full Code Here

        }
        DbCollection col = DbCollection.getCollection(colPath);
        if(col == null) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        final IDocumentTable doc;
        try {
            doc = ImportDocument.loadDocument(col, docFile);
        } catch (FileNotFoundException fnf) {
            throw new XQueryException("File not found: " + docPath, fnf);
        } catch (DbException e) {
View Full Code Here

        final Collection<DTMDocument> docs = catalog.values();
        final NodeSequence<DTMDocument> ret = new NodeSequence<DTMDocument>(dynEnv);
        for(DTMDocument d : docs) {
            ret.addItem(d);
            if(profiler != null && !(d instanceof LazyDTMDocument)) {
                IDocumentTable doctbl = d.documentTable();
                PagingProfile profile = doctbl.getPagingProfile();
                if(profile != null) {
                    profile.setProfiler(profiler);
                }
            }
        }
View Full Code Here

                if(LOG.isInfoEnabled()) {
                    LOG.info("Index scan done. matched: " + matched.countMatched() + ", filtered: "
                            + matchCounts);
                }
                if(matchCounts > 0) {
                    final IDocumentTable doctbl;
                    try {
                        doctbl = DocumentTableLoader.load(col, docName, _dynEnv);
                    } catch (IOException e) {
                        throw new XQRTException("failed to load document '" + docName
                                + "' is the collection '" + col.getAbsolutePath() + '\'', e);
                    }
                    final PagingProfile profile = doctbl.getPagingProfile();
                    Strategy origStrategy = null;
                    if(profile != null) {
                        profile.setProfiler(profiler);
                        origStrategy = profile.getStrategy();
                        profile.setStrategy(Strategy.index);
View Full Code Here

    public boolean removeDocument(Transaction tx, String docName) throws DbException {
        assert (docName != null);
        // remove from cache
        String docPath = getAbsolutePath() + File.separatorChar + docName;
        IDocumentTable removedDoc = DocumentTableLoader.removeDocument(docPath);
        if(removedDoc != null) {
            try {
                removedDoc.close();
            } catch (IOException e) {
                LOG.warn("Failed to close a document: " + docPath, e);
            }
        }
View Full Code Here

        return !FileUtils.listFiles(getDirectory(), new String[] { docName }, new String[] { IDocumentTable.DTM_SEGMENT_FILE_SUFFIX }, false).isEmpty();
    }

    public DTMDocument getDocument(Transaction tx, String docName, DynamicContext dynEnv)
            throws DbException {
        final IDocumentTable dtm;
        try {
            dtm = DocumentTableLoader.load(this, docName, dynEnv);
        } catch (IOException e) {
            throw new DbException("loading document failed: " + docName, e);
        }
View Full Code Here

TOP

Related Classes of xbird.xquery.dm.dtm.IDocumentTable

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.