Source Code Cross Referenced for AutoAnalysisFormController.java in  » Report » openi » org » openi » web » controller » analysis » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Report » openi » org.openi.web.controller.analysis 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*********************************************************************************
002:         * The contents of this file are subject to the OpenI Public License Version 1.0
003:         * ("License"); You may not use this file except in compliance with the
004:         * License. You may obtain a copy of the License at
005:         * http://www.openi.org/docs/LICENSE.txt
006:         *
007:         * Software distributed under the License is distributed on an "AS IS" basis,
008:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009:         * the specific language governing rights and limitations under the License.
010:         *
011:         * The Original Code is: OpenI Open Source
012:         *
013:         * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
014:         * Portions created by Loyalty Matrix, Inc. are
015:         * Copyright (C) 2005 Loyalty Matrix, Inc.; All Rights Reserved.
016:         *
017:         * Contributor(s): i18n : Pedro Casals Fradera (2006/05/16)
018:         *
019:         ********************************************************************************/package org.openi.web.controller.analysis;
020:
021:        import java.util.HashMap;
022:        import java.util.List;
023:        import java.util.Map;
024:
025:        import javax.servlet.http.HttpServletRequest;
026:        import javax.servlet.http.HttpServletResponse;
027:
028:        import org.apache.log4j.Logger;
029:        import org.openi.analysis.Datasource;
030:        import org.openi.project.ProjectContext;
031:        import org.openi.xmla.XmlaConnector;
032:        import org.springframework.validation.BindException;
033:        import org.springframework.web.servlet.ModelAndView;
034:        import org.springframework.web.servlet.mvc.SimpleFormController;
035:
036:        import com.tonbeller.jpivot.olap.model.OlapException;
037:
038:        /**
039:         * Controller to configure dashboard
040:         */
041:        public class AutoAnalysisFormController extends SimpleFormController {
042:            private static Logger logger = Logger
043:                    .getLogger(AutoAnalysisFormController.class);
044:            // private ProjectContext projectContext = null;
045:
046:            private String selectOverviewFormView;
047:            private String configureOverviewFormView;
048:
049:            /**
050:             * This method will create the command object and set it in its initial state.
051:             * This method is called before the user is directed to the first page of the wizard
052:             *
053:             * @param request HttpServletRequest
054:             * @return Object
055:             * @throws Exception
056:             *
057:             */
058:            protected Object formBackingObject(HttpServletRequest request)
059:                    throws Exception {
060:                logger.debug("handling formBackingObject, request: "
061:                        + request.getParameterMap());
062:                ProjectContext projectContext = (ProjectContext) request
063:                        .getSession().getAttribute("projectContext");
064:                if (!projectContext.checkPermission("/autogenerate.htm")) {
065:                    throw new SecurityException(
066:                            "User does not have appropriate permission");
067:                }
068:
069:                //not just using the projectContext as a command object b/c it does not handle
070:                // state (and shouldn't), should extend the AbstractWizardFormController?
071:                Map model = new HashMap();
072:                // model.put("overviews", projectContext.getProject().getOverviews());
073:                // projectContext.getProject().setOverviews(this.getMockOverviewMap());
074:                // model.put("overviews", this.getMockOverviewMap());
075:                model.put("datasources", projectContext.getProject()
076:                        .getDataSourceMap());
077:
078:                String targetDatasource = request
079:                        .getParameter("targetDatasource");
080:                if (targetDatasource != null && targetDatasource.length() > 0) {
081:                    model.put("cubes", discoverCubes(projectContext
082:                            .getDatasource(targetDatasource)));
083:                    model.remove("targetCube");//reset the target cube
084:                    model.put("targetDatasource", targetDatasource);
085:                }
086:                return model;
087:            }
088:
089:            /**
090:             * @param datasource
091:             * @return
092:             * @throws OlapException
093:             */
094:            private List discoverCubes(Datasource datasource)
095:                    throws OlapException {
096:                return new XmlaConnector().getCubeList(datasource);
097:            }
098:
099:            /**
100:             * Submit callback with all parameters. Called in case of submit without
101:             * errors reported by the registered validator, or on every submit if no validator.
102:             * @param request HttpServletRequest
103:             * @param response HttpServletResponse
104:             * @param command Object
105:             * @param errors BindException
106:             * @return ModelAndView
107:             * @throws Exception
108:             */
109:            protected ModelAndView onSubmit(HttpServletRequest request,
110:                    HttpServletResponse response, Object command,
111:                    BindException errors) throws Exception {
112:
113:                logger.debug("onSubmit: " + request.getParameterMap());
114:                ProjectContext projectContext = (ProjectContext) request
115:                        .getSession().getAttribute("projectContext");
116:
117:                Map model = (Map) command;
118:                logger.debug("command map: " + model);
119:                String targetDatasource = (String) model
120:                        .get("targetDatasource");
121:                String targetCube = request.getParameter("targetCube");
122:
123:                logger.debug("targetDatasource=" + targetDatasource);
124:                logger.debug("targetCube=" + targetCube);
125:
126:                projectContext.autogenerate(targetDatasource, targetCube,
127:                        "Auto_Generated/" + targetCube.replaceAll(" ", "_"),
128:                        null);
129:
130:                //message, you have just created blah, to view all go here, or look in the navigation
131:                // for a specific report
132:
133:                return super.onSubmit(request, response, command, errors);
134:            }
135:
136:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.