Examples of ShowCurrentScreenResponse


Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

     */
    public CommandResponse actionDeleteElement(CommandRequest request) throws Exception {
        String graphicElement = request.getParameter("graphicElement");
        if (graphicElement == null || "".equals(graphicElement)) {
            log.error("Missing required parameter: graphicElement.");
            return new ShowCurrentScreenResponse();
        }
        String graphicElementClassName = graphicElement.substring(0, 1).toUpperCase() + graphicElement.substring(1);
        Class graphicElementClass = Class.forName("org.jboss.dashboard.ui.resources." + graphicElementClassName);
        Method managerGetter = graphicElementClass.getMethod("getManager", new Class[]{});
        GraphicElementManager manager = (GraphicElementManager) managerGetter.invoke(null, new Object[]{});
        String id = request.getParameter(graphicElement + "Id");
        GraphicElement element = manager.getElementByDbid(id);
        if (element != null)
            manager.delete(element);
        else
            log.error("Cannot delete element");
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

        SimpleFormHandler handler = new SimpleFormHandler(status);
        status.clear();
        String graphicElement = request.getParameter("graphicElement");
        if (graphicElement == null || "".equals(graphicElement)) {
            log.error("Missing required parameter: graphicElement.");
            return new ShowCurrentScreenResponse();
        }
        String graphicElementClassName = graphicElement.substring(0, 1).toUpperCase() + graphicElement.substring(1);
        Class graphicElementClass = Class.forName("org.jboss.dashboard.ui.resources." + graphicElementClassName);

        String workspaceId = handler.validateString(request, "workspaceId", false);
        String sectionId = handler.validateString(request, "sectionId", false);
        String panelId = handler.validateString(request, "panelId", false);
        String id = handler.validateString(request, graphicElement + "Id", true);
        if (!isValidId(id)) {
            status.addWrongField(graphicElement + "Id");
        }
        try {
            if (request.getUploadedFilesCount() == 1) {
                if (status.isValidated()) {
                    log.debug("Creating preview.");
                    try {
                        Method previewGetter = graphicElementClass.getMethod("getPreviewInstance", new Class[]{File.class, String.class, Long.class, Long.class, String.class});
                        GraphicElementPreview preview = (GraphicElementPreview) previewGetter.invoke(null, new Object[]{request.getFilesByParamName().get("file"), workspaceId, sectionId == null ? null : new Long(sectionId), panelId == null ? null : new Long(panelId), id});
                        request.getSessionObject().setAttribute(PREVIEW_ATTRIBUTE, preview);
                        log.debug("Created preview " + preview);
                    } catch (Exception e) {
                        log.error("Error making preview: ", e);
                    }
                }
            } else {
                log.debug("Status is not valid. Number of files is not 1, it is " + request.getUploadedFilesCount());
                status.addWrongField("zipFile");
            }
        } catch (Exception e) {
            status.addError(e.getMessage());
        }
        if (status.isValidated()) {
            String previewPage = request.getParameter("previewPage");
            if (previewPage != null) {
                return new ShowScreenResponse(previewPage);
            }
        }
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

     */
    public CommandResponse actionConfirmNewElement(CommandRequest request) throws Exception {
        String graphicElement = request.getParameter("graphicElement");
        if (graphicElement == null || "".equals(graphicElement)) {
            log.error("Missing required parameter: graphicElement.");
            return new ShowCurrentScreenResponse();
        }
        String graphicElementClassName = graphicElement.substring(0, 1).toUpperCase() + graphicElement.substring(1);
        Class graphicElementClass = Class.forName("org.jboss.dashboard.ui.resources." + graphicElementClassName);
        Method managerGetter = graphicElementClass.getMethod("getManager", new Class[]{});
        GraphicElementManager manager = (GraphicElementManager) managerGetter.invoke(null, new Object[]{});
        GraphicElementPreview preview = (GraphicElementPreview) request.getSessionObject().getAttribute(PREVIEW_ATTRIBUTE);
        final GraphicElement element = preview.toElement();
        manager.createOrUpdate(element);
        FormStatus status = SessionManager.getCurrentFormStatus();
        status.clear();
        String successPage = request.getParameter("successPage");
        if (successPage != null) {
            return new ShowScreenResponse(successPage);
        }
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

     * Change the skin to use in admin mode
     */
    public CommandResponse actionChangeAdminSkin(CommandRequest request) throws Exception {
        String id = request.getParameter("skinDbid");
        request.getSessionObject().setAttribute("adminSkinToUse", id);
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

    /**
     * Cancel operation, show current screen
     */
    public CommandResponse actionCancel(CommandRequest request) throws Exception {
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

    public CommandResponse actionChangeLanguage(CommandRequest request) throws Exception {
        String lang = request.getParameter("language");
        if (lang != null && lang.trim().length() > 0) {
            LocaleManager.lookup().setCurrentLang(lang);
        }
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

            }
        });
        modalDialog.show();

        // Force the current screen to be refreshed so the error report will be displayed.
        RequestContext.lookup().setResponse(new ShowCurrentScreenResponse());
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

    public CommandResponse actionNavigateTo(CommandRequest request) {
        String path = request.getParameter("path");
        TreeNode node = tree.getNodeByPath(path);
        if (node == null) {
            log.error("Node with path " + path + " does not exist.");
            return new ShowCurrentScreenResponse();
        }
        treeStatus.edit(node);
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

    public CommandResponse actionExpandOrCollapse(CommandRequest request) {
        String path = request.getParameter("path");
        TreeNode node = tree.getNodeByPath(path);
        if (node == null) {
            log.error("Node with path " + path + " does not exist.");
            return new ShowCurrentScreenResponse();
        }
        if (treeStatus.isExpanded(node)) {
            treeStatus.collapse(node);
        } else {
            treeStatus.expand(node);
        }
        return new ShowCurrentScreenResponse();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.ShowCurrentScreenResponse

        Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
        Object selectedValue = dataSetTable.getValueAt(rowIndex, columnIndex);
        if (selectedValue instanceof Interval) {
            if (dashboard.filter(selectedProperty.getPropertyId(), (Interval) selectedValue, FilterByCriteria.ALLOW_ANY)) {
                // If drill-down then force the whole screen to be refreshed.
                return new ShowCurrentScreenResponse();
            }
        } else {
            Collection values = new ArrayList();
            values.add(selectedValue);
            if (dashboard.filter(selectedProperty.getPropertyId(), null, false, null, false, values, FilterByCriteria.ALLOW_ANY)) {
                // If drill-down then force the whole screen to be refreshed.
                return new ShowCurrentScreenResponse();
            }
        }
        return null;
    }
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.