Package org.apache.xindice.util

Examples of org.apache.xindice.util.Configuration


        if (log.isInfoEnabled()) {
            log.info("Database points to " + dbrootDir.getAbsolutePath());
        }

        try {
            Configuration queryCfg = config.getChild(QUERYENGINE);
            if (queryCfg != null) {
                this.engine.setConfig(queryCfg);
            }
        } catch (Exception e) {
            if (log.isWarnEnabled()) {
                log.warn("ignored exception", e);
            }
        }

        if (!sysInit) {
            this.systemCollection = new SystemCollection(this);

            try {
                this.systemCollection.init();
            } catch (XindiceException e) {
                if (log.isWarnEnabled()) {
                    log.warn("ignored exception", e);
                }
            }

            super.addCollection(systemCollection);
            this.sysInit = true;
        }

        try {
            // Bootstrap from the database itself...  This is accomplished
            // by intercepting the setConfig call and using a Configuration
            // retrieved from the database instead of the standard config
            Document colDoc = systemCollection.getCollection(SystemCollection.CONFIGS).getDocument(COLKEY);
            if (colDoc == null) {
                DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                colDoc = db.newDocument();
                Element root = colDoc.createElement(DATABASE);
                root.setAttribute(NAME, getName());
                colDoc.appendChild(root);
                systemCollection.getCollection(SystemCollection.CONFIGS).setDocument(COLKEY, colDoc);
            }

            super.setConfig(new Configuration(colDoc.getDocumentElement(), false));
        } catch (Exception e) {
            if (log.isWarnEnabled()) {
                log.warn("ignored exception", e);
            }
        }
View Full Code Here


            doc.appendChild(index);
        }

        Collection col = getCollection((String) message.get(COLLECTION));
        Configuration config = new Configuration(doc.getDocumentElement(), false);
        col.createIndexer(config);

        Hashtable result = new Hashtable();
        result.put(RESULT, message.get(NAME));
        return result;
View Full Code Here

    void init() throws DBException {
        // Bootstrap the System Collection
        try {
            Document sysDoc = DOMParser.toDocument(SYSCOL_DEFINITION);
            Configuration sysCfg = new Configuration(sysDoc, false);
            setConfig(sysCfg);
        } catch (Exception e) {
            if (log.isFatalEnabled()) {
                log.fatal("FATAL ERROR: Generating System Collection '" + SYSCOL + "'", e);
            }
View Full Code Here

    public void init() throws DBException {
        // Bootstrap the Meta Collection
        try {
            Document metaDoc = DOMParser.toDocument(METACOL_DEFINITION);
            Configuration metaCfg = new Configuration(metaDoc, false);
            setConfig(metaCfg);
        } catch (Exception e) {
            if (log.isFatalEnabled()) {
                log.fatal("FATAL ERROR: Generating System Collection '" + METACOL + "'", e);
            }
View Full Code Here

                        + "  <filer class=\"org.apache.xindice.core.filer.BTreeFiler\" />"
                        + "</collection>";

                try {
                    Document cfgDoc = DOMParser.toDocument(cfgText);
                    Configuration cfg = new Configuration(cfgDoc, false);
                    childcol = current.createCollection(segment, cfg);
                } catch (DBException de) {
                    throw de;
                } catch (Exception e) {
                    throw new DBException(FaultCodes.getFaultCode(e));
View Full Code Here

    // See superclass for documentation. Note that first argument is the path, not the name.
    public org.xmldb.api.base.Collection createCollection(String path, Document configuration) throws XMLDBException {
        checkOpen();
        try {
            Configuration config = new Configuration(configuration.getDocumentElement(), false);
            col.createCollection(path, config);

            // Traverse path to get newly created collection
            org.xmldb.api.base.Collection col = this;
            if (path.indexOf("/") != -1) {
View Full Code Here

    /* see superclass for documentation */
    public void createIndexer(Document configuration) throws XMLDBException {
        checkOpen();
        try {
            col.createIndexer(new Configuration(configuration, false));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(e);
        }
    }
View Full Code Here

            colEle.appendChild(filEle);
        }

        CollectionManager colman = getCollection((String) message.get(COLLECTION));

        Configuration config = new Configuration(doc.getDocumentElement(), false);
        colman.createCollection((String) message.get(NAME), config);

        Hashtable result = new Hashtable();
        result.put(RESULT, message.get(NAME));
        return result;
View Full Code Here

    }

    public void setUp() throws Exception {
        String name = getClass().getName();
        db = new Database();
        db.setConfig(new Configuration(DOMParser.toDocument(DatabaseTest.DATABASE)));
        collection = db.createCollection(name, new Configuration(
                DOMParser.toDocument(
                        "<collection compressed=\"true\" name=\"" + name + "\" inline-metadata=\"true\">" +
                            "<filer class=\"org.apache.xindice.core.filer.BTreeFiler\" />" +
                        "</collection>"), false
        ));

        String config = "<index name='Test' " +
                        "       class='org.apache.xindice.core.indexer.ValueIndexer' " +
                        "       pattern='test1' />";
        collection.createIndexer(new Configuration(DOMParser.toDocument(config)));
    }
View Full Code Here

        ROOT.mkdir();
        filer.setLocation(ROOT, TEST_COLLECTION_NAME);
        // FSFiler needs location attribute
        String config = "<filer location='" + TEST_COLLECTION_NAME + "' " +
                               "pagecount='128' pagesize='4096'/>";
        filer.setConfig(new Configuration(DOMParser.toDocument(config)));
        if (!filer.exists()) {
            filer.create();
        }
        filer.open();
View Full Code Here

TOP

Related Classes of org.apache.xindice.util.Configuration

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.