Package org.apache.xindice.util

Examples of org.apache.xindice.util.Configuration


            }
        }
        if (srcConfig.hasChildren()) {
            Configuration[] childConf = srcConfig.getChildren();
            for (int i = 0; i < childConf.length; i++) {
                Configuration childDestConfig = destConfig.getChild(childConf[i].getName(), true);
                copyConfigurationContent(childConf[i], childDestConfig);
            }
        }

        return destConfig;
View Full Code Here


        return destConfig;
    }

    private static Configuration createConfiguration() {
        Document doc = new DocumentImpl();
        return new Configuration(doc.createElement(CONF_ELE), false);
    }
View Full Code Here

            doc.appendChild(index);
        }

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

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

    }

    private static Map copyCollection(Collection col, Collection parent, String name, boolean deep)
            throws DBException {

        Configuration config = CollectionConfigurationHelper.copyConfiguration(name, col.getConfig());
        Collection newCol = parent.createCollection(name, config);

        if (deep) {
            return copyCollectionContent(col, newCol);
        } else {
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) {
            log.fatal("Failed to generate system collection '" + SYSCOL + "'", e);

            // TODO: System.exit() CANNOT be good here.
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

                    if (type != null) {
                        e.setAttribute("type", type);
                    }

                    idxMgr.create(new Configuration(e));
                } else {
                    log.debug("Query performance may be improved by using ValueIndex with pattern '" + ps + "'");
                }
            } catch (Exception e) {
                if (log.isWarnEnabled()) {
View Full Code Here

        } else {
            String[] columnTitles = {"name", "pattern", "class", "type",
                                     "pagesize", "max key size", "delete"};
            printStartTable(columnTitles, output);
            for (int i = 0; i < indexes.length; i++) {
                Configuration thisConf = col.getIndexer(indexes[i]).getConfig();
                String indexerName = thisConf.getAttribute("name");
                String indexerType = thisConf.getAttribute("type", "");
                String indexerClass = thisConf.getAttribute("class");
                if (indexerClass.equalsIgnoreCase(XINDICE_NAME_INDEXER)) {
                    indexerClass = "NameIndexer";
                    indexerType = "name";
                } else {
                    indexerClass = "ValueIndexer";
                }
                String[] contents = {
                        "<b>" + indexerName + "</b>",
                        "<b>" + thisConf.getAttribute("pattern") + "</b>",
                        indexerClass,
                        indexerType,
                        thisConf.getAttribute("pagesize", ""),
                        thisConf.getAttribute("maxkeysize", ""),
                        "<a href=\"?viewer=" + getName() + "&delete="
                        + indexerName + "\">delete</a>"
                };
                printTableRow(contents, output);
            }
View Full Code Here

        if (maxkeysize != null && maxkeysize.length() > 0) {
            idxEle.setAttribute("maxkeysize", maxkeysize);
        }

        doc.appendChild(idxEle);
        return col.createIndexer(new Configuration(doc, false));
    }
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.