Package org.jmanage.webui.forms

Examples of org.jmanage.webui.forms.GraphForm


                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {

        ApplicationConfig appConfig = context.getApplicationConfig();
        GraphForm form = (GraphForm)actionForm;
        String[] attributes = form.getAttributes();
        String[] displayNames = request.getParameterValues("displayNames");
        List<GraphAttributeConfig> graphAttrConfigs =
          new ArrayList<GraphAttributeConfig>(attributes.length);
        for(int i=0; i<attributes.length; i++){
            Expression expression = new Expression(attributes[i]);
            GraphAttributeConfig graphAttrConfig = new GraphAttributeConfig(
                    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);
View Full Code Here


                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(Utils.getServiceContext(context), ACL_ADD_GRAPH);
        GraphForm form = (GraphForm)actionForm;
        String[] attributes = form.getAttributes();
        String[] attributeNames = new String[attributes.length];
        String[] objectNames = new String[attributes.length];
        String[] displayNames = new String[attributes.length];
        for(int i=0; i<attributes.length;i++){
            Expression expression = new Expression(attributes[i]);
View Full Code Here

                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            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()];
View Full Code Here

TOP

Related Classes of org.jmanage.webui.forms.GraphForm

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.