Package org.apache.lenya.xml

Examples of org.apache.lenya.xml.XPath


     *
     * @throws Exception DOCUMENT ME!
     */
    public void configure(Element root) throws Exception {
        DOMUtil du = new DOMUtil();
        update_index_type = du.getAttributeValue(root, new XPath("update-index/@type"));
        index_dir = du.getAttributeValue(root, new XPath("index-dir/@src"));
        htdocs_dump_dir = du.getAttributeValue(root, new XPath("htdocs-dump-dir/@src"));

        String indexerClassName = du.getAttributeValue(root, new XPath("indexer/@class"));
        indexerClass = Class.forName(indexerClassName);
    }
View Full Code Here


     *
     * @throws Exception DOCUMENT ME!
     */
    public void configure(Element root) throws Exception {
        DOMUtil du = new DOMUtil();
        update_index_type = du.getAttributeValue(root, new XPath("update-index/@type"));
        index_dir = du.getAttributeValue(root, new XPath("index-dir/@src"));
        htdocs_dump_dir = du.getAttributeValue(root, new XPath("htdocs-dump-dir/@src"));

        String indexerClassName = du.getAttributeValue(root, new XPath("indexer/@class"));
        indexerClass = Class.forName(indexerClassName);
    }
View Full Code Here

     * @throws Exception DOCUMENT ME!
     */
    public void configure(Element root) throws Exception {
        DOMUtil du = new DOMUtil();

        base_url = du.getAttributeValue(root, new XPath("base-url/@href"));
        scope_url = du.getAttributeValue(root, new XPath("scope-url/@href"));
        user_agent = du.getElementValue(root, new XPath("user-agent"));
        uri_list = du.getAttributeValue(root, new XPath("uri-list/@src"));
        htdocs_dump_dir = du.getAttributeValue(root, new XPath("htdocs-dump-dir/@src"));
        if (du.elementExists(root, new XPath("robots"))) {
            robots_file = du.getAttributeValue(root, new XPath("robots/@src"));
            robots_domain = du.getAttributeValue(root, new XPath("robots/@domain"));
        }
    }
View Full Code Here

            String xupdateInsertAfter = null;
            if (parent) {
                xa = getAttributes(request.getParameter(pname), xa.tagID);
                xupdateInsertAfter = "<xupdate:insert-after select=\"" + select
                        + " \"><xupdate:element name=\""
                        + new XPath(select).getNameWithoutPredicates() + "\"" + namespaceAttribute
                        + ">" + xa.xupdateAttrExpr + removeParent(request.getParameter(pname))
                        + "</xupdate:element></xupdate:insert-after>";
            } else {
                xupdateInsertAfter = "<xupdate:insert-after select=\"" + select
                        + " \"><xupdate:element name=\""
                        + new XPath(select).getNameWithoutPredicates() + "\"" + namespaceAttribute
                        + ">" + xa.xupdateAttrExpr + request.getParameter(pname)
                        + "</xupdate:element></xupdate:insert-after>";
            }
            getLogger().debug(".update(): Update Node (insert-after): " + xupdateInsertAfter);

            String xupdateRemove = "<xupdate:remove select=\"" + select + " \"/>";
            getLogger().debug(".update(): Update Node (remove): " + xupdateRemove);

            String xupdateUpdateAttribute = "<xupdate:update select=\""
                    + new XPath(select).removePredicates(select) + "[@tagID='temp']/@tagID"
                    + " \">" + xa.tagID + "</xupdate:update>";
            getLogger().debug(".update(): Update Node (update tagID attribute): "
                    + xupdateUpdateAttribute);

            return "<xupdate:modifications xmlns:xupdate=\"http://www.xmldb.org/xupdate\">"
View Full Code Here

     *
     * @throws Exception DOCUMENT ME!
     */
    public void configure(Element root) throws Exception {
        DOMUtil du = new DOMUtil();
        update_index_type = du.getAttributeValue(root, new XPath("update-index/@type"));
        index_dir = du.getAttributeValue(root, new XPath("index-dir/@src"));
        htdocs_dump_dir = du.getAttributeValue(root, new XPath("htdocs-dump-dir/@src"));

        String indexerClassName = du.getAttributeValue(root, new XPath("indexer/@class"));
        indexerClass = Class.forName(indexerClassName);
    }
View Full Code Here

     * @throws Exception DOCUMENT ME!
     */
    public void configure(Element root) throws Exception {
        DOMUtil du = new DOMUtil();

        base_url = du.getAttributeValue(root, new XPath("base-url/@href"));
        scope_url = du.getAttributeValue(root, new XPath("scope-url/@href"));
        user_agent = du.getElementValue(root, new XPath("user-agent"));
        uri_list = du.getAttributeValue(root, new XPath("uri-list/@src"));
        htdocs_dump_dir = du.getAttributeValue(root, new XPath("htdocs-dump-dir/@src"));
        if (du.elementExists(root, new XPath("robots"))) {
            robots_file = du.getAttributeValue(root, new XPath("robots/@src"));
            robots_domain = du.getAttributeValue(root, new XPath("robots/@domain"));
        }
    }
View Full Code Here

            xa = getAttributes(request.getParameter(pname), xa.tagID);
            xupdateInsertAfter =
                "<xupdate:insert-after select=\""
                    + select
                    + " \"><xupdate:element name=\""
                    + new XPath(select).getNameWithoutPredicates()
                    + "\""
                    + namespaceAttribute
                    + ">"
                    + xa.xupdateAttrExpr
                    + removeParent(request.getParameter(pname))
                    + "</xupdate:element></xupdate:insert-after>";
        } else {
            xupdateInsertAfter =
                "<xupdate:insert-after select=\""
                    + select
                    + " \"><xupdate:element name=\""
                    + new XPath(select).getNameWithoutPredicates()
                    + "\""
                    + namespaceAttribute
                    + ">"
                    + xa.xupdateAttrExpr
                    + request.getParameter(pname)
                    + "</xupdate:element></xupdate:insert-after>";
        }
        log.debug(
            ".update(): Update Node (insert-after): " + xupdateInsertAfter);

        String xupdateRemove =
            "<xupdate:remove select=\"" + select + " \"/>";
        log.debug(".update(): Update Node (remove): " + xupdateRemove);

        String xupdateUpdateAttribute =
            "<xupdate:update select=\""
                + new XPath(select).removePredicates(select)
                + "[@tagID='temp']/@tagID"
                + " \">"
                + xa.tagID
                + "</xupdate:update>";
        log.debug(
View Full Code Here

            DOMUtil du = new DOMUtil();
            String path = argv[0];
           
            Document config = DocumentHelper.readDocument(new File(path));
            indexer.configure(du.getElement(config.getDocumentElement(), new XPath("indexer")), argv[0]);

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

TOP

Related Classes of org.apache.lenya.xml.XPath

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.