Package org.jmanage.core.config

Examples of org.jmanage.core.config.GraphConfig


                    expression.getMBeanName(),expression.getTargetName(),
                    displayNames[i]);
            graphAttrConfigs.add(graphAttrConfig);
        }
        String graphId = request.getParameter(RequestParams.GRAPH_ID);
        GraphConfig graphConfig = null;
        if(graphId==null || graphId.equals("")){
            graphConfig = new GraphConfig(GraphConfig.getNextGraphId(),
                    form.getGraphName(), Long.parseLong(form.getPollInterval()),
                    appConfig, graphAttrConfigs);
            graphConfig.setYAxisLabel(form.getYAxisLabel());
            if(form.getScaleFactor() != null){
                graphConfig.setScaleFactor(new Double(form.getScaleFactor()));
                graphConfig.setScaleUp(Boolean.valueOf(form.getScaleUp()));
            }
            appConfig.addGraph(graphConfig);
        }else{
            graphConfig = appConfig.findGraph(graphId);
            graphConfig.setName(form.getGraphName());
            graphConfig.setAttributes(graphAttrConfigs);
            graphConfig.setPollingInterval(Long.parseLong(form.getPollInterval()));
            graphConfig.setYAxisLabel(form.getYAxisLabel());
            if(form.getScaleFactor() != null){
                graphConfig.setScaleFactor(new Double(form.getScaleFactor()));
                graphConfig.setScaleUp(Boolean.valueOf(form.getScaleUp()));
            }else{
                graphConfig.setScaleFactor(null);
                graphConfig.setScaleUp(null);
            }
            graphConfig.setAppConfig(appConfig);
        }

        ConfigurationService service = ServiceFactory.getConfigurationService();
        service.addGraph(Utils.getServiceContext(context), graphConfig);
        return mapping.findForward(Forwards.SUCCESS);
View Full Code Here


        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
        WebContext context = WebContext.get(request);
        ApplicationConfig appConfig = context.getApplicationConfig();
        // graphs at cluster level are not yet supported
        assert !appConfig.isCluster();
        GraphConfig graphConfig = appConfig.findGraph(id);

        HtmlElement applet = new HtmlElement("applet");
        applet.addAttribute("code", "org/jmanage/webui/applets/GraphApplet.class");
        applet.addAttribute("archive", "/applets/applets.jar,/applets/jfreechart-0.9.20.jar,/applets/jcommon-0.9.5.jar");
        applet.addAttribute("width", width);
        applet.addAttribute("height", height);

        ParamElement param = null;

        param = new ParamElement(GraphAppletParameters.GRAPH_TITLE, graphConfig.getName());
        applet.addChildElement(param);

        param = new ParamElement(GraphAppletParameters.POLLING_INTERVAL, graphConfig.getPollingInterval());
        applet.addChildElement(param);

        String remoteURL = Utils.getServerBaseURL(request) +
                "/app/fetchAttributeValues.do;jsessionid=" +
                Utils.getCookieValue(request, "JSESSIONID");
        param = new ParamElement(GraphAppletParameters.REMOTE_URL, remoteURL);
        applet.addChildElement(param);

        param = new ParamElement(GraphAppletParameters.ATTRIBUTE_DISPLAY_NAMES,
                graphConfig.getAttributeDisplayNames());
        applet.addChildElement(param);

        param = new ParamElement(GraphAppletParameters.ATTRIBUTES,
                graphConfig.getAttributesAsString());
        applet.addChildElement(param);

        param = new ParamElement(GraphAppletParameters.Y_AXIS_LABEL,
                graphConfig.getYAxisLabel());
        applet.addChildElement(param);

        if(graphConfig.getScaleFactor() != null){
            param = new ParamElement(GraphAppletParameters.SCALE_FACTOR,
                    graphConfig.getScaleFactor());
            applet.addChildElement(param);
        }

        if(graphConfig.isScaleUp() != null){
            param = new ParamElement(GraphAppletParameters.SCALE_UP,
                    graphConfig.isScaleUp());
            applet.addChildElement(param);
        }

        final JspWriter writer = pageContext.getOut();
View Full Code Here

            throws Exception {
        AccessController.checkAccess(Utils.getServiceContext(context),ACL_EDIT_GRAPH);
        GraphForm form = (GraphForm)actionForm;
        String graphId = form.getGraphId();
        ApplicationConfig appConfig = context.getApplicationConfig();
        GraphConfig graphConfig = appConfig.findGraph(graphId);
        if(graphConfig!=null){
            form.setGraphName(graphConfig.getName());
            form.setPollInterval(String.valueOf(graphConfig.getPollingInterval()));
            form.setYAxisLabel(graphConfig.getYAxisLabel());
            if(graphConfig.getScaleFactor() != null){
                form.setScaleFactor(graphConfig.getScaleFactor().toString());
                form.setScaleUp(graphConfig.isScaleUp().booleanValue());
            }

            List attributes = graphConfig.getAttributes();
            String[] attributeNames = new String[attributes.size()];
            String[] objectNames = new String[attributes.size()];
            String[] displayNames = new String[attributes.size()];
            int i=0;
            for(Iterator itr=attributes.iterator(); itr.hasNext();){
View Full Code Here

        // todo: do we need access control for graphs? probably not.
        //AccessController.checkAccess(context.getServiceContext(),
        //        ACLConstants.ACL_VIEW_APPLICATIONS);

        /*set current page for navigation*/
        GraphConfig graphConfig =
                appConfig.findGraph(request.getParameter("graphId"));
        assert graphConfig != null;
        request.setAttribute(RequestAttributes.NAV_CURRENT_PAGE,
                graphConfig.getName());

        return mapping.findForward("success");
    }
View Full Code Here

TOP

Related Classes of org.jmanage.core.config.GraphConfig

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.