Package org.jboss.dashboard.export

Examples of org.jboss.dashboard.export.ImportResults


            File file = (File) request.getFilesByParamName().get("importFile");
            try {

                // Parse the file.
                ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
                ImportResults importResults = importMgr.parse(new FileInputStream(file));

                // Save the imported results.
                importMgr.update(importResults);

                // Show import messages.
                MessageList messages = importResults.getMessages();
                Locale locale = LocaleManager.currentLocale();
                Iterator it = messages.iterator();
                while (it.hasNext()) {
                    Message message = (Message) it.next();
                    switch (message.getMessageType()) {
View Full Code Here


    protected void deserializeDataDisplayer() {
        try {
            if (dataDisplayerUid == null) return;
            DataDisplayerType type = DataDisplayerServices.lookup().getDataDisplayerManager().getDisplayerTypeByUid(dataDisplayerUid);
            if (dataDisplayerXML != null) {
                ImportResults importResults = DataDisplayerServices.lookup().getImportManager().createImportResults();
                dataDisplayer = type.getXmlFormat().parse(dataDisplayerXML, importResults);
                if (importResults.getMessages().hasErrors()) {
                    throw new RuntimeException(importResults.getMessages().get(0).toString());
                }
                Locale locale = LocaleManager.currentLocale();
                dataDisplayer.setDataDisplayerType(type);
                dataDisplayer.setDataProvider(getDataProvider());
                if (dataDisplayer instanceof AbstractChartDisplayer) {
View Full Code Here

    protected ImportManager importManager;

    public Map<Locale,Properties> extract() throws Exception {
        Map<Locale,Properties> bundles = new HashMap<Locale, Properties>();
        if (xmlFile != null && xmlFile.exists()) {
            ImportResults importResults = importManager.parse(new FileInputStream(xmlFile));

            // Check parsing results.
            MessageList messages = importResults.getMessages();
            Locale locale = LocaleManager.currentLocale();
            Iterator it = messages.iterator();
            while (it.hasNext()) {
                Message message = (Message) it.next();
                switch (message.getMessageType()) {
                    case Message.ERROR: throw new Exception(message.getMessage(locale));
                    case Message.WARNING: log.warn(message.getMessage(locale)); break;
                    case Message.INFO: log.info(message.getMessage(locale)); break;
                }
            }

            // Extract i18n literals from data providers
            Set<DataProvider> dataProviders = importResults.getDataProviders();
            for (DataProvider dataProvider : dataProviders) {
                processDataProvider(dataProvider, bundles);
            }

            // Extract i18n literals from KPIs
            Set<KPI> kpis = importResults.getKPIs();
            for (KPI kpi : kpis) {
                processKPI(kpi, bundles);
            }
        }
        return bundles;
View Full Code Here

        File kpisFile = new File(webAppDir, "WEB-INF/etc/appdata/initialData/showcaseKPIs.xml");
        FileInputStream is = new FileInputStream(kpisFile);

        ImportManager importManager = DataDisplayerServices.lookup().getImportManager();
        ImportResults context = importManager.parse(is);

        // Just copy the output generated as replacing methods of the ShowcaseKpisTest class.
        for (KPI kpi : context.getKPIs()) {
            // Leave out report-like KPIs with a large number of rows.
            if (kpi.getCode().equals("kpi_30771353684719633")) continue;
            if (kpi.getCode().equals("kpi_29761353668431694")) continue;

            String method = KPITestMethodGenerator.generateKPITestMethod(kpi);
View Full Code Here

            File file = (File) request.getFilesByParamName().get("importFile");
            try {

                // Parse the file.
                ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
                ImportResults importResults = importMgr.parse(new FileInputStream(file));

                // Save the imported results.
                importMgr.update(importResults);

                // Show import messages.
                MessageList messages = importResults.getMessages();
                Locale locale = LocaleManager.currentLocale();
                for (Message message : messages) {
                    switch (message.getMessageType()) {
                        case Message.ERROR: messagesHandler.addError(message.getMessage(locale)); break;
                        case Message.WARNING: messagesHandler.addWarning(message.getMessage(locale)); break;
View Full Code Here

            File file = (File) request.getFilesByParamName().get("importFile");
            try {

                // Parse the file.
                ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
                ImportResults importResults = importMgr.parse(new FileInputStream(file));

                // Save the imported results.
                importMgr.update(importResults);

                // Show import messages.
                MessageList messages = importResults.getMessages();
                Locale locale = LocaleManager.currentLocale();
                for (Message message : messages) {
                    switch (message.getMessageType()) {
                        case Message.ERROR: messagesHandler.addError(message.getMessage(locale)); break;
                        case Message.WARNING: messagesHandler.addWarning(message.getMessage(locale)); break;
View Full Code Here

    protected void deserializeDataDisplayer() {
        try {
            if (dataDisplayerUid == null) return;
            DataDisplayerType type = DataDisplayerServices.lookup().getDataDisplayerManager().getDisplayerTypeByUid(dataDisplayerUid);
            if (dataDisplayerXML != null) {
                ImportResults importResults = DataDisplayerServices.lookup().getImportManager().createImportResults();
                dataDisplayer = type.getXmlFormat().parse(dataDisplayerXML, importResults);
                if (importResults.getMessages().hasErrors()) {
                    throw new RuntimeException(importResults.getMessages().get(0).toString());
                }
                Locale locale = LocaleManager.currentLocale();
                dataDisplayer.setDataDisplayerType(type);
                dataDisplayer.setDataProvider(getDataProvider());
                if (dataDisplayer instanceof AbstractChartDisplayer) {
View Full Code Here

                return false;
            }

            // Parse the file.
            ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
            ImportResults importResults = importMgr.parse(new FileInputStream(pf));

            // Save the imported results.
            if (upgrade) importMgr.update(importResults);
            else importMgr.save(importResults);

            // Show import messages.
            MessageList messages = importResults.getMessages();
            Locale locale = LocaleManager.currentLocale();
            Iterator it = messages.iterator();
            while (it.hasNext()) {
                Message message = (Message) it.next();
                switch (message.getMessageType()) {
View Full Code Here

            File file = (File) request.getFilesByParamName().get("importFile");
            try {

                // Parse the file.
                ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
                ImportResults importResults = importMgr.parse(new FileInputStream(file));

                // Save the imported results.
                importMgr.update(importResults);

                // Show import messages.
                MessageList messages = importResults.getMessages();
                Locale locale = LocaleManager.currentLocale();
                Iterator it = messages.iterator();
                while (it.hasNext()) {
                    Message message = (Message) it.next();
                    switch (message.getMessageType()) {
View Full Code Here

            File file = (File) request.getFilesByParamName().get("importFile");
            try {

                // Parse the file.
                ImportManager importMgr = DataDisplayerServices.lookup().getImportManager();
                ImportResults importResults = importMgr.parse(new FileInputStream(file));

                // Save the imported results.
                importMgr.update(importResults);

                // Show import messages.
                MessageList messages = importResults.getMessages();
                Locale locale = LocaleManager.currentLocale();
                Iterator it = messages.iterator();
                while (it.hasNext()) {
                    Message message = (Message) it.next();
                    switch (message.getMessageType()) {
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.export.ImportResults

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.