RE: redirect at the end of a pipeline/match

2003-06-05 Thread Neil Palmer
I'm looking to do the same thing - I'm using Cocoon purely for it's 
XML generation/transformation capabilities, while my actual application
is using JBoss/Jetty & Struts.

Basically I have an admin app that allows you to marshall a business 
object via Castor, perform various transformations on it and then 
serialize the result to an XML file.  This XML file will then get 
pushed out to production for use on the front end customer facing app.
However, I'd love to be able to redirect back to the admin home page 
after the xml serializaton.  I'm not actually using Cocoon for any
content presentation.

I've only been using Cocoon (2.0.4) for a couple of months, so if
there's a better way of doing this, I'm all ears.  While the redirect
after the serialization isn't critical, it'd certainly be nice.

cheers,
neil.

-Original Message-
From: Geoff Howard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 04, 2003 2:05 PM
To: [EMAIL PROTECTED]
Subject: Re: redirect at the end of a pipeline/match

What would the purpose be of sending xml back as a result and then
redirecting the client?  This "need" keeps coming up when using the
transformers with side effects, of which the sql transformer is one.

Again, why do you need to redirect?  Why not serve them the content
you want them to have right away?

Geoff

At 01:46 PM 6/4/2003, you wrote:
>I'm looking for a clean way to 'redirect' a user back to a page, at the

>end of a pipeline.
>
>
>
>
>
>
>
>
>
>
>map:redirect doesn't work because it skips the generate and transform. 
>Browsing through the mail archive someone suggest's using a meta
redirect 
>tag in generated html. 
>(http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=105464887116737&w=2
)
>
>This would work but it seems clunky.. There must be a cleaner way to 
>accomplish this.?
>
>-Daniel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



TextParserGenerator question

2003-03-27 Thread Neil Davies
Is there actually a working TextParserGenerator? I've not seen any 
examples of anyone using it on the web.

I can't get Cocoon to recognise it in the sitemap decleration.

Thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: error trying to use TextParserGenerator

2003-03-26 Thread Neil Davies


Is there a detailed exception in the logs under WEB-INF/logs/*.log ?
(Perhaps you must set the log level higher)
With this exception I can only draw the conclusion, that the generator
have problems with the configuration within the components section.
Stephan.

Okay. I have looked at the error.log file, I meant to mention this in my 
last email but I sent it without realising I hadn't, and it mentioned a 
ClassNotFoundException on the TextParserGenerator. I have looked in the 
sitemap.xmap in the jakara-home/webapps/cocoon directory and there is no 
mention of a TextParserGenerator in there, which must be causing the 
problem.

I am using Cocoon 2.0.4, which is the latest version I think. Is the 
TextParserGenerator included with this? The other generators work 
without any bother.

Can anyone point me in the direction of some information on this 
subject? I have looked at the user-documentation on the 
TextParserGenerator online.

Here is the error-report if it is of any help:

ERROR   (2003-03-26) 17:24.25:543   [core.manager] (/cocoon/eadcairs) 
Thread-10/Handler: Error compiling sitemap
org.apache.avalon.framework.configuration.ConfigurationException: Error 
in sitemap configuration : org.apache.cocoon.generation.TextParserGenerator
   at 
org.apache.cocoon.www.file_.C_.jakarta_tomcat.webapps.cocoon.c2.eadcairs.sitemap_xmap.configure(C:\jakarta-tomcat\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/file_/C_/jakarta_tomcat/webapps/cocoon/c2/eadcairs\sitemap_xmap.java:148)
   at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:264)
   at 
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:98)
   at 
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:187)
   at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:357)
   at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:312)
   at org.apache.cocoon.sitemap.Handler.run(Handler.java:267)
   at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.ClassNotFoundException: 
org.apache.cocoon.generation.TextParserGenerator
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1428)
   at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
   at org.apache.cocoon.util.ClassUtils.loadClass(ClassUtils.java:88)
   at 
org.apache.cocoon.sitemap.AbstractSitemap.load_component(AbstractSitemap.java:263)
   at 
org.apache.cocoon.www.file_.C_.jakarta_tomcat.webapps.cocoon.c2.eadcairs.sitemap_xmap$Configurer.configGenerators(C:\jakarta-tomcat\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/file_/C_/jakarta_tomcat/webapps/cocoon/c2/eadcairs\sitemap_xmap.java:170)
   at 
org.apache.cocoon.www.file_.C_.jakarta_tomcat.webapps.cocoon.c2.eadcairs.sitemap_xmap.configure(C:\jakarta-tomcat\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/file_/C_/jakarta_tomcat/webapps/cocoon/c2/eadcairs\sitemap_xmap.java:126)
   at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:264)
   at 
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:98)
   at 
org.apache.cocoon.components.language.generator.GeneratorSelector.addGenerator(GeneratorSelector.java:187)
   at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:357)
   at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:312)
   at org.apache.cocoon.sitemap.Handler.run(Handler.java:267)
   at java.lang.Thread.run(Thread.java:536)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


error trying to use TextParserGenerator

2003-03-26 Thread Neil Davies




Apologies if this has been answered previously but I'm a relative newbie to Cocoon2.

I have a structured text file which is exported from a database (non SQL, a complete mess so there's no chance of using standard xsl logic to extract data) and need to convert it into ead-xml.

I am trying to see if I am capable of doing this using a TextParserGenerator to get it into an XML format that I can manipulate into ead. Unfortunately I keep getting the following Internal Server Error:

type fatal
message Error in sitemap configuration : org.apache.cocoon.generation.TextParserGenerator
description org.apache.avalon.framework.configuration.ConfigurationException: Error in sitemap configuration : org.apache.cocoon.generation.TextParserGenerator
sender org.apache.cocoon.servlet.CocoonServlet
source Cocoon servlet

Here's the bulk of the sitemap:

"http://apache.org/cocoon/sitemap/1.0">

	


-- other components --





		
		







If the grammer file would be helpful I'll post it, but I'll try and keep this minimal for now.

Thanks.





RE: Cocoon-2.1-dev build fails

2003-03-25 Thread neil
Re: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104865067609362&w=2

1. Ok, lib/core/util.concurrent-1.3.1.jar has been added to fix this.
   (I'd added 1.3.2 locally and that also works).

2. I had a look at build.xml and figured out that I need:

./build.sh \
 -Dinclude.webapp.libs=yes \
 -Dexclude.webapp.samples=yes \
 -Dexclude.webapp.documenation=yes \
 -Dexclude.webapp.javadocs=yes \
 -Dexclude.scratchpad=yes \
 -Dexclude.webapp.scratchpad=yes \
 -Dexclude.webapp.idldocs=yes \
 war

to build a minimal cocoon.war. This works fine.
(got a runtime error (when running cocoon) when I also tried -Dexclude.deprecated=yes).

Cheers,
Neil Bacon

-Original Message-
From: Geoff Howard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 March 2003 3:06 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Cocoon-2.1-dev build fails


Neil, I can't reproduce this problem.  I did build clean and excluded xmldb
block via local.blocks.properties.  The build ran fine, and cocoon started
up with no error (in jetty, but still...).  After trying a fresh cvs update,
and a build clean if you still have this problem can you specify what other
blocks you're excluding if any and how to reproduce the no class def error
(like what samples page?).  Also, since you obviously have both tomcat and
jetty ready to go, can you try it in jetty (cocoon.bat servlet).

Geoff

> -Original Message-
> From: neil [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 25, 2003 5:22 PM
> To: Cocoon-Users (E-mail)
> Subject: Re: Cocoon-2.1-dev build fails
>
>
> Re: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104862608911688&w=2
>
> I like the way the build tries to let you include just what you
> want, but there
> are a few little problems with it. Yesterday I checked out the
> CVS HEAD and now
> using jdk-1.4.1, windows2000/cygwin ...
>
> 1.
> I tried excluding blocks I don't need by using
> local.blocks.properties, but when I ran
> cocoon (in tomcat-4.1.18) I got:
>
> java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/Executor
>   at org.apache.cocoon.Cocoon.contextualize(Cocoon.java:204)
>   at
> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet
> .java:1304)
>   at
> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:505)
>   at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapp
> er.java:934)
>
> It seems that src/blocks/xmldb/lib/xmldb-api-2001.jar
> includes the package
> EDU/oswego/cs/dl/util/concurrent which is referenced elsewhere.
> So the xmldb block
> cannot be excluded.
>
> 2.
> I tried to exclude samples and docs:
>
> ./build.sh  -Dinclude.webapp.libs=yes \
> -Dexclude.webapp.samples=yes \
> -Dexclude.webapp.documenation=yes \
> -Dexclude.webapp.javadocs=yes war
>
> and got:
>
> Writing: C:\cocoon-2.1\build\webapp\WEB-INF\cocoon.xconf
>
> scratchpad-samples:
> Copying 57 files to C:\cocoon-2.1\build\webapp\samples
> Copied 1 empty directory to C:\cocoon-2.1\build\webapp\samples
> Copying 87 files to C:\cocoon-2.1\build\webapp\samples
>
> BUILD FAILED
> file:///C:/cocoon-2.1/build.xml:637: IOException:
> java.io.FileNotFoundException:
>  C:\cocoon-2.1\build\webapp\samples\samples.xml (The system
> cannot find the file
>  specified)
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cocoon-2.1-dev build fails

2003-03-25 Thread neil
Re: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104862608911688&w=2

I like the way the build tries to let you include just what you want, but there
are a few little problems with it. Yesterday I checked out the CVS HEAD and now
using jdk-1.4.1, windows2000/cygwin ...

1.
I tried excluding blocks I don't need by using local.blocks.properties, but when I ran
cocoon (in tomcat-4.1.18) I got:

java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/Executor
at org.apache.cocoon.Cocoon.contextualize(Cocoon.java:204)
at 
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1304)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:505)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:934)

It seems that src/blocks/xmldb/lib/xmldb-api-2001.jar includes the package
EDU/oswego/cs/dl/util/concurrent which is referenced elsewhere. So the xmldb block
cannot be excluded.

2.
I tried to exclude samples and docs:

./build.sh  -Dinclude.webapp.libs=yes \
-Dexclude.webapp.samples=yes \
-Dexclude.webapp.documenation=yes \
-Dexclude.webapp.javadocs=yes war

and got:

Writing: C:\cocoon-2.1\build\webapp\WEB-INF\cocoon.xconf

scratchpad-samples:
Copying 57 files to C:\cocoon-2.1\build\webapp\samples
Copied 1 empty directory to C:\cocoon-2.1\build\webapp\samples
Copying 87 files to C:\cocoon-2.1\build\webapp\samples

BUILD FAILED
file:///C:/cocoon-2.1/build.xml:637: IOException: java.io.FileNotFoundException:
 C:\cocoon-2.1\build\webapp\samples\samples.xml (The system cannot find the file
 specified)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: writing excel files with merge and coloured cells

2003-03-11 Thread neil
In reply to: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104725042020751&w=2

Although gnumeric xml allows any colour to be specified, excel only has a 56 colour 
palette.
This page shows excel's default palette (some details depend on the version):
  http://www.mvps.org/dmcritchie/excel/colors.htm
If you choose a colour that isn't in the palette I think you get white. All the 
colours I've tried
from this palette have worked except no. 45: #FF9900.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



patch for and with Sybase and MS SQL server

2003-02-17 Thread neil
The new implementation for  and 
in 
src/java/org/apache/cocoon/components/language/markup/xsp/AbstractEsqlConnection.java
is pretty neat, especially for oracle.

1) Unfortunately, Sybase Adaptive Server Enterprise does not support "select TOP",
   only Sybase Adaptive Server Anywhere. Both use urls starting with "jdbc:sybase:"
   so some other means must be used to distinguish between them.

2) MS SQL Server also supports "select TOP", so SybaseEsqlQuery should be used with it 
too.

Here is a patch to address this stuff:

--- 
/cygdrive/c/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/AbstractEsqlConnection.java
Sat Feb  1 09:49:18 2003
+++ 
+../src/java/org/apache/cocoon/components/language/markup/xsp/AbstractEsqlConnection.java
+Tue Feb 18 12:00:38 2003
@@ -122,6 +122,19 @@


 /**
+ * Sybase has 2 RDBMS products. The Sybase JDBC driver uses a url starting with 
+"jdbc:sybase:" for both.
+ * Here are the product names and versions returned from the Sybase JDBC driver:
+ *getMetaData().getDatabaseProductName()  
+getMetaData().getDatabaseProductVersion()
+ * 1) Adaptive Server Anywhere7.0.4.3373
+ * 2) Sybase SQL Server   Adaptive Server 
+Enterprise/12.0.0.3/P/SWR 9777 ESD 4/NT (IX86)/OS
4.0/1699/32bit/OPT/Wed Sep 05 21:14:50 2001
+ * The first supports "select TOP" as used by SybaseEsqlQuery, but the second 
+does not.
+ */
+private boolean isSybaseAdaptiveServerAnywhere() throws SQLException {
+   String databaseProductName = 
+getConnection().getMetaData().getDatabaseProductName().toLowerCase();
+   return databaseProductName.indexOf("anywhere") > -1;
+}
+
+/**
  * Factory method for creating an EsqlQuery object. If type is set to
  * "" or "auto" it will try to find type from the JDBC connection URL.
  * If this does not succeed the generic JDBC type will be assumed.
@@ -144,6 +157,15 @@
 query = new MysqlEsqlQuery(this,queryString);
 }
 else if (url.startsWith("jdbc:sybase:")) {
+   if (isSybaseAdaptiveServerAnywhere()) {
+   query = new SybaseEsqlQuery(this,queryString);
+   } else {
+   query = new JdbcEsqlQuery(this,queryString);
+   }
+}
+   else if(url.startsWith("jdbc:microsoft:sqlserver:")) {
+   // MS SQL Server also supports "select TOP" like Sybase ASA
+   // Maybe SybaseEsqlQuery should be renamed to something like 
+SelectTopEsqlQuery?
 query = new SybaseEsqlQuery(this,queryString);
 }
 else if (url.startsWith("jdbc:oracle:")) {
@@ -155,6 +177,13 @@
 }
 }
 else if ("sybase".equalsIgnoreCase(type)) {
+   if (isSybaseAdaptiveServerAnywhere()) {
+   query = new SybaseEsqlQuery(this,queryString);
+   } else {
+   query = new JdbcEsqlQuery(this,queryString);
+   }
+}
+else if ("mssqlserver".equalsIgnoreCase(type)) {
 query = new SybaseEsqlQuery(this,queryString);
 }
 else if ("postgresql".equalsIgnoreCase(type)) { query = new 
PostgresEsqlQuery(this,queryString);


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Cocoon generated Excel data and IIS with WebDav

2003-01-27 Thread neil
People generating dynamic Excel data and using MS IIS may hit this problem. I've 
posted it because it affects cocoon users, even
though its not really anything to do with cocoon.

Environment
---
MS IIS v5 web server with dynamic content redirected to tomcat/cocoon.


Problem
---
Some client PC's see cocoon generated excel data correctly (data shown in an Excel 
spreadsheet inside the IE window), but other PC's
get the applications "session timed out" HTML page displayed inside Excel!
I'm not sure if its related to the version of IE, but I sometimes had the problem with 
IE5 and sometimes didn't have
it with IE6.
The problem goes away if the client bypasses IIS by using tomcat's port 8080.


Solution

Disable webdav in IIS v5 by adding an entry to the registry. Put the following in a 
*.reg file then double click it.

REGEDIT4
; Disable WebDAV for IIS 5.0 - see 
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q241520&;
; otherwise some IE browser's perform a WebDAV LOCK on the URL after downloading an 
Excel spreadsheet.
; Cocoon seems to treat the LOCK as a GET, but since the request has no sessionID it 
redirects to the
; SessionTimedOut page.
; If you need WebDAV then removing NTFS write access from all files and dirs in the 
application should
; also work.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters]
"DisableWebDAV"=dword:0001


Cause
-
WebDAV allows you to use your web browser to open/lock/write files served by a web 
server.
In IIS5 WebDAV is always enabled for any files/dirs that have NTFS write permission 
unless you disable it using regedit.

IIS & cocoon logs show that when some versions of IE download a cocoon generated excel 
spreadsheet they do this:

METHOD: POST on URL /cocoon/pinnacle/asReportByType.xsp
this generates the excel data

METHOD: OPTIONS (an HTTP 1.1 method) on URL /cocoon/pinnacle
since I've configured only *.xsp to be redirected IIS responds.
IIS must say something about whether the URL is WebDAV editable.

METHOD: LOCK (a WebDAV extension to HTTP 1.1) on URL 
/cocoon/pinnacle/asReportByType.xsp
This request is generated by the browser, but it has no session and has a header:
  user-agent=Microsoft Data Access Internet Publishing Provider DAV 1.1

Cocoon logs the method as LOCK but treats it the same as a GET (and my application 
doesn't check the method).
Since there's no session my application redirects to the session timed out page.
This page gets displayed inside Excel instead of the Excel report.


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Excel needs filename?

2003-01-27 Thread neil
Problem: IE not recognizing Excel data generated by cocoon as being an Excel 
spreadsheet.

1) This is due to a bug in HSSFSerializer.java, where the mime-type is hardcoded as 
"vnd.ms-excel"
   (the correct mime-type for Excel is "application/vnd.ms-excel"). Once this is fixed 
it works fine
   with IE/Excel so the problem is not due to a bug in IE.

2) HSSFSerializer.java ignores any mime-type configured in the sitemap. This is 
reasonable
   because there is only one correct value so it may as well be hardcoded. 
Unfortunately the example
   sitemap includes this mime-type configuration and this has misled many innocent 
folk into thinking
   that they are using the correct mime-type when they are not.

ref to previous discussion on this:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=103895523032418&w=2
Subject: Re: HSSFSerializer mime-type
Date:2002-12-03

-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Does Cocoon work in Jetty?

2002-12-04 Thread neil
Yes I've got cocoon-2.0.3_branch and 2.1-dev working in both jetty-4.2.2 and 
tomcat-4.1.12 with no hassles
(but I'm not using JSP or jboss). I do get this exception when jetty starts - maybe 
its related to your problem:

10:20:42.207 WARN!!
org.mortbay.util.MultiException[java.lang.ClassNotFoundException: org.apache.jas
per.servlet.JspServlet]
at org.mortbay.http.HttpServer.start(HttpServer.java:655)
at org.mortbay.jetty.Server.main(Server.java:404)
[0]=java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:236)
at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:200)
at org.mortbay.http.HttpContext.loadClass(HttpContext.java:1315)
at org.mortbay.jetty.servlet.Holder.start(Holder.java:161)
at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:204)

at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHa
ndler.java:445)
at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(We
bApplicationHandler.java:163)
at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationC
ontext.java:502)
at org.mortbay.http.HttpServer.start(HttpServer.java:678)
at org.mortbay.jetty.Server.main(Server.java:404)


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: HSSFSerializer mime-type

2002-12-03 Thread neil
No, although the example sitemap includes config that looks like its setting the 
mime-type
HSSFSerializer.java doesn't actually use it. Its hardcoded - and I think its 
reasonable to
hardcode it as there is only one correct value (its just that the current hardcoded 
value
isn't it).

"Andrew C. Oliver" <[EMAIL PROTECTED]> wrote:
> IIRC this is configurable...  

> neil wrote:

>> The HSSFSerializer hardcodes the mime-type as "vnd.ms-excel" whereas I think it \
>> should be "application/vnd.ms-excel" (at lease that works better for me). Without \
>> this I got erratic behavior with IE/Excel - sometimes the spreadsheet would appear \
>> inside the IE window (excel inside IE) and othertimes it would appear inside a \
>> separate Excel window. 


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




HSSFSerializer mime-type

2002-12-02 Thread neil
The HSSFSerializer hardcodes the mime-type as "vnd.ms-excel" whereas I think it should 
be "application/vnd.ms-excel"
(at lease that works better for me). Without this I got erratic behavior with IE/Excel 
- sometimes the spreadsheet would
appear inside the IE window (excel inside IE) and othertimes it would appear inside a 
separate Excel window.

-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Problem with a store procedure in a XSP page

2002-11-24 Thread neil
Since the 2.0.3 release there have been fixes applied to esql in the 
cocoon_2_0_3_branch (that's a CVS tag). These fixes are for
stored procedure support, so I suggest you try them. I've been using them with stored 
procs in Oracle 8i, SQL Server (7 & 2000),
Sybase (ASA & ASE) and it works great.


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




XSP caching with 2.1-dev

2002-11-21 Thread neil
Hi cocooners,
I'm just trying the CVS HEAD and have a problem with some of my old 2.0.3 XSP's which 
used to be cached for 30mins.

generateValidity() now has to return a org.apache.excalibur.source.SourceValidity 
instead of a
org.apache.cocoon.caching.CacheValidity.
I used to return org.apache.cocoon.caching.DeltaTimeCacheValidity(30, 0) to cache for 
30 mins.
Is there a new substitute for this or do I have to write my own?

P.S. I like the look of the XForm & flow stuff and the performance of xsltc!
Cheers,
Neil.


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Redirect in XSP

2002-11-09 Thread Neil A
Thanks Joerg and Artur, but in my case I'm building for WAP.  
Unfortunately the WML equivalent of your client side redirect crashes 
early Nokia 7110 phones.

I really want to use  but my URL is in the XML of the 
pipeline and I can't get it into a sitemap parameter:


	
	
		
	
	

	

	


Actions can't seem to read or transform the pipeline xml, they can only 
read and act on request parameters.  XSLT transformers can't create 
sitemap parameters.  So I'm a bit stuck.  Can anyone fill in the gap?

Thanks,

Neil.


On Saturday, November 9, 2002, at 03:23 AM, Artur Bialecki wrote:



Who should close the  element? The transformer can not send an
endElement() until everything inside is processed. Of course you have

to

Ofcourse, I don't know what I was thinking.


Does this make it a bit clearer? Everybody can of course improve my


This makes it very clear.

Thanks Joerg,

Artur...


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>





-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Redirect in XSP

2002-11-08 Thread Neil A
Hi all

I joined the cocoon users list today to ask a very similar question.

I have a list of external URLs held in XML and I have a pipeline to 
pick the right one.  I want to use  within the 
sitemap, but I can't find a way to get the URL out of XML and make it a 
sitemap parameter for  to use.

Can anyone help us both?

Thanks,

Neil.


On Friday, November 8, 2002, at 09:41 AM, Witold TreliƄski wrote:

Hi!

I have a question. How to make o redirection in XSP from one page to 
other
depeneding on some code in ? I tried 

url="any"/> and it doesn't work.

WT


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: avalon.excalibur ping of oracle fails

2002-10-15 Thread neil

In cocoon.xconf, the oradb attribute in 
select 1 from dual
  
If you don't specify  it defaults to "select 1", which seems to be OK for 
everything
except Oracle.

-Original Message-
From: neil [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 10 September 2002 3:23 PM
To: Cocoon-Users (E-mail)
Subject: avalon.excalibur ping of oracle fails


Hi,
Has anyone using oracle already solved this one?

Although my app works OK, I'm getting debug messages (shown below) indicating that the 
database "ping" fails
so cocoon is dicarding the connection and creating a new one.
I guess its going slower than it could due to this.

I do have
  

  http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




fix EncodeURLTransformer to process page that generates the session

2002-09-18 Thread neil

Hi,
I've just started using org.apache.cocoon.transformation.EncodeURLTransformer and 
found it works fine
except for the first page generated after my login page i.e. the page that creates the 
session.

I see that it uses
request.isRequestedSessionIdFromURL()
to determine whether any encoding is required, but this is false for the page that 
creates the session.

If I change the test from
if ( request.isRequestedSessionIdFromURL() ) {
to
  final String fred = "fred.html";
if ( request.isRequestedSessionIdFromURL() || 
!fred.equals(response.encodeURL(fred)) ) {
then it works for this page too. Maybe there's a neater way to do the same thing?

Without this fix a workaround would be to create the session when the login form is 
generated
instead of when its posted.
Cheers,
Neil.


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




avalon.excalibur ping of oracle fails

2002-09-09 Thread neil

Hi,
Has anyone using oracle already solved this one?

Although my app works OK, I'm getting debug messages (shown below) indicating that the 
database "ping" fails
so cocoon is dicarding the connection and creating a new one.
I guess its going slower than it could due to this.

I do have
  

  http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcCo
nnection.java?rev=1.16&content-type=text/vnd.viewcvs-markup



DEBUG   (2002-09-10) 13:54.51:787   [core.datasources.webtest_ora] 
(/cocoon/pinnacle/assetDetail.xsp)
HttpProcessor[8080][1]/ResourceLimitingPool: Got a 
org.apache.avalon.excalibur.datasource.Jdbc3Connection from the pool.
DEBUG   (2002-09-10) 13:54.51:787   [core.datasources.webtest_ora] 
(/cocoon/pinnacle/assetDetail.xsp)
HttpProcessor[8080][1]/AbstractJdbcConnection: Pinging database after 6910ms of 
inactivity.
DEBUG   (2002-09-10) 13:54.51:837   [core.datasources.webtest_ora] 
(/cocoon/pinnacle/assetDetail.xsp)
HttpProcessor[8080][1]/AbstractJdbcConnection: Ping of connection failed.
java.sql.SQLException: ORA-00923: FROM keyword not found where expected

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at 
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at 
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at 
org.apache.avalon.excalibur.datasource.AbstractJdbcConnection.isClosed(AbstractJdbcConnection.java:154)
at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.validatePoolable(ResourceLimitingJdbcConnectionPool.java:1
08)
at 
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:99)
at 
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:174)
at
org.apache.cocoon.www.file_.C_.jakarta_tomcat_4_0_4_LE_jdk14.webapps.cocoon.pinnacle.oracle.locationAction_xsp.generate(C:\jakarta-t
omcat-4.0.4-LE-jdk14\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/file_/C_/jakarta_tomcat_4_0_4_LE_jdk14/weba
pps/cocoon/pinnacle/oracle\locationAction_xsp.java:335)


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: esql patch for paging and ResultSets from Oracle stored procs

2002-08-18 Thread neil

Here is a small patch to esql.xsl r1.13.2.8

1) fix runtime compilation error described in a previous posting to this thread
copy the type from 
directly into the generated code rather than use reflection as in EsqlQuery.getType()
(which should be removed if this patch is applied). Argument for doing this was 
presented in my
previous posting.

2) add paging for result set obtained from a column
e.g.

  


sessionData.getRow() - 
1

sessionData.getRowsPerPage()


Index: src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
===
RCS file: 
/home/cvspublic/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.13.2.8
diff -u -b -r1.13.2.8 esql.xsl
--- src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl 11 Aug 
2002 20:08:57 -  1.13.2.8
+++ src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl 19 Aug 
+2002 01:06:50 -
@@ -1,6 +1,7 @@
 

-
+
+
 

 creates a nested query like block that uses the result set obtained from 
a column as current result set.
 
+  
+  
 
   // nested result set
 if (_esql_query != null) {
   _esql_queries.push(_esql_query);
 }
 _esql_query = new EsqlQuery((ResultSet) );
+
+
+  try {
+_esql_query.setMaxRows( Integer.parseInt(String.valueOf().trim()) );
+  } catch (NumberFormatException e) {}
+
+
+
+  try {
+_esql_query.setSkipRows( Integer.parseInt(String.valueOf().trim()) );
+  } catch (NumberFormatException e) {}
+
+
 {

 }
@@ -1098,7 +1114,8 @@
 Types.LONGVARCHAR
 Types.LONGVARCHAR
 Types.VARBINARY
-EsqlQuery.getType("")
+
+
 Types.
   
 



-Original Message-----
From: neil [mailto:[EMAIL PROTECTED]]
Sent: Monday, 19 August 2002 9:57 AM
To: '[EMAIL PROTECTED]'; Cocoon-Users (E-mail)
Subject: RE: esql patch for paging and ResultSets from Oracle stored
procs


I would rather esql copied the type from 
directly into the generated code than use reflection as in EsqlQuery.getType() to get 
the int value (this is a change
made after cocoon-2.0.3). The generated code is DBMS specific either way so there is 
nothing wrong with it referencing
a DBMS specific class.

SQLTransformer has to use reflection because its acting as an interpreter and 
executing the queries directly rather than generating
code to do so.
Regards,
Neil.



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: esql patch for paging and ResultSets from Oracle stored procs

2002-08-18 Thread neil

I would rather esql copied the type from 
directly into the generated code than use reflection as in EsqlQuery.getType() to get 
the int value (this is a change
made after cocoon-2.0.3). The generated code is DBMS specific either way so there is 
nothing wrong with it referencing
a DBMS specific class.

SQLTransformer has to use reflection because its acting as an interpreter and 
executing the queries directly rather than generating
code to do so.
Regards,
Neil.



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: esql patch for paging and ResultSets from Oracle stored procs

2002-08-16 Thread neil

I just tried the latest from the cocoon_2_0_3_branch and got...

org.apache.cocoon.components.language.LanguageException: Error compiling control_xsp:
Line 448, column 45:  unreported exception: java.lang.IllegalAccessException; must be 
caught or declared to be thrown

Line 448 in control_xsp.java is:
registerOutParameter(1, 
EsqlQuery.getType("oracle.jdbc.driver.OracleTypes.CURSOR"));

EsqlQuery.getType(String typeName) throws ClassNotFoundException, 
NoSuchFieldException, IllegalAccessException

These need to be declared as thrown in the generated code (or caught, logged, and 
something else thrown).




Also, I don't think paging works within esql:call-results/esql:use-results e.g.:


  


sessionData.getRow() - 
1

sessionData.getRowsPerPage()
I'll look into this one next week.

Regards,
Neil.


-Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 8 August 2002 6:51 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: esql patch for paging and ResultSets from Oracle stored
procs

[snip]

> Changed get-Sql-Type so that an unrecognized type is copied verbatim into
> the java code without having "Types."

Not applied -- I believe it's better to follow the SQLTransformer here
that uses Class.forName(). Reason: reduce XSP dependency from
DBMS. Drawback: Since it's runtime it's slightly slower, OTOH an
intelligent compiler could optimize it away. Hence, different patch
applied.

[snip]


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: esql patch for paging and ResultSets from Oracle stored procs

2002-08-08 Thread neil

Thanks for applying this stuff (or alternatives) so quickly.

>> EsqlQuery.java
>> 
>> Fix paging:
>
>Thanks, an "else" was missing.
>
>> With EsqlQuery.position initialised to -1:
>>   I asked for 3 rows starting at 0 and got 4 rows starting at 0
>>   I asked for 3 rows starting at i > 0 and got 3 rows starting at i + 1
>> with position initialised to 0 it works as expected.
>
>I'm not with you on this one -- according to JDBC rows are numbered
>from 1.

OK so just decrease my row numbers by one then the same description applies:
With EsqlQuery.position initialised to -1:
  I asked for 3 rows starting at 1 and got 4 rows starting at 1
  I asked for 3 rows starting at i > 1 and got 3 rows starting at i + 1
with position initialised to 0 it works as expected.
This was without any .

The "else" that you mention - does that have something to do with this problem?

Cheers,
Neil.


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




patch to fix NullPointerException from

2002-06-03 Thread neil

I've got a form that posts multiple values for a request parameter (multiple
instances of ).

request.getParameterValues() returns a String[] with an element for each
posted value.
If nothing is entered into into one of the text fields the corresponding
element in the String[] is null, but this isn't handled by
Request object helper
+ * 
+ * Modified by Pinnacle Software to fix:
+ *
+ * java.lang.NullPointerException
+ * at
org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper.data(XSPObj
ectHelper.java:196)
+ * at
org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper.elementData
(XSPObjectHelper.java:93)
+ * at
org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper.getParamet
erValues(XSPRequestHelper.java:291)
+ * at
org.apache.cocoon.www.pinnacle.assetComponents_xsp.generate(C:\jakarta-tomca
t-4.0.4-b3\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/w
ww/pinnacle\assetComponents_xsp.java:1299)
+ * at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
tor.java:260)
+ * 
  *
  * @author mailto:[EMAIL PROTECTED]";>Ricardo Rocha
+ * @version Modified from Apache's version CVS Id: XSPRequestHelper.java,v
1.11 2002/02/27 05:33:50 vgritsenko Exp
  * @version CVS $Id: XSPRequestHelper.java,v 1.1 2002/06/04 04:52:31 neil
Exp $
  */
 public class XSPRequestHelper {
@@ -278,15 +289,18 @@
 String[] values = request.getParameterValues(name);
 if (values != null) {
 for (int i = 0; i < values.length; i++) {
-if(form_encoding != null && values[i] != null &&
-values[i].length() > 0) {
-try {
-values[i] = new
String(values[i].getBytes(container_encoding),
-form_encoding);
-} catch(java.io.UnsupportedEncodingException uee) {
-throw new RuntimeException("Unsupported Encoding
Exception: " +
-uee.getMessage());
-}
+   if (values[i] != null) {
+   if(form_encoding != null && values[i].length() > 0) {
+   try {
+   values[i] = new 
+String(values[i].getBytes(container_encoding),
+  form_encoding);
+   } catch(java.io.UnsupportedEncodingException uee) {
+   throw new RuntimeException("Unsupported Encoding 
+Exception: " +
+  uee.getMessage());
+   }
+   }
+   } else {
+   values[i] = "";
 }
 XSPObjectHelper.elementData(URI, PREFIX, contentHandler,
 "value", values[i]);


-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: esql v1.22 multiple returned update counts and ResultSets

2002-05-22 Thread neil

> > > I settled for Torstens solution without @index. Both requirements
> > (different /
> > > same esql:results) are difficult to provide. Please suggest a syntax
for
> > that.
> > Some possibilities are to reuse the last one or to add a 'default'
attribute
> > or some such.
> > But I wouldn't bother unless there is some consensus that its a good
idea.
>
> I'm undecided on this one. I fear both solutions are difficult to work
> with. But as I hardly have the requirement to process several results,
> I have no strong opinion.

I'll try your changes out sometime soon, but for now I'm still using my
patch but with your switch
statements added. I've added a default case to the switch:

  
  case : 
break;
  
  default: 
break;

This allows you to reuse the same  if you want to.
Likewise for  and .
Its not "difficult to work with" and I think its an option worth having even
though its not strictly necessary.

Cheers,
Neil.


-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: esql v1.22 multiple returned update counts and ResultSets

2002-05-21 Thread neil

On 22 May 2002 Christian Haul wrote:

> > The loop test cannot be:
> > > } while(_esql_query.getMoreResults());
> > because this would stop the loop whenever the next result is an update
count
> > (without processing this update count and any following results). Please
> > read the javadoc carefully any try experimenting with a simple
standalone
> > test programme.
>
> Neil, please look at the actual code. EsqlQuery.getMoreResults() does a
lot
> more than Statement.getMoreResults().
OK. I didn't spot that your change depends on updates to other files too.
Picky minor point: Although I don't like the semantics of JDBCs
getMoreResults()
I like even less having different semantics for the same method name in
EsqlQuery.

> > Please also note from the JDK javadocs: "For maximum portability, a
call's
> > ResultSet objects and update counts should be processed prior to getting
the
> > values of output parameters."
> > This was the wrong way around in esql 1.22.
>
> Again, please look at the code. EsqlQuery.getMoreResults() retrieves the
> update count and keeps it for later reference. Further calls to
EsqlQuery.getUpdateCount()
> will return the buffered result.
Thats nice, but not relevant to the Sun doco that I quoted. I'll rephrase
it: fetching OUT
parameters should be done after processing all returned results.

>From esql.xsl 1.24:
  
// call results

  

  

  

My understanding is that fetching OUT parameters is done within
esql:call-results
and processing returned results is done by esql:do-results. If so it is done
the
wrong way around.

> I settled for Torstens solution without @index. Both requirements
(different /
> same esql:results) are difficult to provide. Please suggest a syntax for
that.
Some possibilities are to reuse the last one or to add a 'default' attribute
or some such.
But I wouldn't bother unless there is some consensus that its a good idea.

> So, could you please check with the current code whether it does what it
should?
I'm trying to get minimum modifications to cocoon-2.0.2 to do what I need.
I can't just switch from a stable release to the latest CVS snapshot (boring
I know).
Do you think I should try the latest esql.xsl, EsqlQuery.java &
EsqlHelper.java
over cocoon-2.0.2 or do you know of other updates that these depend on
(those are the only files I had to update for my patch).

> > PRIVILEGED - PRIVATE AND CONFIDENTIAL
> > This email and any files transmitted with it are intended solely for the
use
>
> Does this indicated we would not be able to use your patch?
Anybody may use it. I'll try to remove that from future postings.

Thanks for your help and the good stuff in esql.
Regards,
Neil.


-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: esql v1.22 multiple returned update counts and ResultSets

2002-05-19 Thread neil

Re: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102165197728849&w=2

> note that you are always calling getUpdateCount on the same statement.
will
> it's state be changed?!? That would be indeed a ugly behaviour...
The code I included in the original post is abridged working code that
correctly handles result sets and update counts in any order, as described
in the JDK javadocs. In the case that several update counts are returned
before the first result set then you simply go through the "else" part of
the loop several times before the "if" part.
Yes - cs.getMoreResults() changes the state of cs.

> I believe that we actually should expect
>
> (resultset, update count)
No. The JDK javadoc is quite clear that each result is either:
- a result set (true returned from execute() or getMoreResults()) or
- an update count (false returned)
and not both of these and the code provided shows that it works as
documented.

The loop test cannot be:
> } while(_esql_query.getMoreResults());
because this would stop the loop whenever the next result is an update count
(without processing this update count and any following results). Please
read the javadoc carefully any try experimenting with a simple standalone
test programme.

Please also note from the JDK javadocs: "For maximum portability, a call's
ResultSet objects and update counts should be processed prior to getting the
values of output parameters."
This was the wrong way around in esql 1.22.

Its a nice idea to add an index attribute or some such to allow a different
 or  for each returned result set. But
there should still be a way to use the same  or
 (maybe a default to use if the index isn't matched).

Here's my patch to esql.xsl v1.22:
- handles any number of result sets and update counts returned in any order
- processes returned result sets and update counts prior to getting the
values of output parameters
but it doesn't add an index attribute to allow different 
or  for each returned result set.

Its only been tested with MS SQLServer jdbc driver and stored procs
returning one result set (sometimes as the first result and other times
after multiple update counts) and no OUT parameters, but it is hopefully
more general that this.


--- org/apache/cocoon/components/language/markup/xsp/java/esql.xsl.1.22 Fri
May 17 00:41:14 2002
+++ org/apache/cocoon/components/language/markup/xsp/java/esql.xsl  Fri May
17 07:12:56 2002
@@ -1,6 +1,16 @@
 

-
+
 

 
   
 _esql_query.execute(true);
-_esql_query.execute();
+_esql_query.execute();
 _esql_query.execute();
   
 
@@ -445,16 +455,12 @@
 
   
   getLogger().debug("esql query: " + _esql_query.getQueryString());
-  
-// call results
-
-  
-
-  
-  if (_esql_query.hasResultSet()) {
-do {
+  // start handling multiple returned update counts and ResultSets ...
+  int countReturnedResults = 0;
+  for ( boolean nextResultIsResultSet = _esql_query.hasResultSet();
true; nextResultIsResultSet = _esql_query.getMoreResults() ) {
+if (nextResultIsResultSet) {
+  ++countReturnedResults;
   _esql_query.getResultRows();
-
   if (_esql_query.nextRow()) {
 
   }
@@ -462,16 +468,29 @@
 
   }
   _esql_query.getResultSet().close();
-
-} while(_esql_query.getMoreResults());
   } else {
-if (_esql_query.getStatement().getUpdateCount() >= 0) {
-  
+  // either the next result is an update count or there are no more
results
+  int updateCount = _esql_query.getStatement().getUpdateCount();
+  if ( updateCount == -1 ) {
+break; // no more results
 }
-else{
-  
+  ++countReturnedResults;
+  
 }
   }
+  
+// call results
+
+
+  
+
+  
   _esql_query.getStatement().close();
 } catch (SQLException _esql_exception_) {
 

PRIVILEGED - PRIVATE AND CONFIDENTIAL
This email and any files transmitted with it are intended solely for the use
of the addressee(s) and may contain information which is confidential or
privileged. If you receive this email and you are not the addressee (or
responsible for delivery of the email to the addressee), please disregard
the contents of the email, delete the email and notify the author
immediately.
Before opening or using any attachments, please scan them for viruses and
defects. We do not accept any liability for loss or damage, which may arise
from your receipt of this e-mail. Our liability is limited to re-supplying
any affected attachments.




-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional co

esql v1.22 multiple returned update counts and ResultSets

2002-05-16 Thread neil

Hi,
it seems that a few cocoon users like me, are hacking about with esql to get
it to do what we need. I'm working on the change shown below and am happy to
share it if anyone wants it.

JDBC can handle a sequence of values returned from a stored procedure, where
the values can be update counts and ResultSets in any order. It looks to me
like esql v1.22 will only handle a sequence with all the ResultSets before
the first update count and at most one update count. e.g.
ResultSet*updateCount? (where * and ? are as in a RE).

MS SqlServer stored procs return an update count for every
insert/update/delete performed and a ResultSet for every query (whose
results aren't consumed in the procedure) in the order that they are
performed. So its important to handle update counts and ResultSets in any
order.

Instead of esql.xsl code like:

  if (_esql_query.hasResultSet()) {
do {
  // handle ResultSet
} while(_esql_query.getMoreResults());
  } else {
if (_esql_query.getStatement().getUpdateCount() >= 0) {
  
}
else{
  
}
  }

we need something that produces java code that looks like this:

String query = "{ ? = foo() }";
java.sql.CallableStatement cs = conn.prepareCall(
query,
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY );

// The JDK javadocs say "If used, the result parameter must be
// registered as an OUT parameter".
// It doesn't matter what the Type is.
// esql will do this if instead of giving it "{ ? ="
// we give it " ="
cs.registerOutParameter(1, java.sql.Types.INTEGER);

int resultCount = 0;
for ( boolean nextResultIsResultSet = cs.execute(); true;
nextResultIsResultSet = cs.getMoreResults() ) {
if (nextResultIsResultSet) {
java.sql.ResultSet rs = cs.getResultSet();
++resultCount;
// handle ResultSet
rs.close();
} else {
// either the next result is an update count or there are no more results
int updateCount = cs.getUpdateCount();
if ( updateCount == -1 ) {
break; // no more results
// only finished when cs.getMoreResults() == false &&
cs.getUpdateCount() == -1
// awful bit of API but it works
}
++resultCount;
// handle updateCount
}
// there may still be more ResultSets and/or update counts
}
if (resultCount == 0) {
// no returned results
}

PRIVILEGED - PRIVATE AND CONFIDENTIAL
This email and any files transmitted with it are intended solely for the use
of the addressee(s) and may contain information which is confidential or
privileged. If you receive this email and you are not the addressee (or
responsible for delivery of the email to the addressee), please disregard
the contents of the email, delete the email and notify the author
immediately.
Before opening or using any attachments, please scan them for viruses and
defects. We do not accept any liability for loss or damage, which may arise
from your receipt of this e-mail. Our liability is limited to re-supplying
any affected attachments.




-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




DTD for the sitemap

2002-04-22 Thread neil

Has anyone come up with a reasonably rigorous DTD for the sitemap? I know
its been talked about at various times, but I haven't found one yet.
I've cobbled together the following DTD, which I find handy with emacs xml
(psgml) mode. It handles the cocoon-2.0.2 sitemap OK and should be handy
with other xml DTD aware editors. Any feedback and improvements would be
welcome.

The lack of "name groups" (a SGML DTD feature) in XML DTDs makes the DTD
very repetitive and awkward to maintain.





























































































-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




SQLTransformer bug that appears under load

2002-04-08 Thread neil

I've been load testing my cocoon app with jmeter and I think I've found a
SQLTransformer bug.
My (MS SQL Server) JDBC driver was complaining about attempts to use various
objects after they had been closed (Connections, ResultSets and Statements).

In Query.execute() I think this bit should be removed:
} finally {
conn.close();
conn = null;// To make sure we don't use this
connection again.
}

as it's incorrect to close the connection before you've finished with the
ResultSets, Statements etc.
The connection is closed later when SQLTransformer.executeQuery() calls
Query.close() anyway.

I know Connection.close() doesn't really close the connection to the DB
(because its a pooled connection it just allows it to be recycled), but I
think its reuse under load does cause problems. By removing these lines I
was able to get my app to work correctly under heavy loads on a dual CPU
Windows 2000 box.


-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




build error: cocoon-2.0.2, jdk-1.4, Win2000

2002-03-26 Thread neil

In a dos box:
  set PATH=C:\WINNT\system32;C:\WINNT
  set CLASSPATH=
  build clean
  build

First error:

C:\Neil\cocoon-2.0.2\build\cocoon\src\org\apache\cocoon\components\language\
mark
up\xsp\EsqlConnection.java:66: class
org.apache.cocoon.components.language.marku
p.xsp.EsqlConnection must be declared abstract. It does not define int
getHoldability() from interface java.sql.Connection.
public class EsqlConnection implements Connection {

followed by 11 more.

An earlier post:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101622718100348&w=2
suggested to ensure that no older jdk's are in the PATH or CLASSPATH,
but I think I've taken care of that.

Some s I've added to build.xml seem to show that jdbc3.present is
properly set:
filter-jdbc:
nofilter-jdbc:
 [echo] in nofilter-jdbc



-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Object Oriented Cocoon

2002-03-01 Thread Ellis, Neil (FNB)

Dear All

Firstly Wow! 

What a framework, I am inspired by the level of thought that has gone into
this app/framework.

Anyway, I've been using a simple scripting language I wrote which merely
translates to XSLT with extensions.

Now I've been looking at taking some of the better concepts behind Zope (teh
object oriented python application server) and translate to the world of
XSL/XSLT/XPath et al.

It seems to me that if the sitemaps and translators etc were built from a
script then we can define object types from the sitemap and
translators/serializers etc. With the addition of object oriented features
of inheritance etc then I'm half the way there. Glue on Xindice as an object
store and we've got Zope with a whole load more bells and whistles and
importantly a solid enterprise structure behind it.

I'm interested in hearing if anyone is going down this path already or if
anyone has any views.  I am very new to cocoon and am in search of the right
platform for this venture.

Many regards
Neil Ellis


-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: sunRise tutorial here

2002-02-28 Thread Ellis, Neil (FNB)

My thanks.

> -Original Message-
> From: Jean-Philippe Courson [SMTP:[EMAIL PROTECTED]]
> Sent: 28 February 2002 16:38
> To:   [EMAIL PROTECTED]
> Subject:  Re: sunRise tutorial here
> 
> You are using tomcat 4.0.2 that causes some problems. For now, use 
> tomcat 4.0.1
> 
> Ellis, Neil (FNB) wrote:
> > Hi I've just installed cocoon on a linux box redhat 7.1 with sun jdk,
> tomcat
> > 4.0 and got this ... I've searched the web to no avail... any ideas?
> > I got a 500 error with:
> > javax.servlet.ServletException: Servlet.init() for servlet Cocoon2 threw
> > exception
> > at
> >
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
> 93
> > 5)
> > at
> >
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653
> )
> > at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
> ja
> > va:214)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 66)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472
> )
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
> ja
> > va:190)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 66)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472
> )
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
> > at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1
> 80
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 66)
> > at
> >
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValv
> e.
> > java:170)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 64)
> > at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1
> 70
> > )
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 64)
> > at
> >
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 64)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472
> )
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja
> va
> > :174)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java
> :5
> > 66)
> > at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472
> )
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.jav
> a:
> > 1012)
> > at
> >
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:11
> 07
> > )
> > at java.lang.Thread.run(Thread.java:484)
> > root cause 
> > java.lang.NoClassDefFoundError: javax/xml/transform/URIResolver
> > at java.lang.ClassLoader.defineClass0(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
> > at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
> > at
> >
> org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClass
> Lo
> > ader.java:1631)
> > at
> >
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.j
> av
> > a:926)
> > at
> >
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.j
> av
> > a:1360)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
> > at
> >
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.configure(
> Ex
&

RE: sunRise tutorial here

2002-02-28 Thread Ellis, Neil (FNB)

Hi I've just installed cocoon on a linux box redhat 7.1 with sun jdk, tomcat
4.0 and got this ... I've searched the web to no avail... any ideas?
I got a 500 error with:
javax.servlet.ServletException: Servlet.init() for servlet Cocoon2 threw
exception
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
5)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1012)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107
)
at java.lang.Thread.run(Thread.java:484)
root cause 
java.lang.NoClassDefFoundError: javax/xml/transform/URIResolver
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo
ader.java:1631)
at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav
a:926)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.configure(Ex
caliburComponentManager.java:408)
at org.apache.cocoon.Cocoon.configure(Cocoon.java:406)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:267)
at
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:991)
at
org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:308)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
6)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5

RE: Calling MS SQL stored procedure

2002-02-21 Thread neil

I'm using  instead of IN parameters:
{ ? = call sp(
'',

) }

The MS JDBC driver had trouble parsing a query with new lines in it,
but at least it gets by with one long line.

In reply to:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101429060624988&w=2


-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Re: Calling MS SQL stored procedure

2002-02-20 Thread neil

Sorry I can't reply to the same thread. I rely on the archives as the
traffic is too high for me to stay subscribed. This is in reply to:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101423330019994&w=2

I use the JDBC escape syntax as Christian Haul suggested in his reply, but I
also had to
modify SQLTransformer.java to handle the ResultSets returned by SQL Server
stored procedures.
I've tried to make it handle multiple returned ResultSets, but can't test
with more than one
because my MS JDBC driver only handles the first one then says there are no
more.

SQLTransformer.java only handled ResultSets as OUT parameters (as used by
Oracle, Postgres etc.) not those returned implicitly as by SQL Server.

I posted the patch to cocoon-users on 2002-02-08
This might take you there:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101316887401395&w=2

Please share any improvements you may have.
Cheers,
Neil.


Subject:  Calling MS SQL stored procedure
From: "Miller, Grant" <[EMAIL PROTECTED]>
Date: 2002-02-20 15:45:47
Hi,
I'm having a problem calling an ms sql server stored procedure with the sql
transformer (using cocoon 2.0.1 and tomcat 4).
The code is:


   
  begin dbo.testformike('hi');
  end;
   


The error message is:

Invalid call syntax: begin dbo.testformike('hi'); end;

I always get this with isstoredprocedure="true".
Also, I'm not sure what the qualifier before the function name should be
(dbo is the owner in this example).
Another thing we have tried is:

This query:


  exec DBO.TESTFORMIKE 'hi'



but this gives:

A server cursor is not allowed on a remote stored procedure or stored
procedure with more than one SELECT statement. Use a default result set or
client cursor

We are completely stuck and do not want to use esql.
Thanks for any help,

Grant Miller



-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




streaming large pdf reports

2002-02-19 Thread neil

I'm trying to get large PDF reports streaming to the browser so that:
1. not too much memory is used (we can support multiple users doing reports)
2. we can support arbitrarily large reports
3. the user sees data dribbling onto their screen rather than being left to
wonder
   if anything is happening

(Please don't ask if anybody can really do anything useful with such big
reports).

We'd like to get:
  a) SQLTransformer to perform a query,
  b) XSLT to produce fo,
  c) fop to produce pdf and
  d) the browser
to all stream properly, but at the moment it looks like there are problems
at b),
c) and d). Evidence follows.

I believe we should be able to get XSLT and fop streaming. Has anybody
managed to?
I'm using cocoon-2.0 with updates as described below. Does cocoon-2.0.1 have
some
other updates that are required to make this stream?



Test conditions are described at the end, here are the results:

  a)query   b)fo  c)fop
before start of o/p   0:00:10   0:02:40   0:11:21
duration of o/p   0:02:20   0:00:40   0:01:38
size of o/p  43179378  22849290  33346282

The first column, a) shows the production of xml by SQLTransformer calling a
SQL Server stored procedure that returns 93000 rows. The file started
growing
after 10 secs and was complete after another 2 minutes 20 secs. So
SQLTransformer
by itself streams OK.

The 2nd column, b) shows the same thing as a) but with XSLT added.
The style sheet is almost as simple as possible to produce xsl-fo.
It produces a page () containing only
the
word "details" for each . There are no fancy XPath expressions that
could
be responsable for stopping it streaming. It takes longer to start producing
output
than a) took to complete. Apparently it doesn't stream.
I've updated to xalan-2.2.0.jar and set "incremental-processing" to "true"
in cocoon.xconf in an effort to make it stream.

The last column, c) shows the same thing as b) but with fop pdf
serialization added.
It takes 11 minutes to start outputting then only another 1 1/2 minutes to
complete
writing 32Mb of pdf. The mail archives suggest that fop can only do output
when it
gets to a . That's why I produced a separate

for each row in b), but it still doesn't stream.
See: http://marc.theaimsgroup.com/?l=fop-user&m=101405590416285&w=2

As for d) displaying the data in the browser as it arrives, it seems there
is
a problem here too. fop produces "non-optimized" pdf. For acrobat reader to
start rendering before all the data has arrived the pdf has to be
"optimized".
I believe this is on the fop "to do" list but not yet done.
See: http://marc.theaimsgroup.com/?l=fop-dev&m=99556319518135&w=2

Test conditions:
- 384M physical memory
- jdk 1.3.1-02 server JVM with: -server -Xmx356M

cocoon-2.0 mods:
- patched SQLTransformer.java for ResultSets returned from SQL Server stored
procedures
  See: http://marc.theaimsgroup.com/?t=10131690432&r=1&w=2
- xalan-2.2.0.jar, fop-0.20.3rc.jar (instead of xalan-2.2.0-D13.jar,
fop-0.20.1-dev.jar)
- xerces config: incremental-processing="true" in cocoon.xconf (originally
false)
- janitor store config: freememory="2000", heapsize="24000" in
cocoon.xconf

I'm using a java programme instead of a browser so that I know when the data
starts arriving.


-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Example use of writeDOMsession / readDOMsession

2002-02-11 Thread neil

Here's a sitemap example (for cocoon-2.0) using writeDOMsession /
readDOMsession (as suggested in the docs) to avoid repetitive queries of
reference tables. It works fine, but I haven't done any benchmarking to find
out if it was worth the trouble (and it was quite a bit of trouble)!

Questions:

1. Is there some way this global data could be saved globally rather than
per session?
I guess a new set of global data matchers, selectors and read/writeDOMGlobal
would be required
(more trouble that its worth to me).

2. Has anybody found this approach to be worthwhile or otherwise?

3. Has anybody got a better way of doing it?

Cheers,
    Neil.



























































-
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




patch to SQLTransformer for result sets returned from stored procedures

2002-02-08 Thread neil

The version of org.apache.cocoon.transformation.SQLTransformer.java in
cocoon 2.0 handles ResultSets returned from a stored procedure as OUT
parameters.

Oracle and some others do this, however MS SQL Server and some others can
return multiple results each of which is either a ResultSet or a count of
updated rows.

The following patch attempts to jack up SQLTransformer v1.24 to handle these
multiple results. It works well enough for what I need, but has only been
tested with a MS SQL Server stored procedure that returns one ResultSet.

v1.24 is the most recent version before SQLTransformer was moved somewhere
else in the source tree. It's more recent than what comes with cocoon 2.0.

If anyone wants to try it or just review the changes and offer suggestions
for improvements please feel free. I just compile this one file and jar the
resulting classes into cocoon\WEB-INF\lib\AAnewstuff.jar and cocoon picks it
up from there.

Cheers,
    Neil.

Result of: LC_ALL=C TZ=UTC0 diff -Naurb SQLTransformer-1.24.java
SQLTransformer.java

--- SQLTransformer-1.24.javaThu Feb  7 01:23:52 2002
+++ SQLTransformer.java Fri Feb  8 05:25:10 2002
@@ -35,7 +35,7 @@
  * @author mailto:[EMAIL PROTECTED]";>Giacomo Pati
  * (PWR Organisation & Entwicklung)
  * @author mailto:[EMAIL PROTECTED]";>Sven Beauprez
- * @version CVS $Revision: 1.24 $ $Date: 2001/12/15 00:21:19 $ $Author:
vgritsenko $
+ * @version CVS $Revision: 1.2 $ $Date: 2002/02/08 05:25:10 $ $Author: neil
$
  */

 public class SQLTransformer extends AbstractTransformer implements
Composable, Recyclable, Disposable, Configurable {
@@ -263,7 +263,6 @@
 }

 getLogger().debug( "SQLTransformer executing query nr " + index );
-AttributesImpl attr = new AttributesImpl();
 Query query = (Query) queries.elementAt( index );
 boolean query_failure = false;
 try {
@@ -280,19 +279,19 @@
 query_failure = true;
 }
 if ( !query_failure ) {
-
+if ( !query.isStoredProcedure() ) {
+   AttributesImpl rowsetAttr = new AttributesImpl();
 if ( showNrOfRows != null &&
showNrOfRows.equalsIgnoreCase( "true" ) ) {
-attr.addAttribute( my_uri, query.nr_of_rows,
query.nr_of_rows, "CDATA",
+   rowsetAttr.addAttribute( my_uri, query.nr_of_rows, 
+query.nr_of_rows,
"CDATA",
String.valueOf( query.getNrOfRows() ) );
 }
 String name = query.getName();
 if ( name != null ) {
-attr.addAttribute( my_uri, query.name_attribute,
query.name_attribute, "CDATA",
+   rowsetAttr.addAttribute( my_uri, query.name_attribute,
query.name_attribute, "CDATA",
name );
 }
-this.start( query.rowset_name, attr );
-attr = new AttributesImpl();
-if ( !query.isStoredProcedure() ) {
+   this.start( query.rowset_name, rowsetAttr );
+   AttributesImpl attr = new AttributesImpl();
 while ( query.next() ) {
 this.start( query.row_name, attr );
 query.serializeRow();
@@ -301,10 +300,10 @@
 }
 this.end( query.row_name );
 }
+   this.end( query.rowset_name );
 } else {
 query.serializeStoredProcedure();
 }
-this.end( query.rowset_name );
 }
 } catch ( SQLException e ) {
 getLogger().debug( "SQLTransformer.executeQuery()", e );
@@ -566,7 +565,7 @@

SQLTransformer.MAGIC_OUT_PARAMETER_NR_ATTRIBUTE );
 String type = attributes.getValue( my_uri,

SQLTransformer.MAGIC_OUT_PARAMETER_TYPE_ATTRIBUTE );
-getLogger().debug( "OUT PARAMETER NAME" + name + ";NR " +
nr + "; TYPE " + type );
+getLogger().debug( "OUT PARAMETER NAME " + name + "; NR " +
nr + "; TYPE " + type );
 int position = Integer.parseInt( nr );
 getCurrentQuery().setOutParameter( position, type, name );
 current_state =
SQLTransformer.STATE_INSIDE_OUT_PARAMETER_ELEMENT;
@@ -759,13 +758,13 @@
 class Query {

 /** Who's your daddy? **/
-protected SQLTransformer transformer;
+protected final SQLTransformer transformer;

 /** What index are you in daddy's queries list **/
-protected int query_index;
+protected final int query_index;

 /** SQL configuration information **/
-protected Properties properties;
+protected final Properties properties;

 /** Dummy static variabl

RE: XSP in a stylesheet help

2001-12-19 Thread neil

Wouldn't it be easier to compute the row number in the stylesheet instead of
XSP?

I think  will give you the 1 based index
of the current element
e.g.

 
   
   

which might be what you need. Otherwise you could define a variable and
increment it to count the rows.

Great XSLT examples are available at:
http://wwbota.free.fr/XSLT_models/README.htm and sites it refers to (see
http://IncrementalDevelopment.com/xsltrick/ for numeric computations).


-Original Message-
From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 20 December 2001 2:18 AM
To: [EMAIL PROTECTED]
Subject: REQ: XSP in a stylesheet help


Hi all,

(please CC me your response, I get the digest)

I'm working on a stylesheet that is intent on organizing the simple-sql
example page ($COCOON/docs/samples/sql/sql-page.xml) into a gnumeric
style xml spreadsheet.  I'm very close, but I need to an incremental row
number.  I figured I'd just use XSP inside of my stylesheet, but all
I've accomplished so far is a literal printout of what is in between the
 tags.  I thought perhaps I needed some other directives
inside the cocoon configuration but I've not

Attached is my stylesheet so far.  Can someone point me in the right
direction.  I've been reading like mad (yes I read xml.apache.org), and
I'm just short of the understanding I need to pull this off.  An example
of a stylesheet that uses an incremental value via xsp would be ideal,
or if someone could show me how to get this to work would be even
better.  One thing I know I've got to figure out is how to get the
expression value into the row attribute, but first even getting the expr
tag interpreted correctly would be a good start.

Once I get a few of these finished we'll probably have enough test cases
for our XML->XLS serialization project (sourceforge.net/projects/poi).
(it shares gnumeric's xml format) We hope to release a beta on Monday.

Thanks,

Andy

-


http://www.w3.org/1999/XSL/Transform";

xmlns:sql="http://apache.org/cocoon/SQL/2.0";

xmlns:xsp="http://apache.org/1999/XSP/Core";
  >

  
  
int incr = 5;
  

  
   http://www.gnome.org/gnumeric/v7";>
 
 
 
 2
 

 
 


 
 

 

 

  

  
  
  

  
 incr
 
   


 
 
  

 
 



--
www.superlinksoftware.com
www.sourceforge.net/projects/poi - port of Excel format to java
http://developer.java.sun.com/developer/bugParade/bugs/4487555.html
- fix java generics!


The avalanche has already started. It is too late for the pebbles to
vote.
-Ambassador Kosh


-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>



-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




ArrayIndexOutOfBoundsException from filter transform (FilterTransformer)

2001-12-11 Thread neil

I've got something working with (from sitemap.xmap):

  


but if I change the "2" to a "1" I get (amongst heaps of other stack trace
lines):

original exceptionOriginal exception :
java.lang.ArrayIndexOutOfBoundsException
at
org.apache.xalan.serialize.SerializerToHTML.endElement(SerializerToHTML.java
:772)
at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerI
dentityImpl.java:1047)
at
org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:104)
at
org.apache.cocoon.serialization.AbstractTextSerializer.endElement(AbstractTe
xtSerializer.java:335)
at
org.apache.cocoon.transformation.FilterTransformer.endElement(FilterTransfor
mer.java:109)

I couldn't find this in the bug database at
http://nagoya.apache.org/bugzilla/index.html

Is it a bug and if so is it in xalan or
org.apache.cocoon.transformation.FilterTransformer?

Has anyone else come across this?

P.S. I'm finding cocoon pretty wonderful so far - so thanks to all
contributors.


-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>