Package org.jboss.dashboard.commons.xml

Examples of org.jboss.dashboard.commons.xml.XMLNode


        renderFragment("entryEnd");
        return !result.hasErrors();
    }

    protected void renderElementsInEntry(ImportResult result, int index) {
        XMLNode node = result.getRootNode();
        List<XMLNode> children = node.getChildren();
        if (children == null || children.isEmpty()) {
            renderFragment("emptyEntry");
        } else {
            renderFragment("entryElementsOutputStart");
            BackOfficePermission createPerm = BackOfficePermission.newInstance(null, BackOfficePermission.ACTION_CREATE_WORKSPACE);
View Full Code Here


                    log.warn("Problems importing entry " + result.getEntryName() + ": " + result.getWarnings().get(j));
                }
            }

            String parentKey = null;
            XMLNode node = result.getRootNode();
            processNode(node, parentKey, bundles);
        }
        return bundles;
    }
View Full Code Here

                if (value == null) value = new String(node.getContent());
                getBundle(bundles, new Locale(language)).setProperty(key, value);
            }
            Iterator it = node.getChildren().iterator();
            while (it.hasNext()) {
                XMLNode child = (XMLNode) it.next();
                processNode(child, key, bundles);
            }
        }
    }
View Full Code Here

            else workspacesManager.addNewWorkspace(workspace);
        }

        //Children
        for (int i = 0; i < node.getChildren().size(); i++) {
            XMLNode child = (XMLNode) node.getChildren().get(i);
            if (ExportVisitor.PARAMETER.equals(child.getObjectName())) {
                createWorkspaceParameter(child, workspace);
            } else if (ExportVisitor.PANEL_INSTANCE.equals(child.getObjectName())) {
                createPanelInstance(result, child, workspace, attributes, onStartup);
            } else if (ExportVisitor.RESOURCE.equals(child.getObjectName())) {
                createResource(result, workspace.getId(), null, null, child, attributes, onStartup);
            } else if (ExportVisitor.SECTION.equals(child.getObjectName())) {
                createSection(result, workspace, child, attributes, onStartup);
            } else if (ExportVisitor.PERMISSION.equals(child.getObjectName())) {
                createPermission(result, workspace, workspace, child, attributes);
            }
        }
        workspacesManager.store(workspace);
        //Save the policy, as probably everybody modified it...
View Full Code Here

        workspace.addSection(section);
        UIServices.lookup().getWorkspacesManager().store(workspace);

        //Children
        for (int i = 0; i < node.getChildren().size(); i++) {
            XMLNode child = (XMLNode) node.getChildren().get(i);
            if (ExportVisitor.PARAMETER.equals(child.getObjectName())) {
                String name = child.getAttributes().getProperty(ExportVisitor.PARAMETER_ATTR_NAME);
                if (ExportVisitor.SECTION_CHILD_TITLE.equals(name)) {
                    String value = child.getAttributes().getProperty(ExportVisitor.PARAMETER_ATTR_VALUE);
                    String lang = child.getAttributes().getProperty(ExportVisitor.PARAMETER_ATTR_LANG);
                    section.setTitle(value, lang);
                }
            } else if (ExportVisitor.RESOURCE.equals(child.getObjectName())) {
                createResource(result, workspace.getId(), section.getId(), null, child, attributes, onStartup);
            } else if (ExportVisitor.PANEL.equals(child.getObjectName())) {
                createPanel(result, section, child, attributes, onStartup);
            } else if (ExportVisitor.PERMISSION.equals(child.getObjectName())) {
                createPermission(result, section.getWorkspace(), section, child, attributes);
            }
        }
    }
View Full Code Here

        // Add panel to section
        section.assignPanel(panel, regionId);
        UIServices.lookup().getSectionsManager().store(section);
        panel.getProvider().getDriver().fireAfterPanelPlacedInRegion(panel, null);
        for (int i = 0; i < node.getChildren().size(); i++) {
            XMLNode child = (XMLNode) node.getChildren().get(i);
            if (ExportVisitor.PERMISSION.equals(child.getObjectName())) {
                createPermission(result, panel.getWorkspace(), panel, child, attributes);
            }
        }
    }
View Full Code Here

        pi.setWorkspace(workspace);
        UIServices.lookup().getPanelsManager().store(pi);
        pi.init();
        //Children
        for (int i = 0; i < node.getChildren().size(); i++) {
            XMLNode child = (XMLNode) node.getChildren().get(i);
            if (ExportVisitor.PARAMETER.equals(child.getObjectName())) {
                createPanelInstanceParameter(child, pi);
            } else if (ExportVisitor.RESOURCE.equals(child.getObjectName())) {
                createResource(result, workspace.getId(), null, pi.getInstanceId(), child, attributes, onStartup);
            } else if (ExportVisitor.RAWCONTENT.equals(child.getObjectName())) {
                if (pi.getProvider().getDriver() instanceof Exportable) {
                    try {
                        ((Exportable) pi.getProvider().getDriver()).importContent(pi, new ByteArrayInputStream(child.getContent()));
                    }
                    catch (Exception e) {
                        result.getWarnings().add("panelFailedToImport");
                        result.getWarningArguments().add(new Object[]{LocaleManager.lookup().localize(pi.getTitle()), e, e.getMessage()});
                    }
View Full Code Here

        for (int i = 0; i < nlist.getLength(); i++) {
            Node item = nlist.item(i);
            if (ExportVisitor.WORKSPACE_EXPORT.equals(item.getNodeName()))
                rootNode = item;
        }
        node = new XMLNode("?", null);
        node.loadFromXMLNode(rootNode);
    }
View Full Code Here

    private XMLNode rootNode;
    private XMLNode currentNode;

    public ExportVisitor() {
        rootNode = new XMLNode(WORKSPACE_EXPORT, null);
        currentNode = rootNode;
    }
View Full Code Here

    public XMLNode getRootNode() {
        return rootNode;
    }

    public Object visitWorkspace(Workspace p) throws Exception {
        XMLNode node = new XMLNode(WORKSPACE, currentNode);
        node.addAttribute(WORKSPACE_ATTR_ID, p.getId());
        node.addAttribute(WORKSPACE_ATTR_SKIN_ID, p.getSkinId());
        node.addAttribute(WORKSPACE_ATTR_ENVELOPE_ID, p.getEnvelopeId());
        if (p.getFriendlyUrl() != null) node.addAttribute(WORKSPACE_ATTR_FR_URL, p.getFriendlyUrl());
        node.addAttribute(WORKSPACE_ATTR_HOME_MODE, String.valueOf(p.getHomeSearchMode()));
        currentNode.addChild(node);
        currentNode = node;
        return node;
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.commons.xml.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.