Examples of DOMParserFactory


Examples of org.apache.lenya.xml.DOMParserFactory

        this.configurationFilePath = configurationFilePath;

        File configurationFile = new File(configurationFilePath);

        try {
            Document document = new DOMParserFactory().getDocument(configurationFilePath);
            configure(document.getDocumentElement());
        } catch (Exception e) {
            log.error("Cannot load publishing configuration! ", e);
        }
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

    /** @see junit.framework.TestCase#setUp() */
    protected void setUp() throws Exception {
    /**
     * initialise the RCML-document. Delete all entries
     */
      DOMParserFactory dpf = new DOMParserFactory();
      document = dpf.getDocument();

      Element root = dpf.newElementNode(document, "XPSRevisionControl");
      document.appendChild(root);

    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

        this.configurationFilePath = configurationFilePath;

        File configurationFile = new File(configurationFilePath);

        try {
            Document document = new DOMParserFactory().getDocument(configurationFilePath);
            configure(document.getDocumentElement());
        } catch (Exception e) {
            log.error("Cannot load publishing configuration! ", e);
            System.err.println("Cannot load publishing configuration! " + e);
        }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

            Date start = new Date();

            Indexer indexer = (Indexer) ie.getIndexerClass().newInstance();

            DOMUtil du = new DOMUtil();
            Document config = new DOMParserFactory().getDocument(argv[0]);
            indexer.configure(du.getElement(config.getDocumentElement(), new XPath("indexer")), argv[0]);

            if (create) {
                indexer.createIndex(root, index);
            } else {
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

            File parent = new File(rcmlFile.getParent());
            parent.mkdirs();

            write();
        } else {
            DOMParserFactory dpf = new DOMParserFactory();
            document = dpf.getDocument(rcmlFile.getAbsolutePath());
        }
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

    /**
     * initialise the RCML-document. Delete all entries
     */
    public void initDocument() {
        DOMParserFactory dpf = new DOMParserFactory();
        document = dpf.getDocument();

        Element root = dpf.newElementNode(document, "XPSRevisionControl");
        document.appendChild(root);
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

     * @throws IOException if an error occurs
     * @throws Exception if an error occurs
     */
    public void checkOutIn(short type, String identity, long time, boolean backup)
        throws IOException, Exception {
        DOMParserFactory dpf = new DOMParserFactory();

        Element identityElement = dpf.newElementNode(document, "Identity");
        identityElement.appendChild(dpf.newTextNode(document, identity));

        Element timeElement = dpf.newElementNode(document, "Time");
        timeElement.appendChild(dpf.newTextNode(document, "" + time));

        Element checkOutElement = null;

        if (type == co) {
            checkOutElement = dpf.newElementNode(document, "CheckOut");
        } else if (type == ci) {
            checkOutElement = dpf.newElementNode(document, "CheckIn");
        } else {
            log.error("ERROR: " + this.getClass().getName() + ".checkOutIn(): No such type");

            return;
        }

        checkOutElement.appendChild(identityElement);
        checkOutElement.appendChild(timeElement);

    if (backup) {
      Element backupElement = dpf.newElementNode(document, "Backup");
      checkOutElement.appendChild(backupElement);
    }

        Element root = document.getDocumentElement();
    root.insertBefore(dpf.newTextNode(document, "\n"), root.getFirstChild());
        root.insertBefore(checkOutElement, root.getFirstChild());

        setDirty();

        // If this is a checkout, we write back the changed state
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

     * @return org.w3c.dom.Document The clone document
     *
     * @throws Exception if an error occurs
     */
    public org.w3c.dom.Document getDOMDocumentClone() throws Exception {
        Document documentClone = new DOMParserFactory().getDocument();
        documentClone.appendChild(documentClone.importNode(document.getDocumentElement(), true));

        return documentClone;
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

            File parent = new File(rcmlFile.getParent());
            parent.mkdirs();

            write();
        } else {
            DOMParserFactory dpf = new DOMParserFactory();
            document = dpf.getDocument(rcmlFile.getAbsolutePath());
        }
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMParserFactory

    /**
     * initialise the RCML-document. Delete all entries
     */
    public void initDocument() {
        DOMParserFactory dpf = new DOMParserFactory();
        document = dpf.getDocument();

        Element root = dpf.newElementNode(document, "XPSRevisionControl");
        document.appendChild(root);
    }
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.