Package org.jboss.dashboard.workspace

Examples of org.jboss.dashboard.workspace.GraphicElementManager


            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[]{});
        FormStatus status = SessionManager.getCurrentFormStatus();
        status.clear();

        String elementId = request.getParameter(graphicElement + "Id");
        String workspaceId = request.getParameter("workspaceId");
        String sectionIdParam = request.getParameter("sectionId");
        String panelIdParam = request.getParameter("panelId");
        log.debug("Changing scope to " + workspaceId + "->" + sectionIdParam + "->" + panelIdParam);
        workspaceId = "".equals(workspaceId) ? null : workspaceId;
        Long sectionId = "".equals(sectionIdParam) || sectionIdParam == null ? null : new Long(sectionIdParam);
        Long panelId = "".equals(panelIdParam) || panelIdParam == null ? null : new Long(panelIdParam);
        if (workspaceId == null) {
            sectionId = null;
            panelId = null;
        }
        if (sectionId == null && manager.getElementScopeDescriptor().isAllowedPanel())
            panelId = null;

        if (elementId != null) {
            final GraphicElement element = manager.getElementByDbid(elementId);
            if (element != null) {
                log.debug("Find " + graphicElement + " with id=" + element.getId() + " and workspace=" + workspaceId + " and section=" + sectionId + " and panel=" + panelId);
                GraphicElement existingElement = manager.getElement(element.getId(), workspaceId, sectionId, panelId);
                if (existingElement != null) {
                    log.warn("Refusing change " + graphicElement + " workspace, as it would match an existing one.");
                    status.addMessage("ui.admin.workarea." + graphicElement + "s.cannotChangeScope");
                } else {
                    element.clearDeploymentFiles();
                    element.setWorkspaceId(workspaceId);
                    element.setSectionId(sectionId);
                    element.setPanelId(panelId);
                    manager.createOrUpdate(element);
                }
            } else {
                log.error(graphicElementClass + " not found, id=" + elementId);
            }
        } else {
View Full Code Here


            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

            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);
View Full Code Here

        String elementId = request.getParameter("elementId");

        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[]{});

        GraphicElement element = manager.getElementByDbid(elementId);

        request.getRequestObject().setAttribute("previewElement", element);
        request.getRequestObject().setAttribute("fullPageJsp", "/admin/" + previewPage);
        return new ShowScreenResponse("/admin/" + previewPage);
    }
View Full Code Here

        List resourcesToShow = new ArrayList();

        GraphicElementManager[] resourcesManagers = UIServices.lookup().getGraphicElementManagers();
        for (int i = 0; i < resourcesManagers.length; i++) {
            GraphicElementManager manager = resourcesManagers[i];
            GraphicElement[] elements = manager.getElements(workspaceId, sectionId, panelId);
            for (int j = 0; j < elements.length; j++) {
                GraphicElement graphicElement = elements[j];
                if ((resourceType != null && resourceType.equals(graphicElement.getCategoryName())) || resourceType == null) {
                    if (manager.isBaseElement(graphicElement) && !includeBase) {
                        log.debug("Excluding global element from selection.");
                    } else {
                        resourcesToShow.add(graphicElement);
                        log.debug("Adding element to selection.");
                    }
View Full Code Here

        List resourcesToShow = new ArrayList();

        GraphicElementManager[] resourcesManagers = UIServices.lookup().getGraphicElementManagers();
        for (int i = 0; i < resourcesManagers.length; i++) {
            GraphicElementManager manager = resourcesManagers[i];
            GraphicElement[] elements = manager.getElements(workspaceId, sectionId, panelId);
            for (int j = 0; j < elements.length; j++) {
                GraphicElement graphicElement = elements[j];
                if ((resourceType != null && resourceType.equals(graphicElement.getCategoryName())) || resourceType == null) {
                    if (manager.isBaseElement(graphicElement) && !includeBase) {
                        log.debug("Excluding global element from selection.");
                    } else {
                        resourcesToShow.add(graphicElement);
                        log.debug("Adding element to selection.");
                    }
View Full Code Here

            renderFragment("outputUploadResourceFile");
            renderFragment("outputUploadResourceEndRow");
            setAttribute("graphicElement", graphicElement);
            renderFragment("outputUploadResourceEnd");

            GraphicElementManager manager = (GraphicElementManager) managerGetter.invoke(null, new Object[]{});
            setAttribute("graphicElement", graphicElement);
            setAttribute("graphicElementClassName", graphicElementClassName);
            setAttribute("manager", manager);
            String workspaceId = handler.getWorkspaceId();
            Long sectionId = handler.getSectionId();
            Long panelId = handler.getPanelId();

            GraphicElement[] elements;
            if ((workspaceId == null) & (sectionId == null) & (panelId == null)) elements = manager.getElements();
            else
                elements = manager.getManageableElements(workspaceId, sectionId, panelId);
            setAttribute("elements", elements);
            renderFragment("outputResources");

        } catch (Exception e) {
            log.error("Error: " + e.getMessage());
View Full Code Here

        try {
            String graphicElementClassName = resourceType.substring(0, 1).toUpperCase() + resourceType.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);
            GraphicElement element = preview.toElement();
            manager.createOrUpdate(element);
            actionCreate = null;
            actionCancel = null;
            inserted = true;
            resourceId = null;
            file = null;
View Full Code Here

        try {
            String graphicElementClassName = resourceType.substring(0, 1).toUpperCase() + resourceType.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);
            actionCreate = null;
            actionCancel = null;
            inserted = true;
            resourceId = null;
            file = null;
View Full Code Here

        try {
            String graphicElementClassName = resourceType.substring(0, 1).toUpperCase() + resourceType.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);
            actionCreate = null;
            actionCancel = null;
            inserted = true;
            resourceId = null;
            file = null;
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.workspace.GraphicElementManager

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.