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: McDonald, B. <Bru...@ba...> - 2003-07-31 15:40:58
|
Ok, Thanks
This does look good. I propose that we move to this library for all our synchonization needs. What do you all say to this?
regards,
Bruce.
-----Original Message-----
From: Ken Geis [mailto:kg...@ga...]
Sent: Thursday, July 31, 2003 2:28 AM
To: bab...@li...
Subject: [Babeldoc-devel] Re: Babeldoc-devel digest, Vol 1 #156 - 2 msgs
From the page:
PooledExecutor
A tunable, extensible thread pool class
Last year, I looked at Commons Threadpool and went with util.concurrent
to do what I needed.
bab...@li... wrote:
> From: Bruce McDonald <br...@mc...>
> Subject: Re: [Babeldoc-devel] Commons sandbox components
>
> Ken,
>
> I have looked at this in the past (this even used to be part of the babeldoc
> distribution in the pre-1.0 days). There are some very usefull classes in
> here. I don't however see a thread pool implementation. It looks like it
> will be easy to fashion one out of the multiplicity of classes in that
> package, but, time is not on my side here...
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Babeldoc-devel mailing list
Bab...@li...
https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
|
|
From: Ken G. <kg...@ga...> - 2003-07-31 06:28:17
|
From the page:
PooledExecutor
A tunable, extensible thread pool class
Last year, I looked at Commons Threadpool and went with util.concurrent
to do what I needed.
bab...@li... wrote:
> From: Bruce McDonald <br...@mc...>
> Subject: Re: [Babeldoc-devel] Commons sandbox components
>
> Ken,
>
> I have looked at this in the past (this even used to be part of the babeldoc
> distribution in the pre-1.0 days). There are some very usefull classes in
> here. I don't however see a thread pool implementation. It looks like it
> will be easy to fashion one out of the multiplicity of classes in that
> package, but, time is not on my side here...
|
|
From: Bill H. <Bil...@Ac...> - 2003-07-31 04:32:24
|
I'm having what looks to me like a configuration problem: I'm using Babeldoc 1.0, tomcat 4.1.24. I'm doing this on my personal machine for testing. The log entries for Tomcat are: 2003-07-22 17:56:38 HostConfig[localhost]: Deploying web application directory babeldoc-console 2003-07-22 17:56:38 StandardHost[localhost]: Installing web application at context path /babeldoc- console from URL file:C:\jakarta-tomcat-4.1.24\webapps\babeldoc-console 2003-07-22 17:56:38 WebappLoader[/babeldoc-console]: Deploying class repositories to work directory C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\babeldoc-console 2003-07-22 17:56:38 StandardManager[/babeldoc-console]: Seeding random number generator class java.security.SecureRandom 2003-07-22 17:56:38 StandardManager[/babeldoc-console]: Seeding of random number generator has been completed 2003-07-22 17:56:40 StandardWrapper[/babeldoc-console:default]: Loading container servlet default 2003-07-22 17:56:40 StandardWrapper[/babeldoc-console:invoker]: Loading container servlet invoker 2003-07-22 17:58:49 StandardWrapper[/manager:HTMLManager]: Loading container servlet HTMLManager 2003-07-22 17:58:49 HTMLManager: init: Associated with Deployer 'localhost' 2003-07-22 17:58:49 HTMLManager: init: Global resources are available 2003-07-22 17:58:49 HTMLManager: list: Listing contexts for virtual host 'localhost' Which all seem okay. There is also a velocity log indicating that velocity has started successfully. When I reference the url: http://localhost/babeldoc-console/servlet/Console the response returned is: <html><body></body></html> So, the servlet is serving, but I must have something wrong in the configuration somewhere. When I reference localhost/babeldoc-console/index.html the response is: <html> <head> </head> <frameset cols="100,*"> <frame name="navigation" src="navigation.vm" noresize frameborder=0> <frame name="main" src="main.vm" noresize frameborder=0> </frameset> <body></body> </html> but the screen is blank. When i reference localhost/babeldoc-console/navigation.vm the response is: <html><body></body></html> When I reference localhost/babeldoc-console/main.vm the response is the same. I am suspecting a velocity set-up problem, but don't know where to start looking, as the web.xml file has the mapping: <servlet-mapping> <servlet-name>ConsoleServlet</servlet-name> <url-pattern>*.vm</url-pattern> </servlet-mapping> Which seems to indicate to me that the console servlet is processing the velocity files. The web.xml file seems to reference a <init-param>: <init-param> <param-name>properties</param-name> <param-value>/velocity.properties</param-value> </init-param> I found this file in the babeldoc-console directory but all it has in it is: file.resource.loader.path = . runtime.log = velocity.log beyond that I'm searching... not sure what to look at next. Thanks for any help. Bill On 24 Jul 2003 at 11:57, McDonald, Bruce wrote: > Bill, is there any logging that you can can find? > > What version of babeldoc and tomcat are you using? > > What is your url? > > regards, > Bruce. > > PS. Please post through the mailing list. > > -----Original Message----- > From: Bill Harrelson [mailto:Bil...@ac...] > Sent: Wednesday, July 23, 2003 8:28 PM > To: McDonald, Bruce > Subject: Babeldoc console configuration. > > > Bruce, > > I don't seem to be having much luck getting babeldoc to work under > Tomcat, and I wondered if you could point me to any configuration > information? > > I've read through the .bat file, and made what seem to be the > appropriate modifications, and I get a log indicating that velocity > has started, and the Tomcat manager says that the babeldoc-console > servlet is started, but the console servlet just serves a blank page. > > Is there any documentation or tips anywhere on how to approach this? > > Thanks, > > Bill > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_ > 01/01 _______________________________________________ Babeldoc- devel > mailing list Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel -- William B. Harrelson President Accordare 13A Medford Street, Suite 4 Arlington, MA 02474 t:781-646-2241 f:781-459-8347 c:617-335-0702 Bil...@Ac... ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click- url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel ------- End of forwarded message --------- William B. Harrelson President Accordare 13A Medford Street, Arlington, MA 02474 t:781-646-2241 f:781-646-2242 Bil...@Ac... |
|
From: Bruce M. <br...@mc...> - 2003-07-31 02:11:52
|
Ken, I have looked at this in the past (this even used to be part of the babeldoc distribution in the pre-1.0 days). There are some very usefull classes in here. I don't however see a thread pool implementation. It looks like it will be easy to fashion one out of the multiplicity of classes in that package, but, time is not on my side here... regards, Bruce. On Wednesday 30 July 2003 08:07 pm, Ken Geis wrote: > I noticed that Jakarta Commons Threadpool was added to Babeldoc to > handle the feeders. I'm concerned about using libraries that are > "sandbox" code. I would recommend using Doug Lea's util.concurrent > library. I think that Commons Threadpool is not so popular because of > the existence and quality of this library. > > http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro. >html > > > Ken > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Ken G. <kg...@ga...> - 2003-07-31 00:08:12
|
I noticed that Jakarta Commons Threadpool was added to Babeldoc to handle the feeders. I'm concerned about using libraries that are "sandbox" code. I would recommend using Doug Lea's util.concurrent library. I think that Commons Threadpool is not so popular because of the existence and quality of this library. http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html Ken |
|
From: <tr...@us...> - 2003-07-30 23:25:09
|
Update of /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/digester
In directory sc8-pr-cvs1:/tmp/cvs-serv23796
Modified Files:
DigesterConversionUnmarshaller.java
Log Message:
Bad imports, etc fixed.
Index: DigesterConversionUnmarshaller.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/digester/DigesterConversionUnmarshaller.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DigesterConversionUnmarshaller.java 27 Jun 2003 01:44:07 -0000 1.5
--- DigesterConversionUnmarshaller.java 30 Jul 2003 23:14:05 -0000 1.6
***************
*** 66,74 ****
package com.babeldoc.conversion.digester;
- import com.babeldoc.conversion.ConversionUnmarshaller;
- import com.babeldoc.conversion.FieldData;
- import com.babeldoc.conversion.LineSegmentData;
-
import com.babeldoc.core.I18n;
import org.apache.commons.digester.Digester;
--- 66,73 ----
package com.babeldoc.conversion.digester;
import com.babeldoc.core.I18n;
+ import com.babeldoc.conversion.flatfile.FieldData;
+ import com.babeldoc.conversion.flatfile.LineSegmentData;
+ import com.babeldoc.conversion.flatfile.ConversionUnmarshaller;
import org.apache.commons.digester.Digester;
***************
*** 94,101 ****
* @version 1.0
*/
! public class DigesterConversionUnmarshaller implements ConversionUnmarshaller {
private Conversion conversion;
! private FieldData[] fields = null;
! private LineSegmentData[] lineSegments = null;
public static final String DEFAULT_CSV_SEPARATOR = ",";
public static final String DEFAULT_LINE_SEPARATOR = "\n";
--- 93,100 ----
* @version 1.0
*/
! public class DigesterConversionUnmarshaller implements com.babeldoc.conversion.flatfile.ConversionUnmarshaller {
private Conversion conversion;
! private com.babeldoc.conversion.flatfile.FieldData[] fields = null;
! private com.babeldoc.conversion.flatfile.LineSegmentData[] lineSegments = null;
public static final String DEFAULT_CSV_SEPARATOR = ",";
public static final String DEFAULT_LINE_SEPARATOR = "\n";
***************
*** 225,236 ****
lineSegments[i] = new LineSegmentData();
! LineSegment inLineSegment = ((LineSegment) (conversion.getLineSegments()
! .get(i)));
lineSegments[i].name = inLineSegment.getSegmentName();
lineSegments[i].value = inLineSegment.getSegmentValue();
! lineSegments[i].column = NumberUtils.stringToInt(inLineSegment.getSegmentColumn(),
! 0);
! lineSegments[i].width = NumberUtils.stringToInt(inLineSegment.getSegmentWidth(),
! 0);
lineSegments[i].endGroup = inLineSegment.getEndGroupName();
lineSegments[i].startGroup = inLineSegment.getBeginGroupName();
--- 224,232 ----
lineSegments[i] = new LineSegmentData();
! LineSegment inLineSegment = ((LineSegment) (conversion.getLineSegments().get(i)));
lineSegments[i].name = inLineSegment.getSegmentName();
lineSegments[i].value = inLineSegment.getSegmentValue();
! lineSegments[i].column = NumberUtils.stringToInt(inLineSegment.getSegmentColumn(), 0);
! lineSegments[i].width = NumberUtils.stringToInt(inLineSegment.getSegmentWidth(), 0);
lineSegments[i].endGroup = inLineSegment.getEndGroupName();
lineSegments[i].startGroup = inLineSegment.getBeginGroupName();
|
|
From: <tr...@us...> - 2003-07-30 23:24:11
|
Update of /cvsroot/babeldoc/babeldoc/readme/userguide In directory sc8-pr-cvs1:/tmp/cvs-serv25501/userguide Modified Files: chapter1.xml Log Message: Some small changes. Index: chapter1.xml =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/readme/userguide/chapter1.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** chapter1.xml 24 Feb 2003 22:50:26 -0000 1.1.1.1 --- chapter1.xml 30 Jul 2003 23:24:06 -0000 1.2 *************** *** 11,16 **** <para>Babeldoc can be used to process documents which are flowing in and out of a system. There are three basic ways to develope applications to handle these document flows:</para> <orderedlist> ! <listitem>Hand-coded standalone applications have the benefit of simplicity. These applications can have be slow (java start-up times are significant) and also inflexible, hard to maintain, hard to track errors and can result in fragile systems. Also such systems are very non-portable.</listitem> ! <listitem>Hand-coded Rmi servers applications better than (1) in terms of performance but can be hard to administer and control (you have to do this yourself).</listitem> <listitem>Server based processes - this is better in manageability and terms of scaleability but could be overkill for simple situations.</listitem> </orderedlist> --- 11,16 ---- <para>Babeldoc can be used to process documents which are flowing in and out of a system. There are three basic ways to develope applications to handle these document flows:</para> <orderedlist> ! <listitem>Hand-coded standalone applications have the benefit of simplicity. These applications can have be slow (java start-up times are significant) and also inflexible, hard to maintain, difficult to track errors and can result in fragile systems. Also such systems could be non-portable in that they make assumptions about their environments.</listitem> ! <listitem>Hand-coded Rmi (or similar protocol based) servers applications better than (1) in terms of performance but can be hard to administer and control (you have to do this yourself).</listitem> <listitem>Server based processes - this is better in manageability and terms of scaleability but could be overkill for simple situations.</listitem> </orderedlist> *************** *** 41,45 **** <firstterm>Scanner</firstterm>: A standalone application to monitor resources (disks, FTP sites) and when a file is found, make a document and introduce the document to the specified pipeline. This is a powerful tool and can be made to perform some intricate tasks.</listitem> <listitem> ! <firstterm>Feeder</firstterm>: A standalone application that introduces a document into a pipeline.</listitem> </orderedlist> </section> --- 41,47 ---- <firstterm>Scanner</firstterm>: A standalone application to monitor resources (disks, FTP sites) and when a file is found, make a document and introduce the document to the specified pipeline. This is a powerful tool and can be made to perform some intricate tasks.</listitem> <listitem> ! <firstterm>Feeder (1)</firstterm>: A standalone application that introduces a document into a pipeline.</listitem> ! <listitem> ! <firstterm>Feeder (2)</firstterm>: An internal babeldoc processing component that governs how documents are fed to pipelines.</listitem> </orderedlist> </section> |
|
From: <tr...@us...> - 2003-07-30 23:17:43
|
Update of /cvsroot/babeldoc/babeldoc
In directory sc8-pr-cvs1:/tmp/cvs-serv24412
Modified Files:
build.properties build.xml
Log Message:
Updated version number, updated the distribution build targets.
Index: build.properties
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/build.properties,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** build.properties 16 Jul 2003 22:45:25 -0000 1.12
--- build.properties 30 Jul 2003 23:17:29 -0000 1.13
***************
*** 1,4 ****
src = ./src
! babeldoc_version = 1.1.3-dev
config = ./config
modules = ./modules
--- 1,4 ----
src = ./src
! babeldoc_version = 1.1.5-dev
config = ./config
modules = ./modules
Index: build.xml
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/build.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** build.xml 27 Jun 2003 00:14:55 -0000 1.13
--- build.xml 30 Jul 2003 23:17:30 -0000 1.14
***************
*** 12,22 ****
<target
name="dist_src"
! description="Build the source distribution package">
! <zip destfile="babeldoc-src-${babeldoc_version}.zip">
! <zipfileset dir="modules" prefix="babeldoc-src-${babeldoc_version}/modules"/>
! <zipfileset dir="support" prefix="babeldoc-src-${babeldoc_version}/support"/>
! <zipfileset dir="readme" prefix="babeldoc-src-${babeldoc_version}/readme"/>
! <zipfileset dir="." includes="*.txt" prefix="babeldoc-src-${babeldoc_version}"/>
! <zipfileset dir="." includes="build.*" prefix="babeldoc-src-${babeldoc_version}"/>
</zip>
</target>
--- 12,25 ----
<target
name="dist_src"
! description="Build the source distribution package"
! depends="clean">
!
! <property name="src_zip_file" value="babeldoc-src-${babeldoc_version}"/>
! <zip destfile="${src_zip_file}.zip">
! <zipfileset dir="modules" prefix="${src_zip_file}/modules"/>
! <zipfileset dir="support" prefix="${src_zip_file}/support"/>
! <zipfileset dir="readme" prefix="${src_zip_file}/readme"/>
! <zipfileset dir="." includes="quickstart*.txt" prefix="${src_zip_file}"/>
! <zipfileset dir="." includes="build.*" prefix="${src_zip_file}"/>
</zip>
</target>
***************
*** 28,39 ****
name="dist_bin"
description="Build the binary distribution package"
! depends="build">
! <zip destfile="babeldoc-bin-${babeldoc_version}.zip">
! <zipfileset dir="." includes="*.txt" prefix="babeldoc-bin-${babeldoc_version}"/>
! <zipfileset dir="readme" prefix="babeldoc-bin-${babeldoc_version}/readme"/>
! <zipfileset dir="build" includes="**/*" prefix="babeldoc-bin-${babeldoc_version}"/>
</zip>
</target>
<!--
--- 31,48 ----
name="dist_bin"
description="Build the binary distribution package"
! depends="setup,build">
! <property name="bin_zip_file" value="babeldoc-bin-${babeldoc_version}"/>
! <zip destfile="${bin_zip_file}.zip">
! <zipfileset dir="." includes="quickstart*.txt" prefix="${bin_zip_file}"/>
! <zipfileset dir="readme" prefix="${bin_zip_file}/readme"/>
! <zipfileset dir="build" includes="**/*" prefix="${bin_zip_file}"/>
</zip>
</target>
+
+ <target
+ name="dist"
+ description="build the src and bin distribution packages"
+ depends="dist_src,dist_bin"/>
<!--
|
|
From: McDonald, B. <Bru...@ba...> - 2003-07-30 23:14:18
|
Can you post fix to 1.0? I will do 1.1 tonight. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Wednesday, July 30, 2003 4:54 PM To: McDonald, Bruce; bab...@li... Subject: AW: [Babeldoc-devel] Ignored Stage stops the pipeline Very fast support, thanks. This bug is also in 1.0. Stefan -----Urspr=FCngliche Nachricht----- Von: McDonald, Bruce [mailto:Bru...@ba...] Gesendet: Mittwoch, 30. Juli 2003 22:18 An: Stefan Krieger; bab...@li... Betreff: RE: [Babeldoc-devel] Ignored Stage stops the pipeline I have found the error in the 1.1 codebase... see the class: com.babeldoc.core.pipeline.PipelineStage.java Line 597: Change: this.processIgnored(); to: psResults =3D this.processIgnored(); The results got ignored and this meant that babeldoc thought that this ignored pipeline stage was the last stage in the system. regards, Bruce. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Wednesday, July 30, 2003 4:06 PM To: bab...@li... Subject: [Babeldoc-devel] Ignored Stage stops the pipeline I have set the option "ignored" for a stage in my pipline to "true". Unfortunately, this does not result in skipping the step. The whole pipline seems to terminate but without an exception. The journal status says "ignored" for the stage but all following stages ar= e skipped. Am I doing something wrong or is this a bug ? Stefan ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: <tr...@us...> - 2003-07-30 22:49:00
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv18408/com/babeldoc/core/pipeline/stage
Modified Files:
DomifyPipelineStage.java
Log Message:
Fixed bug with ignored stages stopping the pipeline processing and the missing DOM_KEY on the DomifyPipelineStage
Index: DomifyPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/DomifyPipelineStage.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DomifyPipelineStage.java 25 Jul 2003 13:21:26 -0000 1.13
--- DomifyPipelineStage.java 30 Jul 2003 22:48:57 -0000 1.14
***************
*** 105,108 ****
--- 105,110 ----
*/
public class DomifyPipelineStage extends PipelineStage {
+ public static final String DOM_KEY = "dom";
+
//Options
public static final String VALIDATE = "validate";
|
|
From: <tr...@us...> - 2003-07-30 22:49:00
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline
In directory sc8-pr-cvs1:/tmp/cvs-serv18408/com/babeldoc/core/pipeline
Modified Files:
PipelineStage.java
Log Message:
Fixed bug with ignored stages stopping the pipeline processing and the missing DOM_KEY on the DomifyPipelineStage
Index: PipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineStage.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** PipelineStage.java 17 Jul 2003 00:22:10 -0000 1.16
--- PipelineStage.java 30 Jul 2003 22:48:57 -0000 1.17
***************
*** 595,599 ****
} else {
//stage is ignored. Ignore it!
! this.processIgnored();
this.updateJournalStatus(JournalStatus.IGNORED);
}
--- 595,599 ----
} else {
//stage is ignored. Ignore it!
! psResults = this.processIgnored();
this.updateJournalStatus(JournalStatus.IGNORED);
}
***************
*** 707,712 ****
* @return the array of results
*
! * @throws PipelineException DOCUMENT ME!
! * @throws JournalException DOCUMENT ME!
*/
protected PipelineStageResult[] processHelper(String[] results)
--- 707,712 ----
* @return the array of results
*
! * @throws PipelineException
! * @throws JournalException
*/
protected PipelineStageResult[] processHelper(String[] results)
|
|
From: Stefan K. <ste...@co...> - 2003-07-30 20:56:04
|
Very fast support, thanks. This bug is also in 1.0. Stefan -----Ursprüngliche Nachricht----- Von: McDonald, Bruce [mailto:Bru...@ba...] Gesendet: Mittwoch, 30. Juli 2003 22:18 An: Stefan Krieger; bab...@li... Betreff: RE: [Babeldoc-devel] Ignored Stage stops the pipeline I have found the error in the 1.1 codebase... see the class: com.babeldoc.core.pipeline.PipelineStage.java Line 597: Change: this.processIgnored(); to: psResults = this.processIgnored(); The results got ignored and this meant that babeldoc thought that this ignored pipeline stage was the last stage in the system. regards, Bruce. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Wednesday, July 30, 2003 4:06 PM To: bab...@li... Subject: [Babeldoc-devel] Ignored Stage stops the pipeline I have set the option "ignored" for a stage in my pipline to "true". Unfortunately, this does not result in skipping the step. The whole pipline seems to terminate but without an exception. The journal status says "ignored" for the stage but all following stages are skipped. Am I doing something wrong or is this a bug ? Stefan ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: McDonald, B. <Bru...@ba...> - 2003-07-30 20:20:18
|
I have found the error in the 1.1 codebase... see the class: com.babeldoc.core.pipeline.PipelineStage.java Line 597: Change: this.processIgnored(); to: psResults = this.processIgnored(); The results got ignored and this meant that babeldoc thought that this ignored pipeline stage was the last stage in the system. regards, Bruce. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Wednesday, July 30, 2003 4:06 PM To: bab...@li... Subject: [Babeldoc-devel] Ignored Stage stops the pipeline I have set the option "ignored" for a stage in my pipline to "true". Unfortunately, this does not result in skipping the step. The whole pipline seems to terminate but without an exception. The journal status says "ignored" for the stage but all following stages are skipped. Am I doing something wrong or is this a bug ? Stefan ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: McDonald, B. <Bru...@ba...> - 2003-07-30 20:15:33
|
This sounds like a bug - but this is a strange bug. Are you using babeldoc 1.0.x? -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Wednesday, July 30, 2003 4:06 PM To: bab...@li... Subject: [Babeldoc-devel] Ignored Stage stops the pipeline I have set the option "ignored" for a stage in my pipline to "true". Unfortunately, this does not result in skipping the step. The whole pipline seems to terminate but without an exception. The journal status says "ignored" for the stage but all following stages are skipped. Am I doing something wrong or is this a bug ? Stefan ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Stefan K. <ste...@co...> - 2003-07-30 20:06:24
|
I have set the option "ignored" for a stage in my pipline to "true". Unfortunately, this does not result in skipping the step. The whole pipline seems to terminate but without an exception. The journal status says "ignored" for the stage but all following stages are skipped. Am I doing something wrong or is this a bug ? Stefan |
|
From: McDonald, B. <Bru...@ba...> - 2003-07-30 18:12:14
|
Yes, Sorry about that - my fault. I will be applying fix tonight. regards, Bruce -----Original Message----- From: Ken Geis [mailto:kg...@ga...] Sent: Wednesday, July 30, 2003 2:36 AM To: bab...@li... Subject: [Babeldoc-devel] Re: postgresql Just to explain, the code in CVS does not compile right now, so I'm waiting to check that my additions compile against the 1.1 codebase. The PostgreSQL code I've written is only for journalling; I thought I had checked this in long ago. > Update of /cvsroot/babeldoc/babeldoc/readme/sql/postgresql > In directory sc8-pr-cvs1:/tmp/cvs-serv29434/postgresql > > Log Message: > Directory /cvsroot/babeldoc/babeldoc/readme/sql/postgresql added to the repository ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Ken G. <kg...@ga...> - 2003-07-30 06:36:25
|
Just to explain, the code in CVS does not compile right now, so I'm waiting to check that my additions compile against the 1.1 codebase. The PostgreSQL code I've written is only for journalling; I thought I had checked this in long ago. > Update of /cvsroot/babeldoc/babeldoc/readme/sql/postgresql > In directory sc8-pr-cvs1:/tmp/cvs-serv29434/postgresql > > Log Message: > Directory /cvsroot/babeldoc/babeldoc/readme/sql/postgresql added to the repository |
|
From: <kg...@us...> - 2003-07-29 20:28:53
|
Update of /cvsroot/babeldoc/babeldoc/readme/sql/postgresql In directory sc8-pr-cvs1:/tmp/cvs-serv29434/postgresql Log Message: Directory /cvsroot/babeldoc/babeldoc/readme/sql/postgresql added to the repository |
|
From: Stefan K. <ste...@co...> - 2003-07-28 21:42:45
|
Good hint. I have forgotten that. Maybe I will have to provide a patch for version 1.0, maybe we will upgrade to the new version. It is stable ? But at the moment it is not a real problem for my project. Regarding DOM4J: If you are using DOM4J you should not have any encoding problems, anyway. However, does this mean that you are creating the complete DOM tree in memory ? This could be an issue for big text files. This was an advantage of the old implementation. Stefan -----Ursprüngliche Nachricht----- Von: McDonald, Bruce [mailto:Bru...@ba...] Gesendet: Montag, 28. Juli 2003 23:10 An: Stefan Krieger; Bruce McDonald; bab...@li... Betreff: RE: [Babeldoc-devel] FlatToXMLStage produce invalid XML Ok, Stefan - are you going to be making the change? Notice that I have changed the implementation to use dom4j for the generation of the XML - this should make things a little simpler. Bruce. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Monday, July 28, 2003 5:05 PM To: Bruce McDonald; bab...@li... Subject: AW: [Babeldoc-devel] FlatToXMLStage produce invalid XML Bruce, sorry for the delay. I am very busy, my project is on the finish line. First, I think, we have to invoke a XML encoding method in ConversionClient before the value is written to the stream. This should be a minor change. Second, we need the XML encoding prefix to specify the codepage of the XML document. This is important for us germans, because of the Umlauts (äöü) ! Stefan -----Ursprüngliche Nachricht----- Von: Bruce McDonald [mailto:br...@mc...] Gesendet: Donnerstag, 24. Juli 2003 03:30 An: Stefan Krieger; bab...@li... Betreff: Re: [Babeldoc-devel] FlatToXMLStage produce invalid XML Hmmm, Good catch - how do you think that we can get this fixed? regards, Bruce. On Wednesday 23 July 2003 05:10 pm, Stefan Krieger wrote: > Hi, > > I just recognized that the FlatToXmlPipelineStage does not XML encode the > characters >,<,&,". > If the text file includes those characters, the result will be invalid XML. > > Regards, > Stefan > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: <ste...@us...> - 2003-07-28 21:34:31
|
Update of /cvsroot/babeldoc/babeldoc/modules/sql/src/com/babeldoc/sql/journal
In directory sc8-pr-cvs1:/tmp/cvs-serv5776
Modified Files:
GenericSqlJournal.java
Log Message:
added synchronization in log.
getNextStep and DB update must be a single unit.
Index: GenericSqlJournal.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/sql/src/com/babeldoc/sql/journal/GenericSqlJournal.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** GenericSqlJournal.java 14 Jul 2003 22:43:29 -0000 1.8
--- GenericSqlJournal.java 28 Jul 2003 21:34:28 -0000 1.9
***************
*** 661,665 ****
con = (Connection) resource.checkOut();
- long step = getNextStep(con, id);
String pstageName = (stage != null) ? stage : "null";
String additional = "";
--- 661,664 ----
***************
*** 672,676 ****
pstmt = con.prepareStatement(logInsertStmt);
pstmt.setLong(1, id);
- pstmt.setLong(2, step);
pstmt.setLong(3, new Date().getTime());
pstmt.setString(4, operation.toString());
--- 671,674 ----
***************
*** 678,683 ****
pstmt.setString(6, pstageName);
pstmt.setString(7, additional);
- pstmt.executeUpdate();
if (operation.equals(JournalOperation.updateDocument)) {
writeDelta(con, id, step, (PipelineDocument) data);
--- 676,689 ----
pstmt.setString(6, pstageName);
pstmt.setString(7, additional);
+ // without synchronized it is likely to get the same value
+ // from getNextStep several times in multiple threads
+ long step ;
+ synchronized ( this.getClass() ) {
+ step = getNextStep(con, id);
+ pstmt.setLong(2, step);
+ pstmt.executeUpdate();
+ }
+
if (operation.equals(JournalOperation.updateDocument)) {
writeDelta(con, id, step, (PipelineDocument) data);
|
|
From: McDonald, B. <Bru...@ba...> - 2003-07-28 21:11:14
|
Ok, Stefan - are you going to be making the change? Notice that I have changed= the implementation to use dom4j for the generation of the XML - this shoul= d make things a little simpler. Bruce. -----Original Message----- From: Stefan Krieger [mailto:ste...@co...] Sent: Monday, July 28, 2003 5:05 PM To: Bruce McDonald; bab...@li... Subject: AW: [Babeldoc-devel] FlatToXMLStage produce invalid XML Bruce, sorry for the delay. I am very busy, my project is on the finish line. First, I think, we have to invoke a XML encoding method in ConversionClient before the value is written to the stream. This should be a minor change. Second, we need the XML encoding prefix to specify the codepage of the XML document. This is important for us germans, because of the Umlauts (=E4=F6= =FC) ! Stefan -----Urspr=FCngliche Nachricht----- Von: Bruce McDonald [mailto:br...@mc...] Gesendet: Donnerstag, 24. Juli 2003 03:30 An: Stefan Krieger; bab...@li... Betreff: Re: [Babeldoc-devel] FlatToXMLStage produce invalid XML Hmmm, Good catch - how do you think that we can get this fixed? regards, Bruce. On Wednesday 23 July 2003 05:10 pm, Stefan Krieger wrote: > Hi, > > I just recognized that the FlatToXmlPipelineStage does not XML encode the > characters >,<,&,". > If the text file includes those characters, the result will be invalid XML. > > Regards, > Stefan > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Babeldoc-devel mailing list Bab...@li... https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: Stefan K. <ste...@co...> - 2003-07-28 21:04:55
|
Bruce, sorry for the delay. I am very busy, my project is on the finish line. First, I think, we have to invoke a XML encoding method in ConversionClient before the value is written to the stream. This should be a minor change. Second, we need the XML encoding prefix to specify the codepage of the XML document. This is important for us germans, because of the Umlauts (äöü) ! Stefan -----Ursprüngliche Nachricht----- Von: Bruce McDonald [mailto:br...@mc...] Gesendet: Donnerstag, 24. Juli 2003 03:30 An: Stefan Krieger; bab...@li... Betreff: Re: [Babeldoc-devel] FlatToXMLStage produce invalid XML Hmmm, Good catch - how do you think that we can get this fixed? regards, Bruce. On Wednesday 23 July 2003 05:10 pm, Stefan Krieger wrote: > Hi, > > I just recognized that the FlatToXmlPipelineStage does not XML encode the > characters >,<,&,". > If the text file includes those characters, the result will be invalid XML. > > Regards, > Stefan > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Babeldoc-devel mailing list > Bab...@li... > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel |
|
From: McDonald, B. <Bru...@ba...> - 2003-07-28 20:59:25
|
Please submit this Stefan.
-----Original Message-----
From: Stefan Krieger [mailto:ste...@co...]
Sent: Monday, July 28, 2003 4:56 PM
To: bab...@li...
Subject: [Babeldoc-devel] Synchronization problem in GenericSQLJournal
Hello,
We are using the SQL journal in a multi-threaded J2EE environment and got
some DB error, because of duplicated IDs in LOG table.
We solved it by making getNextStep and the DB Update a critical section. I
think, this makes sense and should go into the babeldoc code.
Regards,
Stefan
// copied from GenericSQLJournal with synchronization
// getNextStep + DB Update is a critical section
protected void log(IJournalTicket ticket, JournalOperation operation,
String other, String stage, Object data) throws
JournalException {
//getLog().debug("[GenericSqlJournal.log] called");
// Get the next step for the ticket
if (!ticket.isDummy()) {
PreparedStatement pstmt = null;
Connection con = null;
String logInsertStmt = SqlQueryManager.getSqlQuery(LOG_INSERT);
//getLog().debug("[GenericSqlJournal.log] sql: "+logInsertStmt);
long id = ((JournalTicket)ticket).getValue();
try {
con = (Connection) resource.checkOut();
pstmt = con.prepareStatement(logInsertStmt);
String pstageName = (stage != null) ? stage : "null";
String additional = "";
if (operation.equals(JournalOperation.updateStatus)) {
additional = (String) data;
}
//getLog().debug("[GenericSqlJournal.log] Writing step: "+step);
pstmt.setLong(1, id);
pstmt.setLong(3, new java.util.Date().getTime());
pstmt.setString(4, operation.toString());
pstmt.setString(5, other);
pstmt.setString(6, pstageName);
pstmt.setString(7, additional);
long step ;
// without synchronized it is likely to get the same value
// from getNextStep several times in multiple threads
synchronized ( this.getClass() ) {
step = getNextStep(con, id);
pstmt.setLong(2, step);
pstmt.executeUpdate();
}
if (operation.equals(JournalOperation.updateDocument)) {
writeDelta(con, id, step,
(com.babeldoc.core.pipeline.PipelineDocument) data);
}
} catch (Exception se) {
LogService.getInstance().logError(se);
} finally {
try {
if (pstmt != null) {
pstmt.close();
}
resource.checkIn(con);
} catch (Exception se) {
LogService.getInstance().logError(I18n.get("sql.403"), se);
}
}
}
}
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Babeldoc-devel mailing list
Bab...@li...
https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
|
|
From: Stefan K. <ste...@co...> - 2003-07-28 20:56:08
|
Hello,
We are using the SQL journal in a multi-threaded J2EE environment and got
some DB error, because of duplicated IDs in LOG table.
We solved it by making getNextStep and the DB Update a critical section. I
think, this makes sense and should go into the babeldoc code.
Regards,
Stefan
// copied from GenericSQLJournal with synchronization
// getNextStep + DB Update is a critical section
protected void log(IJournalTicket ticket, JournalOperation operation,
String other, String stage, Object data) throws
JournalException {
//getLog().debug("[GenericSqlJournal.log] called");
// Get the next step for the ticket
if (!ticket.isDummy()) {
PreparedStatement pstmt = null;
Connection con = null;
String logInsertStmt = SqlQueryManager.getSqlQuery(LOG_INSERT);
//getLog().debug("[GenericSqlJournal.log] sql: "+logInsertStmt);
long id = ((JournalTicket)ticket).getValue();
try {
con = (Connection) resource.checkOut();
pstmt = con.prepareStatement(logInsertStmt);
String pstageName = (stage != null) ? stage : "null";
String additional = "";
if (operation.equals(JournalOperation.updateStatus)) {
additional = (String) data;
}
//getLog().debug("[GenericSqlJournal.log] Writing step: "+step);
pstmt.setLong(1, id);
pstmt.setLong(3, new java.util.Date().getTime());
pstmt.setString(4, operation.toString());
pstmt.setString(5, other);
pstmt.setString(6, pstageName);
pstmt.setString(7, additional);
long step ;
// without synchronized it is likely to get the same value
// from getNextStep several times in multiple threads
synchronized ( this.getClass() ) {
step = getNextStep(con, id);
pstmt.setLong(2, step);
pstmt.executeUpdate();
}
if (operation.equals(JournalOperation.updateDocument)) {
writeDelta(con, id, step,
(com.babeldoc.core.pipeline.PipelineDocument) data);
}
} catch (Exception se) {
LogService.getInstance().logError(se);
} finally {
try {
if (pstmt != null) {
pstmt.close();
}
resource.checkIn(con);
} catch (Exception se) {
LogService.getInstance().logError(I18n.get("sql.403"), se);
}
}
}
}
|
|
From: <tr...@us...> - 2003-07-26 15:17:28
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv10309
Modified Files:
EntityResolverDiskCache.java DomifyPipelineStage.java
Log Message:
Index: EntityResolverDiskCache.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/EntityResolverDiskCache.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EntityResolverDiskCache.java 24 Jul 2003 23:51:20 -0000 1.2
--- EntityResolverDiskCache.java 25 Jul 2003 13:21:26 -0000 1.3
***************
*** 86,173 ****
**/
public class EntityResolverDiskCache
! implements EntityResolver
! {
! /**
! * Construct a new EntityResolverDiskCache that backends to the given EntityResolver and
! * caches its entities in the given directory.
! **/
! public EntityResolverDiskCache(EntityResolver entityResolver, String baseDirectory)
! throws Exception
! {
! this.entityResolver = entityResolver;
! this.baseDirectory = new File(baseDirectory);
! if (!this.baseDirectory.isDirectory()) {
! throw new Exception("Not a directory.");
! }
! }
!
! /**
! * resolve an entity
! **/
! public InputSource resolveEntity (String publicId, String systemId)
! throws SAXException, IOException
! {
! try {
! File file = null;
! // synchronize on the systemId so two attempts to resolve don't result in two gets from the backend
! synchronized (systemId.intern()) {
! file = new File(baseDirectory, Integer.toString(systemId.hashCode()));
! if (!file.exists()) {
! InputSource inputSource = entityResolver.resolveEntity(publicId, systemId);
! if (inputSource != null) {
! Reader reader = inputSource.getCharacterStream();
! if (reader != null) {
! FileWriter fw = new FileWriter(file);
! char[] buffer = new char[1024];
! int charsRead;
! while ((charsRead = reader.read(buffer)) != 01) {
! fw.write(buffer, 0, charsRead);
! }
! fw.close();
! reader.close();
! }
! else {
! InputStream byteStream = inputSource.getByteStream();
! if (byteStream != null) {
! FileOutputStream outputStream = new FileOutputStream(file);
! byte[] buffer = new byte[1024];
! int bytesRead;
! while ((bytesRead = byteStream.read(buffer)) != -1) {
! outputStream.write(buffer, 0, bytesRead);
! }
! outputStream.close();
! byteStream.close();
! }
! }
! }
! if (!file.exists()) {
! URL url = new URL(systemId);
! InputStream inputStream = url.openStream();
! FileOutputStream outputStream = new FileOutputStream(file);
! byte[] buffer = new byte[1024];
! int bytesRead;
! while ((bytesRead = inputStream.read(buffer)) != -1) {
! outputStream.write(buffer, 0, bytesRead);
! }
! outputStream.close();
! inputStream.close();
! }
}
! }
! InputSource is = new InputSource(new FileInputStream(file));
! is.setPublicId(publicId);
! is.setSystemId(systemId);
! return is;
! }
! catch (RuntimeException t) {
! t.printStackTrace();
! throw t;
}
! }
!
! /** the EntityResolver to backend to **/
! EntityResolver entityResolver;
!
! /** the directory to use as a cache **/
! File baseDirectory;
}
--- 86,168 ----
**/
public class EntityResolverDiskCache
! implements EntityResolver {
! /**
! * Construct a new EntityResolverDiskCache that backends to the given EntityResolver and
! * caches its entities in the given directory.
! **/
! public EntityResolverDiskCache(EntityResolver entityResolver, String baseDirectory)
! throws Exception {
! this.entityResolver = entityResolver;
! this.baseDirectory = new File(baseDirectory);
! if (!this.baseDirectory.isDirectory()) {
! throw new Exception("Not a directory.");
! }
! }
!
! /**
! * resolve an entity
! **/
! public InputSource resolveEntity(String publicId, String systemId)
! throws SAXException, IOException {
! try {
! File file = null;
! // synchronize on the systemId so two attempts to resolve don't result in two gets from the backend
! synchronized (systemId.intern()) {
! file = new File(baseDirectory, Integer.toString(systemId.hashCode()));
! if (!file.exists()) {
! InputSource inputSource = entityResolver.resolveEntity(publicId, systemId);
! if (inputSource != null) {
! Reader reader = inputSource.getCharacterStream();
! if (reader != null) {
! FileWriter fw = new FileWriter(file);
! char[] buffer = new char[1024];
! int charsRead;
! while ((charsRead = reader.read(buffer)) != 01) {
! fw.write(buffer, 0, charsRead);
! }
! fw.close();
! reader.close();
! } else {
! InputStream byteStream = inputSource.getByteStream();
! if (byteStream != null) {
! FileOutputStream outputStream = new FileOutputStream(file);
! byte[] buffer = new byte[1024];
! int bytesRead;
! while ((bytesRead = byteStream.read(buffer)) != -1) {
! outputStream.write(buffer, 0, bytesRead);
! }
! outputStream.close();
! byteStream.close();
! }
}
! }
! if (!file.exists()) {
! URL url = new URL(systemId);
! InputStream inputStream = url.openStream();
! FileOutputStream outputStream = new FileOutputStream(file);
! byte[] buffer = new byte[1024];
! int bytesRead;
! while ((bytesRead = inputStream.read(buffer)) != -1) {
! outputStream.write(buffer, 0, bytesRead);
! }
! outputStream.close();
! inputStream.close();
! }
! }
}
! InputSource is = new InputSource(new FileInputStream(file));
! is.setPublicId(publicId);
! is.setSystemId(systemId);
! return is;
! } catch (RuntimeException t) {
! t.printStackTrace();
! throw t;
! }
! }
!
! /** the EntityResolver to backend to **/
! EntityResolver entityResolver;
!
! /** the directory to use as a cache **/
! File baseDirectory;
}
Index: DomifyPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/DomifyPipelineStage.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DomifyPipelineStage.java 24 Jul 2003 14:06:13 -0000 1.12
--- DomifyPipelineStage.java 25 Jul 2003 13:21:26 -0000 1.13
***************
*** 190,204 ****
}
! // public IConfigInfo getPipelineInfo() {
! // return info;
! // }
!
public static Document getCachedDom(PipelineDocument document) {
! Document doc = (Document)domCache.get(document);
! return doc;
}
public static void putCachedDom(PipelineDocument document, Document doc) {
! domCache.put(document, doc);
}
--- 190,212 ----
}
! /**
! * Get the dom object cached on this pipelinedocument (stored on the
! * weak hashmap)
! *
! * @param document
! * @return
! */
public static Document getCachedDom(PipelineDocument document) {
! return (Document)domCache.get(document);
}
+ /**
+ * Store the document in the dom cache
+ *
+ * @param document
+ * @param doc
+ */
public static void putCachedDom(PipelineDocument document, Document doc) {
! domCache.put(document, doc);
}
***************
*** 233,238 ****
}
} catch (Exception e) {
! e.printStackTrace();
! com.babeldoc.core.LogService.getInstance().logError(e);
}
--- 241,245 ----
}
} catch (Exception e) {
! LogService.getInstance().logError(e);
}
***************
*** 431,435 ****
* @throws PipelineException DOCUMENT ME!
*/
! public PipelineStageResult[] process() throws PipelineException {
try {
String schemaFile = getOptions(SCHEMA_FILE);
--- 438,443 ----
* @throws PipelineException DOCUMENT ME!
*/
! public PipelineStageResult[] process()
! throws PipelineException {
try {
String schemaFile = getOptions(SCHEMA_FILE);
|