Examples of ImportResult


Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

            renderFragment("empty");
        } else {
            renderFragment("outputStart");
            boolean anyError = false;
            for (int i = 0; i < results.length; i++) {
                ImportResult result = results[i];
                if (!renderImportResult(result, i))
                    anyError = true;
            }
            if (!anyError) renderFragment("importButton");
            renderFragment("outputEnd");
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

    public CommandResponse actionImport(final Panel panel, final CommandRequest request) {
        ImportResult[] results = getSessionInfo().getImportResult();
        int entriesCount = 0;
        for (int i = 0; i < results.length; i++) {
            ImportResult result = results[i];
            entriesCount += result.getRootNode().getChildren().size();
        }
        int[][] indexes = new int[entriesCount][];
        int indexesCurrentPos = 0;
        Enumeration en = request.getRequestObject().getParameterNames();
        while (en.hasMoreElements()) {
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

    public CommandResponse actionImport(final Panel panel, final CommandRequest request) {
        ImportResult[] results = getSessionInfo().getImportResult();
        int entriesCount = 0;
        for (int i = 0; i < results.length; i++) {
            ImportResult result = results[i];
            entriesCount += result.getRootNode().getChildren().size();
        }
        int[][] indexes = new int[entriesCount][];
        int indexesCurrentPos = 0;
        Enumeration en = request.getRequestObject().getParameterNames();
        while (en.hasMoreElements()) {
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

    protected ExportManager exportManager;

    public Map<Locale,Properties> extract() throws Exception {
        Map<Locale,Properties> bundles = new HashMap<Locale, Properties>();
        if (xmlFile != null && xmlFile.exists()) {
            ImportResult result = exportManager.loadXML(xmlFile.getName(), new FileInputStream(xmlFile));

            if (result.getException() != null) throw result.getException();
            if (result.getWarnings() != null && result.getWarnings().size() > 0) {
                for (int j = 0; j < result.getWarnings().size(); j++) {
                    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

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

                return false;
            }

            // Load the file.
            ExportManager exportManager = UIServices.lookup().getExportManager();
            ImportResult result = exportManager.loadXML(pf.getName(), new FileInputStream(pf));
            if (result == null) {
                log.warn("Error on importation. Nothing to import");
                return false;
            }

            if (result.getException() != null) throw result.getException();
            if (result.getWarnings() != null && result.getWarnings().size() > 0) {
                for (int j = 0; j < result.getWarnings().size(); j++) {
                    log.warn("Problems importing entry " + result.getEntryName() + ": " + result.getWarnings().get(j));
                }
            }

            exportManager.create(new ImportResult[]{result}, null, true);
            return true;
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

        }
        return (ImportResult[]) list.toArray(new ImportResult[list.size()]);
    }

    public ImportResult loadXML(String name, InputStream is) {
        return new ImportResult(name, is);
    }
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

    public CreateResult[] create(ImportResult[] results, int[][] indexes, boolean onStartup) {
        List elementsToCreate = new ArrayList();
        List attributesForCreation = new ArrayList();
        if (indexes == null) {
            for (int i = 0; i < results.length; i++) {
                ImportResult result = results[i];
                elementsToCreate.addAll(result.getRootNode().getChildren());
                while (attributesForCreation.size() < elementsToCreate.size())
                    attributesForCreation.add(result.getAttributes());
            }
        } else {
            for (int i = 0; i < indexes.length; i++) {
                int[] index = indexes[i];
                if (index != null)
                    if (index.length == 1) {
                        ImportResult result = results[index[0]];
                        elementsToCreate.addAll(result.getRootNode().getChildren());
                        while (attributesForCreation.size() < elementsToCreate.size())
                            attributesForCreation.add(result.getAttributes());
                    } else if (index.length > 1) {
                        ImportResult result = results[index[0]];
                        for (int j = 1; j < index.length; j++) {
                            int idx = index[j];
                            elementsToCreate.add(result.getRootNode().getChildren().get(idx));
                            while (attributesForCreation.size() < elementsToCreate.size())
                                attributesForCreation.add(result.getAttributes());
                        }
                    }
            }
        }
        List createResults = new ArrayList();
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

            renderFragment("empty");
        } else {
            renderFragment("outputStart");
            boolean anyError = false;
            for (int i = 0; i < results.length; i++) {
                ImportResult result = results[i];
                if (!renderImportResult(result, i))
                    anyError = true;
            }
            if (!anyError) renderFragment("importButton");
            renderFragment("outputEnd");
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

    public CommandResponse actionImport(final Panel panel, final CommandRequest request) {
        ImportResult[] results = getSessionInfo().getImportResult();
        int entriesCount = 0;
        for (int i = 0; i < results.length; i++) {
            ImportResult result = results[i];
            entriesCount += result.getRootNode().getChildren().size();
        }
        int[][] indexes = new int[entriesCount][];
        int indexesCurrentPos = 0;
        Enumeration en = request.getRequestObject().getParameterNames();
        while (en.hasMoreElements()) {
View Full Code Here

Examples of org.jboss.dashboard.workspace.export.structure.ImportResult

                return false;
            }

            // Load the file.
            ExportManager exportManager = UIServices.lookup().getExportManager();
            ImportResult result = exportManager.loadXML(pf.getName(), new FileInputStream(pf));
            if (result == null) {
                log.warn("Error on importation. Nothing to import");
                return false;
            }

            if (result.getException() != null) throw result.getException();
            if (result.getWarnings() != null && result.getWarnings().size() > 0) {
                for (int j = 0; j < result.getWarnings().size(); j++) {
                    log.warn("Problems importing entry " + result.getEntryName() + ": " + result.getWarnings().get(j));
                }
            }

            exportManager.create(new ImportResult[]{result}, null, true);
            return true;
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.