Examples of PanelInstance


Examples of org.jboss.dashboard.workspace.PanelInstance

                    if (provider == null) {
                        provider = new HashMap();
                        group.put(providers[j], provider);
                    }
                    for (Iterator iterator = instances.iterator(); iterator.hasNext(); ) {
                        PanelInstance instance = (PanelInstance) iterator.next();
                        if (instance.getProviderName().equals(providers[j].getId())) {
                            String instanceGroupName = instance.getParameterValue(PanelInstance.PARAMETER_GROUP, LocaleManager.lookup().getDefaultLang());
                            instanceGroupName = instanceGroupName == null ? "" : instanceGroupName.trim();
                            Map instanceGroup = (Map) provider.get(instanceGroupName);
                            if (instanceGroup == null) {
                                instanceGroup = new HashMap();
                                provider.put(instanceGroupName, instanceGroup);
                            }
                            instanceGroup.put(instance.getInstanceId(), instance);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

                    if (provider == null) {
                        provider = new HashMap();
                        group.put(providers[j], provider);
                    }
                    for (Iterator iterator = instances.iterator(); iterator.hasNext(); ) {
                        PanelInstance instance = (PanelInstance) iterator.next();
                        if (instance.getProviderName().equals(providers[j].getId())) {
                            String instanceGroupName = instance.getParameterValue(PanelInstance.PARAMETER_GROUP, LocaleManager.lookup().getDefaultLang());
                            instanceGroupName = instanceGroupName == null ? "" : instanceGroupName.trim();
                            Map instanceGroup = (Map) provider.get(instanceGroupName);
                            if (instanceGroup == null) {
                                instanceGroup = new HashMap();
                                provider.put(instanceGroupName, instanceGroup);
                            }
                            instanceGroup.put(instance.getInstanceId(), instance);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

            }
        }
    }

    protected boolean checkPanelDuplicated(Panel panel) {
        PanelInstance instance = panel.getInstance();
        Set sections = new HashSet();
        Panel[] panels = instance.getAllPanels();
        for (int i = 0; i < panels.length; i++) {
            Panel panel1 = panels[i];
            sections.add(panel1.getSection());
        }
        return sections.size() > 1;
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

            }
        }
    }

    protected boolean checkPanelDuplicated(Panel panel) {
        PanelInstance instance = panel.getInstance();
        Set sections = new HashSet();
        Panel[] panels = instance.getAllPanels();
        for (int i = 0; i < panels.length; i++) {
            Panel panel1 = panels[i];
            sections.add(panel1.getSection());
        }
        return sections.size() > 1;
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

        if (instances != null) {
            List sortedInstances = new ArrayList(instances.size());

            for (Iterator itInstance = instances.keySet().iterator(); itInstance.hasNext(); ) {
                Long instanceId = (Long) itInstance.next();
                PanelInstance instance = (PanelInstance) instances.get(instanceId);
                String title = (String) LocaleManager.lookup().localize(instance.getTitle());
                Map mapRepresentation = new HashMap();
                mapRepresentation.put("title", title);
                mapRepresentation.put("instanceId", instanceId);
                sortedInstances.add(mapRepresentation);
            }
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

        if (instances != null) {
            List sortedInstances = new ArrayList(instances.size());

            for (Iterator itInstance = instances.keySet().iterator(); itInstance.hasNext(); ) {
                Long instanceId = (Long) itInstance.next();
                PanelInstance instance = (PanelInstance) instances.get(instanceId);
                String title = (String) LocaleManager.lookup().localize(instance.getTitle());
                Map mapRepresentation = new HashMap();
                mapRepresentation.put("title", title);
                mapRepresentation.put("instanceId", instanceId);
                sortedInstances.add(mapRepresentation);
            }
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

                    renderFragment("outputHeaders");
                    Iterator it = panelInstances.iterator();
                    int counter = 0;
                    while (it.hasNext()) {
                        String instanceId = it.next().toString();
                        PanelInstance instance = workspace.getPanelInstance(instanceId);
                        setAttribute("instanceId", instanceId);
                        setAttribute("group", instance.getResource(instance.getProvider().getGroup(), getLocale()));
                        setAttribute("description", instance.getResource(instance.getProvider().getDescription(), getLocale()));
                        setAttribute("title", getLocalizedValue(instance.getTitle()));
                        setAttribute("counter", counter);
                        counter++;
                        renderFragment("outputOpt");
                    }
                    renderFragment("outputOptEnd");
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

    public CommandResponse actionSave(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();
        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);
        UserStatus.lookup().checkPermission(workspacePerm);

        PanelInstance instance = getPanelInstance();

        request.getRequestObject().setAttribute(PanelInstanceGeneralPropertiesFormatter.PANEL_INSTANCE, instance);
        PanelProviderParameter[] params = getPanelProviderParameters(instance);
        String language = formStatus.getValueAsString("lang");

        boolean anyParamWritten = false;

        if (params != null && params.length > 0) {
            for (int i = 0; i < params.length; i++) {
                String value = params[i].readFromRequest(request.getRequestObject());
                log.debug("Panel " + instance.getInstanceId() + " field:" + params[i].getId() + " = " + value);
                if (params[i].isI18n()) {
                    String oldValue = instance.getParameterValue(params[i].getId(), language);
                    if (!RenderUtils.noNull(oldValue).equals(RenderUtils.noNull(value)) && params[i].isValid(value)) {
                        instance.setParameterValue(params[i].getId(), value, language);
                        anyParamWritten = true;
                    }
                } else {
                    String oldValue = instance.getParameterValue(params[i].getId());
                    if (!RenderUtils.noNull(oldValue).equals(RenderUtils.noNull(value)) && params[i].isValid(value)) {
                        instance.setParameterValue(params[i].getId(), value);
                        anyParamWritten = true;
                    }
                }

                if (!params[i].isValid(value)) formStatus.addWrongField(params[i].getId());
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

    @Inject
    private ShowPanelConfigComponent showPanelConfigComponent;

    public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
        try {
            PanelInstance instance = showPanelConfigComponent.getPanelInstance();
            if (instance != null) {
                renderFragment("outputStart");

                renderPanelParameters(httpServletRequest, instance, instance.getSystemParameters());
                renderPanelParameters(httpServletRequest, instance, instance.getCustomParameters());

                renderFragment("outputEnd");
            } else {
                log.warn("Error: panelInstance is null");
            }
View Full Code Here

Examples of org.jboss.dashboard.workspace.PanelInstance

    @Inject
    private ShowPanelConfigComponent showPanelConfigComponent;

    public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
        try {
            PanelInstance instance = showPanelConfigComponent.getPanelInstance();
            if (instance != null) {
                renderFragment("outputStart");

                renderPanelParameters(httpServletRequest, instance, instance.getSystemParameters());
                renderPanelParameters(httpServletRequest, instance, instance.getCustomParameters());

                renderFragment("outputEnd");
            } else {
                log.warn("Error: panelInstance is 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.