Source Code Cross Referenced for IReportConnection.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » 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 » iReport 2.0.5 » it.businesslogic.ireport 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2005 - 2008 JasperSoft Corporation.  All rights reserved. 
003:         * http://www.jaspersoft.com.
004:         *
005:         * Unless you have purchased a commercial license agreement from JasperSoft,
006:         * the following license terms apply:
007:         *
008:         * This program is free software; you can redistribute it and/or modify
009:         * it under the terms of the GNU General Public License version 2 as published by
010:         * the Free Software Foundation.
011:         *
012:         * This program is distributed WITHOUT ANY WARRANTY; and without the
013:         * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014:         * See the GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018:         * or write to:
019:         *
020:         * Free Software Foundation, Inc.,
021:         * 59 Temple Place - Suite 330,
022:         * Boston, MA  USA  02111-1307
023:         *
024:         *
025:         *
026:         *
027:         * IReportConnection.java
028:         * 
029:         * Created on 28 maggio 2003, 0.11
030:         *
031:         */
032:
033:        package it.businesslogic.ireport;
034:
035:        import it.businesslogic.ireport.connection.gui.BasicIReportConnectionEditor;
036:        import it.businesslogic.ireport.gui.MainFrame;
037:        import it.businesslogic.ireport.util.I18n;
038:        import java.util.Map;
039:        import javax.swing.JOptionPane;
040:
041:        /**
042:         *
043:         * @author  Administrator
044:         */
045:        public abstract class IReportConnection {
046:
047:            private String name = "";
048:
049:            /*
050:             * Return true if this connection is a "Connection" to a database
051:             * I.E. you can see JDBCConnection
052:             */
053:            public boolean isJDBCConnection() {
054:                return false;
055:            }
056:
057:            /*
058:             * Return true if this ireport connection can be used using getJRDataSource
059:             * I.E. you can see JDBCConnection
060:             */
061:            public boolean isJRDataSource() {
062:                return true;
063:            }
064:
065:            /**
066:             * This method provides the name of the connection type. I.e.: JDBC connection
067:             */
068:            public abstract String getDescription();
069:
070:            /**
071:             *  This method return an instanced connection to the database.
072:             *  If isJDBCConnection() return false => getConnection() return null
073:             */
074:            public java.sql.Connection getConnection() {
075:                return null;
076:            }
077:
078:            /**
079:             *  This method return an instanced JRDataDource to the database.
080:             *  If isJDBCConnection() return true => getJRDataSource() return false
081:             */
082:            public net.sf.jasperreports.engine.JRDataSource getJRDataSource() {
083:                return new net.sf.jasperreports.engine.JREmptyDataSource();
084:            }
085:
086:            /** Getter for property name.
087:             * @return Value of property name.
088:             *
089:             */
090:            public java.lang.String getName() {
091:                return name;
092:            }
093:
094:            /** Setter for property name.
095:             * @param name New value of property name.
096:             *
097:             */
098:            public void setName(java.lang.String name) {
099:                this .name = name;
100:            }
101:
102:            /** All properties of an IReportConnection are stored in a XML file as Pair key/value
103:             *  This HashMap must contain all the properties that the IReportConnection must save in the
104:             *  XML.
105:             *  IReport will store the content of this HashMap in the XML. Please note that all the values
106:             *  and keys will be casted to String!
107:             */
108:            public java.util.HashMap getProperties() {
109:                return new java.util.HashMap();
110:            }
111:
112:            /** All properties of a IReportConnection are stored in a XML file as Pair key/value
113:             *  This HashMap contains all the properties found for this IReportConnection in the
114:             *  XML. You must use this hashMap to initialize all attributes of your IReprotConnection
115:             */
116:            public void loadProperties(java.util.HashMap map) {
117:            }
118:
119:            /** Redefine this method is not useful (and not raccomended)
120:             *  It just write a portion of XML for save properties a IReportConnection name
121:             */
122:            public void save(java.io.PrintWriter pw) {
123:                java.util.HashMap hm = this .getProperties();
124:                pw.println("\t<iReportConnection name=\"" + this .getName()
125:                        + "\" connectionClass=\"" + this .getClass().getName()
126:                        + "\">");
127:                java.util.Iterator iterator = hm.keySet().iterator();
128:
129:                while (iterator.hasNext()) {
130:                    String key = (String) iterator.next();
131:                    pw.println("\t\t<connectionParameter name=\"" + key
132:                            + "\"><![CDATA[" + hm.get(key)
133:                            + "]]></connectionParameter>");
134:                }
135:                pw.println("\t</iReportConnection>");
136:            }
137:
138:            public String toString() {
139:                return getName();
140:            }
141:
142:            /**
143:             * This method is call before the datasource is used and permit to add special parameters to the map
144:             *
145:             */
146:            public Map getSpecialParameters(Map map)
147:                    throws net.sf.jasperreports.engine.JRException {
148:                return map;
149:            }
150:
151:            /**
152:             * This method is call after the datasource is used to dispose special parameters
153:             * (i.e. closing an Hibernate session create as parameter with a getSpecialParameters...
154:             *
155:             */
156:            public Map disposeSpecialParameters(Map map) {
157:                return map;
158:            }
159:
160:            /**
161:             * This method is used to test the configuration. To throw an exception if the test fails is not mandatory
162:             * and anyway the exception will be ignored.
163:             * The method is responsible to show error messages it the test has success or fails!!
164:             *
165:             */
166:            public void test() throws Exception {
167:                JOptionPane
168:                        .showMessageDialog(
169:                                MainFrame.getMainInstance(),
170:                                I18n
171:                                        .getString(
172:                                                "messages.connectionDialog.connectionTestSuccessful",
173:                                                "Connection test successful!"),
174:                                "", JOptionPane.INFORMATION_MESSAGE);
175:                return;
176:            }
177:
178:            /**
179:             * This method is used to provide to the datasources window the GUI to configure this kind of component.
180:             * 
181:             *
182:             */
183:            public IReportConnectionEditor getIReportConnectionEditor() {
184:                return new BasicIReportConnectionEditor();
185:            }
186:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.