Examples of DOMUtil


Examples of org.apache.lenya.xml.DOMUtil

    protected void transformXML (Document doc,
         String childId, short childType, String childName,
         Map parameters)
  throws Exception {

        DOMUtil du = new DOMUtil();
        du.setElementValue(doc, "/system/id", childId);
        du.setElementValue(doc, "/system/system_name", childName);
 
        log.debug("system_name = " +
      du.getElementValue(doc.getDocumentElement(),
             new org.apache.lenya.xml.XPath("system_name")));
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

    protected void transformXML (Document doc,
         String childId, short childType, String childName,
         Map parameters)
  throws Exception {

        DOMUtil du = new DOMUtil();
        du.setElementValue(doc, "/system/id", childId);
        du.setElementValue(doc, "/system/system_name", childName);
 
        log.debug("system_name = " +
      du.getElementValue(doc.getDocumentElement(),
             new org.apache.lenya.xml.XPath("system_name")));
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

    protected void transformXML (Document doc,
         String childId, short childType, String childName,
         Map parameters)
  throws Exception {

        DOMUtil du = new DOMUtil();
        // Replace id
        du.setElementValue(doc, "/system/id", childId);
        // Replace name
        du.setElementValue(doc, "/system/system_name", childName);
        // Replace project URL
        String project_url = (String)parameters.get("project_url");
        du.setElementValue(doc, "/system/main_url", project_url);
 
        log.debug(".transformXML(): system_name = " +
      du.getElementValue(doc.getDocumentElement(),
             new org.apache.lenya.xml.XPath("system_name")));

        log.debug(".transformXML(): " + parameters.keySet());
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

    protected void transformXML (Document doc,
         String childId, short childType, String childName,
         Map parameters)
  throws Exception {

        DOMUtil du = new DOMUtil();
        du.setElementValue(doc, "/article/head/title", childId);
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

    protected void transformXML (Document doc,
         String childId, short childType, String childName,
         Map parameters)
  throws Exception {

        DOMUtil du = new DOMUtil();

        // Replace id
        du.setElementValue(doc, "/article/meta/id", childId);

        // Replace editor
        org.apache.lenya.cms.ac.Identity identity = (org.apache.lenya.cms.ac.Identity)parameters.get("org.apache.lenya.cms.ac.Identity");
        du.setElementValue(doc, "/article/meta/editor", identity.getUsername());

        Calendar cal = new GregorianCalendar();

        // Replace year
        du.setElementValue(doc, "/article/meta/date/year",
         Integer.toString(cal.get(Calendar.YEAR)));

        // Replace month
        int month = cal.get(Calendar.MONTH) + 1;
        du.setElementValue(doc, "/article/meta/date/month",
         Integer.toString(month));
        du.setAttributeValue(doc, "/article/meta/date/month/@name",
           DateUtil.getMonthName(month));

        // Replace day
        du.setElementValue(doc, "/article/meta/date/day",
         Integer.toString(cal.get(Calendar.DAY_OF_MONTH)));
        du.setAttributeValue(doc, "/article/meta/date/day/@name",
         DateUtil.getDayName(cal.get(Calendar.DAY_OF_WEEK)));

        // Replace hour
        du.setElementValue(doc, "/article/meta/date/hour",
         DateUtil.oneToTwoDigits(Integer.toString(cal.get(Calendar.HOUR_OF_DAY))));

        // Replace minute
        du.setElementValue(doc, "/article/meta/date/minute",
         DateUtil.oneToTwoDigits(Integer.toString(cal.get(Calendar.MINUTE))));
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

     * @param configuration DOCUMENT ME!
     *
     * @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"));
    }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

           
            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")));
           
            if (create)
                indexer.createIndex(root, index);
            else
                indexer.updateIndex(root, index);
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

    /**
     * Create XML Document
     */
     public Document createDocument() throws Exception {
         DOMUtil du = new DOMUtil();
         Document iml = du.create("<?xml version=\"1.0\"?><identity id=\"" +  username + "\"></identity>");
         du.setAttributeValue(iml, "/identity/password/@type", "md5");
         du.setElementValue(iml, "/identity/password", encryptedPassword);
         du.setElementValue(iml, "/identity/comment", comment);
         for (int i = 0; i < groupnames.size(); i++) {
             du.addElement(iml, "/identity/groups/group", (String) groupnames.elementAt(i));
         }

         //new org.apache.lenya.xml.DOMWriter(System.out).printWithoutFormatting(iml);
         return iml;
     }
View Full Code Here

Examples of org.apache.lenya.xml.DOMUtil

     * @param configuration DOCUMENT ME!
     *
     * @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

Examples of org.apache.lenya.xml.DOMUtil

     * @param configuration DOCUMENT ME!
     *
     * @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
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.