Package org.jboss.dashboard.ui.resources

Examples of org.jboss.dashboard.ui.resources.GraphicElement


        GraphicElement[] layouts = UIServices.lookup().getLayoutsManager().getElements(getId(), null, null);
        GraphicElement[][] elements = {skins, envelopes, layouts};
        for (int i = 0; i < elements.length; i++) {
            GraphicElement[] elementsArray = elements[i];
            for (int j = 0; j < elementsArray.length; j++) {
                GraphicElement element = elementsArray[j];
                element.acceptVisit(visitor);
            }
        }

        //Add panelInstances
        PanelInstance[] panelInstances = getPanelInstances();
View Full Code Here


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

        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

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

        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

            GraphicElementManager manager = managers[i];
            if (!manager.getElementScopeDescriptor().isAllowedPanel())
                continue; //This manager does not define panel elements.
            GraphicElement[] elements = manager.getElements(getWorkspace().getId(), getSection().getId(), getPanelId());
            for (int j = 0; j < elements.length; j++) {
                GraphicElement element = elements[j];
                manager.delete(element);
            }
        }
    }
View Full Code Here

        GraphicElement[] layouts = UIServices.lookup().getLayoutsManager().getElements(getWorkspace().getId(), getId());
        GraphicElement[][] elements = {galleries, skins, envelopes, layouts};
        for (int i = 0; i < elements.length; i++) {
            GraphicElement[] elementsArray = elements[i];
            for (int j = 0; j < elementsArray.length; j++) {
                GraphicElement element = elementsArray[j];
                element.acceptVisit(visitor);
            }
        }

        // Visit panels
View Full Code Here

        deployBaseElements();
        if (elements != null) {
            new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                for (Iterator iterator = elements.iterator(); iterator.hasNext();) {
                    GraphicElement graphicElement = (GraphicElement) iterator.next();
                    graphicElement.checkDeployment();
                    session.update(graphicElement);
                }
            }}.execute();
        }
    }
View Full Code Here

            protected void txFragment(Session session) throws Exception {
                FlushMode oldFlushMode = session.getFlushMode();
                session.setFlushMode(FlushMode.NEVER);
                List dbItems = ((org.hibernate.classic.Session) session).find("from " + classToHandle.getName() + " as element");
                for (int i = 0; i < dbItems.size(); i++) {
                    GraphicElement element = (GraphicElement) dbItems.get(i);
                    //element.deploy();
                    log.debug("Loaded db item " + element.getId());
                    elements.add(element);
                }
                session.setFlushMode(oldFlushMode);
            }
        };
View Full Code Here

    /**
     * Deploys an element (zip file). Deployment consists in creating or updating it in database
     */
    protected void deployZippedElement(File zipFile, String elementId) throws Exception {
        log.debug("Deploying " + classToHandleName + " " + zipFile);
        final GraphicElement existingElement = getElement(elementId, null, null, null);
        log.debug("Existing element with id " + elementId + " = " + existingElement);
        if (existingElement != null) {
            log.debug("Updating file " + zipFile + ". (Already deployed in db)");
            existingElement.setZipFile(zipFile);
            existingElement.setLastModified(new Date());
        } else {
            log.info("Deploying to database " + classToHandleName + " " + zipFile);
            Constructor c = classToHandle.getConstructor(new Class[]{String.class, File.class});
            final GraphicElement element = (GraphicElement) c.newInstance(new Object[]{elementId, zipFile});

            HibernateTxFragment txFragment = new HibernateTxFragment() {
                protected void txFragment(Session session) throws Exception {
                    element.setLastModified(new Date());
                    session.save(element);
                }
            };

            txFragment.execute();
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.ui.resources.GraphicElement

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.