Package org.apache.xindice.xml.dom

Examples of org.apache.xindice.xml.dom.DocumentImpl.createElement()


                if (table.get(XMLTools.NAME_OF) != null && table.get(XMLTools.PATTERN) != null) {

                    Document doc = new DocumentImpl();

                    // Create the index element to hold attributes
                    Element idxEle = doc.createElement("index");
                    idxEle.setAttribute("class", XINDICE_VAL_INDEXER);
                    idxEle.setAttribute("name", (String) table.get(XMLTools.NAME_OF));
                    idxEle.setAttribute("pattern", (String) table.get(XMLTools.PATTERN));

View Full Code Here


    }

    public Node getContextNode() {
        if (elem == null) {
            Document d = new DocumentImpl();
            elem = d.createElement("nsmap");
            d.appendChild(elem);
            Iterator i = entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry entry = (Map.Entry) i.next();
                String pfx = (String) entry.getKey();
View Full Code Here

        checkOpen();
        try {
            Document doc = new DocumentImpl();

            Element colEle = doc.createElement("collection");
            colEle.setAttribute("compressed", "true");
            colEle.setAttribute("name", name);
            doc.appendChild(colEle);

            Element filEle = doc.createElement("filer");
View Full Code Here

            Element colEle = doc.createElement("collection");
            colEle.setAttribute("compressed", "true");
            colEle.setAttribute("name", name);
            doc.appendChild(colEle);

            Element filEle = doc.createElement("filer");
            filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
            colEle.appendChild(filEle);

            return createCollection(name, doc);
        } catch (Exception e) {
View Full Code Here

            throw new Exception("Cannot create a NULL collection");
        }

        Document doc = new DocumentImpl();

        Element colEle = doc.createElement("collection");
        colEle.setAttribute("name", colName);
        // FIXME Make this configurable
        colEle.setAttribute("compressed", "true");
        colEle.setAttribute("inline-metadata", "true");
View Full Code Here

        colEle.setAttribute("compressed", "true");
        colEle.setAttribute("inline-metadata", "true");

        doc.appendChild(colEle);

        Element filEle = doc.createElement("filer");
        String filerClass = "org.apache.xindice.core.filer.BTreeFiler";
        // see if user specified filer type
        if (table.getString(XMLTools.FILER) != null) {
            String filer = table.getString(XMLTools.FILER);
            if ("HashFiler".equals(filer)) {
View Full Code Here

        return createConfiguration(name, null, null, null);
    }

    public static Configuration createConfiguration(String name, String compressed, String inlineMeta, String filerClass) {
        Document doc = new DocumentImpl();
        Element colEle = doc.createElement(CONF_ELE);
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("null name");
        }
        colEle.setAttribute(COL_NAME_ATTR, name);
        if (compressed == null || (!compressed.equalsIgnoreCase("true") && !compressed.equalsIgnoreCase("false"))) {
View Full Code Here

        if (inlineMeta == null || (!inlineMeta.equalsIgnoreCase("true") && !inlineMeta.equalsIgnoreCase("false"))) {
            inlineMeta = Boolean.toString(DEFAULT_INLINE_META);
        }
        colEle.setAttribute(INLINE_META_ATTR, inlineMeta);
        doc.appendChild(colEle);
        Element filEle = doc.createElement(FILER_ELE);
        if (filerClass == null || filerClass.length() == 0) {
            filerClass = DEFAULT_FILER_CLASS;
        }
        filEle.setAttribute(FILER_CLASS_ATTR, filerClass);
        colEle.appendChild(filEle);
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

    private Document buildConfig(XMLTools.Config table) throws Exception {
        Document config = new DocumentImpl();

        // Create the index element to hold attributes
        Element idxEle = config.createElement("index");
        idxEle.setAttribute("class", XINDICE_VAL_INDEXER);
        idxEle.setAttribute("name", table.getString(XMLTools.NAME_OF));

        // Setup optional index attributes
        String type = table.getString(XMLTools.TYPE);
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.