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: David G. <dg...@co...> - 2003-08-06 04:25:52
|
Creating and deleting the variables won't help with the scheduler variable,
which is needed in finishUp() to stop all running worker threads. Currently,
Scanner.finshUp() crashes as follows:
java.lang.NullPointerException
at com.babeldoc.scanner.ScannerWorkerScheduler.stopAll(Unknown Source)
at com.babeldoc.scanner.Scanner.stop(Unknown Source)
at com.babeldoc.scanner.Scanner.finishUp(Unknown Source)
at com.babeldoc.core.BabeldocCommand$1$ShutMeDownNicely.run(Unknown
Source)
because the scheduler variable is instantiated in execute() (actually, it's
instantiated in start(), which is invoked by execute()), but then it's
reinitialized to null by the time finishUp() tries to use it to shut down
things.
I'm not quite sure how best to address this problem. One way that immediately
comes to mind is to change the calling method so that execute() is invoked
separately from the constructor, but that will probably involve changing code
in each tool. It can be fixed just in Scanner, but then it will probably
come back to bite another developer (or the same, forgetful one) somewhere in
the distant future...
David
On Tuesday 05 August 2003 8:45 pm, Bruce McDonald wrote:
> This pattern is used for all commandline tools.
>
> I guess that most variables that are needed should be encapsulated in a
> class that is created and deleted within execute.
>
> regards,
> Bruce.
>
> On Tuesday 05 August 2003 11:45 pm, David Glick wrote:
> > I noticed that the constructor for Scanner looks like (or, actually, IS):
> >
> > public Scanner(String[] args) {
> > super("scanner", I18n.get("scanner.Scanner.toolDescription"), args);
> > }
> >
> > which I believe causes the parent BabelDocCommand class constructor to
> > initialize the command line properly and then invoke execute() on
> > Scanner. What seems to be happening, though, is that, should any private
> > variables be initialized at declaration (private boolean test = false;),
> > and then set to true in execute(), it will be false again in finishUp().
> > Apparently, not all variables are initialized at the time that the
> > constructor is called, and so the variables are initialized sometime
> > after execute() is executing...
> >
> > This caused me some intersting moments in trying to have the Scanner
> > class end elegantly after displaying the help screen. I assume that all
> > the other tools use the same architecture. Is this a known side effect?
> >
> >
> > David
>
> -------------------------------------------------------
> 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
--
David Glick
Transmit Consulting, Inc
619-475-4052
dg...@tr...
|
|
From: Bruce M. <br...@mc...> - 2003-08-06 03:48:18
|
All, This story started simply: I wanted to pass in a couple of parameters to the XslTransformPipelineStage so that the documentation output can be pretty... Well, I then noticed that the parameters that the XSL stylesheets are of the form: xxxx.aaaa.bbb - now this really screws up the configuration passing scheme - it uses the '.' to find the components of the configuration. So then it was necessary to update the parsing to quote parts some of the configuration so that it is possible to do the following: 1. aaaa.bbbb.cccc.dddd=zzzzzzzzzzzzzzzzzz 2. aaaa.bbbb."cccc.dddd"=yyyyyyyyyyyyyyyyy are separate. I am now using the CSVReader (from the csv19.jar) using the '.' as a separator and '"' as a quote character. This means that more sophisticated quoting is possible. The downside is that the configuration processing is potentially slower. Please take a look at the TieredConfigurationHelper and the SimplePipelineStageResolver. regards, Bruce. PS. If anyone wants to go through some of the pipeline stages and expand the descriptions of the pipelinestages and the configuration options. |
|
From: Bruce M. <br...@mc...> - 2003-08-06 03:45:28
|
This pattern is used for all commandline tools.
I guess that most variables that are needed should be encapsulated in a class
that is created and deleted within execute.
regards,
Bruce.
On Tuesday 05 August 2003 11:45 pm, David Glick wrote:
> I noticed that the constructor for Scanner looks like (or, actually, IS):
>
> public Scanner(String[] args) {
> super("scanner", I18n.get("scanner.Scanner.toolDescription"), args);
> }
>
> which I believe causes the parent BabelDocCommand class constructor to
> initialize the command line properly and then invoke execute() on Scanner.
> What seems to be happening, though, is that, should any private variables
> be initialized at declaration (private boolean test = false;), and then set
> to true in execute(), it will be false again in finishUp(). Apparently,
> not all variables are initialized at the time that the constructor is
> called, and so the variables are initialized sometime after execute() is
> executing...
>
> This caused me some intersting moments in trying to have the Scanner class
> end elegantly after displaying the help screen. I assume that all the
> other tools use the same architecture. Is this a known side effect?
>
>
> David
|
|
From: David G. <dg...@co...> - 2003-08-06 03:34:18
|
I noticed that the constructor for Scanner looks like (or, actually, IS):
public Scanner(String[] args) {
super("scanner", I18n.get("scanner.Scanner.toolDescription"), args);
}
which I believe causes the parent BabelDocCommand class constructor to
initialize the command line properly and then invoke execute() on Scanner.
What seems to be happening, though, is that, should any private variables be
initialized at declaration (private boolean test = false;), and then set to
true in execute(), it will be false again in finishUp(). Apparently, not all
variables are initialized at the time that the constructor is called, and so
the variables are initialized sometime after execute() is executing...
This caused me some intersting moments in trying to have the Scanner class end
elegantly after displaying the help screen. I assume that all the other
tools use the same architecture. Is this a known side effect?
David
--
David Glick
Transmit Consulting, Inc
619-475-4052
dg...@tr...
|
|
From: <tr...@us...> - 2003-08-06 03:23:53
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv29205/src/com/babeldoc/core/pipeline/simple
Modified Files:
SimplePipelineStageResolver.java
Log Message:
Changed the ad-hoc configuration scanning code with the csv reader code.
Index: SimplePipelineStageResolver.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/simple/SimplePipelineStageResolver.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SimplePipelineStageResolver.java 19 Jul 2003 15:32:27 -0000 1.6
--- SimplePipelineStageResolver.java 6 Aug 2003 03:23:41 -0000 1.7
***************
*** 72,77 ****
--- 72,80 ----
import com.babeldoc.core.pipeline.PipelineStageConfig;
import com.babeldoc.core.pipeline.PipelineStageResolver;
+ import com.mindprod.csv.CSVReader;
import java.util.Iterator;
+ import java.io.StringReader;
+ import java.io.IOException;
***************
*** 132,137 ****
// Also handle connections
else if (key.endsWith(NEXT_STAGE)) {
! String source = key.substring(0, key.length() - NEXT_STAGE.length() -
! 1);
setupNextStages(source, value);
} else if (key.equals(ENTRY_STAGE)) {
--- 135,139 ----
// Also handle connections
else if (key.endsWith(NEXT_STAGE)) {
! String source = key.substring(0, key.length() - NEXT_STAGE.length() - 1);
setupNextStages(source, value);
} else if (key.equals(ENTRY_STAGE)) {
***************
*** 143,164 ****
// point the working hashtable to the newly created map. If the last
// token is reached map the value to the name in the map.
! StringTokenizer st = new StringTokenizer(key, ".");
! int numTokens = st.countTokens();
! PipelineStageConfig working = stageConfig;
!
! int i = 1;
! while (st.hasMoreTokens()) {
! String token = st.nextToken();
! if (working.get(token) == null) {
! working.put(token, new PipelineStageConfig(token));
! }
! working = working.get(token);
! if (i++ == numTokens) {
! working.setValue(value);
}
}
}
--- 145,169 ----
// point the working hashtable to the newly created map. If the last
// token is reached map the value to the name in the map.
! CSVReader csvReader = new CSVReader(new StringReader(key), '.', '"', false, true);
! try {
! String [] tokens = csvReader.getAllFieldsInLine();
! int numTokens = tokens.length;
! PipelineStageConfig working = stageConfig;
! for (int j = 0; j < tokens.length; j++) {
! String token = tokens[j];
! if (working.get(token) == null) {
! working.put(token, new PipelineStageConfig(token));
! }
! working = working.get(token);
! if (j == numTokens-1) {
! working.setValue(value);
! }
}
+ } catch (IOException e) {
+ // This should never happen
}
}
|
|
From: <tr...@us...> - 2003-08-06 03:23:53
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core
In directory sc8-pr-cvs1:/tmp/cvs-serv29205/src/com/babeldoc/core
Modified Files:
TieredConfigurationHelper.java
Log Message:
Changed the ad-hoc configuration scanning code with the csv reader code.
Index: TieredConfigurationHelper.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/TieredConfigurationHelper.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TieredConfigurationHelper.java 19 Jul 2003 15:32:27 -0000 1.5
--- TieredConfigurationHelper.java 6 Aug 2003 03:23:41 -0000 1.6
***************
*** 68,73 ****
--- 68,76 ----
import com.babeldoc.core.config.IConfig;
import com.babeldoc.core.config.ConfigService;
+ import com.mindprod.csv.CSVReader;
import java.util.*;
+ import java.io.StringReader;
+ import java.io.IOException;
/**
***************
*** 121,142 ****
String value = config.getString(key);
! StringTokenizer st = new StringTokenizer(key, ".");
! int numTokens = st.countTokens();
! Map working = configs;
! int tokenCount = 1;
! while (st.hasMoreTokens()) {
! String token = st.nextToken();
! if(tokenCount < numTokens) {
! if (working.get(token) == null) {
! working.put(token, new HashMap());
! }
! working = (Map)working.get(token);
! } else {
! working.put(token, value);
}
! ++tokenCount;
}
}
--- 124,148 ----
String value = config.getString(key);
! try {
! CSVReader csvReader = new CSVReader(new StringReader(key), '.', '"', false, true);
! String [] tokens = csvReader.getAllFieldsInLine();
! int numTokens = tokens.length;
! Map working = configs;
! for(int tokenCount = 0; tokenCount < numTokens; ++tokenCount) {
! String token = tokens[tokenCount];
! if(tokenCount < numTokens-1) {
! if (working.get(token) == null) {
! working.put(token, new HashMap());
! }
! working = (Map)working.get(token);
! } else {
! working.put(token, value);
! }
}
! } catch (IOException e) {
! // This should never happen
}
}
***************
*** 179,197 ****
cfg.setString("mike.four", "4");
cfg.setString("mike.five", "5");
! cfg.setString("peter.four.alpha", "4");
! cfg.setString("peter.five.beta", "5");
! cfg.setString(".info.broken", "aaa");
Map map = new TieredConfigurationHelper(cfg).getNamedConfigs();
for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
String name = (String) iterator.next();
! System.out.println("Map name: "+name);
! Map inner = (Map)map.get(name);
! for (Iterator iterator1 = inner.keySet().iterator(); iterator1.hasNext();) {
! String s = (String) iterator1.next();
! String v = (String)inner.get(s);
! System.out.println(" "+s+"="+v);
}
}
--- 185,211 ----
cfg.setString("mike.four", "4");
cfg.setString("mike.five", "5");
! cfg.setString("peter.\"four.alpha\"", "4");
! cfg.setString("peter.\"five.beta\"", "5");
! cfg.setString("\".info.broken\"", "aaa");
Map map = new TieredConfigurationHelper(cfg).getNamedConfigs();
+ printMap(map, 0);
+ }
+
+ private static void printMap(Map map, int i) {
for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
String name = (String) iterator.next();
+ Object o = map.get(name);
! for(int j = 0; j < i; ++j) {
! System.out.print(" ");
! }
! System.out.print(name);
! if(o instanceof Map) {
! System.out.println("");
! printMap((Map)o, i+1);
! } else {
! System.out.println("="+o);
}
}
|
|
From: <dgl...@us...> - 2003-08-06 03:19:03
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner
In directory sc8-pr-cvs1:/tmp/cvs-serv28628/modules/scanner/src/com/babeldoc/scanner
Modified Files:
Scanner.java
Log Message:
If '-h' switch, display help screen and exit
Index: Scanner.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/Scanner.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Scanner.java 4 Aug 2003 23:57:48 -0000 1.22
--- Scanner.java 6 Aug 2003 03:19:00 -0000 1.23
***************
*** 129,132 ****
--- 129,139 ----
public void execute(CommandLine commandLine) {
super.execute(commandLine);
+
+ // if the user asked for a help screen, exit and let him rerun the command.
+ if (commandLine.hasOption('h')) {
+ return;
+ }
+
+ // otherwise, continue with normal execution path
if (commandLine.hasOption('s')) {
scannerConfig = commandLine.getOptionValue('s');
***************
*** 141,144 ****
--- 148,152 ----
/**
+ * TODO: DOCUMENT ME!
*
*/
***************
*** 257,260 ****
--- 265,274 ----
*/
public void stop() {
+ // if there is no scheduler, then we haven't started anything that needs to be
+ // stopped...
+ if (this.scheduler == null) {
+ return;
+ }
+
log.logInfo("Shutting down...");
log.logInfo("Stopping workers...");
|
|
From: <tr...@us...> - 2003-08-06 02:45:05
|
Update of /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/digester In directory sc8-pr-cvs1:/tmp/cvs-serv23420/src/com/babeldoc/conversion/digester Removed Files: Conversion.java DigesterConversionUnmarshaller.java Field.java Header.java InputDocument.java LineSegment.java OutputDocument.java Log Message: removed dead classes --- Conversion.java DELETED --- --- DigesterConversionUnmarshaller.java DELETED --- --- Field.java DELETED --- --- Header.java DELETED --- --- InputDocument.java DELETED --- --- LineSegment.java DELETED --- --- OutputDocument.java DELETED --- |
|
From: Bruce M. <br...@mc...> - 2003-08-06 00:39:44
|
Do it. On Tuesday 05 August 2003 08:46 pm, David Glick wrote: > It's normal for a program that prints a help screen to end so that it can > be re-run with options. The process tool, for example, does this, but the > scanner tool will print the help options and then continue to execute. Is > this the intended functionality? If not, I'd be happy to change it, > because it's driving me slightly batty... :-) > > > David |
|
From: David G. <dg...@co...> - 2003-08-06 00:35:27
|
It's normal for a program that prints a help screen to end so that it can be re-run with options. The process tool, for example, does this, but the scanner tool will print the help options and then continue to execute. Is this the intended functionality? If not, I'd be happy to change it, because it's driving me slightly batty... :-) David -- David Glick Transmit Consulting, Inc 619-475-4052 dg...@tr... |
|
From: Bruce M. <br...@mc...> - 2003-08-06 00:31:42
|
Hey all, I have just submitted a bunch of stuff. basically: 1. The light config configuration lister and tracker. 2. Fix-ups to various pipeline stages here and there (basically as done as part of 3 below) 3. Consolidated the document pipeline code so that the pipelinestage and scanner worker documentation generators are rolled into the documentation pipeline. This meant that I had to do some debugging of configuration that was bad (and hidden). It also means that documentation is absolutely current. 4. Updated the documentation to reflect the configuration work. regards, Bruce. |
|
From: <tr...@us...> - 2003-08-06 00:19:30
|
Update of /cvsroot/babeldoc/babeldoc/readme/userguide In directory sc8-pr-cvs1:/tmp/cvs-serv32366/userguide Removed Files: pipelinestages.xml scanners.xml Log Message: removed the pipeline and scanner documentation - they now get created out of the documentation pipeline. --- pipelinestages.xml DELETED --- --- scanners.xml DELETED --- |
|
From: <tr...@us...> - 2003-08-06 00:18:10
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline/simple In directory sc8-pr-cvs1:/tmp/cvs-serv32161/config/pipeline/simple Removed Files: documentation.properties Log Message: Updated the documentation pipeline so that the pipeline and scanner documentation are created inline. --- documentation.properties DELETED --- |
|
From: <tr...@us...> - 2003-08-06 00:18:10
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline In directory sc8-pr-cvs1:/tmp/cvs-serv32161/config/pipeline Modified Files: config.properties Log Message: Updated the documentation pipeline so that the pipeline and scanner documentation are created inline. Index: config.properties =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline/config.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** config.properties 24 Feb 2003 22:42:15 -0000 1.1.1.1 --- config.properties 6 Aug 2003 00:18:07 -0000 1.2 *************** *** 6,9 **** #test-ejb.delegate=test documentation.type=simple ! documentation.configFile=pipeline/simple/documentation --- 6,9 ---- #test-ejb.delegate=test documentation.type=simple ! documentation.configFile=pipeline/documentation/documentation |
|
From: <tr...@us...> - 2003-08-06 00:18:10
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline/documentation
In directory sc8-pr-cvs1:/tmp/cvs-serv32161/config/pipeline/documentation
Added Files:
documentation.properties scanner2docbook.xsl stage2docbook.xsl
Log Message:
Updated the documentation pipeline so that the pipeline and scanner documentation are created inline.
--- NEW FILE: documentation.properties ---
entryStage=attrdefault
#attrcheck.stageType=Scripting
#attrcheck.nextStage=choose
#attrcheck.language=javascript
#attrcheck.scriptFile=core/scripts/attrcheck.js
#attrcheck.attrs.style=Attribute 'Style' required. This attribute determines the output document type. One of: html, xhtml, text
#attrcheck.failOnError=true
attrdefault.stageType=Scripting
attrdefault.nextStage=callstages
attrdefault.language=javascript
attrdefault.scriptFile=core/scripts/attrdefault.js
attrdefault.attrs.style=html
callstages.stageType=CallStage
callstages.callStage=documentation.stagexml
callstages.discardResults=true
callstages.nextStage=callscanners
callscanners.stageType=CallStage
callscanners.callStage=documentation.scannerxml
callscanners.discardResults=true
callscanners.nextStage=choose
choose.stageType=Router
choose.nextStage=transform
choose.nextStage.pdftransform=#if(${document.get("style").equalsIgnoreCase("pdf")})true#end
transform.stageType=XslTransform
transform.transformationFile=readme/docbook-xsl/${document.get("style")}/docbook.xsl
transform.nextStage=writer
pdftransform.stageType=XslTransform
pdftransform.transformationFile=readme/docbook-xsl/fo/docbook.xsl
pdftransform.nextStage=fotransform
fotransform.stageType=XslFoTransform
fotransform.nextStage=writer
fotransform.outputType=pdf
fotransform.bufferSize=2048
writer.stageType=FileWriter
writer.nextStage=null
writer.outputFile=${document.get("file_name")}.${document.get("style")}
#
# Generate the stage xml
stagexml.stageType=Scripting
stagexml.language=javascript
stagexml.script=\
importClass(Packages.com.babeldoc.core.service.ServiceFactory);\
importClass(Packages.com.babeldoc.core.pipeline.PipelineStageType);\
importClass(Packages.java.lang.System);\
var services = ServiceFactory.getAllServices("PipelineStage");\
var keyset = services.keySet();\
var keyiter = keyset.iterator();\
var bufr = new java.lang.StringBuffer();\
bufr.append("<stage-defns>\\n");\
while(keyiter.hasNext()) {\
var key = keyiter.next();\
var objtype = PipelineStageType.getPipelineStageType(key);\
if(objtype!=null) {\
var obj = objtype.getTypeInstance();\
var info = obj.getInfo();\
if(info!=null) {\
var xmlfrag = info.toXml();\
bufr.append(xmlfrag);\
}\
}\
}\
bufr.append("</stage-defns>\\n");\
document.setBytes(bufr.toString().getBytes());\
document.setMimeType("text/xml");
stagexml.nextStage=stagexform
stagexform.stageType=XslTransform
stagexform.nextStage=stagewriter
stagexform.transformationFile=pipeline/documentation/stage2docbook.xsl
stagewriter.stageType=FileWriter
stagewriter.nextStage=null
stagewriter.outputFile=readme/userguide/pipelinestages.xml
#
# Generate the scanner xml
scannerxml.stageType=Scripting
scannerxml.language=javascript
scannerxml.script=\
importClass(Packages.com.babeldoc.core.service.ServiceFactory);\
importClass(Packages.com.babeldoc.scanner.ScannerWorkerType);\
importClass(Packages.java.lang.System);\
var services = ServiceFactory.getAllServices("ScannerWorker");\
var keyset = services.keySet();\
var keyiter = keyset.iterator();\
var bufr = new java.lang.StringBuffer();\
bufr.append("<scanner-defns>\\n");\
while(keyiter.hasNext()) {\
var key = keyiter.next();\
var objtype = ScannerWorkerType.getScannerWorkerType(key);\
if(objtype!=null) {\
var obj = objtype.getTypeInstance();\
var info = obj.getInfo();\
if(info!=null) {\
var xmlfrag = info.toXml();\
bufr.append(xmlfrag);\
}\
}\
}\
bufr.append("</scanner-defns>\\n");\
document.setBytes(bufr.toString().getBytes());\
document.setMimeType("text/xml");
scannerxml.nextStage=scannertransform
scannertransform.stageType=XslTransform
scannertransform.nextStage=scannerwriter
scannertransform.transformationFile=pipeline/documentation/scanner2docbook.xsl
scannerwriter.stageType=FileWriter
scannerwriter.nextStage=null
scannerwriter.outputFile=readme/userguide/scanners.xml
--- NEW FILE: scanner2docbook.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/scanner-defns">
<section>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match="scanner-defn">
<section>
<title><xsl:value-of select="scanner-type"/></title>
<para><xsl:value-of select="scanner-desc"/></para>
<xsl:if test="count(scanner-option) > 0">
<informaltable frame="all">
<tgroup cols="4">
<thead>
<row>
<entry><para>Name</para></entry>
<entry><para>Type</para></entry>
<entry><para>number</para></entry>
<entry><para>description</para></entry>
</row>
</thead>
<tbody>
<xsl:apply-templates select="scanner-option"/>
</tbody>
</tgroup>
</informaltable>
</xsl:if>
</section>
</xsl:template>
<xsl:template match="scanner-option">
<row>
<entry><para><xsl:value-of select="option-name"/></para></entry>
<entry><para><xsl:value-of select="option-type"/></para></entry>
<entry><para><xsl:value-of select="option-number"/></para></entry>
<entry><para><xsl:value-of select="option-desc"/></para></entry>
</row>
</xsl:template>
</xsl:stylesheet>
--- NEW FILE: stage2docbook.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/stage-defns">
<section>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match="stage-defn">
<section>
<title><xsl:value-of select="stage-type"/></title>
<para><xsl:value-of select="stage-desc"/></para>
<xsl:if test="count(stage-option) > 0">
<informaltable frame="all">
<tgroup cols="4">
<thead>
<row>
<entry><para>Name</para></entry>
<entry><para>Type</para></entry>
<entry><para>number</para></entry>
<entry><para>description</para></entry>
</row>
</thead>
<tbody>
<xsl:apply-templates select="stage-option"/>
</tbody>
</tgroup>
</informaltable>
</xsl:if>
</section>
</xsl:template>
<xsl:template match="stage-option">
<row>
<entry><para><xsl:value-of select="option-name"/></para></entry>
<entry><para><xsl:value-of select="option-type"/></para></entry>
<entry><para><xsl:value-of select="option-number"/></para></entry>
<entry><para><xsl:value-of select="option-desc"/></para></entry>
</row>
<xsl:if test="count(option-suboption) > 0">
<xsl:apply-templates select="option-suboption"/>
</xsl:if>
</xsl:template>
<xsl:template match="option-suboption">
<row>
<entry><para><xsl:value-of select="../option-name"/>.<xsl:value-of select="option-name"/></para></entry>
<entry><para><xsl:value-of select="option-type"/></para></entry>
<entry><para><xsl:value-of select="option-number"/></para></entry>
<entry><para><xsl:value-of select="option-desc"/></para></entry>
</row>
</xsl:template>
</xsl:stylesheet>
|
|
From: <tr...@us...> - 2003-08-06 00:12:10
|
Update of /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv30989
Modified Files:
XlsToXmlPipelineStage.java
Log Message:
Fixed bug where info was returning a null for the options!
Index: XlsToXmlPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/conversion/src/com/babeldoc/conversion/pipeline/stage/XlsToXmlPipelineStage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** XlsToXmlPipelineStage.java 19 Jul 2003 13:16:47 -0000 1.3
--- XlsToXmlPipelineStage.java 6 Aug 2003 00:12:05 -0000 1.4
***************
*** 72,75 ****
--- 72,76 ----
import java.util.Collection;
+ import java.util.ArrayList;
/**
***************
*** 94,98 ****
public Collection getTypeSpecificOptions() {
! return null;
}
});
--- 95,99 ----
public Collection getTypeSpecificOptions() {
! return new ArrayList();
}
});
|
|
From: <tr...@us...> - 2003-08-05 23:56:20
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline/documentation In directory sc8-pr-cvs1:/tmp/cvs-serv27421/documentation Log Message: Directory /cvsroot/babeldoc/babeldoc/modules/core/config/pipeline/documentation added to the repository |
|
From: <tr...@us...> - 2003-08-05 23:54:06
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/config/service In directory sc8-pr-cvs1:/tmp/cvs-serv26924/config/service Modified Files: query.properties Log Message: Fixed bad service name - external application Index: query.properties =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/config/service/query.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** query.properties 31 May 2003 01:46:42 -0000 1.5 --- query.properties 5 Aug 2003 23:54:03 -0000 1.6 *************** *** 6,10 **** ScannerWorker.ftp=com.babeldoc.scanner.worker.FtpScanner ScannerWorker.sql=com.babeldoc.scanner.worker.SqlScanner ! ScannerWorker.application=com.babeldoc.scanner.worker.ExternalApplicationSCanner ScannerWorker.http=com.babeldoc.scanner.worker.HttpScanner --- 6,10 ---- ScannerWorker.ftp=com.babeldoc.scanner.worker.FtpScanner ScannerWorker.sql=com.babeldoc.scanner.worker.SqlScanner ! ScannerWorker.application=com.babeldoc.scanner.worker.ExternalApplicationScanner ScannerWorker.http=com.babeldoc.scanner.worker.HttpScanner |
|
From: <tr...@us...> - 2003-08-05 23:49:30
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv25766/src/com/babeldoc/core/pipeline/stage
Modified Files:
CallStagePipelineStage.java RouterPipelineStage.java
Log Message:
Enhanced the callstage stage and added some comments to router stage
Index: CallStagePipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/CallStagePipelineStage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** CallStagePipelineStage.java 27 Jun 2003 02:19:59 -0000 1.6
--- CallStagePipelineStage.java 5 Aug 2003 23:49:27 -0000 1.7
***************
*** 69,72 ****
--- 69,73 ----
import com.babeldoc.core.option.ConfigOption;
import com.babeldoc.core.option.IConfigOptionType;
+ import com.babeldoc.core.option.BooleanConfigOptionType;
import com.babeldoc.core.pipeline.*;
***************
*** 87,90 ****
--- 88,92 ----
/** The single configuration option */
public static final String CALL_STAGE = "callStage";
+ public static final String DISCARD_RESULTS = "discardResults";
/**
***************
*** 104,108 ****
ArrayList options = new ArrayList();
options.add(new ConfigOption(CALL_STAGE, IConfigOptionType.STRING,
! null, false, I18n.get("core.pipeline.stage.callstage.callStage")));
return options;
--- 106,112 ----
ArrayList options = new ArrayList();
options.add(new ConfigOption(CALL_STAGE, IConfigOptionType.STRING,
! null, true, I18n.get("core.pipeline.stage.callstage.callStage")));
! options.add(new ConfigOption(DISCARD_RESULTS, IConfigOptionType.BOOLEAN,
! "true", false, I18n.get("core.pipeline.stage.callstage.discard")));
return options;
***************
*** 122,139 ****
public PipelineStageResult[] process() throws PipelineException {
String callStage = getOptions(CALL_STAGE);
- ArrayList alist = new ArrayList();
- PipelineFactoryFactory.process(callStage, this.getDocument(),
- this.getTicket(), alist);
! // Convert from the called PipelineStageResult.name which is null to the
! // actual next pipelinestage name
! PipelineStageResult[] docs = (PipelineStageResult[]) alist.toArray(new PipelineStageResult[alist.size()]);
! String name = this.getNextPipelineStageName();
! for (int i = 0; i < docs.length; ++i) {
! docs[i].setNamePipelineStage(name);
! }
! return docs;
}
}
--- 126,151 ----
public PipelineStageResult[] process() throws PipelineException {
String callStage = getOptions(CALL_STAGE);
! if(this.hasOption(DISCARD_RESULTS)&&this.getOptions(DISCARD_RESULTS).equals(BooleanConfigOptionType.TRUE)) {
! PipelineDocument pdoc = (PipelineDocument)this.getDocument().clone();
! PipelineFactoryFactory.process(callStage, this.getDocument(),
! this.getTicket(), null);
! this.setDocument(pdoc);
! return this.processHelper();
! } else {
! ArrayList alist = new ArrayList();
! PipelineFactoryFactory.process(callStage, this.getDocument(),
! this.getTicket(), alist);
! // Convert from the called PipelineStageResult.name which is null to the
! // actual next pipelinestage name
! PipelineStageResult[] docs = (PipelineStageResult[]) alist.toArray(new PipelineStageResult[alist.size()]);
! String name = this.getNextPipelineStageName();
! for (int i = 0; i < docs.length; ++i) {
! docs[i].setNamePipelineStage(name);
! }
! return docs;
! }
}
}
Index: RouterPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/RouterPipelineStage.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** RouterPipelineStage.java 15 Jul 2003 15:07:53 -0000 1.10
--- RouterPipelineStage.java 5 Aug 2003 23:49:27 -0000 1.11
***************
*** 67,80 ****
import com.babeldoc.core.I18n;
import com.babeldoc.core.option.*;
! import com.babeldoc.core.pipeline.PipelineStage;
! import com.babeldoc.core.pipeline.PipelineStageInfo;
! import com.babeldoc.core.pipeline.PipelineStageType;
! import java.util.ArrayList;
! import java.util.Collection;
! import java.util.TreeMap;
! import java.util.Iterator;
! import java.util.HashMap;
/**
--- 67,75 ----
import com.babeldoc.core.I18n;
+ import com.babeldoc.core.NameValuePair;
import com.babeldoc.core.option.*;
! import com.babeldoc.core.pipeline.*;
! import java.util.*;
/**
***************
*** 107,137 ****
public RouterPipelineStage() {
super(new PipelineStageInfo() {
! public String getName() {
! return "Router";
! }
! public String getDescription() {
! return I18n.get("100110");
! }
! public Collection getTypeSpecificOptions() {
! ArrayList options = new ArrayList();
! /**
! * Define the type of the complex configuration option - it has one
! * subtype and the subtype accepts values of service type:
! * PipelineStage
! */
! IConfigOptionType routerType = new ComplexConfigOptionType(new ConfigOption[] { new ConfigOption(
! NEXT_STAGE_NAME,
! new ServiceTypeConfigOptionType(
! PipelineStageType.SERVICE_PREFIX), I18n.get("100111")) });
! //add specific options
! options.add(new ConfigOption(NEXTSTAGE, routerType, I18n.get("100111")));
! return options;
! }
! });
}
--- 102,132 ----
public RouterPipelineStage() {
super(new PipelineStageInfo() {
! public String getName() {
! return "Router";
! }
! public String getDescription() {
! return I18n.get("100110");
! }
! public Collection getTypeSpecificOptions() {
! ArrayList options = new ArrayList();
! /**
! * Define the type of the complex configuration option - it has one
! * subtype and the subtype accepts values of service type:
! * PipelineStage
! */
! IConfigOptionType routerType = new ComplexConfigOptionType(new ConfigOption[]{new ConfigOption(
! NEXT_STAGE_NAME,
! new ServiceTypeConfigOptionType(
! PipelineStageType.SERVICE_PREFIX), I18n.get("100111"))});
! //add specific options
! options.add(new ConfigOption(NEXTSTAGE, routerType, I18n.get("100111")));
! return options;
! }
! });
}
***************
*** 144,171 ****
* @throws com.babeldoc.core.pipeline.PipelineException
*/
! public com.babeldoc.core.pipeline.PipelineStageResult[] process()
! throws com.babeldoc.core.pipeline.PipelineException {
! com.babeldoc.core.NameValuePair[] stages = this.getOptionList(new String[] { NEXTSTAGE });
! com.babeldoc.core.NameValuePair[] orders = this.getOptionList(new String[]{ORDER});
!
! HashMap orderByStageName = new HashMap();
! if (orders != null) {
! for (int i = 0; i < orders.length; i++) {
! String stage = orders[i].getName();
! String orderStr = orders[i].getValue();
! Integer order = null;
! try {
! order = new Integer(orderStr);
! }
! catch (NumberFormatException nfe) {
! order = new Integer(stage.hashCode());
! }
! orderByStageName.put(stage, order);
! }
}
!
! TreeMap tm = new TreeMap();
! // Now templatize and enrich the document
if ((stages != null) && (stages.length > 0)) {
for (int i = 0; i < stages.length; ++i) {
--- 139,169 ----
* @throws com.babeldoc.core.pipeline.PipelineException
*/
! public PipelineStageResult[] process()
! throws PipelineException {
! NameValuePair[] stages = this.getOptionList(new String[]{NEXTSTAGE});
! NameValuePair[] orders = this.getOptionList(new String[]{ORDER});
!
! Map orderByStageName = getOrders(orders);
!
! // Now get the routes, optionally ordered.
! Map tm = getOrderedRoutes(stages, orderByStageName);
!
! // If one or more routes where selected, then build the array
! if (tm.size() > 0) {
! int index = 0;
! PipelineStageResult[] results = new PipelineStageResult[tm.size()];
! for (Iterator i = tm.keySet().iterator(); i.hasNext();) {
! Object key = i.next();
! results[index++] = (PipelineStageResult) tm.get(key);
! }
!
! return results;
! } else {
! return super.processHelper();
}
! }
! private Map getOrderedRoutes(NameValuePair[] stages, Map orderByStageName) {
! Map tm = new TreeMap();
if ((stages != null) && (stages.length > 0)) {
for (int i = 0; i < stages.length; ++i) {
***************
*** 174,200 ****
if (Boolean.valueOf(script).booleanValue()) {
! Integer order = (Integer)orderByStageName.get(stage);
if (order == null) {
! order = new Integer(stage.hashCode());
}
! com.babeldoc.core.pipeline.PipelineStageResult psr = new com.babeldoc.core.pipeline.PipelineStageResult(stage, getDocument(), getTicket());
tm.put(order, psr);
}
}
}
! // If one or more routes where selected, then build the array
! if (tm.size() > 0) {
! int index = 0;
! com.babeldoc.core.pipeline.PipelineStageResult[] results = new com.babeldoc.core.pipeline.PipelineStageResult[tm.size()];
! for (Iterator i = tm.keySet().iterator(); i.hasNext(); ) {
! Object key = i.next();
! results[index++] = (com.babeldoc.core.pipeline.PipelineStageResult)tm.get(key);
! }
!
! return results;
! } else {
! return super.processHelper();
}
}
}
--- 172,203 ----
if (Boolean.valueOf(script).booleanValue()) {
! Integer order = (Integer) orderByStageName.get(stage);
if (order == null) {
! order = new Integer(stage.hashCode());
}
! PipelineStageResult psr = new PipelineStageResult(stage, getDocument(), getTicket());
tm.put(order, psr);
}
}
}
+ return tm;
+ }
! private Map getOrders(NameValuePair[] orders) {
! Map orderByStageName = new HashMap();
! if (orders != null) {
! for (int i = 0; i < orders.length; i++) {
! String stage = orders[i].getName();
! String orderStr = orders[i].getValue();
! Integer order = null;
! try {
! order = new Integer(orderStr);
! } catch (NumberFormatException nfe) {
! order = new Integer(stage.hashCode());
! }
! orderByStageName.put(stage, order);
! }
}
+ return orderByStageName;
}
}
|
|
From: <tr...@us...> - 2003-08-05 23:49:30
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline
In directory sc8-pr-cvs1:/tmp/cvs-serv25766/src/com/babeldoc/core/pipeline
Modified Files:
PipelineDocument.java
Log Message:
Enhanced the callstage stage and added some comments to router stage
Index: PipelineDocument.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineDocument.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PipelineDocument.java 27 Jun 2003 02:19:58 -0000 1.13
--- PipelineDocument.java 5 Aug 2003 23:49:27 -0000 1.14
***************
*** 93,97 ****
* @version 1.0
*/
! public class PipelineDocument implements INamed, Serializable {
//Moved from ScanDocument since it is more general
public static final String NAME = "file_name";
--- 93,97 ----
* @version 1.0
*/
! public class PipelineDocument implements INamed, Serializable, Cloneable {
//Moved from ScanDocument since it is more general
public static final String NAME = "file_name";
***************
*** 132,138 ****
/**
! * TODO: DOCUMENT ME!
*
! * @return DOCUMENT ME!
*/
public Map getAttributes() {
--- 132,138 ----
/**
! * Get all the attributes on the pipeline document
*
! * @return map of attributes
*/
public Map getAttributes() {
***************
*** 328,336 ****
/**
! * TODO: DOCUMENT ME!
*
! * @param object DOCUMENT ME!
*
! * @return DOCUMENT ME!
*/
public boolean equals(Object object) {
--- 328,336 ----
/**
! * Equality operator
*
! * @param object test this object
*
! * @return boolean indicating equality
*/
public boolean equals(Object object) {
***************
*** 408,412 ****
/**
! * convert to a string
*
* @return DOCUMENT ME!
--- 408,412 ----
/**
! * toXml to a string
*
* @return DOCUMENT ME!
***************
*** 414,417 ****
--- 414,426 ----
public String toString() {
return new String(buffer);
+ }
+
+ /**
+ * Kinda clone
+ *
+ * @return
+ */
+ public Object clone() {
+ return new PipelineDocument(this, getBytes());
}
}
|
|
From: <tr...@us...> - 2003-08-05 23:49:30
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/config/i18n In directory sc8-pr-cvs1:/tmp/cvs-serv25766/config/i18n Modified Files: messages.properties Log Message: Enhanced the callstage stage and added some comments to router stage Index: messages.properties =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/config/i18n/messages.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** messages.properties 5 Aug 2003 23:28:30 -0000 1.15 --- messages.properties 5 Aug 2003 23:49:27 -0000 1.16 *************** *** 368,373 **** core.pipeline.stage.domify.validate=Validate the XML core.pipeline.stage.domify.schema=The schema file to validate against ! core.pipeline.stage.callstage.desc=Allows a pipeline to call another pipeline core.pipeline.stage.callstage.callStage=Pipeline to call core.pipeline.stage.enrich.desc=Adds attributes to the document. The value can be a velocity script. core.pipeline.stage.filewriter.desc=Writes the document to a disk file. The contents are written as binary or text data depending on the binary flag on the document. --- 368,376 ---- core.pipeline.stage.domify.validate=Validate the XML core.pipeline.stage.domify.schema=The schema file to validate against ! ! core.pipeline.stage.callstage.desc=Allows a pipeline to call another pipelinestage. This pipeline stage is very useful in that it allows for modular pipeline configurations. The result of the called pipeline is either used instead of the current pipeline document or is discarded depending on the setting of the discardResults configuration core.pipeline.stage.callstage.callStage=Pipeline to call + core.pipeline.stage.callstage.discard=Discard the pipeline document from the called stage. + core.pipeline.stage.enrich.desc=Adds attributes to the document. The value can be a velocity script. core.pipeline.stage.filewriter.desc=Writes the document to a disk file. The contents are written as binary or text data depending on the binary flag on the document. |
|
From: <tr...@us...> - 2003-08-05 23:39:28
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/command
In directory sc8-pr-cvs1:/tmp/cvs-serv23033
Modified Files:
PipelineCommand.java
Log Message:
Should have been calling parent method.
Index: PipelineCommand.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/command/PipelineCommand.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PipelineCommand.java 16 Jul 2003 22:45:27 -0000 1.7
--- PipelineCommand.java 5 Aug 2003 23:39:25 -0000 1.8
***************
*** 118,121 ****
--- 118,122 ----
*/
public void execute(CommandLine commandLine) {
+ super.execute(commandLine);
try {
if (commandLine.hasOption('Q')) {
|
|
From: McDonald, B. <Bru...@ba...> - 2003-08-05 23:35:49
|
Quick answer: 1. No formal way to do so. Choose a string identifier (take a look at some of the other examples) and then add the entry to the resource bundle and make the change to your code. You can easily test this. 2. Same as above. 3. No, the printUsage can automatically printusage for all defined arguments. -----Original Message----- From: David Glick [mailto:dg...@co...] Sent: Tuesday, August 05, 2003 11:15 AM To: bab...@li... Subject: [Babeldoc-devel] Config file dump committed; questions for completing Hi Bruce, I've committed my changes to dump the configuration files and contents. Hopefully, the following questions will make sense: 1. In the setupCommandLine() method, I've hard-coded the description string. I believe it should be changed into a reference key into the resource bundles (as the other description strings are in the same method), but I'm not sure if there is a formal way to do so. How do I assign the appropriate resource key? 2. I added a method printConfigInfo(). It also has a hard-coded string that should be changed. Same question as in #1 above. 3. Should the new '-d' option be added to the printUsage() method? It wasn't clear to me where it actually should be put. Thanks, David -- David Glick Transmit Consulting, Inc 619-475-4052 dg...@tr... ------------------------------------------------------- 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: Bruce M. <br...@mc...> - 2003-08-05 23:31:56
|
David, Take a look at the LightConfigCommand class. As for the logging thing - we do have the -v flag which is *NOT* being used. This could be used to increase the logging level to debug - that certainly would make all kinds of logging happen. Let me look into that... regards, Bruce. On Tuesday 05 August 2003 02:00 pm, David Glick wrote: > Okay, I understand how you're using it, and I think I can make it work for > my scenario. If the '-l' and '-t' switches aren't present, does it default > to the original functionality, e..g list all config files and their > contents? > > Also, I had intended for the '-d' switch to be available for all modules to > output appropriate debug information. For example, a soap writer might > dump the soap envelope and all the protocol packets. This can also be > accomplished, I suppose, by increasing (decreasing? I always get confused > which way it goes to show more info) the logging level; is there currently > a way to set the log level on the command line? > > Also, I still don't understand how to move hard-coded strings into the > resource bundles...? > > > Thanks, > > David > > On Tuesday 05 August 2003 10:34 am, McDonald, Bruce wrote: > > David, > > > > Interesting - I did not think of that but still I think that it will > > probably be just as useful. Here is a usage scenario: > > > > Lets say that the configuration 'pipeline/config' is somehow broken and > > we need to track the configuration key, documentation.type, the command: > > > > C:\work\vap_rpt>babeldoc lightconfig -l pipeline/config -t > > documentation.type Listing urls for the configuration: > > pipeline/config.properties > > 1: > > jar:file:/c:/download/babeldoc/build/lib/babeldoc_core.jar!/core/pipeline > >/c onfig.properties documentation.type = simple > > 0: file:/C:/work/vap_rpt/./pipeline/config.properties > > documentation.type Not defined > > > > > > > > This tells me that the file pipeline/config.properties appears twice in > > the configuration and the configuration key, documentation.type is > > defined in the first configuration only and its value is simple. > > > > regards, > > Bruce. > > > > -----Original Message----- > > From: David Glick [mailto:dg...@co...] > > Sent: Tuesday, August 05, 2003 1:39 PM > > To: McDonald, Bruce; bab...@li... > > Subject: Re: [Babeldoc-devel] Config file dump committed; questions for > > completing > > > > > > Yeah, that's just what I had planned for rev 2... :-) > > > > I like your additional functionality, but I'm unclear as to what the > > advantage is of changing it from a command line switch into a separate > > command. I had assumed that this would be most useful in conjunction > > with another command that was not operating the way you expected. I > > therefore intended for this switch to be added to the original command > > line so that you could re-run it and determine if the problem was in the > > configuration, or elsewhere. If it is now a separate command, how will > > be above scenario play out? > > > > > > David > > > > On Tuesday 05 August 2003 10:05 am, McDonald, Bruce wrote: > > > David, > > > > > > I am spending some time with this tool. > > > > > > Heres what I have done so far: > > > > > > 1. Extracted the code into a new command: lightconfig > > > 2. Added another parameter (-t) which tracks a configuration value. > > > It will indicate those files that override the configuration value. > > > > > > regards, > > > Bruce. > > > > > > -----Original Message----- > > > From: David Glick [mailto:dg...@co...] > > > Sent: Tuesday, August 05, 2003 11:15 AM > > > To: bab...@li... > > > Subject: [Babeldoc-devel] Config file dump committed; questions for > > > completing > > > > > > > > > Hi Bruce, > > > > > > I've committed my changes to dump the configuration files and contents. > > > Hopefully, the following questions will make sense: > > > > > > 1. In the setupCommandLine() method, I've hard-coded the description > > > string. I believe it should be changed into a reference key into the > > > resource bundles (as the other description strings are in the same > > > method), but I'm not sure if there is a formal way to do so. How do I > > > assign the appropriate resource key? > > > > > > 2. I added a method printConfigInfo(). It also has a hard-coded string > > > that should be changed. Same question as in #1 above. > > > > > > 3. Should the new '-d' option be added to the printUsage() method? It > > > wasn't clear to me where it actually should be put. > > > > > > > > > Thanks, > > > > > > David |
|
From: <tr...@us...> - 2003-08-05 23:28:32
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage
In directory sc8-pr-cvs1:/tmp/cvs-serv21227/src/com/babeldoc/core/pipeline/stage
Modified Files:
XslTransformPipelineStage.java
Log Message:
Now able to add arbitraty numbers of parameters to the XSL transformer thereby making the whole thing more powerful (I hope)
Index: XslTransformPipelineStage.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/stage/XslTransformPipelineStage.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** XslTransformPipelineStage.java 4 Aug 2003 23:41:03 -0000 1.16
--- XslTransformPipelineStage.java 5 Aug 2003 23:28:30 -0000 1.17
***************
*** 68,73 ****
--- 68,75 ----
import com.babeldoc.core.I18n;
import com.babeldoc.core.ResourceLoader;
+ import com.babeldoc.core.NameValuePair;
import com.babeldoc.core.option.ConfigOption;
import com.babeldoc.core.option.IConfigOptionType;
+ import com.babeldoc.core.option.ComplexConfigOptionType;
import com.babeldoc.core.pipeline.*;
***************
*** 76,83 ****
import java.net.URL;
! import java.util.ArrayList;
! import java.util.Collection;
! import java.util.Map;
! import java.util.WeakHashMap;
import javax.xml.transform.*;
--- 78,82 ----
import java.net.URL;
! import java.util.*;
import javax.xml.transform.*;
***************
*** 95,99 ****
* script XSLT is also cached, again leading to performance improvements.
* </p>
! *
* <p>
* There are a number of parameters which are set in the tranformer which will
--- 94,98 ----
* script XSLT is also cached, again leading to performance improvements.
* </p>
! *
* <p>
* There are a number of parameters which are set in the tranformer which will
***************
*** 112,115 ****
--- 111,117 ----
public static final String TRANSFORMATION_SCRIPT = "transformationScript";
private static Map map = null;
+ public static final String PARAM = "param";
+ public static final String PARAM_PIPELINESTAGE = "pipelinestage";
+ public static final String PARAM_DOCUMENT = "document";
/**
***************
*** 123,127 ****
public String getDescription() {
! return I18n.get("core.stage.xslTransform.desc");
}
--- 125,129 ----
public String getDescription() {
! return I18n.get("core.pipeline.stage.xslTransform.desc");
}
***************
*** 131,138 ****
options.add(new ConfigOption(TRANSFORMATION_FILE,
IConfigOptionType.FILENAME, null, false,
! I18n.get("core.stage.xslTransform.file")));
options.add(new ConfigOption(TRANSFORMATION_SCRIPT,
IConfigOptionType.MULTI, null, false,
! I18n.get("core.stage.xslTransform.script")));
return options;
--- 133,148 ----
options.add(new ConfigOption(TRANSFORMATION_FILE,
IConfigOptionType.FILENAME, null, false,
! I18n.get("core.pipeline.stage.xslTransform.file")));
options.add(new ConfigOption(TRANSFORMATION_SCRIPT,
IConfigOptionType.MULTI, null, false,
! I18n.get("core.pipeline.stage.xslTransform.script")));
!
! // This allows for arbitrary numbers of parameters to be added to the
! // XSL transformer.
! IConfigOptionType param = new ComplexConfigOptionType(new ConfigOption[] { new ConfigOption(
! PARAM, IConfigOptionType.STRING, I18n.get("core.pipeline.stage.xslTransform.param")) });
!
! //add specific options
! options.add(new ConfigOption(PARAM, param, I18n.get("core.pipeline.stage.xslTransform.param")));
return options;
***************
*** 344,353 ****
private PipelineDocument transformDocument(String xslfile, String xslscript)
throws TransformerException, PipelineException, IOException {
! // Create a transform factory instance.
Transformer transformer = getTransformer(xslfile, xslscript);
! // Create a transformer for the stylesheet.
! transformer.setParameter("pipelinestage", this);
! transformer.setParameter("document", this.getDocument());
byte[] data = transformInputStream(transformer,
--- 354,361 ----
private PipelineDocument transformDocument(String xslfile, String xslscript)
throws TransformerException, PipelineException, IOException {
! // Get a transform.
Transformer transformer = getTransformer(xslfile, xslscript);
! addParametersToTransformer(transformer);
byte[] data = transformInputStream(transformer,
***************
*** 360,363 ****
--- 368,392 ----
return newDoc;
}
+
+ /**
+ * Add the parameters to the transformer. There are mandatory and
+ * configurable parameters.
+ *
+ * @param transformer
+ */
+ private void addParametersToTransformer(Transformer transformer) {
+ // Now add the mandatory parameters
+ transformer.setParameter(PARAM_PIPELINESTAGE, this);
+ transformer.setParameter(PARAM_DOCUMENT, this.getDocument());
+
+ // And any other parameters that might be configured.
+ NameValuePair[] params = this.getOptionList(new String[] { PARAM });
+ if ((params != null) && (params.length > 0)) {
+ for (int i = 0; i < params.length; i++) {
+ NameValuePair param = params[i];
+ transformer.setParameter(param.getName(), param.getValue());
+ }
+ }
+ }
}
***************
*** 379,385 ****
/**
! * TODO: DOCUMENT ME!
*
! * @return DOCUMENT ME!
*/
public Templates getTemplate() {
--- 408,414 ----
/**
! * Get the template on the cache item
*
! * @return
*/
public Templates getTemplate() {
***************
*** 408,412 ****
/**
! * TODO: DOCUMENT ME!
*
* @return DOCUMENT ME!
--- 437,441 ----
/**
! * Get the file name for the cached object
*
* @return DOCUMENT ME!
***************
*** 417,421 ****
/**
! * TODO: DOCUMENT ME!
*
* @return DOCUMENT ME!
--- 446,450 ----
/**
! * Get the modified timestamp
*
* @return DOCUMENT ME!
|