01: /**
02: * ===========================================
03: * JFreeReport : a free Java reporting library
04: * ===========================================
05: *
06: * Project Info: http://reporting.pentaho.org/
07: *
08: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
09: *
10: * This library is free software; you can redistribute it and/or modify it under the terms
11: * of the GNU Lesser General Public License as published by the Free Software Foundation;
12: * either version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16: * See the GNU Lesser General Public License for more details.
17: *
18: * You should have received a copy of the GNU Lesser General Public License along with this
19: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20: * Boston, MA 02111-1307, USA.
21: *
22: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
23: * in the United States and other countries.]
24: *
25: * ------------
26: * ExtParserModuleInit.java
27: * ------------
28: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
29: */package org.jfree.report.modules.parser.ext;
30:
31: import java.net.URL;
32:
33: import org.jfree.base.modules.ModuleInitializeException;
34: import org.jfree.base.modules.ModuleInitializer;
35: import org.jfree.util.ObjectUtilities;
36: import org.jfree.xmlns.parser.ParserEntityResolver;
37:
38: /**
39: * Performs the module initialization for the extended parser.
40: *
41: * @author Thomas Morgner
42: */
43: public class ExtParserModuleInit implements ModuleInitializer {
44: /**
45: * the Public ID for the extensible version of JFreeReport XML definitions.
46: */
47: public static final String PUBLIC_ID_EXTENDED = "-//JFreeReport//DTD report definition//EN//extended/version 0.8.5";
48: /**
49: * the Public ID for the old extensible version of JFreeReport XML definitions.
50: */
51: public static final String PUBLIC_ID_EXTENDED_084 = "-//JFreeReport//DTD report definition//EN//extended";
52: public static final String SYSTEM_ID = "http://jfreereport.sourceforge.net/extreport-085.dtd";
53:
54: /**
55: * Default Constructor.
56: */
57: public ExtParserModuleInit() {
58: }
59:
60: /**
61: * Initializes the ext-parser and registers it at the parser base module.
62: *
63: * @throws ModuleInitializeException if an error ocurres.
64: */
65: public void performInit() throws ModuleInitializeException {
66: final ParserEntityResolver res = ParserEntityResolver
67: .getDefaultResolver();
68:
69: final URL urlExtReportDTD = ObjectUtilities
70: .getResource(
71: "org/jfree/report/modules/parser/ext/resources/extreport-085.dtd",
72: ExtParserModuleInit.class);
73: res.setDTDLocation(PUBLIC_ID_EXTENDED, SYSTEM_ID,
74: urlExtReportDTD);
75: res
76: .setDeprecatedDTDMessage(
77: PUBLIC_ID_EXTENDED_084,
78: "The given public identifier for the XML document is deprecated. "
79: + "Please use the current document type declaration instead: \n"
80: + " <!DOCTYPE report PUBLIC \n"
81: + " \"-//JFreeReport//DTD report definition//EN//extended/version 0.8.5\"\n"
82: + " \"http://jfreereport.sourceforge.net/extreport-085.dtd\">");
83:
84: }
85: }
|