You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(14) |
Mar
(107) |
Apr
(211) |
May
(93) |
Jun
(158) |
Jul
(159) |
Aug
(368) |
Sep
(188) |
Oct
(151) |
Nov
(115) |
Dec
(98) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(25) |
Feb
|
Mar
(33) |
Apr
(28) |
May
(116) |
Jun
(2) |
Jul
(117) |
Aug
(19) |
Sep
(9) |
Oct
(2) |
Nov
|
Dec
(4) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(9) |
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(267) |
Sep
|
Oct
|
Nov
(6) |
Dec
(512) |
| 2008 |
Jan
(187) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <mic...@us...> - 2003-12-05 23:40:13
|
Update of /cvsroot/babeldoc/modules/jabber/src/com/babeldoc/jabber/module In directory sc8-pr-cvs1:/tmp/cvs-serv31501/jabber/src/com/babeldoc/jabber/module Added Files: XmppWriterModule.java Log Message: Cleaned up to compile --- NEW FILE: XmppWriterModule.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/modules/jabber/src/com/babeldoc/jabber/module/XmppWriterModule.java,v 1.1 2003/12/05 23:40:10 michaelansley Exp $ * $DateTime$ * $Author: michaelansley $ * */ package com.babeldoc.jabber.module; import com.babeldoc.core.module.BabeldocModule; import java.util.HashSet; import java.util.Set; /** * This is the jfreereports module - it doesn't do very much except support the dependsOn. * * @author MCA * @version 1.0 */ public class XmppWriterModule extends BabeldocModule { public static final String MODULE = "jabber"; /** * jabber module only depends on core * * @return */ public Set getDependsOn() { Set set = new HashSet(); set.add("core"); return set; } /** * The Name of the module is jfreereports * * @return */ public String getName() { return MODULE; } } |
|
From: <mic...@us...> - 2003-12-05 23:39:42
|
Update of /cvsroot/babeldoc/modules/jabber/src/com/babeldoc/jabber/module In directory sc8-pr-cvs1:/tmp/cvs-serv31370/jabber/src/com/babeldoc/jabber/module Log Message: Directory /cvsroot/babeldoc/modules/jabber/src/com/babeldoc/jabber/module added to the repository |
|
From: Walt Teh-M. Y. <wal...@as...> - 2003-12-05 08:50:15
|
Hi, The latest stable release of Babeldoc (1.2.0) seems unable to handle directories specified through the $CLASSPATH environment variable properly. The command line interface (bin/babeldoc) ignores any directory given at $CLASSPATH. This means none the examples under examples/ could run as described in the user guide. I've attached a very simple patch to allow directories in the $CLASSPATH in case if you also regard this as a bug. Any comment will be welcome. Thanks. -- Walt |
|
From: Hans B. <ben...@ch...> - 2003-12-04 18:49:58
|
Hi to all,
I am trying to use JTidyPipelineStage the first time since 1.0.2, but it
throws the following exception:
-------------
java.lang.ArrayStoreException
at
java.util.AbstractCollection.toArray(AbstractCollection.java:174)
at
com.babeldoc.core.pipeline.stage.JTidyPipelineStage.getConfigProperties(JTidyPipelineStage.java:336)
at
com.babeldoc.core.pipeline.stage.JTidyPipelineStage.process(JTidyPipelineStage.java:291)
------------
I assume that casting the ConfigOptions from getOptions() to Strings in
line 337
---
String[] optionKeys = (String[]) getInfo().getOptions().toArray(new String[0]);
---
causes the problem, but at the moment I have no idea what to do instead
Any suggestions?
Regards,
Hans
|
|
From: Dejan K. <dej...@ya...> - 2003-12-04 12:39:24
|
I guess it does not build. In fact I am even not sure if it is working at all (it should work, Smack API is pretty simple to use but I haven't tried it). Since I haven't time to deal with it more I have separated from the Babeldoc core so it can be maintained and released separately. IMO, that should be path for other new modules. So, we should make some kind of framework or dummy module that should be used for other modules too. It should have defined structure (required files and folders) and off course build script. I guess it should not be different between modules. So if you have a time, do this for JFreeReport module and I will do the same latter for Jabber (when I have a time). We should also decide if we want to move modules to different SF project but that is not urgent yet. Regards, Dejan --- Michael Ansley <mic...@ze...> wrote: > The jabber module doesn't seem to build properly. > Can anybody verify > this, and is anybody interested? Does it matter > right now? > > Cheers... > > > MikeA > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback > Program. > Does SourceForge.net help you be more productive? > Does it > help you create better code? SHARE THE LOVE, and > help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ |
|
From: Michael A. <mic...@ze...> - 2003-12-04 09:01:31
|
The jabber module doesn't seem to build properly. Can anybody verify this, and is anybody interested? Does it matter right now? Cheers... MikeA |
|
From: Michael A. <mic...@ze...> - 2003-12-04 08:59:51
|
That is very cool! MikeA On Thu, 2003-12-04 at 08:21, Dejan Krsmanovic wrote: > > Hope the conference is going well. I haven't been > > to Belgium yet; guess > > I should find a conference there sometime and get > > myself over ;-) > > > > The most interesting moment for me was when I have > noticed Babeldoc on one company's presentation! It > turns out that it is company where one of our > developers (Vincent Harq) is working. What a small > world! So I finally met one of Babeldoc developers! > > Dejan > > __________________________________ > Do you Yahoo!? > Free Pop-Up Blocker - Get it now > http://companion.yahoo.com/ > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Dejan K. <dej...@ya...> - 2003-12-04 08:21:56
|
> Hope the conference is going well. I haven't been > to Belgium yet; guess > I should find a conference there sometime and get > myself over ;-) > The most interesting moment for me was when I have noticed Babeldoc on one company's presentation! It turns out that it is company where one of our developers (Vincent Harq) is working. What a small world! So I finally met one of Babeldoc developers! Dejan __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ |
|
From: Michael A. <mic...@ze...> - 2003-12-04 00:45:14
|
All, The jfreereports module is now in the "module" project in CVS. I will shortly be removing the TEMP_MIKEA CVS tag, so if you are currently working with it, please ensure that you delete your working directory, and replace it with the HEAD for both the "babeldoc" and "modules" projects. Using ant to build the jfreereports module should provide you with a build/lib directory containing the babeldoc_jfreereports.jar file, as well as all the dependency .jar files. One thing that I would like particular comment on is my implementation of XMLTableModel. This is a concrete implementation of java.swing.table.AbstractTableModel that provides a TableModel interface to the XML document produced by the SqlQuery stage. I think that I;ve made it too specific, but I'm not familiar enough with how XML works to make it more generic, or make it perform better. I think that right now, the performace sucks, because every time the table model is queried for data, an XPath query is executed on the XML, which is likely to perform like a dog. So, all ideas for improvements welcome. Cheers... MikeA |
|
From: <mic...@us...> - 2003-12-04 00:44:46
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker
In directory sc8-pr-cvs1:/tmp/cvs-serv11279/src/com/babeldoc/scanner/worker
Modified Files:
MailboxScanner.java
Log Message:
Mailbox scanner updated to correctly use the filtering capabilities provided
by the superclass.
Scanner classes updated to cater for upgraded jmx scanner.
Build.xml updated to correct the project name and exclude the jboss-service.xml
file, as it's now included in the .sarfile built at the top level.
Index: MailboxScanner.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/worker/MailboxScanner.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** MailboxScanner.java 13 Oct 2003 07:24:39 -0000 1.29
--- MailboxScanner.java 4 Dec 2003 00:44:42 -0000 1.30
***************
*** 79,83 ****
import javax.mail.Folder;
import javax.mail.Message;
- import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
--- 79,82 ----
***************
*** 85,91 ****
import javax.mail.Store;
- import java.util.regex.Pattern;
- import java.util.regex.Matcher;
-
import com.babeldoc.core.I18n;
import com.babeldoc.core.option.ConfigOption;
--- 84,87 ----
***************
*** 116,124 ****
public static final String SUBJECT_FILTER = "subjectFilter";
! //Values for getFrom attribute
public static final String BODY = "body";
public static final String ATTACHMENT = "attachment";
! //default values
public static String DEFAULT_PROTOCOL = "pop3";
public static String DEFAULT_FOLDER = "INBOX";
--- 112,120 ----
public static final String SUBJECT_FILTER = "subjectFilter";
! /** Values for getFrom attribute */
public static final String BODY = "body";
public static final String ATTACHMENT = "attachment";
! /** Default values */
public static String DEFAULT_PROTOCOL = "pop3";
public static String DEFAULT_FOLDER = "INBOX";
***************
*** 149,156 ****
* Do the scan
*
! * @throws ScannerException DOCUMENT ME!
*/
public void doScan() throws ScannerException {
- //Folder folder = null;
Folder folder = null;
Store store = null;
--- 145,153 ----
* Do the scan
*
! * @throws ScannerException
! *
! * @see ScannerWorker
*/
public void doScan() throws ScannerException {
Folder folder = null;
Store store = null;
***************
*** 206,212 ****
* @param message the message to be tested against the current
* set of filters
* @return boolean true if the message matches any of the
* current filters
! * @see Message ScannerWorker
*/
private boolean matchMessage(Message m) throws javax.mail.MessagingException {
--- 203,213 ----
* @param message the message to be tested against the current
* set of filters
+ *
* @return boolean true if the message matches any of the
* current filters
! *
! * @throws MessagingException
! *
! * @see Message
*/
private boolean matchMessage(Message m) throws javax.mail.MessagingException {
***************
*** 216,220 ****
boolean subjectMatch = false;
! // Check for a match in the recipients
Address[] from = m.getFrom();
for (int j = 0; j < from.length; j++) {
--- 217,221 ----
boolean subjectMatch = false;
! // Check for a match in the senders
Address[] from = m.getFrom();
for (int j = 0; j < from.length; j++) {
***************
*** 244,247 ****
--- 245,249 ----
}
+ // Check for a match in the subject
if (getLog().isDebugEnabled()) {
getLog().logDebug("Testing " + m.getSubject().toString() + " against " + getFilter(SUBJECT_FILTER));
***************
*** 287,291 ****
/**
! * release the held resource. Do nothing - no held resources.
*/
public void relinquishResources() {
--- 289,293 ----
/**
! * Release held resources. Do nothing - no held resources.
*/
public void relinquishResources() {
***************
*** 300,306 ****
* @return StringBuffer with content of the message
*
! * @throws Exception
*/
! private StringBuffer getMailContent(Part part) throws Exception {
// Code donated by Hans Benedict.
BufferedReader reader =
--- 302,308 ----
* @return StringBuffer with content of the message
*
! * @throws IOException, MessagingException
*/
! private StringBuffer getMailContent(Part part) throws java.io.IOException, javax.mail.MessagingException {
// Code donated by Hans Benedict.
BufferedReader reader =
***************
*** 310,314 ****
while ((line = reader.readLine()) != null) {
- //System.out.println( "appending: "+line);
result.append(line).append("\n");
}
--- 312,315 ----
***************
*** 323,340 ****
* @param message
*
! * @throws MessagingException DOCUMENT ME!
*/
! private void deleteMessage(Message message) throws MessagingException {
message.setFlag(Flags.Flag.DELETED, true);
}
/**
! * DOCUMENT ME!
*
* @param message
*
! * @throws Exception DOCUMENT ME!
*/
! private void processMessage(Message message) throws Exception {
//process as multipart
if (message.getContent() instanceof Multipart) {
--- 324,343 ----
* @param message
*
! * @throws MessagingException
*/
! private void deleteMessage(Message message) throws javax.mail.MessagingException {
message.setFlag(Flags.Flag.DELETED, true);
}
/**
! * Place the specified message in a queue.
! * <p>
! * Multipart messages need to be handled slightly differently.
*
* @param message
*
! * @throws IOException, MessagingException
*/
! private void processMessage(Message message) throws java.io.IOException, javax.mail.MessagingException {
//process as multipart
if (message.getContent() instanceof Multipart) {
***************
*** 346,358 ****
/**
! * DOCUMENT ME!
*
* @param multipart
* @param originalMessage DOCUMENT ME!
*
! * @throws Exception DOCUMENT ME!
*/
private void processMultipart(Multipart multipart, Message originalMessage)
! throws Exception {
int numberOfParts = multipart.getCount();
--- 349,365 ----
/**
! * Processes multiparts of a multipart message.
! * <p>
! * This method is recursive, unravelling the (possibly) nested multiparts
! * of a message. Each multipart is broken down into its constituent parts
! * which are enqueued, before the entire multipart is enqueued.
*
* @param multipart
* @param originalMessage DOCUMENT ME!
*
! * @throws IOException, MessagingException
*/
private void processMultipart(Multipart multipart, Message originalMessage)
! throws java.io.IOException, javax.mail.MessagingException {
int numberOfParts = multipart.getCount();
***************
*** 366,370 ****
originalMessage);
}
!
processPart(part, originalMessage);
}
--- 373,377 ----
originalMessage);
}
! // Should this be here, or in the else portion of the above if statement?
processPart(part, originalMessage);
}
***************
*** 372,384 ****
/**
! * This method is used for processing message part
*
! * @param part
! * @param originalMessage DOCUMENT ME!
*
! * @throws Exception DOCUMENT ME!
*/
private void processPart(Part part, Message originalMessage)
! throws Exception {
String disposition = part.getDisposition();
String path = protocol + "://" + username + "@" + host + "/" + folder_;
--- 379,393 ----
/**
! * This method is used for processing a message part.
! * <p>
! * This method processes a part, either a base part, or multipart.
*
! * @param part Part of message to process
! * @param originalMessage Reference to original message for certain properties
*
! * @throws IOException, MessagingException
*/
private void processPart(Part part, Message originalMessage)
! throws java.io.IOException, javax.mail.MessagingException {
String disposition = part.getDisposition();
String path = protocol + "://" + username + "@" + host + "/" + folder_;
***************
*** 392,398 ****
attrs.put(SCAN_FROM_KEY, originalMessage.getFrom());
attrs.put(SCAN_REPLYTO_KEY, originalMessage.getReplyTo());
!
! //attrs.put("to" , originalMessage.getAllRecipients());
! //attrs.put(SCAN_TO_KEY, originalMessage.getSubject());
if (disposition == null) {
--- 401,405 ----
attrs.put(SCAN_FROM_KEY, originalMessage.getFrom());
attrs.put(SCAN_REPLYTO_KEY, originalMessage.getReplyTo());
! //attrs.put(SCAN_TO_KEY , originalMessage.getAllRecipients());
if (disposition == null) {
***************
*** 408,412 ****
//store all attributes
! //TODO: This should be done more clever then this
attrs.put("contentType", "text/plain");
attrs.put(ScannerWorker.FILE_NAME_KEY, originalMessage.getSubject());
--- 415,419 ----
//store all attributes
! //TODO: This should be done more clever than this
attrs.put("contentType", "text/plain");
attrs.put(ScannerWorker.FILE_NAME_KEY, originalMessage.getSubject());
|
|
From: <mic...@us...> - 2003-12-04 00:44:46
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx
In directory sc8-pr-cvs1:/tmp/cvs-serv11279/src/com/babeldoc/scanner/jmx
Modified Files:
ScannerService.java ScannerServiceMBean.java
Log Message:
Mailbox scanner updated to correctly use the filtering capabilities provided
by the superclass.
Scanner classes updated to cater for upgraded jmx scanner.
Build.xml updated to correct the project name and exclude the jboss-service.xml
file, as it's now included in the .sarfile built at the top level.
Index: ScannerService.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx/ScannerService.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ScannerService.java 27 Jun 2003 14:00:15 -0000 1.5
--- ScannerService.java 4 Dec 2003 00:44:42 -0000 1.6
***************
*** 66,76 ****
package com.babeldoc.scanner.jmx;
import com.babeldoc.scanner.Scanner;
/**
* MBean service support for jboss. Start up the scanner
- */
- /**
* MBean implementor - this is for embedding the scanner into a mbean container
* like jboss or weblogic, etc, etc. Generally a good idea, the only problem
--- 66,77 ----
package com.babeldoc.scanner.jmx;
+ import com.babeldoc.core.LogService;
import com.babeldoc.scanner.Scanner;
+ import java.net.URL;
+
/**
* MBean service support for jboss. Start up the scanner
* MBean implementor - this is for embedding the scanner into a mbean container
* like jboss or weblogic, etc, etc. Generally a good idea, the only problem
***************
*** 81,88 ****
*/
public class ScannerService implements ScannerServiceMBean {
! Scanner scanner = null;
! // Property
! private String configUrl;
/**
--- 82,95 ----
*/
public class ScannerService implements ScannerServiceMBean {
! private static LogService log =
! LogService.getInstance(ScannerService.class.getName());
! public static final int STATE_STOPPED = 0;
! public static final int STATE_STARTED = 1;
! public static final String stateDescriptions[] = new String[] {"scanner.002", "scanner.001"};
! int state = 0;
! Scanner scanner = null;
! // Property
! private String configUrl;
/**
***************
*** 94,126 ****
*/
public void setConfigUrl(String configUrl) throws Exception {
! this.configUrl = configUrl;
! System.out.println("setConfigUrl: " + configUrl);
}
/**
! * Start the service mbean
*
! * @return DOCUMENT ME!
*
! * @throws Exception DOCUMENT ME!
*/
public String getConfigUrl() throws Exception {
! System.out.println("getConfigUrl: " + configUrl);
! return this.configUrl;
}
/**
! * Start the service mbean
*
! * @throws Exception DOCUMENT ME!
*/
! public void start() throws Exception {
! scanner = new Scanner(new String[] { });
!
! //TODO: Double check this since it maybe won't work... Did anyone used this anyway???
! scanner.start();
! System.out.println(com.babeldoc.core.I18n.get("scanner.001"));
}
/**
--- 101,199 ----
*/
public void setConfigUrl(String configUrl) throws Exception {
! this.configUrl = configUrl;
! getLog().logDebug("setConfigUrl: " + configUrl);
}
/**
! * Get the configUrl setting
*
! * @return configUrl DOCUMENT ME!
*
! * @throws Exception
*/
public String getConfigUrl() throws Exception {
! getLog().logDebug("getConfigUrl: " + configUrl);
! return this.configUrl;
! }
!
! /**
! * Set the babeldoc home
! *
! * @param babeldoc.home The babeldoc home directory
! *
! * @throws Exception
! */
! public void setBabeldocHome(String home) throws Exception {
! System.setProperty("babeldoc.home", home);
! getLog().logDebug("setBabeldocHome: " + home);
! }
!
! /**
! * Get the babeldoc home
! *
! * @return babeldoc.home The babeldoc home directory
! *
! * @throws Exception
! */
! public String getBabeldocHome() throws Exception {
! String home = System.getProperty("babeldoc.home");
! getLog().logDebug("getBabeldocHome: " + home);
! return (home);
! }
!
! public void setBabeldocUserHome(String home) throws Exception {
! System.setProperty("babeldoc.user", home);
! getLog().logDebug("setBabeldocUserHome: " + home);
! }
!
! public String getBabeldocUserHome() throws Exception {
! String home = System.getProperty("babeldoc.user");
! getLog().logDebug("getBabeldocUserHome: " + home);
! return (home);
}
+
/**
! * Get the state string
*
! * @return StateString The string describing the current state
! *
! * @throws Exception
*/
! public String getStateString() throws Exception {
! getLog().logDebug("getStateString: " + com.babeldoc.core.I18n.get(stateDescriptions[state]));
! return (com.babeldoc.core.I18n.get(stateDescriptions[state]));
}
+
+ /**
+ * Start the service mbean
+ *
+ * @throws Exception DOCUMENT ME!
+ */
+ public void start() throws Exception {
+
+ /* This section determines what the usual babeldoc.home will be for a standard
+ * JBoss system. This will be ignored by other J2EE application containers,
+ * but we should probably look at putting good defaults in for them too.
+ */
+ String babeldocHome = System.getProperty("jboss.server.config.url");
+ if ((babeldocHome != null) && (babeldocHome.length() > 0)) {
+ // This assumes that jboss.server.conf.url will always be a file://
+ // Not sure if babeldoc can handle a non-file home directory, e.g. ftp://
+ URL urlHome = new URL(babeldocHome);
+ setBabeldocHome(urlHome.getFile());
+ setBabeldocUserHome(urlHome.getFile());
+ }
+
+ scanner = new Scanner(new String[] { });
+
+ //TODO: Double check this since it maybe won't work... Did anyone used this anyway???
+ // MCA: I checked, it works.
+ // TODO: Remove this and above comments before 1.3 release.
+ scanner.start();
+ state = ScannerService.STATE_STARTED;
+ getLog().logDebug(com.babeldoc.core.I18n.get(stateDescriptions[state]));
+ }
/**
***************
*** 130,135 ****
*/
public void stop() throws Exception {
! scanner.stop();
! System.out.println(com.babeldoc.core.I18n.get("scanner.002"));
}
! }
--- 203,232 ----
*/
public void stop() throws Exception {
! if (scanner == null) {
! state = ScannerService.STATE_STOPPED;
! }
! if (state != ScannerService.STATE_STOPPED) {
! scanner.stop();
! scanner.finishUp();
! }
! state = ScannerService.STATE_STOPPED;
! getLog().logDebug(com.babeldoc.core.I18n.get(stateDescriptions[state]));
}
!
! public static LogService getLog() {
! return log;
! }
!
! public static void setLog(LogService log) {
! ScannerService.log = log;
! }
!
! public void refreshConfig() throws Exception {
! if (state == ScannerService.STATE_STOPPED) {
! getLog().logDebug("Refreshing scanner configuration");
! scanner.refreshConfig();
! } else {
! throw new Exception("Invalid state for operation");
! }
! }
! }
\ No newline at end of file
Index: ScannerServiceMBean.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx/ScannerServiceMBean.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScannerServiceMBean.java 27 Jun 2003 14:00:15 -0000 1.3
--- ScannerServiceMBean.java 4 Dec 2003 00:44:42 -0000 1.4
***************
*** 92,95 ****
--- 92,105 ----
public String getConfigUrl() throws Exception;
+ public void setBabeldocHome(String home) throws Exception;
+
+ public String getBabeldocHome() throws Exception;
+
+ public void setBabeldocUserHome(String home) throws Exception;
+
+ public String getBabeldocUserHome() throws Exception;
+
+ public String getStateString() throws Exception;
+
/**
* TODO: DOCUMENT ME!
***************
*** 105,107 ****
--- 115,124 ----
*/
public void stop() throws Exception;
+
+ /**
+ * TODO: DOCUMENT ME!
+ *
+ * @throws Exception DOCUMENT ME!
+ */
+ public void refreshConfig() throws Exception;
}
|
|
From: <mic...@us...> - 2003-12-04 00:44:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv11279/src/com/babeldoc/scanner/gui
Modified Files:
ScannerMonitorFrame.java
Log Message:
Mailbox scanner updated to correctly use the filtering capabilities provided
by the superclass.
Scanner classes updated to cater for upgraded jmx scanner.
Build.xml updated to correct the project name and exclude the jboss-service.xml
file, as it's now included in the .sarfile built at the top level.
Index: ScannerMonitorFrame.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/gui/ScannerMonitorFrame.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ScannerMonitorFrame.java 14 Aug 2003 02:34:20 -0000 1.7
--- ScannerMonitorFrame.java 4 Dec 2003 00:44:42 -0000 1.8
***************
*** 409,413 ****
int returned = fileDialog.showOpenDialog(this);
! if (returned == fileDialog.APPROVE_OPTION) {
if (fileDialog.getSelectedFile().exists()) {
optionEditor.setText(fileDialog.getSelectedFile().getPath());
--- 409,413 ----
int returned = fileDialog.showOpenDialog(this);
! if (returned == JFileChooser.APPROVE_OPTION) {
if (fileDialog.getSelectedFile().exists()) {
optionEditor.setText(fileDialog.getSelectedFile().getPath());
***************
*** 624,632 ****
//handle files and dirs
if (optionInfo.getType().equals(IConfigOptionType.DIRECTORY)) {
! fileDialog.setFileSelectionMode(fileDialog.DIRECTORIES_ONLY);
btnFileOpen.setVisible(true);
lblOptionEditor.setText("Choose directory:");
} else if (optionInfo.getType().equals(IConfigOptionType.FILENAME)) {
! fileDialog.setFileSelectionMode(fileDialog.FILES_ONLY);
btnFileOpen.setVisible(true);
lblOptionEditor.setText("Choose file:");
--- 624,632 ----
//handle files and dirs
if (optionInfo.getType().equals(IConfigOptionType.DIRECTORY)) {
! fileDialog.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
btnFileOpen.setVisible(true);
lblOptionEditor.setText("Choose directory:");
} else if (optionInfo.getType().equals(IConfigOptionType.FILENAME)) {
! fileDialog.setFileSelectionMode(JFileChooser.FILES_ONLY);
btnFileOpen.setVisible(true);
lblOptionEditor.setText("Choose file:");
|
|
From: <mic...@us...> - 2003-12-04 00:44:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner
In directory sc8-pr-cvs1:/tmp/cvs-serv11279/src/com/babeldoc/scanner
Modified Files:
Scanner.java ScannerFactory.java
Log Message:
Mailbox scanner updated to correctly use the filtering capabilities provided
by the superclass.
Scanner classes updated to cater for upgraded jmx scanner.
Build.xml updated to correct the project name and exclude the jboss-service.xml
file, as it's now included in the .sarfile built at the top level.
Index: Scanner.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/Scanner.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** Scanner.java 30 Sep 2003 14:30:47 -0000 1.30
--- Scanner.java 4 Dec 2003 00:44:42 -0000 1.31
***************
*** 96,101 ****
private ScannerWorkerScheduler scheduler;
public static final String SCANNER_FEEDER = "scanner";
! public String scannerConfig;
/**
--- 96,107 ----
private ScannerWorkerScheduler scheduler;
+ public static final int STATE_STOPPED = 0;
+ public static final int STATE_STARTED = 1;
+ public static final String stateDescriptions[] = new String[] {"scanner.002", "scanner.001"};
+
public static final String SCANNER_FEEDER = "scanner";
! private String scannerConfig;
!
! private int status = STATE_STOPPED;
/**
***************
*** 114,120 ****
*/
public void execute(CommandLine commandLine) {
- //super.execute(commandLine);
- // otherwise, continue with normal execution path
if (commandLine.hasOption('s')) {
scannerConfig = commandLine.getOptionValue('s');
--- 120,124 ----
***************
*** 217,223 ****
public void start() throws ScannerException {
factory = ScannerFactory.getInstance(scannerConfig);
- // log.logInfo("Starting feeder...");
- // feeder = new AsynchronousFeeder(queue);
try {
setFeeder(FeederFactory.getInstance().getFeeder(SCANNER_FEEDER));
--- 221,225 ----
***************
*** 242,246 ****
e);
sw[i].stop();
- //stop();
}
}
--- 244,247 ----
***************
*** 249,252 ****
--- 250,254 ----
stop();
}
+ status = Scanner.STATE_STARTED;
}
***************
*** 277,282 ****
getLog().logInfo("Stopping feeder");
}
!
!
}
--- 279,283 ----
getLog().logInfo("Stopping feeder");
}
! status = Scanner.STATE_STOPPED;
}
***************
*** 340,343 ****
--- 341,352 ----
public void setFeeder(IFeeder feeder) {
this.feeder = feeder;
+ }
+
+ public void refreshConfig() {
+ log.logInfo("Refreshing configuration");
+ log.logInfo("Status: " + I18n.get(stateDescriptions[status]));
+ if (status == Scanner.STATE_STOPPED) {
+ factory.flushConfig();
+ }
}
}
Index: ScannerFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/ScannerFactory.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ScannerFactory.java 17 Sep 2003 21:58:58 -0000 1.11
--- ScannerFactory.java 4 Dec 2003 00:44:42 -0000 1.12
***************
*** 71,74 ****
--- 71,75 ----
import java.util.HashMap;
+ import com.babeldoc.core.config.ConfigService;
import com.babeldoc.core.I18n;
import com.babeldoc.core.LogService;
***************
*** 106,111 ****
*/
private ScannerFactory(String scannerConfigName) {
! log.logDebug("Creating ScannerFactory for scanner configuration " +
! scannerConfigName);
//load worker configuration
--- 107,111 ----
*/
private ScannerFactory(String scannerConfigName) {
! log.logDebug("Creating ScannerFactory for scanner configuration " + scannerConfigName);
//load worker configuration
***************
*** 253,256 ****
--- 253,269 ----
}
}
+ }
+
+ public void flushConfig() {
+ factories.clear();
+ ConfigService.clearCache();
+ /* Iterator i = factories.keySet().iterator();
+ while (i.hasNext()) {
+ String removal = (String) i.next();
+ log.logInfo("Flushing " + removal);
+ factories.remove(removal);
+ ConfigService.clearCache(removal);
+ }
+ */
}
}
|
|
From: <mic...@us...> - 2003-12-04 00:44:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/config In directory sc8-pr-cvs1:/tmp/cvs-serv11279/config Added Files: jboss-service.xml Log Message: Mailbox scanner updated to correctly use the filtering capabilities provided by the superclass. Scanner classes updated to cater for upgraded jmx scanner. Build.xml updated to correct the project name and exclude the jboss-service.xml file, as it's now included in the .sarfile built at the top level. |
|
From: <mic...@us...> - 2003-12-04 00:44:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner
In directory sc8-pr-cvs1:/tmp/cvs-serv11279
Modified Files:
build.xml
Log Message:
Mailbox scanner updated to correctly use the filtering capabilities provided
by the superclass.
Scanner classes updated to cater for upgraded jmx scanner.
Build.xml updated to correct the project name and exclude the jboss-service.xml
file, as it's now included in the .sarfile built at the top level.
Index: build.xml
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/build.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** build.xml 11 Jun 2003 11:03:20 -0000 1.10
--- build.xml 4 Dec 2003 00:44:42 -0000 1.11
***************
*** 1,3 ****
! <project name="sql" basedir="." default="setup">
<property file="build.properties"/>
--- 1,3 ----
! <project name="scanner" basedir="." default="setup">
<property file="build.properties"/>
***************
*** 57,61 ****
<jar
jarfile="${base_dir}/build/lib/${Jarfile}"
! basedir="${module_path}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
--- 57,63 ----
<jar
jarfile="${base_dir}/build/lib/${Jarfile}"
! basedir="${module_path}"
! compress="false"
! excludes="**/jboss-service.xml">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
|
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports
In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports
Added Files:
build.xml build.properties
Log Message:
Initial commit after moving to modules directory
--- NEW FILE: build.xml ---
<project name="jfreereports" basedir="." default="setup">
<property file="build.properties"/>
<property name="module_name" value="babeldoc_${Module}"/>
<property name="module_path" value="${build}"/>
<property name="base_dir" value="${basedir}"/>
<target
name="setup">
<mkdir dir="./build"/>
<mkdir dir="./build/lib"/>
<mkdir dir="./build/examples"/>
<mkdir dir="./build/readme"/>
<mkdir dir="./build/support"/>
</target>
<target
name="clean">
<echo message="Cleaning ${Module}"/>
<delete dir="${build}"/>
</target>
<target
name="build">
<echo message="${build.compiler}"/>
<available file="./build" type="dir" property="setup.done"/>
<fail message="Setup has not been run - run 'build setup' first" unless="setup.done"/>
<echo message="Building ${Module}"/>
<mkdir dir="${module_path}"/>
<javac
destdir="${module_path}"
srcdir="./src"
deprecation="${compile.deprecation}"
debug="${compile.debug}">
<classpath>
<fileset dir="${base_dir}/build/lib">
<include name="*"/>
</fileset>
<fileset dir="${babeldoc_home}/build/lib">
<include name="*"/>
</fileset>
<pathelement location="${babeldoc_home}/support/ant/lib/junit.jar"/>
</classpath>
</javac>
<!-- Copy the configuration files to build/jfreereports/... -->
<mkdir dir="${module_path}/${Module}"/>
<copy toDir="${module_path}/${Module}">
<fileset dir="config">
<include name="*/**"/>
</fileset>
</copy>
<!-- copy over the services file -->
<mkdir dir="${module_path}/META-INF/services"/>
<copy toDir="${module_path}/META-INF/services">
<fileset dir="services"/>
</copy>
<jar
jarfile="${base_dir}/build/lib/${Jarfile}"
basedir="${module_path}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<section name="Babeldoc">
<attribute name="Module" value="${Module}"/>
<attribute name="Depends" value="${Depends}"/>
<attribute name="ModuleClass" value="${ModuleClass}"/>
</section>
</manifest>
</jar>
<copy toDir="${base_dir}/build">
<fileset dir=".">
<include name="examples/**"/>
<include name="lib/**"/>
</fileset>
</copy>
</target>
<target
name="deploy">
<echo message="Deploying ${Module}"/>
</target>
<target
name="test">
<echo message="Testing ${Module}"/>
</target>
<target name="format">
<echo message="Formatting ${Module}"/>
<echo message="NOT! uncomment to make it work"/>
<!--
uncomment to test it
remove destdir attribute when you are happy with the result
<jalopy fileformat="${jalopy.fileformat}"
convention="${jalopy.convention}"
history="${jalopy.history}"
loglevel="${jalopy.loglevel}"
threads="${jalopy.threads}">
<fileset dir="./src">
<include name="**/*.java" />
</fileset>
</jalopy>
-->
</target>
</project>
--- NEW FILE: build.properties ---
Module=jfreereports
Depends=core,scanner
Jarfile=babeldoc_jfreereports.jar
ModuleClass=com.babeldoc.jfreereports.module.JFRModule
src = ./src
config = ./config
modules = ./modules
docs = ./docs
lib = ./lib
build = ./build
support = ./support
babeldoc_home=../../Babeldoc/
#
# Build settings
build.compiler=modern
compile.debug=on
compile.deprecation=on
#
# Jalopy properties
jalopy.convention= ./support/jalopy/babeldocconvention.xml
jalopy.fileformat = unix
jalopy.history = none
jalopy.loglevel = WARN
jalopy.threads = 1
|
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports/config/i18n
In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/config/i18n
Added Files:
messages.properties
Log Message:
Initial commit after moving to modules directory
--- NEW FILE: messages.properties ---
# com.babeldoc.jfreereports.pipeline.stage.JFRPipelineStage
# Stage and property descriptions
jfr.001=Stage to produce a report from a data document
jfr.002=The report definition
jfr.003=URL of the report definition
jfr.004=Type of output
#Some error messages
jfr.101=Invalid data document mime type
jfr.102=Invalid report definition URL
jfr.103=IO exception when retrieving report definition from URL
jfr.104=Error loading data type {0}
jfr.105=Invalid content base URL
jfr.106=Invalid report definition
jfr.107=Invalid data document
jfr.108=I/O error writing temp file
|
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports/services In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/services Added Files: com.babeldoc.core.module.BabeldocModule Log Message: Initial commit after moving to modules directory --- NEW FILE: com.babeldoc.core.module.BabeldocModule --- com.babeldoc.jfreereports.module.JFRModule |
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage Added Files: JFRPipelineStage.java Log Message: Initial commit after moving to modules directory --- NEW FILE: JFRPipelineStage.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/pipeline/stage/JFRPipelineStage.java,v 1.1 2003/12/03 18:54:06 michaelansley Exp $ * $DateTime$ * $Author: michaelansley $ * */ package com.babeldoc.jfreereports.pipeline.stage; import com.babeldoc.core.I18n; import com.babeldoc.core.LogService; import com.babeldoc.core.NameValuePair; import com.babeldoc.core.option.ComplexConfigOptionType; import com.babeldoc.core.option.ConfigOption; import com.babeldoc.core.option.IConfigOptionType; import com.babeldoc.core.pipeline.PipelineDocument; import com.babeldoc.core.pipeline.PipelineException; import com.babeldoc.core.pipeline.PipelineStage; import com.babeldoc.core.pipeline.PipelineStageInfo; import com.babeldoc.core.pipeline.PipelineStageResult; import com.babeldoc.core.resource.IResource; import com.babeldoc.core.resource.ResourceException; import com.babeldoc.core.resource.ResourceFactory; import com.babeldoc.utils.XMLTableModel; import java.io.BufferedInputStream; import java.io.IOException; import java.io.File; import java.io.FileWriter; import java.io.StringWriter; import java.lang.reflect.Constructor; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.io.FileInputStream; import java.io.InputStream; import java.io.StringReader; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.Node; import org.dom4j.dom.DOMDocument; import org.jfree.report.JFreeReport; import org.jfree.report.ReportProcessingException; import org.jfree.report.modules.parser.base.ReportGenerator; import org.jfree.report.modules.output.pageable.pdf.PDFReportUtil; import org.jfree.report.modules.output.table.csv.CSVReportUtil; import org.jfree.report.modules.output.table.html.HTMLReportUtil; import org.jfree.report.modules.output.table.rtf.RTFReportUtil; import org.xml.sax.InputSource; /** * Make a JFreeReport from SqlQuery output. * * @author michaelansley * @version 1.0 **/ public class JFRPipelineStage extends PipelineStage { private static LogService log = LogService.getInstance(JFRPipelineStage.class.getName()); /** constant: mime type for XML */ public static final String XML_MIME_TYPE = "text/xml"; /** constant: Report definition attribute/config property */ public final static String REPORT_DEF = "reportDefinition"; /** constant: Report definition URL attribute/config property */ public final static String REPORT_DEF_URL = "reportDefinitionUrl"; /** constant: Report output type property */ public final static String REPORT_OUTPUT_FORMAT = "reportOutputFormat"; /** constant: Report output type HTML */ public final static int OUTPUT_FORMAT_HTML = 0; /** constant: Report output type PDF */ public final static int OUTPUT_FORMAT_PDF = 1; /** constant: Report output type CSV */ public final static int OUTPUT_FORMAT_CSV = 2; /** constant: Report output type Excel */ public final static int OUTPUT_FORMAT_XLS = 3; /** constant: Report output type Rich Text Format */ public final static int OUTPUT_FORMAT_RTF = 4; /** instance: Counter for unique file numbers */ private static int tempFileCount = 0; /** * Construct the stage information for this stage * */ public JFRPipelineStage() { super(new PipelineStageInfo() { public String getName() { return "JFreeReport"; } public String getDescription() { return I18n.get("jfr.001"); } public Collection getTypeSpecificOptions() { ArrayList options = new ArrayList(); options.add(new ConfigOption(REPORT_DEF, IConfigOptionType.URL, null, true, I18n.get("jfr.002"))); options.add(new ConfigOption(REPORT_DEF_URL, IConfigOptionType.URL, null, true, I18n.get("jfr.003"))); options.add(new ConfigOption(REPORT_OUTPUT_FORMAT, IConfigOptionType.URL, null, true, I18n.get("jfr.004"))); return options; } }); } /* (non-Javadoc) * @see com.babeldoc.core.pipeline.PipelineStage#process() */ public PipelineStageResult[] process() throws PipelineException { if (getDocument().getMimeType() != XML_MIME_TYPE) { throw new PipelineException(I18n.get("jfr.101")); } // Find the report definition String xmlReportDefinition = getReportDefinition(); JFreeReport report = null; String outputFile = null; try { log.logDebug("Get the table model"); TableModel tm = getTableModel(); log.logDebug("Create a report with the correct definition"); log.logDebug(xmlReportDefinition); StringReader reader = new StringReader (xmlReportDefinition); URL contentBaseURL = new URL ("file:///"); report = ReportGenerator.getInstance().parseReport(new InputSource(reader), contentBaseURL); log.logDebug("Set the data for the report"); report.setData(tm); log.logDebug("Get the required output type"); int outputFormat = getOutputFormat(); outputFile = getTempFilename(); log.logDebug("Generate the report output"); switch (outputFormat) { case OUTPUT_FORMAT_PDF: { PDFReportUtil.createPDF(report, outputFile); break; } case OUTPUT_FORMAT_HTML: { try { HTMLReportUtil.createStreamHTML(report, outputFile); } catch (org.jfree.report.function.FunctionInitializeException e1) { log.logError(e1); } catch (java.io.IOException e2) { log.logError(e2); } catch (org.jfree.report.ReportProcessingException e3) { log.logError(e3); } break; } case OUTPUT_FORMAT_CSV: { try { CSVReportUtil.createCSV(report, outputFile); } catch (org.jfree.report.function.FunctionInitializeException e1) { log.logError(e1); } catch (java.io.IOException e2) { log.logError(e2); } catch (org.jfree.report.ReportProcessingException e3) { log.logError(e3); } break; } case OUTPUT_FORMAT_RTF: { try { RTFReportUtil.createRTF(report, outputFile); } catch (org.jfree.report.function.FunctionInitializeException e1) { log.logError(e1); } catch (java.io.IOException e2) { log.logError(e2); } catch (org.jfree.report.ReportProcessingException e3) { log.logError(e3); } break; } default: { try { HTMLReportUtil.createStreamHTML(report, outputFile); } catch (org.jfree.report.function.FunctionInitializeException e1) { log.logError(e1); } catch (java.io.IOException e2) { log.logError(e2); } catch (org.jfree.report.ReportProcessingException e3) { log.logError(e3); } break; } } } catch (java.net.MalformedURLException e1) { // From new URL() log.logError(e1); throw new PipelineException(I18n.get("jfr.105"), e1); } catch (org.jfree.xml.ElementDefinitionException e2) { // From parseReport() log.logError(e2); throw new PipelineException(I18n.get("jfr.106"), e2); } catch (DocumentException e3) { // From getTableModel() log.logError(e3); throw new PipelineException(I18n.get("jfr.107"), e3); } log.logDebug("Create the pipeline document from the temp file"); PipelineDocument newDocument = null; if (outputFile != null && !(outputFile.equals(""))) { try { byte[] data = getBytesFromFile(new File(outputFile)); newDocument = new PipelineDocument(this.getDocument(), data); newDocument.setBinary(true); newDocument.setMimeType("application/pdf"); new File(outputFile).delete(); } catch (java.io.IOException e) { log.logError(e); throw new PipelineException(I18n.get("jfr.108"), e); } } return super.processHelper(newDocument); } /** * Find the report definition. First search the document attributes for a * report definition, then a report definition URL. Then check the pipeline * stage. * * @return String The report definition * @throws ResourceException Any exceptions encountered are converted to * ResourceException * */ private String getReportDefinition() throws PipelineException { String xmlReportDefinition; String strReportDefinitionUrl; // Try to get the report definition directly from the document attributes xmlReportDefinition = (String) getDocument().get(REPORT_DEF); // If unsuccessful, then try for a report definition URL from the document attributes if (xmlReportDefinition == null) { log.logDebug("No report definition document attribute, trying for URL document attribute"); strReportDefinitionUrl = (String) getDocument().get(REPORT_DEF_URL); if (strReportDefinitionUrl != null) { log.logDebug("Report definition URL found in document attribute"); URL urlReportDefinitionUrl; try { xmlReportDefinition = getStringFromFile(new File(strReportDefinitionUrl)); } catch (IOException e) { throw new PipelineException(I18n.get("jfr.103"), e); } } else { log.logDebug("Report definition URL not found in document attribute"); } } else { log.logDebug("Report definition found in document attribute"); } // If still unsuccessful, then try the stage definition for a report definition if (xmlReportDefinition == null) { log.logDebug("Trying for report definition in stage option"); xmlReportDefinition = (String) this.getInfo().getOption(REPORT_DEF).getValue(); } // Otherwise a report definition URL from the stage definition if (xmlReportDefinition == null) { log.logDebug("Try for report definition URL in stage options"); strReportDefinitionUrl = (String) this.getInfo().getOption(REPORT_DEF_URL).getValue(); if (strReportDefinitionUrl != null) { URL urlReportDefinitionUrl; try { log.logDebug("Report definition URL found in stage options"); xmlReportDefinition = getStringFromFile(new File(strReportDefinitionUrl)); } catch (java.net.MalformedURLException e) { throw new PipelineException(I18n.get("jfr.102"), e); } catch (IOException e) { throw new PipelineException(I18n.get("jfr.103"), e); } } } else { log.logDebug("Report definition found in stage options"); } return (xmlReportDefinition); } private TableModel getTableModel() throws DocumentException { Document doc; XMLTableModel tm = new XMLTableModel(); try { doc = DocumentHelper.parseText(new String(getDocument().getBytes())); } catch (DocumentException e) { LogService.getInstance().logError(e); return (tm); } tm.setDocument(doc, "/queryresults/query"); return (tm); } // Returns the contents of the file in a byte array. public byte[] getBytesFromFile(File file) throws IOException { InputStream is = new FileInputStream(file); // Get the size of the file long length = file.length(); log.logInfo("File size: " + length); // You cannot create an array using a long type. // It needs to be an int type. // Before converting to an int type, check // to ensure that file is not larger than Integer.MAX_VALUE. if (length > Integer.MAX_VALUE) { // File is too large } // Create the byte array to hold the data byte[] bytes = new byte[(int)length]; // Read in the bytes int offset = 0; int numRead = 0; while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } // Ensure all the bytes have been read in if (offset < bytes.length) { throw new IOException("Could not completely read file "+file.getName()); } // Close the input stream and return bytes is.close(); return bytes; } private String getTempFilename() { return (System.getProperty("java.io.tmpdir") + "/tempfile" + getFileCounter()); } private String getStringFromFile(File file) throws java.io.IOException { String s = null; try { BufferedInputStream in = new BufferedInputStream(new FileInputStream(file)); byte[] b = new byte[in.available()]; in.read(b, 0, b.length); s = new String(b, 0, b.length); in.close(); } catch (java.io.FileNotFoundException e1) { s = ""; } return (s); } private synchronized int getFileCounter() { return (++tempFileCount); } private int getOutputFormat() { int result = OUTPUT_FORMAT_PDF; String strReportOutputFormat = (String) getDocument().get(REPORT_OUTPUT_FORMAT); if ((strReportOutputFormat == null) || (strReportOutputFormat.equals(""))) { strReportOutputFormat = (String) this.getInfo().getOption(REPORT_OUTPUT_FORMAT).getValue(); } if (strReportOutputFormat == null) {strReportOutputFormat = ""; } if (strReportOutputFormat.equals("pdf")) { result = OUTPUT_FORMAT_PDF; } else if (strReportOutputFormat.equals("html")) { result = OUTPUT_FORMAT_HTML; } else if (strReportOutputFormat.equals("csv")) { result = OUTPUT_FORMAT_CSV; } else if (strReportOutputFormat.equals("xls")) { result = OUTPUT_FORMAT_XLS; } else if (strReportOutputFormat.equals("rtf")) { result = OUTPUT_FORMAT_RTF; } else { result = OUTPUT_FORMAT_HTML; } return (result); } } |
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/utils In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/src/com/babeldoc/utils Added Files: XMLTableModel.java XMLTableModelTest.java Log Message: Initial commit after moving to modules directory --- NEW FILE: XMLTableModel.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/utils/XMLTableModel.java,v 1.1 2003/12/03 18:54:05 michaelansley Exp $ * $DateTime$ * $Author: michaelansley $ * */ package com.babeldoc.utils; import com.babeldoc.core.LogService; import com.babeldoc.core.I18n; import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.Map; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; import javax.xml.transform.TransformerException; import org.apache.xpath.objects.XNumber; import org.apache.xpath.XPathAPI; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.dom4j.io.DOMWriter; import org.dom4j.DocumentException; /** * A class to provide an AbstractTableModel implementation for data held in * XML format. * * @author mikea * */ public class XMLTableModel extends AbstractTableModel implements TableModel { /** static: log service */ private static LogService log = LogService.getInstance(XMLTableModel.class.getName()); /** constant: document mime type */ public static final String XML_MIME_TYPE = "text/xml"; /** instance: root path for data */ public String QUERY_RESULTS = ""; /** instance: element identifier for rows */ public String ROW = "row"; /** constant: element identifier for row numbers, * TODO: should be configurable by the user */ public static final String ROW_NUMBER = "row-number"; /** instance: element identifier for columns */ public String COLUMN = "column"; /** constant: element identifier for column names, * TODO: should be configurable by the user */ public static final String COLUMN_NAME = "column-name"; /** constant: element identifier for column numbers, * TODO: should be configurable by the user */ public static final String COLUMN_NUMBER = "column-number"; /** constant: element identifier for column class identifiers, * TODO: should be configurable by the user */ public static final String COLUMN_CLASS = "column-class"; /** constant: the default column class identifier */ public static final String DEFAULT_CLASS_NAME = "java.lang.String"; /** constant: the default column class */ public static final Class DEFAULT_CLASS = java.lang.String.class; /** instance: the data */ private Document xmlData; /** instance: cache of the column count */ private int columnCount = -1; /** instance: cache of the row count */ private int rowCount = -1; /** instance: cache of the column classes */ private Class[] columnClasses; /** instance: cache of the column names */ private String[] columnNames; /** instance: cache of the column ordinal positions keyed on name */ private Map columnNumbers = new HashMap(); /** * The default constructor * */ public XMLTableModel() { xmlData = null; } /** * Constructor with data document and root path to data * * @param data the data document * @param rootPath the string representation of the path to the * data within the document * */ public XMLTableModel(org.dom4j.Document data, String rootPath) throws org.dom4j.DocumentException { QUERY_RESULTS = rootPath; xmlData = transformToDOM(data); columnClasses = new Class[getColumnCount()]; columnNames = new String[getColumnCount()]; } /** * Set the data document and clear the cached information * * @param info */ public void setDocument(org.dom4j.Document doc, String rootPath) throws org.dom4j.DocumentException { QUERY_RESULTS = rootPath; xmlData = transformToDOM(doc); columnCount = -1; rowCount = -1; columnClasses = new Class[getColumnCount()]; columnNames = new String[getColumnCount()]; columnNumbers = new HashMap(); } /* (non-Javadoc) * @see javax.swing.table.TableModel#getColumnCount() */ public int getColumnCount() { if (xmlData == null) return (0); if (columnCount >= 0) return (columnCount); // This is the xpath for the count of columns in the first row String xpath = "count(" + QUERY_RESULTS + "/" + ROW + "[@row-number=\"0\"]/" + COLUMN + ")"; XNumber n; try { n = (XNumber) XPathAPI.eval(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return (-1); } columnCount = new Double(n.num()).intValue(); return (columnCount); } /* (non-Javadoc) * @see javax.swing.table.TableModel#getRowCount() */ public int getRowCount() { if (xmlData == null) return (0); if (rowCount >= 0) return (rowCount); // This is the xpath for the count of columns in the first row String xpath = "count(" + QUERY_RESULTS + "/" + ROW + ")"; XNumber n; try { n = (XNumber) XPathAPI.eval(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return (-1); } // Get the result value from the node and cache rowCount = new Double(n.num()).intValue(); return (rowCount); } /* (non-Javadoc) * @see javax.swing.table.TableModel#getValueAt(int, int) */ public Object getValueAt(int rowIndex, int columnIndex) { if (xmlData == null) return (null); // This is the xpath for a cell in an XML data document from the SqlQuery // pipeline stage String xpath = QUERY_RESULTS + "/" + ROW + "[@" + ROW_NUMBER + "=\"" + rowIndex + "\"]/" + COLUMN + "[@" + COLUMN_NUMBER + "=\"" + (columnIndex + 1) + "\"]"; Node n; try { n = XPathAPI.selectSingleNode(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return null; } NamedNodeMap attrs = n.getAttributes(); String className = attrs.getNamedItem(COLUMN_CLASS).getNodeValue(); if (className == null || className.equals("")) { className = DEFAULT_CLASS_NAME; } Object v; try { Class c = Class.forName(className); Constructor cons = c.getConstructor(new Class[] {String.class}); if (n.getFirstChild() == null) { v = null; } else { v = cons.newInstance(new Object[] {n.getFirstChild().getNodeValue()}); } } catch (Exception e) { log.logWarn(e.getMessage()); v = new String("[" + I18n.get("jfr.104", className) + "]"); } return v; } /** * Convert the document to w3c format * * @param info */ private org.w3c.dom.Document transformToDOM(org.dom4j.Document doc) throws DocumentException { DOMWriter writer = new DOMWriter(); return writer.write(doc); } /** * Returns the class of the column specified * * @param columnIndex the column being queried * @return the Object.class, or null if the position is not valid */ public Class getColumnClass(int columnIndex) { if ((columnIndex < 0) || (columnIndex >= columnClasses.length)) return (null); // Invalid index Class c = columnClasses[columnIndex]; if (c == null) { if (xmlData == null) return (null); // This is the xpath for a cell in an XML data document from the SqlQuery // pipeline stage String xpath = QUERY_RESULTS + "/" + ROW + "[@row-number=\"0\"]/" + COLUMN + "[@" + COLUMN_NUMBER + "=\"" + (columnIndex + 1) + "\"]"; Node n; try { n = XPathAPI.selectSingleNode(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return null; } if (n == null) return (null); // Column position not found NamedNodeMap attrs = n.getAttributes(); String className = attrs.getNamedItem(COLUMN_CLASS).getNodeValue(); if (className == null || className.equals("")) { className = DEFAULT_CLASS_NAME; } try { c = Class.forName(className); } catch (ClassNotFoundException e) { log.logWarn(e.getMessage()); c = DEFAULT_CLASS; } columnClasses[columnIndex] = c; } return (c); } /** * Returns the column name for the column index specified * * @param column the column being queried * @return a string containing the name of <code>column</code> or * an empty string if not found */ public String getColumnName(int column) { String name; if ((column < 0) || (column >= columnNames.length)) return (""); // Invalid index name = columnNames[column]; if (name == null) { if (xmlData == null) return (null); // This is the xpath for a cell in an XML data document from the SqlQuery // pipeline stage String xpath = QUERY_RESULTS + "/" + ROW + "[@row-number=\"0\"]/" + COLUMN + "[@" + COLUMN_NUMBER + "=\"" + (column + 1) + "\"]"; Node n; try { n = XPathAPI.selectSingleNode(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return null; } if (n == null) return (""); // Column position not found NamedNodeMap attrs = n.getAttributes(); name = attrs.getNamedItem(COLUMN_NAME).getNodeValue(); columnNames[column] = name; } return (name); } /** * Returns a column index given its name. * * @param columnName string containing name of column to be located * @return the column with <code>columnName</code>, or -1 if not found */ public int findColumn(String columnName) { if (xmlData == null) return (-1); Integer columnNumber = (Integer) columnNumbers.get(columnName); if (columnNumber == null) { // This is the xpath for the count of columns in the first row String xpath = QUERY_RESULTS + "/" + ROW + "[@row-number=\"0\"]/" + COLUMN + "[@" + COLUMN_NAME + "=\"" + columnName + "\"]"; Node n; try { n = XPathAPI.selectSingleNode(xmlData, xpath); } catch (TransformerException e) { log.logError(e); return -1; } if (n == null) return (-1); // Column name not found NamedNodeMap attrs = n.getAttributes(); columnNumber = new Integer(attrs.getNamedItem(COLUMN_NUMBER).getNodeValue()); columnNumbers.put(columnName, columnNumber); } return (columnNumber.intValue() - 1); } public String getColumnID() { return COLUMN; } public void setColumnID(String column) { COLUMN = column; } public String getRowID() { return ROW; } public void setRowID(String row) { ROW = row; } } --- NEW FILE: XMLTableModelTest.java --- /* * Created on 28-Nov-2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package com.babeldoc.utils; import junit.framework.TestCase; import org.dom4j.Document; import org.dom4j.DocumentHelper; /** * @author mikea * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class XMLTableModelTest extends TestCase { private XMLTableModelTest() { String strDoc = new String("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<queryresults>" + " <query query-name=\"query1\" query-number=\"0\">" + " <row row-number=\"0\">" + " <column column-name=\"quiz\" column-number=\"1\" column-class=\"java.lang.String\">Yes</column>" + " <column column-name=\"company_name\" column-number=\"2\" column-class=\"java.lang.String\">Peter Abel</column>" + " <column column-name=\"last_name\" column-number=\"3\" column-class=\"java.lang.String\">Abel</column>" + " <column column-name=\"first_name\" column-number=\"4\" column-class=\"java.lang.String\">Peter</column>" + " <column column-name=\"main_phone\" column-number=\"5\" column-class=\"java.lang.String\">(888)555-8188</column>" + " <column column-name=\"fk_seminar_code\" column-number=\"6\" column-class=\"java.lang.String\">001</column>" + " <column column-name=\"seminar_tmpl_name\" column-number=\"7\" column-class=\"java.lang.String\">Annual Update</column>" + " <column column-name=\"start_date\" column-number=\"8\" column-class=\"java.lang.String\">11/17/1999</column>" + " <column column-name=\"hotel_place\" column-number=\"9\" column-class=\"java.lang.String\">Corte, CA</column>" + " <column column-name=\"amount_paid\" column-number=\"10\" column-class=\"java.math.BigDecimal\">200.000000</column>" + " <column column-name=\"id_booking\" column-number=\"11\" column-class=\"java.lang.Integer\">65703</column>" + " <column column-name=\"shipping_address\" column-number=\"12\" column-class=\"java.lang.String\"></column>" + " <column column-name=\"city\" column-number=\"13\" column-class=\"java.lang.String\">Oakland</column>" + " <column column-name=\"attended\" column-number=\"14\" column-class=\"java.lang.String\">No</column>" + " </row>" + " <row row-number=\"1\">" + " <column column-name=\"quiz\" column-number=\"1\" column-class=\"java.lang.String\">Yes</column>" + " <column column-name=\"company_name\" column-number=\"2\" column-class=\"java.lang.String\">David Bartley</column>" + " <column column-name=\"last_name\" column-number=\"3\" column-class=\"java.lang.String\">Bartley</column>" + " <column column-name=\"first_name\" column-number=\"4\" column-class=\"java.lang.String\">David</column>" + " <column column-name=\"main_phone\" column-number=\"5\" column-class=\"java.lang.String\">(888)555-7703</column>" + " <column column-name=\"fk_seminar_code\" column-number=\"6\" column-class=\"java.lang.String\">001</column>" + " <column column-name=\"seminar_tmpl_name\" column-number=\"7\" column-class=\"java.lang.String\">Annual Update</column>" + " <column column-name=\"start_date\" column-number=\"8\" column-class=\"java.lang.String\">11/18/1999</column>" + " <column column-name=\"hotel_place\" column-number=\"9\" column-class=\"java.lang.String\">Corte, CA</column>" + " <column column-name=\"amount_paid\" column-number=\"10\" column-class=\"java.math.BigDecimal\">165.000000</column>" + " <column column-name=\"id_booking\" column-number=\"11\" column-class=\"java.lang.Integer\">50989</column>" + " <column column-name=\"shipping_address\" column-number=\"12\" column-class=\"java.lang.String\"></column>" + " <column column-name=\"city\" column-number=\"13\" column-class=\"java.lang.String\">Novato</column>" + " <column column-name=\"attended\" column-number=\"14\" column-class=\"java.lang.String\">Yes</column>" + " </row>" + " </query>" + "</queryresults>" ); Document doc; XMLTableModel tm; try { doc = DocumentHelper.parseText(strDoc); tm = new XMLTableModel(doc, "/queryresults/query"); // Column and row counts System.out.println("Column count: " + tm.getColumnCount()); System.out.println("Row count: " + tm.getRowCount()); // Column names and ordinals for (int i = 0; i < tm.getColumnCount(); i++) { String name = tm.getColumnName(i); System.out.println("Position: " + i + ", Name: " + name + ", Ordinal: " + tm.findColumn(name) + ", Class: " + tm.getColumnClass(i).getName()); } // Find a non-existent column name System.out.println(tm.findColumn("XXX")); // Find a non-existent column position System.out.println(tm.getColumnName(15)); // Find a non-existent column class System.out.println(tm.getColumnClass(15)); // getValueAt for (int row = 0; row < tm.getRowCount(); row++) { for (int col = 0; col < tm.getColumnCount(); col++) { String name = tm.getColumnName(col); Object o = tm.getValueAt(row, col); String value; if (o == null) { value = "null"; } else { value = o.toString(); } System.out.println("Row: " + row + ", Column: " + name + ", Value: " + value); } } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { System.getProperties().list(System.out); XMLTableModelTest test = new XMLTableModelTest(); } } |
Update of /cvsroot/babeldoc/modules/jfreereports/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/lib Added Files: gnujaxp.jar itext-1.00.jar jfreereport-0.8.4_4-all.jar poi-2.0-pre3-20030728.jar bsh-1.2b6.jar jcommon-0.8.5.jar pixie-0.8.0.jar Log Message: Initial commit after moving to modules directory --- NEW FILE: gnujaxp.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: itext-1.00.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jfreereport-0.8.4_4-all.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: poi-2.0-pre3-20030728.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsh-1.2b6.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jcommon-0.8.5.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: pixie-0.8.0.jar --- (This appears to be a binary file; contents omitted.) |
|
From: <mic...@us...> - 2003-12-03 18:54:10
|
Update of /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/module In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/src/com/babeldoc/jfreereports/module Added Files: JFRModule.java Log Message: Initial commit after moving to modules directory --- NEW FILE: JFRModule.java --- /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header: /cvsroot/babeldoc/modules/jfreereports/src/com/babeldoc/jfreereports/module/JFRModule.java,v 1.1 2003/12/03 18:54:05 michaelansley Exp $ * $DateTime$ * $Author: michaelansley $ * */ package com.babeldoc.jfreereports.module; import com.babeldoc.core.module.BabeldocModule; import java.util.HashSet; import java.util.Set; /** * This is the jfreereports module - it doesn't do very much except support the dependsOn. * * @author MCA * @version 1.0 */ public class JFRModule extends BabeldocModule { public static final String MODULE = "jfreereports"; /** * jfreereports module only depends on core * * @return */ public Set getDependsOn() { Set set = new HashSet(); set.add("core"); set.add("scanner"); return set; } /** * The Name of the module is jfreereports * * @return */ public String getName() { return MODULE; } } |
|
From: <mic...@us...> - 2003-12-03 18:54:09
|
Update of /cvsroot/babeldoc/modules/jfreereports/config/service In directory sc8-pr-cvs1:/tmp/cvs-serv28497/jfreereports/config/service Added Files: query.properties Log Message: Initial commit after moving to modules directory --- NEW FILE: query.properties --- PipelineStage.JFreeReport=com.babeldoc.jfreereports.pipeline.stage.JFRPipelineStage |
|
From: Michael A. <mic...@ze...> - 2003-12-03 18:00:37
|
Hi, That's exactly what I've done: create a branch tag for 1.2 maintenance, and left 1.3 development on the head. I noticed that there is a 1.3 revision tag, but I think it's spurious. I think we can probably get rid of it. Anybody using it? Anyway, branching the maintenance and leaving development on the HEAD seems to be standard practice. CVS does require you to create a revision tag at the base of a branch, so that the branch can be merged with other branches, which I've done (it's the V1-2_Root revision tag). So, I think we're all set for 1.3, although we can rename the tags if necessary later. Hope the conference is going well. I haven't been to Belgium yet; guess I should find a conference there sometime and get myself over ;-) Cheers... MikeA On Wed, 2003-12-03 at 13:06, Bruce McDonald wrote: > I think that we should stick with this convention - it makes sense. > > On Wednesday 03 December 2003 05:51 am, Dejan Krsmanovic wrote: > > Great Mike! > > We had established some naming convention for braches > > and tags but I cannot remember now (I am in Belgium > > right now on Java Polis conference!). We can rename it > > later. > > When we had released 1.0, we created maintanance > > branch for 1.0 and development was on HEAD. I am not > > sure if we should perform the same rules now. What do > > you (and others) think? > > > > Dejan > > > > --- Michael Ansley <mic...@ze...> wrote: > > > All, > > > > > > I've created a branch for maintenance of 1.2. The > > > branch tag is V1-2, > > > the branch root tag is V1-2_Root. > > > > > > Please make sure that if you fix and commit > > > something in the 1.2 branch > > > that somebody merges the changes to the HEAD. > > > Otherwise we'll get > > > regression problems. If you're not sure, let me > > > know. > > > > > > Any other issues, please let me know. > > > > > > Cheers... > > > > > > > > > MikeA > > > > ------------------------------------------------------- > > > > > This SF.net email is sponsored by: SF.net Giveback > > > Program. > > > Does SourceForge.net help you be more productive? > > > Does it > > > help you create better code? SHARE THE LOVE, and > > > help us help > > > YOU! Click Here: http://sourceforge.net/donate/ > > > _______________________________________________ > > > Babeldoc-devel mailing list > > > Bab...@li... > > > > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel > > > > > > __________________________________ > > Do you Yahoo!? > > Free Pop-Up Blocker - Get it now > > http://companion.yahoo.com/ > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Babeldoc-devel mailing list > > Bab...@li... > > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Bruce M. <br...@mc...> - 2003-12-03 13:06:24
|
I think that we should stick with this convention - it makes sense. On Wednesday 03 December 2003 05:51 am, Dejan Krsmanovic wrote: > Great Mike! > We had established some naming convention for braches > and tags but I cannot remember now (I am in Belgium > right now on Java Polis conference!). We can rename it > later. > When we had released 1.0, we created maintanance > branch for 1.0 and development was on HEAD. I am not > sure if we should perform the same rules now. What do > you (and others) think? > > Dejan > > --- Michael Ansley <mic...@ze...> wrote: > > All, > > > > I've created a branch for maintenance of 1.2. The > > branch tag is V1-2, > > the branch root tag is V1-2_Root. > > > > Please make sure that if you fix and commit > > something in the 1.2 branch > > that somebody merges the changes to the HEAD. > > Otherwise we'll get > > regression problems. If you're not sure, let me > > know. > > > > Any other issues, please let me know. > > > > Cheers... > > > > > > MikeA > > ------------------------------------------------------- > > > This SF.net email is sponsored by: SF.net Giveback > > Program. > > Does SourceForge.net help you be more productive? > > Does it > > help you create better code? SHARE THE LOVE, and > > help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Babeldoc-devel mailing list > > Bab...@li... > > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel > > > __________________________________ > Do you Yahoo!? > Free Pop-Up Blocker - Get it now > http://companion.yahoo.com/ > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |