Package org.webharvest.definition

Examples of org.webharvest.definition.XmlNode


        this.topNode = new DefaultMutableTreeNode();
        this.treeModel = new DefaultTreeModel(this.topNode);
        try {
            String helpContent = CommonUtil.readStringFromUrl( ResourceManager.getHelpContentUrl() );
            XmlNode xmlNode = XmlParser.parse( new InputSource(new StringReader(helpContent)) );
            createNodes(topNode, xmlNode);
        } catch (Exception e) {
            e.printStackTrace();
            GuiUtils.showErrorMessage("Error reading help content!");
        }
View Full Code Here


        if (xmlNode != null) {
            Object topicsObject = xmlNode.getElement("topic");
            if (topicsObject instanceof java.util.List) {
                java.util.List subtopics = (java.util.List) topicsObject;
                for (int i = 0; i < subtopics.size(); i++) {
                    XmlNode xmlSubNode = (XmlNode) subtopics.get(i);

                    String id = xmlSubNode.getAttribute("id");
                    String title = xmlSubNode.getAttribute("title");
                    Object subs = xmlSubNode.getElement("topic");
                    int subtopicCount = subs instanceof java.util.List ? ((java.util.List)subs).size() : 0;

                    TopicInfo topicInfo = new TopicInfo(id, title, subtopicCount);
                    DefaultMutableTreeNode node = new DefaultMutableTreeNode(topicInfo);
                    this.treeModel.insertNodeInto(node, root, root.getChildCount());
View Full Code Here

    }

    private synchronized void downloadAddition() {
        try {
            String content = CommonUtil.readStringFromUrl( new URL(Constants.WELCOME_ADDITION_URL) );
            XmlNode node = XmlParser.parse(new InputSource(new StringReader(content)));
            String versionValue = (String) node.get("version[0].number");
            String versionMessage = (String) node.get("version[0]._value");
            String startValue = (String) node.get("start[0]._value");
            String endValue = (String) node.get("end[0]._value");

            boolean hasStart = startValue != null && !"".equals(startValue.trim());
            boolean hasEnd = endValue != null && !"".equals(endValue.trim());
            boolean hasVersion = versionValue != null && !"".equals(versionValue.trim());
            boolean hasVersionMessage = versionMessage != null && !"".equals(versionMessage.trim());
View Full Code Here

TOP

Related Classes of org.webharvest.definition.XmlNode

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.