Package org.dom4j

Examples of org.dom4j.Element.selectNodes()


            {
                Element testSuiteNode = (Element)testDoc.selectSingleNode("/testsuite");
                String  testSuiteName = testSuiteNode.attributeValue("name");

                // since tests have failed, we add it to the summary
                for (Iterator it = testSuiteNode.selectNodes("testcase[failure or error]").iterator(); it.hasNext();)
                {
                    Element failedTestElement = (Element)it.next();
                    Element newTestElement    = summaryDoc.getRootElement().addElement("failedTest");

                    // Test setup failure, so the test was not actually run ?
View Full Code Here


     */
    public static void pullupDesignProviders(Document doc) {
       
        // Collect keys of used provider dbs
        Element contentdbs = (Element) doc.selectSingleNode("/wga/contentdbs");
        Iterator providerKeysElems = contentdbs.selectNodes("contentdb/design[@provider='db']/@key").iterator();
        Set providerKeys = new LinkedHashSet();
        while (providerKeysElems.hasNext()) {
            Attribute providerKeyAttr = (Attribute) providerKeysElems.next();
            String key = providerKeyAttr.getValue();
            providerKeys.add(key);
View Full Code Here

            mappingLibraries.setText(elementmappings.attributeValue("libraries", ""));
            elementmappings.remove(elementmappings.attribute("libraries"));
        }
       
        List elementsToRemove = new ArrayList();
        Iterator elementmappingTags = elementmappings.selectNodes("elementmapping").iterator();
        while (elementmappingTags.hasNext()) {
            Element elementmapping = (Element) elementmappingTags.next();
            if (elementmapping.attribute("binary") != null) {
                elementmapping.remove(elementmapping.attribute("binary"));
            }
View Full Code Here

          Element elementmapping = (Element) toRemove.next();
          elementmappings.remove(elementmapping);
        }
   
        Element mediamappings = WGUtils.getOrCreateElement(mappings, "mediamappings");
        Iterator mediamappingTags = mediamappings.selectNodes("mediamapping").iterator();
        while (mediamappingTags.hasNext()) {
            Element mediamapping = (Element) mediamappingTags.next();
            WGUtils.getOrCreateAttribute(mediamapping, "binary", "false");
            WGUtils.getOrCreateAttribute(mediamapping, "httplogin", "false");
        }
View Full Code Here

            WGUtils.getOrCreateElement(domain, "defaultpublisheroptions");
        }
   
        // content dbs
        Element contentdbs = WGUtils.getOrCreateElement(wga, "contentdbs");
        Iterator contentdbTags = contentdbs.selectNodes("contentdb").iterator();
        Set usedDomains = new HashSet();
        while (contentdbTags.hasNext()) {
            Element contentdb = (Element) contentdbTags.next();
            WGUtils.getOrCreateAttribute(contentdb, "enabled", "true");
            WGUtils.getOrCreateAttribute(contentdb, "lazyconnect", "false");
View Full Code Here

            }
            usedDomains.add(domainStr);
            WGUtils.getOrCreateElement(contentdb, "login");
   
            Element dboptions = WGUtils.getOrCreateElement(contentdb, "dboptions");
            Iterator options = dboptions.selectNodes("option").iterator();
            Element option;
            String optionName;
            while (options.hasNext()) {
                option = (Element) options.next();
                optionName = option.attributeValue("name");
View Full Code Here

            WGUtils.getOrCreateElement(clientRestrictions, "restrictions");
        }
       
        // Personalisation dbs
        Element persodbs = WGUtils.getOrCreateElement(wga, "personalisationdbs");
        Iterator persodbTags = persodbs.selectNodes("personalisationdb").iterator();
        while (persodbTags.hasNext()) {
            Element persodb = (Element) persodbTags.next();
            WGUtils.getOrCreateAttribute(persodb, "enabled", "true");
            WGUtils.getOrCreateAttribute(persodb, "lazyconnect", "false");
   
View Full Code Here

            Element persConfig = WGUtils.getOrCreateElement(persodb, "persconfig");
            WGUtils.getOrCreateAttribute(persConfig, "mode", "auto");
            WGUtils.getOrCreateAttribute(persConfig, "statistics", "off");
   
            Element dboptions = WGUtils.getOrCreateElement(persodb, "dboptions");
            Iterator options = dboptions.selectNodes("option").iterator();
            Element option;
            String optionName;
            while (options.hasNext()) {
                option = (Element) options.next();
                optionName = option.attributeValue("name");
View Full Code Here

        // second try retrieve user from domain
        if (user == null) {
            String domain = contentDBElement.elementText("domain");
            if (domain != null) {
                Element domainsElement = contentDBElement.getParent().getParent().element("domains");
                List domainElements = domainsElement.selectNodes("domain[@name='" + domain + "']");
                if (domainElements.size() > 0) {
                    Element domainElement = (Element) domainElements.get(0);
                    login = domainElement.element("login");
                    if (login != null) {
                        String value = login.attributeValue("username");
View Full Code Here

        // second try retrieve user from domain
        if (password == null) {
            String domain = contentDBElement.elementText("domain");
            if (domain != null) {
                Element domainsElement = contentDBElement.getParent().getParent().element("domains");
                List domainElements = domainsElement.selectNodes("domain[@name='" + domain + "']");
                if (domainElements.size() > 0) {
                    Element domainElement = (Element) domainElements.get(0);
                    login = domainElement.element("login");
                    if (login != null) {
                        String value = login.attributeValue("password");
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.