Source Code Cross Referenced for CubeReport.java in  » Report » jmagallanes-1.0 » com » calipso » reportgenerator » reportmanager » 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 » jmagallanes 1.0 » com.calipso.reportgenerator.reportmanager 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.calipso.reportgenerator.reportmanager;
002:
003:        import com.calipso.reportgenerator.common.*;
004:        import com.calipso.reportgenerator.reportdefinitions.types.ReportDefinitionReportTypeType;
005:        import com.calipso.reportgenerator.reportdefinitions.types.FilterDefinitionFilterTypeType;
006:        import com.calipso.reportgenerator.common.InfoException;
007:
008:        import java.util.*;
009:
010:        /**
011:         *
012:         * User: soliveri
013:         * Date: Dec 15, 2003
014:         * Time: 5:03:27 PM
015:         *
016:         */
017:
018:        public class CubeReport extends Report {
019:
020:            private transient ExecutedQueryCollection queryCollection;
021:            private HeaderTableModel rowsModel;
022:            private HeaderTableModel columnsModel;
023:            private Vector dataVector;
024:            private ReportQuery query;
025:
026:            public CubeReport() throws InfoException {
027:            }
028:
029:            public CubeReport(ReportSpec reportSpec, ReportSource reportSource,
030:                    ReportGeneratorConfiguration configuration)
031:                    throws InfoException {
032:                super (reportSpec, reportSource, configuration);
033:                initialize();
034:            }
035:
036:            /**
037:             * Ejecuta la inicialización, recolecta toda la información que necesita de la definición del reporte, inicializa
038:             * los objetos encargados de resolver los cálculos y obtiene los valores de parámetros por defecto.
039:             * @throws InfoException
040:             */
041:            private void initialize() throws InfoException {
042:                try {
043:                    setReportData(new CubeReportData(getReportSpec()));
044:                } catch (Exception e) {
045:                    throw new InfoException(LanguageTraslator.traslate("48"), e);
046:                }
047:            }
048:
049:            public String getXml() throws InfoException {
050:                ReportXmlWriter resultWriter = new CubeReportXmlWriter(
051:                        getReportData(), getReportSpec(), getQuery()
052:                                .getParamValues(), query);
053:                return resultWriter.getXml().toString();
054:            }
055:
056:            public ReportResult ExecQuery(ReportQuery query)
057:                    throws InfoException {
058:                if (query == null) {
059:                    throw new InfoException(LanguageTraslator.traslate("49"));
060:                }
061:                if (!getFiltersByType(getReportSpec(),
062:                        FilterDefinitionFilterTypeType.RANKING).isEmpty()) {
063:                    fillEnumeration(query);
064:                }
065:                if (!getFiltersByType(getReportSpec(),
066:                        FilterDefinitionFilterTypeType.EXCLUDEGROUP).isEmpty()) {
067:                    fillExcludedEnumeration(query);
068:                }
069:                if (query.isValid()) {
070:                    System.gc();
071:                    this .query = query;
072:                    setReportQuery(query);
073:                    ReportManagerLogger
074:                            .debug(LanguageTraslator.traslate("200"));
075:                    getReportData().setQuery(query, getPivot());
076:                    DataVectorBuilder dataVectorBuilder = null;
077:                    if (!(getExecutedQueryCollection().alreadyExists(query,
078:                            getConfiguration().queryCacheEnabled()))) {
079:                        DimensionValueTreeBuilder dimensionValueTreeBuilder = new DimensionValueTreeBuilder(
080:                                getReportData());
081:                        DimensionValueNode rowsRoot = dimensionValueTreeBuilder
082:                                .getRowsRoot();
083:                        DimensionValueNode columnsRoot = dimensionValueTreeBuilder
084:                                .getColumnsRoot();
085:                        dataVectorBuilder = getDataVectorBuilder(rowsRoot,
086:                                columnsRoot);
087:                        rowsModel = HeaderTableModel.newRowHeaderTableModel(
088:                                rowsRoot, getQuery().isVisibleTotals(),
089:                                dataVectorBuilder.getRowCount(), getQuery(),
090:                                getReportSpec());
091:                        columnsModel = HeaderTableModel
092:                                .newColumnHeaderTableModel(columnsRoot,
093:                                        getQuery().isVisibleTotals(),
094:                                        dataVectorBuilder.getColCount(),
095:                                        getQuery(), getReportSpec());
096:                        dataVector = dataVectorBuilder.getDataVector();
097:                        registerReportQuery(query, rowsModel, columnsModel,
098:                                dataVector);
099:                        System.out.println(LanguageTraslator.traslate("496"));
100:                    } else if ((getReportSpec().getReportType().toString()
101:                            .equalsIgnoreCase(ReportDefinitionReportTypeType.CUBE
102:                                    .toString()))
103:                            || (getReportSpec().getReportType().toString()
104:                                    .equalsIgnoreCase(ReportDefinitionReportTypeType.CHARTCUBE
105:                                            .toString()))) {
106:                        ExecutedQuery executedQuery = getExecutedQueryCollection()
107:                                .getExecutedQuery(query);
108:                        //Para recuperar del disco
109:                        //ExecutedQuery executedQuery = getExecutedQueryCollection().getExecutedQueryFromDisk(query);
110:                        rowsModel = executedQuery.getRowsModel();
111:                        columnsModel = executedQuery.getColumnsModel();
112:                        dataVector = executedQuery.getDataVector();
113:                        System.out.println(LanguageTraslator.traslate("497"));
114:                    }
115:                } else {
116:                    throw new InfoException(LanguageTraslator.traslate("50"));
117:                }
118:                return new CubeReportResult(getReportSpec(), query, rowsModel,
119:                        columnsModel, dataVector);
120:            }
121:
122:            private ExecutedQueryCollection getExecutedQueryCollection() {
123:                if (queryCollection == null) {
124:                    queryCollection = new ExecutedQueryCollection();
125:                }
126:                return queryCollection;
127:            }
128:
129:            private void registerReportQuery(ReportQuery query,
130:                    HeaderTableModel rowsModel, HeaderTableModel columnsModel,
131:                    Vector dataVector) {
132:                if (getConfiguration().queryCacheEnabled()) {
133:                    ExecutedQuery executedQuery = null;
134:                    if (getExecutedQueryCollection().getCollectionSize() == 0) {
135:                        executedQuery = new ExecutedQuery(query, rowsModel,
136:                                columnsModel, dataVector, true);
137:                    } else {
138:                        executedQuery = new ExecutedQuery(query, rowsModel,
139:                                columnsModel, dataVector, false);
140:                    }
141:                    getExecutedQueryCollection().addExecutedQuery(query,
142:                            executedQuery);
143:                    //Para disco
144:                    //getExecutedQueryCollection().addExecutedQueryToDisk(query, executedQuery);
145:                }
146:            }
147:
148:            public Vector getUpdatedDataModel(int mode, int row, int col,
149:                    boolean isDistributed) throws InfoException {
150:                try {
151:                    boolean changed;
152:                    if (isDistributed) {
153:                        changed = false;
154:                        if (mode == HeaderTableModel.MODE_ROW) {
155:                            changed = rowsModel.changeNodeState(row, col);
156:                        } else {
157:                            changed = columnsModel.changeNodeState(row, col);
158:                        }
159:                    } else {
160:                        changed = true;
161:                    }
162:                    if (changed) {
163:                        DataVectorBuilder dataVectorBuilder = getDataVectorBuilder(
164:                                rowsModel.getDimensionValueNode(), columnsModel
165:                                        .getDimensionValueNode());
166:                        return dataVectorBuilder.getDataVector();
167:                    } else {
168:                        return null;
169:                    }
170:                } catch (InfoException e) {
171:                    throw new InfoException(LanguageTraslator.traslate("327"));
172:                }
173:            }
174:
175:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.