Package org.apache.geronimo.monitoring.console.data

Examples of org.apache.geronimo.monitoring.console.data.View


    private void addViewAttribute(RenderRequest request, boolean includeGraphs) throws PortletException {
        int viewId = Integer.parseInt(request.getParameter("view_id"));
        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, viewId);
                request.setAttribute("view", view);
                if (includeGraphs) {
                    List<Graph> graphs = view.getGraphs();
                    GraphsBuilder builder = new GraphsBuilder();
                    List<StatsGraph> statsGraphs = new ArrayList<StatsGraph>();
                    for (Graph graph: graphs) {
                       if(!graph.getNode().isEnabled())
                           continue;
View Full Code Here


        actionResponse.setRenderParameter("view_id", view_id);

        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, Integer.parseInt(view_id));
                view.setName(actionRequest.getParameter("name"));
                view.setDescription(actionRequest.getParameter("minxss_description"));
                for(Graph graph: view.getGraphs())
                {
                    for(View view_in : graph.getViews())
                    {
                        if(view_in.getId() == view.getId())
                        {//No grantee for that view and view_in have the same reference?
                            graph.getViews().remove(view_in);
                            break;
                        }
                    }
                }
                view.getGraphs().clear();
               
                String[] graphsArray = actionRequest.getParameterValues("graph_ids");
                if (graphsArray != null) {
                    for (String graphIdString: graphsArray) {
                        int graphId = Integer.parseInt(graphIdString);
                        Graph graph = entityManager.find(Graph.class, graphId);
                        view.getGraphs().add(graph);
                        graph.getViews().add(view);
                    }
                }
            } finally {
                userTransaction.commit();
View Full Code Here

                         ActionResponse actionResponse) {
        String name = actionRequest.getParameter("name");
        try {
            userTransaction.begin();
            try {
                View view = new View();
                view.setName(name);
                view.setDescription(actionRequest.getParameter("minxss_description"));
                String[] graphsArray = actionRequest.getParameterValues("graph_ids");
                if (graphsArray != null) {
                    for (String graphIdString: graphsArray) {
                        int graphId = Integer.parseInt(graphIdString);
                        Graph graph = entityManager.find(Graph.class, graphId);
                        view.getGraphs().add(graph);
                        graph.getViews().add(view);
                    }
                }
                entityManager.persist(view);
            } finally {
View Full Code Here

        actionResponse.setRenderParameter("view_id", view_id);

        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, Integer.parseInt(view_id));
                entityManager.remove(view);
            } finally {
                userTransaction.commit();
            }
            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.infoMsg13"));
View Full Code Here

        graph.setData2operation(data2operation == null ? 'A' : data2operation.charAt(0));
        return graph;
    }
   
    private View persistView(String name, String description, Graph[] graphsArray) throws Exception {
        View view = new View();
        view.setName(name);
        view.setDescription(description);
        if (graphsArray != null) {
            for (Graph graph : graphsArray) {
                view.getGraphs().add(graph);
                graph.getViews().add(view);
            }
        }
        entityManager.persist(view);
        return view;
View Full Code Here

    private void addViewAttribute(RenderRequest request, boolean includeGraphs) throws PortletException {
        int viewId = Integer.parseInt(request.getParameter("view_id"));
        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, viewId);
                request.setAttribute("view", view);
                if (includeGraphs) {
                    List<Graph> graphs = view.getGraphs();
                    GraphsBuilder builder = new GraphsBuilder();
                    List<StatsGraph> statsGraphs = new ArrayList<StatsGraph>();
                    for (Graph graph: graphs) {
                       if(!graph.getNode().isEnabled())
                           continue;
View Full Code Here

        actionResponse.setRenderParameter("view_id", view_id);

        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, Integer.parseInt(view_id));
                view.setName(actionRequest.getParameter("name"));
                view.setDescription(actionRequest.getParameter("minxss_description"));
                for(Graph graph: view.getGraphs())
                {
                    for(View view_in : graph.getViews())
                    {
                        if(view_in.getId() == view.getId())
                        {//No grantee for that view and view_in have the same reference?
                            graph.getViews().remove(view_in);
                            break;
                        }
                    }
                }
                view.getGraphs().clear();
               
                String[] graphsArray = actionRequest.getParameterValues("graph_ids");
                if (graphsArray != null) {
                    for (String graphIdString: graphsArray) {
                        int graphId = Integer.parseInt(graphIdString);
                        Graph graph = entityManager.find(Graph.class, graphId);
                        view.getGraphs().add(graph);
                        graph.getViews().add(view);
                    }
                }
            } finally {
                userTransaction.commit();
View Full Code Here

                         ActionResponse actionResponse) {
        String name = actionRequest.getParameter("name");
        try {
            userTransaction.begin();
            try {
                View view = new View();
                view.setName(name);
                view.setDescription(actionRequest.getParameter("minxss_description"));
                String[] graphsArray = actionRequest.getParameterValues("graph_ids");
                if (graphsArray != null) {
                    for (String graphIdString: graphsArray) {
                        int graphId = Integer.parseInt(graphIdString);
                        Graph graph = entityManager.find(Graph.class, graphId);
                        view.getGraphs().add(graph);
                        graph.getViews().add(view);
                    }
                }
                entityManager.persist(view);
            } finally {
View Full Code Here

        actionResponse.setRenderParameter("view_id", view_id);

        try {
            userTransaction.begin();
            try {
                View view = entityManager.find(View.class, Integer.parseInt(view_id));
                entityManager.remove(view);
            } finally {
                userTransaction.commit();
            }
            addInfoMessage(actionRequest, getLocalizedString(actionRequest, "mconsole.infoMsg13"));
View Full Code Here

        graph.setData2operation(data2operation == null ? 'A' : data2operation.charAt(0));
        return graph;
    }
   
    private View persistView(String name, String description, Graph[] graphsArray) throws Exception {
        View view = new View();
        view.setName(name);
        view.setDescription(description);
        if (graphsArray != null) {
            for (Graph graph : graphsArray) {
                view.getGraphs().add(graph);
                graph.getViews().add(view);
            }
        }
        entityManager.persist(view);
        return view;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.monitoring.console.data.View

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.