Re: Cocoon 2.1 web application base path

2012-05-16 Thread Andy Stevens
Hi Bob,

Assuming you have the request input module in your cocoon.xconf, then you
can pass the context path into an xsl:param (or otherwise use in the
sitemap) with e.g.
map:transform src=mytransform.xslt
map:parameter=xslParamName ={request:contextPath}/
/map:transform

Regards,

Andy
 On 16 May 2012 06:02, Bob Harrod rjhar...@gmail.com wrote:

 I'm quite new to cocoon, and supporting an older version (2.1).  Does
 anyone know how I can gain access the web application base path inside of a
 transform?  Of course, it can be passed by the sitemap...  Any help would
 be appreciated!

 Thanks!



Re: XML- PDF bad encoding

2011-12-04 Thread Andy Stevens
It might help if you could include the relevant pipeline code and component
configuration that you're using. And which cocoon version it's for.

Andy.
 On 4 Dec 2011 12:02, FunkyDisco funky_disco_fr...@hotmail.com wrote:


 Appologize in front if this is somewhere explained, but as I'm not guru in
 Cocoon, after 5 days of google search and testing all possible
 combinations,
 haven't found a solution. So here is brief problem description

 When I test file generation from WEB URL, (source-output), :
 XML-XML correct (simple copy test to see if it read OK and write OK)
 XML-RTF correct
 XML-PDF problem (national characters has #)

 I have read http://xmlgraphics.apache.org/fop/faq.html#pdf-characters;,
 chapter 6.2 which shows exactly what I have but when I implement a feature
 some national character (ĐđČčĆć in unicode notation) remain as # signs).

 Is this really a bug or there is a solution, so please once more apologize
 for some dumb entries in this issue, but pretty lost in this case.
 Regards,
 Funky
 --
 View this message in context:
 http://old.nabble.com/XML-%3E-PDF-bad-encoding-tp32911752p32911752.html
 Sent from the Cocoon - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org




Re: Tomcat 64 bit

2011-10-11 Thread Andy Stevens

Hi Paul,

Cocoon can't be compiled in 32 or 64 bit as such; it's java so is compiled 
to platform-independent java byte code.  The byte code is run on a jvm, an 
architecture-specific application, and if you're using a jvm with a 
just-in-time compiler that translates the byte code (or parts of it) to 
native machine code to increase performance then that will end up running 32 
or 64 bit instructions.  But it's all at runtime, nothing you can do about 
when building Cocoon.


Judging by the error message, you're trying to open a path (C:\Program 
Files\Apache Software

Foundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program
Files\Apache Software
Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\Program
Files\Apache Software
Foundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml)as a file, when obviously the string in 
question is a list of 3 semi-colonseparated filenames.  Unsurprisingly, it complains at this The filename,directory 
name, or volume label syntax is incorrect as I believe semicolonsaren't valid characters in windows filenames (and 
unlikely to be found evenif they were).  My guess would be an error in whatever bit of your code orsitemap is supplying the 
outputFile to the XMLFragmentBean, if you can sendthe relevant bit of code I may be able to be more 
specific.Regards,Andy--http://original.justgiving.com/AndyStevens-Bikeathon2011Raising money for Leukaemia Research- 
Original Message -From: Paul Joseph pjos...@gmail.comTo: users@cocoon.apache.orgSent: 
Tuesday, October 11, 2011 4:38 PMSubject: Tomcat 64 bit Hi there, I am using a Cocoon jar (Version 2.11) file 
compiled on a 32 bit XP in a64 bit Tomcat (Version: 7.0.22 ) and using Java 64 bit(jre
-6u24-windows-x64) It runs against a 32 bit Postgresql database (V8.4). It all seems to work well unless I call some special 
functionality in theflowscript that has to create a file on disk.  It then fails with the errorshown below: Question: do I need to 
recompile cocoon in 64 bit--is that the cause ofthis error? Paul  java.io.FileNotFoundException: C:\Program Files\Apache 
SoftwareFoundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program Files\ApacheSoftware 
Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\ProgramFiles\Apache 
SoftwareFoundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml(The filename, directory name, or volume label syntax is 
incorrect)  at java.io.FileOutputStream.open(Native Method)  at java.io.FileOutputStream.init(Unknown Source)  at 
java.io.FileOutputStream.init(Unknown Source)  at java.io.FileWriter.init(Unknown Source)  
atorg.apache.cocoon.ojb.samples.bean.XMLFragmentBean.generate
Fragment(XMLFragmentBean.java:23) The call at line 23 of XMLFragmentBean.generateFrament 
is:BufferedWriter out = new BufferedWriter(new FileWriter(outputFile)); 
- To unsubscribe, e-mail: 
users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: using properties in flowscript

2011-10-03 Thread Andy Stevens
As an alternative to worrying about where the container happens to store the
application when you install it, so you can put the property file relative
to it, why not use a jvm system property to supply the property file's
location?
Or a resource-env-ref lookup?

Andy.
-- 
http://original.justgiving.com/andystevens-bikeathon2011
Raising money for Leukaemia research
 On 3 Oct 2011 15:02, Marco Westermann marwesterm...@gmx.de wrote:


Re: Location of I18N catalogs

2011-08-12 Thread Andy Stevens
Hi,

Apologi
On 11 Aug 2011 22:33, Nathaniel Grove nd...@virginia.edu wrote:
 Yes, I'm using Cocoon 2.1.11 and I've gotten the basic I18N mechanism to
 work, but I'm confused how to go about getting the translations from
 outside of cocoon. I tried putting a URL in the location attribute as
 well as a Cocoon relative pipeline call, but neither worked. Do you have
 a code snippet you could share that shows how you did it?

 Thanks,

 Than

 On 8/11/2011 9:40 AM, Andy Stevens wrote:

 What version of cocoon?
 It's certainly possible, as I've done it myself in the past, although
 I think that was with version 2.1.something. Can't remember if it was
 configured on the components setup or the transformer tag in the
 pipeline, though.
 One thing to beware of is the catalog is only read once and cached, so
 if you're generating the catalog xml from a database that is updated
 you may need to restart the app subsequently. That or adapt the code
 to allow it to be refreshed periodically.

 Andy.
 --

 On 11 Aug 2011 14:19, Nathaniel Grove nd...@virginia.edu
 mailto:nd...@virginia.edu wrote:
  I am new to using the Cocoon I18N feature and have only worked off the
  example given in samples/i18n. The way I have it set up is that the
  catalogs are in their own /translations/ folder at the top level of the
  project. The location is then set in the map:transformer element for
 i18n:
 
  catalogues default=messages
  catalogue id=messages name=messages location=translations/
  /catalogues
 
  I was wondering if it is possible to get the i18n catalogs from a
  location outside of Cocoon, such as a database via a PHP script that
  formats it into the proper XML. I tried setting the location to a
 cocoon
  relative pipeline cocoon:/... that read in an outside XML file but
  this didn't work. Is it possible to do something like this?
 
  Thanks,
 
  Than G.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 mailto:users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 mailto:users-h...@cocoon.apache.org
 

 --
 Nathaniel Grove
 Research Associate  Technical Director
 Tibetan  Himalayan Library
 གངས་ལྗོངས་གློག་རྡུལ་དཔེ་མཛོད་ཁང་།
 http://www.thlib.org


Re: Location of I18N catalogs

2011-08-12 Thread Andy Stevens
Hi,

Apologies for any typos (and the previous incomplete message) - I'm sending
this on my phone in the middle of a forest :-)

I believe the relevant code was

map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0;
map:components
map:transformers
map:transformer name=i18n
src=org.apache.cocoon.transformation.I18nTransformer
catalogues
catalogue id=messages name=msgs location=cocoon:/translations /
... (various closing tags)
map:pipelines
map:pipeline
map:act type=session / (can't remember why this was present, or if it's
actually needed)
map:match pattern=translations/msgs*.xml
... stuff to generate catalogue entries for each language. In this case
there was a default generator reading a file (msgs.xml, msgs_en.xml,
msgs_de.xml, etc.) with the stored procedure call to fetch the tokens 
strings for each language, followed by a sql transformer, an xslt
transformer to convert to the catalogue xml format, and an xml serialiser.

Hope this helps,

Andy.
On 11 Aug 2011 22:33, Nathaniel Grove nd...@virginia.edu wrote:


Re: Location of I18N catalogs

2011-08-11 Thread Andy Stevens
What version of cocoon?
It's certainly possible, as I've done it myself in the past, although I
think that was with version 2.1.something. Can't remember if it was
configured on the components setup or the transformer tag in the pipeline,
though.
One thing to beware of is the catalog is only read once and cached, so if
you're generating the catalog xml from a database that is updated you may
need to restart the app subsequently. That or adapt the code to allow it to
be refreshed periodically.

Andy.
-- 
 On 11 Aug 2011 14:19, Nathaniel Grove nd...@virginia.edu wrote:
 I am new to using the Cocoon I18N feature and have only worked off the
 example given in samples/i18n. The way I have it set up is that the
 catalogs are in their own /translations/ folder at the top level of the
 project. The location is then set in the map:transformer element for i18n:

 catalogues default=messages
 catalogue id=messages name=messages location=translations/
 /catalogues

 I was wondering if it is possible to get the i18n catalogs from a
 location outside of Cocoon, such as a database via a PHP script that
 formats it into the proper XML. I tried setting the location to a cocoon
 relative pipeline cocoon:/... that read in an outside XML file but
 this didn't work. Is it possible to do something like this?

 Thanks,

 Than G.

 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.2 and sendmail

2011-05-09 Thread Andy Stevens
2011/5/9 Grégory Roche webmas...@polymorphisme.org:
 I'm trying send email with Cocoon 2.2.

...
 and in my sitemap.xmap, I have my tramsformer sendmail :

  map:transformer name=sendmail
     src=org.apache.cocoon.mail.transformation.SendMailTransformer/

 and a pipeline for my test :

   map:match pattern=sendmail
     map:generate src=xdocs/sendmail.xml/
     map:transform src=stylesheets/sendmail.xsl
   map:parameter name=name
 value={request-param:name}/
   map:parameter name=email value={request-param:email}/
   map:parameter name=id value={session:id}/
     /map:transform
     map:serialize type=xml/
   /map:match

 I'm sure that my params are good :)

 But then I send an email, I have nothing in my email box !!!

Maybe I'm missing something here, but you don't appear to have called
the sendmail transformer - the pipeline you quoted only has a
generator, xslt transformation and xml serialiser...?


Andy
-- 
http://pseudoq.sourceforge.net/

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 2.2 and sendmail

2011-05-09 Thread Andy Stevens
What mail server host are you sending the mail through? Perhaps it's set up
to prevent relaying and your message is being rejected because of the
address(es) involved?

Andy
-- 
http://pseudoq.sourceforge.net/
 On 9 May 2011 09:19, Grégory Roche webmas...@polymorphisme.org wrote:


 So,

 I have change my pipeline ! I add the transformer for the emails :

 map:match pattern=sendmail
 map:generate src=xdocs/sendmail.xml/
 map:transform src=stylesheets/sendmail.xsl
 map:parameter name=name value={request-param:name}/
 map:parameter name=email value={request-param:email}/
 map:parameter name=id value={session:id}/
 /map:transform
 map:transform type=sendmail/
 map:serialize type=xml/
 /map:match

 That it's good :)

 But then I send an email, I have the reponce :

 :result xmlns=http://apache.org/cocoon/transformation/sendmail;
:failure to=webmas...@polymorphisme.orgInvalid address/:failure
/:result

 And my adresse email webmas...@polymorphisme.org is valide.

 I don't know what is the problem ! Thanks.

 G R

 www.polymorphisme.com
 webmas...@polymorphisme.org
 fixe : +33 (0)5.24.07.64.02
 port : +33 (0)6.89.54.14.84Andy Stevens insomniacpeng...@googlemail.com
a écrit :

 2011/5/9 Grégory Roche webmas...@polymorphisme.org:
 I'm trying send email with Cocoon 2.2.

 ...
 and in my sitemap.xmap, I have my tramsformer sendmail :

 map:transformer name=sendmail
 src=org.apache.cocoon.mail.transformation.SendMailTransformer/

 and a pipeline for my test :

 map:match pattern=sendmail
 map:generate src=xdocs/sendmail.xml/
 map:transform src=stylesheets/sendmail.xsl
 map:parameter name=name
 value={request-param:name}/
 map:parameter name=email value={request-param:email}/
 map:parameter name=id value={session:id}/
 /map:transform
 map:serialize type=xml/
 /map:match

 I'm sure that my params are good :)

 But then I send an email, I have nothing in my email box !!!

 Maybe I'm missing something here, but you don't appear to have called
 the sendmail transformer - the pipeline you quoted only has a
 generator, xslt transformation and xml serialiser...?


 Andy
 --
 http://pseudoq.sourceforge.net/



Re: Cocoon and Single Sign On (Windows Active Directory)

2011-04-20 Thread Andy Stevens
Hi Paul,

Rather than ntlm, try searching for spnego instead.
E.g. would either of http://spnego.sourceforge.net/ or
http://tomcatspnego.codeplex.com/ do what you need?

Andy
-- 
http://pseudoq.sourceforge.net/
 On 13 Apr 2011 15:24, Paul Joseph pjos...@gmail.com wrote:


Re: Mysterious exception in Tomcat logs : java.net.SocketException: Broken pipe

2009-06-11 Thread Andy Stevens
2009/6/10 Gintare Ragaisiene gintare.ragaisi...@gmail.com:
 Hello everyone,

 I've installed cocoon 2.2 webapp on Tomcat 6. For this I deployed .war file 
 in Tomact's webapps directory.
 After a day I looked at the logs and found this exception:

 Jun 9, 2009 8:31:51 PM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet DispatcherServlet threw exception
 java.net.SocketException: Broken pipe
 at java.net.SocketOutputStream.socketWrite0(Native Method)
 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
 at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
 at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
 at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
 at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3121)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1834)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1976)
 at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2497)
 at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4692)
...
 Do anybody knows or can explain to me what is wrong? Where I should research 
 farther about it?
And maybe what outcome of this exception is?

 Thank you,
 Gintare

Broken pipe usually means something tried to write to an established
socket connection, but the other end was no longer there or had closed
the connection prematurely.  I've seen it most often with the servlet
output stream or JSP writer, if the user hits the stop button in
their browser or closes it while the response is still being generated
and/or sent, or there's some networking problem along the way causes
the connection to die.

In your case, however, looks more like it was trying to issue some
command to the database due to a setAutoCommit call (BEGIN
TRANSACTION, maybe?) and discovered that the database was no longer
listening to that connection.  Perhaps the database had timed out the
connection due to inactivity, though in that case if things had closed
 cleaned up properly I'd have thought a connection already closed
type SQLException would be more likely next time the invalid
connection is got from the pool.  But maybe that depends on the
particular database driver; we don't use MySQL, so I can't say for
sure.  Do you get a lot of these exceptions or was this the only one?
Are you aware of any problems with the database or network around the
time this happened?  Was the database server restarted at that time?


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku application

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: generating text output

2009-02-26 Thread Andy Stevens
2009/2/26 Mathias Reem m.r...@gmx.net:
 I've got information about publications as a XML Input. And want to
 generate bibtex output, therefore I use the following pipeline:

 map:generate type=file src=in.xml/
 map:transform type=xsltc src=bibtex.xslt/
 map:serialize type=text/

Looks okay.

 I want to generate the output as shown in out.txt, but only get the
 following output:

 foobar

 All the other is missing. Can someone give me a hint howto generate my
 desired output?

The problem's probably in your XSL.  You have
publication xmlns=http://test; key=pub
in the source doc and try to match it with
xsl:template match=publication
in the XSL.  However, you haven't specified any namespace prefix in
the match attribute, so it will only match a publication element with
no namespace (despite the default namespace you set in the XSL file)
while the element in your source document has a namespace.  As a
result, the default template of xsl:apply-templates/ will be used
instead of the rest of your code, resulting in the output of the text
nodes from your document i.e. foobar.  In the XSL file you need to
map some prefix to your http://test; namespace and use that in the
match expression e.g.
xsl:template match=n:publication xmlns:n=http://test;

The same applies to the authors/author expressions in your xsl:if and
xsl:for-each, and the select expressions in the xsl:value-of elements
- they only match elements with no namespace, while of your source
document's elements are in the specified default namespace
(http://test).  Try the attached XSL code instead.

This isn't really a Cocoon issue, though, just general XSL.  There are
probably more appropriate forums.


Andy
-- 
http://pseudoq.sourceforge.net/  Open source Sudoku creator


bibtex.xslt
Description: Binary data
-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Re: COCOON-1887 (was: Getting started with C2.2 -- where's the exception information?)

2009-02-23 Thread Andy Stevens
2009/2/23 Joerg Heinicke joerg.heini...@gmx.de:
 Hey Andy,

 this particular patch has been applied.

 Thanks,
 Joerg

That's great; thanks.


Andy.

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Getting started with C2.2 -- where's the exception information?

2009-01-30 Thread Andy Stevens
2009/1/30 Bertrand Delacretaz bdelacre...@apache.org:
 On Fri, Jan 30, 2009 at 4:41 PM, DAVIGNON Andre - CETE
 NP/DIODé/PANDOC andre.davig...@developpement-durable.gouv.fr wrote:
 2.1 can stay supported as long as people support it ;-)

 Former colleagues of mine are still maintaining 2.1 apps that I
 created a few years ago, without any problems, and I'm sure many
 people are doing the same. If we had a need to fix something in it,
 we'd do it - and I encourage all 2.1 users to do the same, committers
 can fix things directly and contributors can submit patches. Nobody
 said 2.1 is dead, it is clearly (IMHO) in maintenance mode.

Sounds good in theory, but the big assumption is that submitted
patches might actually be applied.  I uploaded
https://issues.apache.org/jira/browse/COCOON-1887 2 1/2 years ago and
it's still waiting, even though it's a relatively trivial change and
only about half a dozen lines of code if you ignore the comments and
unit test :-(  Less, if you exclude the bit to preserve backward
compatibility.
And it's by no means the oldest patch in the summary list that's sent
to the list every few weeks...


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku solver

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Determining the host OS

2009-01-20 Thread Andy Stevens
2009/1/20 Martin Holmes mhol...@uvic.ca:
 HI Steve,

 Do you know how to call this in a sitemap? If I pass this into an XSLT
 transformation:

 map:parameter name=osName value={system-property:os.name} /

 the parameter is empty.

That looks reasonable to me.  I assume you've got the input module
defined somewhere? (either in the components section of the sitemap
or, more likely, the default
component-instance
class=org.apache.cocoon.components.modules.input.SystemPropertyModule
logger=core.modules.input name=system-property/
entry in cocoon.xconf)
Chances are it would throw an error anyway if it wasn't.

What if you try
map:parameter name=osName value=testing-{system-property:os.name} /
?  Is the parameter still empty in your XSL?  If so, it's not the
input module bit that's the problem.  What does the start of your XSL
file (especially the xsl:param) look like?

The system-property module is a jxpath-based one; I know the example
on http://cocoon.apache.org/2.1/userdocs/concepts/modules.html uses
{system-property:substring-before(user.home, user.name)}
but I'd have thought it should still be okay with no functions.  Do
any other system properties work?  Perhaps the app server hides some
of them - if you write a JSP that loops over them all and prints them
out, is os.name included in the list?  Are you getting any
securitymanager errors appearing in the logs?

Some more ideas at least.


Andy
-- 
http://pseudoq.sourceforge.net/


 Cheers,
 Martin

 Stephen Winnall wrote:

 There is a module called SystemPropertyModule which appears to do what you
 want. Just ask it for os.name.

 Steve

 On 20 Jan 2009, at 01:09, Martin Holmes wrote:

 HI folks,

 I'm trying to write a Cocoon-2.1-based application which I want to be
 completely portable between Tomcats running on Linux, OSX and Windows. I'm
 having a problem with the use of slashes and backslashes, especially on
 Windows, where I've found that some relative paths are expressed with
 backslashes and some with forward slashes, and the {realpath:/} constant
 returns a value without a trailing slash (whereas on *nix there seems to
 always be a trailing slash.

 I could solve these problems using Flowscript and XSLT if I could
 determine what host OS Cocoon is running on. However, I can't find a way to
 do that in the sitemap. There's the HostSelector, which tells me the domain
 of the host; and there's the BrowserSelector, which tells me the connecting
 client's browser; but there's no way I can find to discover what operating
 system Cocoon is running on.

 Does anyone know a way to do this, preferably directly in the sitemap?

 All help appreciated,
 Martin

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: About hadoop

2009-01-09 Thread Andy Stevens
2009/1/9 johnson john...@erp.tw:
 Hi!

 Does Cocoon support hadoop!

Probably.


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku application

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Display tag library with cocoon 2.1

2009-01-06 Thread Andy Stevens
2009/1/4 Biondo Francesco Paolo paolofrancesco.bio...@pro-netics.com:
 Hi, thanks for the answer.
 I'm a newbie of cocoon, I want to use this tag library with cocoon, using
 CForms with definition and template file, like a JSP page.
 With JSP, I define the taglib using
 %@ taglib uri=http://displaytag.sf.net; prefix=display %

 How can I get the same result with Cocoon?

Well, the problem as I see it is that you want to use a CForms
definition  template like a JSP.  Except it isn't a JSP, so a JSP
tag library isn't going to be much use to you in this context as it's
too dependent on the JSP page lifecycle and process flow. You might as
well ask how can I use this tag library in a Perl script?...

About the only way it might work would be to create some sort of JSP
tag Cocoon transformer, that can instantiate an instance of the (or
any?) tag class, simulate enough of the JSP PageContext to allow the
tag to execute, then call its doStartTag/doEndTag/etc. methods when
the triggering open  close elements are observed in the SAX event
stream (and buffering anything in between as necessary if it's a
BodyTag).  But that's not something I'd recommend unless you know
exactly what you're doing...

In my opinion you'd be better off figuring out some other way to
achieve similar effects with tables in Cocoon rather than trying to
get this taglib working in an environment it's not designed for.
http://displaytag.sourceforge.net/1.2/index.html mentions sorting,
paging, cropping, grouping, exporting, ...  I've not done much with
CForms myself so I don't know if it's got other ways to do these, but
many of them could be done in an XSL transformation, or through
client-side javascript; the paging could be done through a
FilterTransformer; the exporting could be done through a separate
pipeline based on the same data source but with a different
transformation and a FOP or HSSF serialiser...

Hope this helps,


Andy
-- 
http://pseudoq.sourceforge.net/

 Excuse my bad english :)

 Bye
 On Sun, 4 Jan 2009 15:33:14 +, Andy Stevens
 insomniacpeng...@googlemail.com wrote:
 2009/1/4 Biondo Francesco Paolo paolofrancesco.bio...@pro-netics.com:
 Hello, can I use displaytag (
 http://displaytag.sourceforge.net/1.2/install.html ) with Apache Cocoon?
 The Install's tutorial says to define: %@ taglib
 uri=http://displaytag.sf.net; prefix=display %, using jsp, How can I
 define the tag extension in xml files in Cocoon? thanks

 What exactly are you trying to do?  Write the output of a Cocoon
 pipeline into request/session attributes then forward the request to a
 JSP that contains these tags?  Have a Cocoon pipeline dynamically
 generate a JSP that contains these tags, which is subsequently run by
 the container's JSP processor?  Use Cocoon's JSP generator to call a
 JSP that uses these tags, then pass the resulting output through the
 rest of a pipeline?  Or something else entirely?

 Since you talk about outputting a taglib directive, it sounds to me
 like you're trying to dynamically generate a JSP using a Cocoon
 pipeline.  Even if you could get it to work, this is probably a bad
 idea - every matching request would run a pipeline, call the JSP
 Compiler, run the resulting servlet, ...
 Not particularly efficient, and depending on what app server you're
 using it may be prone to memory or file handle leaks.  If you can give
 us a better idea what you're trying to achieve we may be able to
 suggest a better way to do it.  At the moment it just sounds to me
 like you need to make your mind up which view technology you want to
 use, Cocoon or JSPs.


 Andy.
 --
 http://pseudoq.sourceforge.net/  Open source java sudoku application

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Display tag library with cocoon 2.1

2009-01-04 Thread Andy Stevens
2009/1/4 Biondo Francesco Paolo paolofrancesco.bio...@pro-netics.com:
 Hello, can I use displaytag (
 http://displaytag.sourceforge.net/1.2/install.html ) with Apache Cocoon?
 The Install's tutorial says to define: %@ taglib
 uri=http://displaytag.sf.net; prefix=display %, using jsp, How can I
 define the tag extension in xml files in Cocoon? thanks

What exactly are you trying to do?  Write the output of a Cocoon
pipeline into request/session attributes then forward the request to a
JSP that contains these tags?  Have a Cocoon pipeline dynamically
generate a JSP that contains these tags, which is subsequently run by
the container's JSP processor?  Use Cocoon's JSP generator to call a
JSP that uses these tags, then pass the resulting output through the
rest of a pipeline?  Or something else entirely?

Since you talk about outputting a taglib directive, it sounds to me
like you're trying to dynamically generate a JSP using a Cocoon
pipeline.  Even if you could get it to work, this is probably a bad
idea - every matching request would run a pipeline, call the JSP
Compiler, run the resulting servlet, ...
Not particularly efficient, and depending on what app server you're
using it may be prone to memory or file handle leaks.  If you can give
us a better idea what you're trying to achieve we may be able to
suggest a better way to do it.  At the moment it just sounds to me
like you need to make your mind up which view technology you want to
use, Cocoon or JSPs.


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku application

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: How to exclude non-html-elements from HTML serialization

2008-11-15 Thread Andy Stevens
2008/11/14 Smigge [EMAIL PROTECTED]:

 Hi!

 I have an HTML serialization, in which I have a structure just for logging
 purposes like this:

 log
  logging stuff
 /log
 html
  HTML-stuff
 /html

 However, the logging stuff is visible on the HTML page as well, and I don't
 want that. I could make an extra transformer to throw the log-structure
 away, but there must be another way of doing this, right?

Use log style=display:none; instead?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: Passing request parameter from the sitemap

2008-08-08 Thread Andy Stevens
2008/8/7 Peter Sparkes [EMAIL PROTECTED]:
 I am trying to pass various request parameter from the sitemap to a eXist
 xquery using:

 map:match pattern=register-with-eXist
  map:generate src=register.xq type=xquery
 !--map:parameter name=user value={flow-attribute:user}/--
 map:parameter name=user value=test/
   /map:generate


 I know the xquery is correct as I have tested it with the the URL
 register.xql?pass=test

register.xq (as you have in the map:generate) or .xql?  Also, you have
pass=test in the URL but name=user value=test in the
map:parameter.  Are those what you're actually using or just typos in
your email?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: Firefox 3 and URL

2008-08-04 Thread Andy Stevens
2008/8/4 Alexandre Mazouz [EMAIL PROTECTED]:

 Okay,

 My problem is now fixed.

 Instead of using HEAD request, i have used GET request :

 this.xmlHttp.open(GET, resourceName, false);
 this.xmlHttp.send(null);

 I think that Firefox 2.0 and Firefox 3.0 have different behaviour of how to
 handle request.

 For FF3
 *In the case of this.xmlHttp.open(HEAD, resourceName, false); : i have no
 responseXML (null)
 *In the case of this.xmlHttp.open(GET, resourceName, false); : i have
 responseXML

 For FF2
 *In the case of this.xmlHttp.open(HEAD, resourceName, false); : i have
 responseXML
 *In the case of this.xmlHttp.open(GET, resourceName, false); : i have
 responseXML

 Why this different behavior?

Given the point of a HEAD request is to fetch the response headers
without the actual body [1], I'm surprised you expected responseXML to
contain anything in the first place.  Are you sure the XHR
open(HEAD, ...) in FF2 is actually sending a HEAD and not using a
GET anyway?  It could be that version doesn't support HEAD and falls
back on the other method, and they've improved things by v3.  I'd be
tempted to try a packet sniffer or the Live HTTP Headers extension to
see exactly what gets sent  received.  Also check the web server
access logs to see what method it thinks was used in each case.  I'd
be surprised if the server responded differently to HEAD requests
according to the browser version, returning the content body in one
case and not the other.  What server software are you using anyway?


Andy.
[1] http://en.wikipedia.org/wiki/HTTP_HEAD_request#Request_methods
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: Finding a new name for Corona (a Cocoon rewrite)

2008-07-31 Thread Andy Stevens
2008/7/31 Hugh Sparks [EMAIL PROTECTED]
 Pipes
 According to Google Translate, it seems inoffensive in German, Spanish, and 
 Polish

 Apache Pipes - It alliterates a bit.

 -Hugh Sparks

However, there's already a Pipes in the web development space -
Yahoo Pipes. http://pipes.yahoo.com/pipes/


Andy
--
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: Rotating log files in Cocoon 2.1.11

2008-07-30 Thread Andy Stevens
2008/7/29 Robert La Ferla [EMAIL PROTECTED]:
 I would like to configure Cocoon 2.1.11 so that every day (24 hrs), the
 cocoon.log is written to a new file (cocoon-2008-JUL-29.log)  I tried
 configuring logkit.xconf to do this but it doesn't work.

Yes it does, ours are rolling over daily just fine. :-)

 Because I didn't
 want to wait a full day to see if it worked, I changed the configuration to
 rotate every minute.   It didn't work.  It either kept a single file or two
 files but never anymore.  I do not care about size.

 I would have expected it to create:

 cocoon-2008-JUL-29_12-01.log
 cocoon-2008-JUL-29_12-02.log
 cocoon-2008-JUL-29_12-03.log
 cocoon-2008-JUL-29_12-04.log
 ...

!--+
 | append if set to 'true' will make cocoon append the events
 | to the existing file, if set to 'false' cocoon will override
 | the existing ones at every new start.
 +--
 appendtrue/append
 !--+
 | rotation allows you to rotate log files one they meet certain
 | criteria. If you uncomment the example below, the log files will
 | be rotated once they are a day old or bigger than 100 Mb.
 +--
 rotation type=unique pattern=-MMM-dd_HH-mm suffix=.log
time00:01:00/time
 /rotation

Just because the pattern includes the HH-mm, won't make it roll over
any more often.  It just means the files will be named
cocoon-2008-JUL-29_00-01.log
cocoon-2008-JUL-30_00-01.log
when they roll over at the time (a minute past midnight) you
specified.  At least, that's how I interpret the javadocs:
 *  dtlt;timegt;/dt
 *  dd
 *   The time as HH:MM:SS when a rotation should occur. If you like to rotate
 *   a logfile more than once a day put an lt;orgt; element
immediately after the
 *   lt;rotationgt; element and specify the times inside the
 *   lt;orgt; element.
 *  /dd
To roll over every minute would need an or element containing 1440
time entries...

 Is this a Cocoon bug or is my configuration incorrect?

Since we're using an older version than 2.1.11, I suppose it's always
possible a bug has appeared in the meantime.  My money's on your
configuration, though.

  Is there a way to
 use log4j instead of LogKit?

There's a log4j.xconf in the sample web app as well as a logkit.xconf,
so I expect so.  Not sure how to configure things to use it, though.
There's a commented out init-param in the web.xml
  param-nameforce-property/param-name
  
param-valueorg.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLogger
/param-value
and another couple
!--
  This parameter switches the logging system from LogKit to Log4J
for Cocoon.
  Log4J has to be configured already.
  init-param
param-namelogger-class/param-name

param-valueorg.apache.avalon.excalibur.logger.Log4JLoggerManager/param-value
  /init-param
--
!--
  If you want to configure log4j using Cocoon, then you can define
  an XML configuration file here. You can use the usual log4j property
  substituation mechanism, e.g. ${context-root} is replaced by the
  context root of this web application etc.
  You can configure the log4j configuration even if you use LogKit
  for Cocoon logging. You can use this to configure third party code
  for example.
  init-param
param-namelog4j-config/param-name
param-value/WEB-INF/log4j.xconf/param-value
  /init-param
--
so perhaps enabling those last two and/or setting the first one to
org.apache.commons.logging.impl.Log4JLogger will do it?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku solver

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



Re: Is it possible to set response headers from within a sitemap?

2008-07-24 Thread Andy Stevens
2008/7/24 Philip Fennell [EMAIL PROTECTED]:
 Is there any way that I can set response headers from the
 sitemap/Cocoon?

...

 I'm using Cocoon 2.2

Isn't that what the HttpHeaderAction does?
http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/acting/HttpHeaderAction.java?view=markup


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku application

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



Re: CSVGenerator separators

2008-07-11 Thread Andy Stevens
2008/7/9 netBrackets [EMAIL PROTECTED]:
  Is there any way to tell the CSVGenerator to use one or more contiguous 
 spaces as a seperator?  You can tell it to use a single space:

  map:match pattern=importSSV/*
 map:generate type=csv src=inputs/{1}
map:parameter name=separator value= /
 /map:generate
 map:serialize type=xml/
  /map:match

 But then when there are contiguous spaces separating values, it increments 
 the field number for each space that it finds, e.g. if there are 28 spaces 
 between the first field and the second field you get:

 csv:record number=1
 csv:field number=1G005/csv:field
 csv:field number=29OR/csv:field
 csv:field number=30G020/csv:field
 csv:field number=31G021/csv:field
 /csv:record

  I'd like it to increment the field number only by 1 for each set of 
 contigous spaces, so it would output the below instead:

 csv:record number=1
 csv:field number=1G005/csv:field
 csv:field number=2OR/csv:field
 csv:field number=3G020/csv:field
 csv:field number=4G021/csv:field
 /csv:record


 Thanks,
 Jeff

I don't know if there's anything in the CSVGenerator that can do this,
but how about following the generator with an XSL transformer that
renumbers the fields?  So long as you're not expecting any gaps in the
fields after the contiguous spaces are taken into account, something
like

xsl:template match=csv:field
xsl:copy
xsl:attribute name=numberxsl:value-of select=position()//xsl:attribute
xsl:apply-templates/
/xsl:copy
/xsl:template

should do the trick.


Andy.
-- 
http://answers.polldaddy.com/poll/771503/  Cross-site scripting poll

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



Re: How to access configuration files and properties after packaging

2008-07-03 Thread Andy Stevens
2008/7/3 Robin Rigby [EMAIL PROTECTED]:
 Here is one way that seems to work.  Make a separate set of configuration
 for development and the default for production.

 \src\main\resources\META-INF\cocoon\properties\config.properties
 \src\main\resources\META-INF\cocoon\dev\properties\config.properties

 and run during development with

 mvn -Dorg.apache.cocoon.mode=dev jetty:run

Safer, surely, to make development the default and configure the
production server with the system property?  Otherwise a developer who
forgets the -D when testing out some code changes could completely
mess up your live data...


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: XSLT Version?

2008-07-03 Thread Andy Stevens
2008/7/3 Andrew Chamberlain [EMAIL PROTECTED]:
 Hi All,

 Simple question, I hope.  How do I find out which version of XSLT I've got?

Try using some XSLT 2-only features in a pipeline and see if you get a
stack trace instead? ;-)

  My version of Cocoon is: 2.1.10, if it's related to that.

 Ultimately, I'd like to be using XSLT 2.0.

Short answer is it depends :-)  The default XSL transformer in the
sample web app uses Xalan, which is XSLT 1.something, so that's
probably what you're using.  But you can change the configuration in
the cocoon.xconf to make it use Saxon instead, which supports 2.0 (or
just set up a second XSL transformer for Saxon and use whichever one
you need in any given pipeline).


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku creator

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



Re: Debugging sitemap

2008-07-01 Thread Andy Stevens
2008/6/27 Robby Pelssers [EMAIL PROTECTED]:
 Here is a way to put a little debug information inside your sitemap:
...
 I will get following output in my console:



 - Start Pipeline Debugging --

 Pipeline executed: static-content

 Matched pattern: static/page/*/page-*.*

 Pattern value: static/page/general/page-home.xhtml

 - End Pipeline Debugging 

Well, I suppose the output's more concise than switching the
sitemap.log level to DEBUG in logkit.xconf, even if it is more
intrusive in the sitemap  :-)


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku solver

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



Re: i18n in JX Template

2008-06-25 Thread Andy Stevens
2008/6/25 Magnus Haraldsen Amundsen [EMAIL PROTECTED]:

 In my JX Template i've created a system to display menues.

 c:menu

 c:menuelement title=menu.topic link=admin/emner/
 i18n:attr=title/
...
but it shows as

 Menu.topic
...
 How do I fix this?

Given that your tokens are all lower case but the output has a leading
capital letter, it seems to me that either they *are* being
substituted (and your catalog has menu.topic=Menu.topic etc.), or
something else is altering the title attributes (to capitalise them)
before the i18n transformer sees them and they aren't translated as
the transformer is probably case sensitive as regards the key names
(so it no longer thinks they match the keys in the catalog).

Or were the capital letters introduced by your mail client and the
original output is also lower case?

One other thought - is the i18n namespace declared correctly in your
template file?  Perhaps the transformer isn't recognising the
i18n:attr attributes, so doesn't think it needs to do anything with
the titles.


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku solver

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



Re: i18n in JX Template

2008-06-25 Thread Andy Stevens
2008/6/25 Magnus Haraldsen Amundsen [EMAIL PROTECTED]:
 I added a i18nTransform before the XSLT transform, just for the fun of
 it, and then the menus is translated correctly.

So what does the admin-styling XSLT do?  Could it be interfering with
the i18n namespace or stripping the i18n:attr attributes off the
relevant elements?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java sudoku application

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



Re: Failing Mysql JDBC connections

2008-06-20 Thread Andy Stevens
2008/6/20 Tobia Conforto [EMAIL PROTECTED]:
 For the record, this was caused by a deadlock problem, where many
 simultaneous requests would get a connection for their SQLTransformer,
 exhausting the connection pool, and then get stuck requesting more
 connections through an input module I wrote myself, before the
 SQLTransformers had a chance to return the connections to the pool.

 I worked around the problem by uncapping the database connections:

 pool-controller min=100 max=150 max-strict=false/

 Now I'd like to know how to avoid the deadlock condition in the first place,
 with capped connections, but I'm not sure it can be done.  I've asked the
 dev list.

Instead of max-strict=false have you tried blocking=false?  I
believe that'll cause it to throw an exception when the pool runs out
rather than waiting till another one comes available (which is the
reason it deadlocks).  Although you probably don't want the users to
get a system error page, it's better than the whole app locking up.
Also try adding a timeout value (e.g. timeout=500), which I think
means that even if it's blocking, it won't do so indefinitely.  Not
that you'll necessarily notice, as the SQLTransformer tries again a
number of times after a delay (both configurable), and by default
it'll be 30 seconds or more before it finally gives up.

We had a similar problem, just using multiple SQLTransformer
components (no input module in our case) in a single pipeline.  We
fixed it by changing the transformer so that it returned its
connection to the pool sooner (in the endDocument method, if I
remember correctly, or maybe it was the endElement for the top-level
execute-query element) instead of the recycle method.  The components
in a pipeline are all created (or got from their respective pools)
when the pipeline is being built, before it executes, and it only
releases/recycles them all once the pipeline finishes executing, so
the existing code meant that one pipeline would grab multiple database
connections from the pool but not return any of them until the whole
thing was done.  This meant a handful of simultaneous calls to a
pipeline(s) with a few SQLTransformers could deadlock each other
(actually, under a high enough load just having two SQLTransformers in
a pipeline would be enough) as the transformers later on in the
pipeline all wait for a connection (stopping the pipelines from
completing) that isn't going to become available as the earlier
transformers are still keeping hold of them all...  By closing the
connections as soon as they're finished with, they become available
again for the later transformers to use.

I can't remember if I raised a bug/enhancement request in JIRA to
change the transformer's behaviour in this way; if I didn't, perhaps
you'd like to...


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: Cocoon in Eclipse??

2008-06-09 Thread Andy Stevens

migselv46 wrote:

Hi

I have searched everywhere and tried everything trying to use cocoon in
Eclipse/Tomcat (or even better in WSAD 5.x) - that is - not by using ant,
maven or jetty server.

Is it at all possible?


What version - 2.1.x or 2.2?  With 2.1.x, the Ant build can generate a 
simple web app for you.  I just copied everything from that into the 
source folders of my own web app project, and started editing...



If yes - how does it work? A normal web application described by 'web.xml'
does not know anything about sitemaps, pipelines or the like.


No, but it knows about the Cocoon servlet.  Just include the 
appropriate entries for servlet (including init params)  
servlet-mapping.  Then amend the various Cocoon config files as 
required.  No doubt there's a preferences setting somewhere in 
WSAD/eclipse to get it to recognise .xmap, .xconf, etc. as XML files 
rather than plain text.


Speaking of WSAD; if you're deploying to Websphere you may want to
- use PARENT_LAST classloader mode (at both application and web module 
levels) when you deploy your application, so that it uses the Xerces  
Xalan versions shipped with Cocoon rather than Websphere's own. 
Alternatively, use the ParanoidCocoonServlet.
- in cocoon.xconf, change the jsp-engine implementation to use the 
named servlet dispatcher one (sorry, can't remember the exact 
classname, check the jsp block's jar) and configure it to use the JSP 
1.2 Processor (I think that's right, check the log messages as 
Websphere starts up to make sure).  If you use the default 
implementation, and have *.jsp mapped to Cocoon, you get an infinite 
loop as the RequestDispatcher Cocoon is given for any JSPs will call 
Cocoon itself again (which in all likelihood will map:match the same 
pipeline again).



How do I connect cocoon and a normal servlet?


What do you mean by connect?  Cocoon *is* a normal servlet, albeit a 
rather complex one, so you can do the usual RequestDispatcher forwards  
includes with it.  Only thing to watch out for is Cocoon always uses 
getOutputStream rather than getWriter, so jsp:include won't work; 
instead, use the JSTL's c:import tag which handles the writer/stream 
conversion.  Also, if you do want to use JSPs that forward/include to 
Cocoon (rather than have everything go through Cocoon and call the JSPs 
via the JSP generator/reader) make sure you don't map *.jsp to Cocoon in 
the servlet mappings.



Andy.
--
http://pseudoq.sourceforge.net/  Open source Sudoku solver

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



Re: Database connection problems

2008-05-12 Thread Andy Stevens
2008/5/8 Derek Hohls [EMAIL PROTECTED]:
 Andy

 Also, there does
 not appear to be ant errors.log or handled-errors.log files
 in the cocoon/WEB-INF/logs directory ... should there be?

Maybe the default configuration (in logkit.xconf) is different in
2.1.8, but that's where it created them for me until I changed the
file to put them elsewhere.  Check the cocoon targets to make sure
it has some defined for those files, and the categories to make sure
there are log-target references for those target IDs.

 The app and DB are running on the same machine (though
 in future they may be on different machines).

Is the application connecting using localhost or your machine's
hostname?  Which does the MySQL Query Browser use?  Is the database
listening on the network or loopback interfaces (or both), and are
both your app and the MySQL tool connecting on the same name/IP
address or might they be trying to connect on different interfaces?
For that matter, does the MySQL Query Browser connect via JDBC or some
other native driver library that defines connection settings
differently? (I've not used it myself)


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: Database connection problems

2008-05-07 Thread Andy Stevens
2008/5/7 Derek Hohls [EMAIL PROTECTED]:
 Using Cocoon 2.1.8

 I have an app which has been working fine... up to now.
 I am now in a situation where:
 * the plain pages on the website (ie. not accessing the
 database) display just fine
 * I can access the database from a 3rd party tool (the
 MySQL Query Browser) without any problems

 BUT I am unable to retrieve any database data via the
 interface... the browser simply shows me its hourglass
 and there is no further response.  I have looked at the
 Cocoon log and the Tomcat log but even the URLs do
 not show up in these.

Are you sure Cocoon is actually managing to connect to the database?
You say there is no further response - how long are you waiting?
I'm not sure about the other database components, but certainly in the
case of the SQLTransformer if it can't get a connection it will (by
default) retry 5 times at 5 second intervals, so it could be 30
seconds before you actually get an error message returned.  And if
it's waiting on a TCP-level timout ConnectException (e.g. because the
port is blocked by a firewall and the packets are being dropped rather
than actually rejecting the connection) that could involve a 20 second
timeout in itself...
I'd have thought you'd still see something in Cocoon's errors.log or
handled-errors.log, though.
You say you can access the database okay yourself; is the application
running locally on the same machine, or is it deployed on some other
server?


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: RegexpRequestParameterSelector unable to get working.

2008-05-07 Thread Andy Stevens
2008/5/6 Gordore [EMAIL PROTECTED]:
  map:match pattern=test
 map:generate src=content/group.xml /
 map:act type=request
 map:parameter name=parameters value=true /
 map:select type= request-param-regexp
 map:parameter name=parameter-name value={group} 
 /
 map:when test=groups
 map:transform type=xslt src=xslt/text.xslt
 map:parameter name=arg value=true /
 /map:transform
  /map:when
  map:otherwise
 map:transform type=xslt src=xslt/text.xslt
 map:parameter name=arg value=false /
 /map:transform
  /map:otherwise
 /map:select
 /map:act
  map:serialize type=html /
  /map:match

  http://server/cocoon/test?group=admin
 arg = false

  http://server/cocoon/test?group=user
 arg = false

I see you have map:parameter name=parameter-name value={group} /
The -name suggests this map:parameter should be the name of the
request parameter to check rather than its value, which is what you're
supplying.  Try using just value=group instead of {group}.
Otherwise, those requests are telling it to do the regexp tests
against the admin and user request parameters, which don't exist...
And since the selector looks up the specified request parameter
itself, that map:act type=request is unnecessary too, unless you
need it for some other sitemap component.


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku generator

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



Too many open files (was PDF Image Caching Problem)

2008-05-07 Thread Andy Stevens
2008/5/5 Lehtonen, Mika [EMAIL PROTECTED]:
  Actually there might be another problem (or bug) lying around if you
 produce htmls' with 'noncaching' option. Cocoon seems to be leaving files
 open when using html-serializer with noncaching option in your pipeline. And
 eventually your application can crash because you exceed the maximum open
 files that your OS tolerates. (Cocoon 2.1.11 / Centos 4.6)

Really?  Aha...

It's not the cocoon.xconf that's left open is it?  And could this
affect earlier versions too?  I mailed the dev list about a week ago
(subject Excessive file handles on cocoon.xconf, see
http://www.nabble.com/Excessive-file-handles-on-cocoon.xconf-tp16973172p17000464.html)
because we were encountering Too many open files errors after
migrating a 2.1.7 app from Websphere 5.0 on Windows to 6.0 on Linux.
I'm wondering if this could be the reason.

Do the files get closed eventually? We were getting these errors with
the limit set to 1024, but after a few minutes things would start
working again for a while.  Also, after increasing the limit to 8000
we haven't seen the error since.  I assume this is because it's now
high enough for the responsible component(s) to get destroyed, garbage
collected, and basically cleaned up properly before things get that
bad.


Andy
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: problem with JSTL import tag on weblogic 9.2

2008-04-29 Thread Andy Stevens
On 28/04/2008, John Lung [EMAIL PROTECTED] wrote:
 Hi:

 We're trying to use JSTL 1.1 c:import tag on weblogic 9.2 in an JSP page to
 import the Cocoon page (Cocoon 2.1.11) under a different context (a
 different webapp in the same weblogic domain).

 c:import url=/MyCocoonPage context=/Cocoon /

 cocoon throws a 404 error and saying no match in the sitemap.  But when I
 directly access this page:

 http://localhost:port/Cocoon/MyCocoonPage

 the page displays fine.  I tested on Tomcat5.5 and it worked fine.  I tested
 to c:import a different JSP on weblogic and it worked fine too.  Any
 suggestions?

If I remember rightly, c:import works much like jsp:include in that it
looks up the relevant RequestDispatcher (in this case, for the Cocoon
servlet) and does a .include() on it.  There's some added trickery to
allow for the included resource calling getOutputStream when the jsp
containing the tag will have already called getWriter, which would
otherwise throw an IllegalStateException.  The thing that's catching
you out is that the .include() call gets passed the original request 
(wrapper around the) response objects, so if your Cocoon pipeline uses
the wildcard or regex URI matchers the URI they see will be for the
originally requested JSP rather than the path  context mapped to the
Cocoon servlet.  That's why it's failing to match and you get the
404s.

We had the same problem on a project I worked on a few years back -
the Content Management System generated JSPs from its data structures,
and we needed to embed some stuff generated by Cocoon.  The first
workaround we used was to change the CMS's templates to generate
c:import tags along the lines of
c:import url=/MyCocoonPage?cocoon-path=/MyCocoonPage context=/Cocoon /
and in our root sitemap.xmap change the default matcher to the request
parameter one instead of the URI one.  That way we didn't have to
change any of the map:match entries except where one pipeline called
another via cocoon:/

The second version workaround we used was to create our own version of
the c:import tag.  This passed a request wrapper to the dispatcher's
include method that behaved as if it was a new request for the
included resource, so the various getServletPath/URI/etc. methods
would return the appropriate values for /Cocoon/MyCocoonPage and no
need to mess around with the extra request parameter.

The third version sent all requests through Cocoon, and anything
asking for a JSP matches a pipeline that uses the JSP reader to call
it.  The rest was down to configuring the jsp-engine entries in
cocoon.xconf so that things got dispatched correctly (not initialising
a new copy of the JSP with every call, and not attempting to forward
the request back through the Cocoon servlet again as that led to a
blown stack and/or Out Of Memory errors).  I'm not entirely sure we
had any JSPs doing further jsp:include or c:import calls, though, as
by this stage we were doing most of the page inclusion on the Cocoon
side via the cinclude transformer.

Hope that gives you some ideas to be going on with.


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application.

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



HTML serializer and Content-Type response header

2008-03-27 Thread Andy Stevens
Hi,

I've got a Cocoon (2.1.7!) based app that I'm moving over from
Websphere 5 to Websphere 6, which includes Chinese text.
Unfortunately, in the new environment all the Chinese characters
appear as garbage, because the browser is using Western (ISO-8859-1)
as the character encoding.  If I switch it over to UTF-8 myself it all
displays fine, but I'm having to do this for every page I request
(which gets tiresome very quickly...)

My HTML serializer is configured with encodingUTF-8/encoding and
the page includes a
META http-equiv=Content-Type content=text/html; charset=UTF-8
tag in the head.  However, where previously (on WAS 5) the app was returning
Content-Type: text/html
in the response headers, I'm now getting
Content-Type: text/html; charset=iso-8859-1
under WAS 6.  It looks like the app server is helpfully setting a
default charset when none is present.

Now, the HTML serializer must be setting the content type to text/html
(as opposed to text/xml or any other mime type other serializers might
use).  Is it possible to have it also include the encoding, though, as
I assume if there's one explicitly specified in the header WAS 6 will
leave it alone?  Some configuration setting other than the encoding,
maybe?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: IncludeTransformer

2008-02-28 Thread Andy Stevens

Sébastien Geindre wrote:

How can i log the http header of a request made by CIcludeTransformer ?


One possibility would be to use Axis' tcpmon utility 
(http://ws.apache.org/axis/java/user-guide.html#AppendixUsingTheAxisTCPMonitorTcpmon)? 
 Just change the CInclude to use localhost and configure tcpmon to 
forward requests to the real service.



Andrew.
--
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: How to log/trace functional information ??

2008-02-21 Thread Andy Stevens
On 14/02/2008, Sébastien Geindre [EMAIL PROTECTED] wrote:
  A client send xml data.
  I need to put it in kind of database.
  This is ok.

  But i would like to write in a file (for example) that client A send
  this datas, this day,...
  All information i need to trace are in  the xml data sent.

  A kind of monitoring, or functional trace.

  How can i do that with C2.2 ?

Are you passing the user's document through a sitemap pipeline?  If
so, you could include a custom transformer that passes everything
through unchanged, but watches for the values you're interested in and
records them.  Then in the endDocument callback, write them to the log
file.  Don't see any reason why 2.2 would be any different from 2.1
with this approach, asides from component lifecycle code.


Andrew.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Re: Doing string operations over sitemap values

2008-02-15 Thread Andy Stevens
On 15/02/2008, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 As a policy for this website we are trying avoid doing any custom java
  programming, only little tiny features added here and there to cocoon
  itself, and clearing some minor gotchas i've found in my way but apart from
  that, adding a custom java inputModule is not an option, until discovered
  the jxpath way i did a draft input module to do the translate, but finally
  no needed to break the no custom java code policy of this site..

You could always upload a patch to Cocoon's JIRA for an input module
that does what you need and ask nicely on the dev list to get it
applied.  That way there's no custom code needed as it's part of the
standard distribution :-)


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku solver

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



Re: Relative paths in fop-0.94

2008-02-06 Thread Andy Stevens

Carlos Martínez wrote:

Hello,

I'm using a fop-0.94 in my local cocoon site to create PDF. All work 
properly but the path of the images always have to be absolute. I don't 
know how to change this.


Unless things have changed from the earlier FOP version, you can't. 
Actually, that's not strictly true.  Cocoon's source resolver isn't 
passed through to FOP, so cocoon: protocol URLs won't work.  But fully 
qualified http: URLs should be okay too, which is okay so long as the 
hostname can be resolved by the box that's running Cocoon.  On an 
internal network that's probably okay, but introduce a DMZ, run the app 
server on a different box to the internet-facing web server and firewall 
it off from direct internet access, and you'll have all sorts of trouble 
getting it working ;-)



 I'm using a serializer that i see here:

map:serializer name=fo2pdf mime-type=application/pdf 
src=CocoonFOPSerializer

   set-content-lengthfalse/set-content-length
   user-configcocoon://fop-config.xml/user-config
/map:serializer

And i created the fop-config.xml file with all the fonts:


If you're using cocoon:// in the user-config, have you included a 
pipeline that matches that path (using e.g. file generator  xml 
serializer to return your config file)?  Otherwise I think you just need 
the relative path to the config file from the sitemap's location.



configuration
   fonts
 !-- A lot of uninsteresting fonts --
   /fonts
/configuration

I try to put some sentences in the fop-config.xml file before the tag 
fonts that i see in some forums, but it doesn't work. Here are some 
lines of this codes:


entry
keybaseDir/key
   valueC:\mypath/value
/entry


I never had any luck getting this to work either, so I came up with an 
alternative approach.  I too used cocoon: in the user-config setting, 
but instead of a static configuration file, I generate it dynamically in 
the matching pipeline.  With e.g. an XSL transformer and passing in an 
xsl:param with the real path to the fonts directory - see
http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html#ContextPathModule 
- the pipeline output contains the absolute paths that FOP expects in 
the configuration, but without having to hard code the path in the 
application so it doesn't matter where the war file gets expanded to 
when deployed in different environments.


And, since you mentioned images, those can work in much the same way. 
Assuming you've already got an XSL transformation generating the xslfo 
from your source file/data, just add a top level xsl:param for the image 
file path, and pass it in from the sitemap using the input module.  Then 
prepend the parameter to the image paths in the XSL generating the 
fo:external-graphic tags, to make them absolute.


That should do the trick for bitmaps; on the offchance it's charts 
you're including there is another option.  If you can produce/convert 
them as SVG, then just include the SVG with your other data (via map 
aggregation or the x/cinclude transformer) and have the XSL put them 
inside fo:instream-foreign-object elements at the appropriate points. 
No paths required.


Hope this helps,


Andy.
--
http://pseudoq.sourceforge.net/  Open source java Sudoku app

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



Re: cocoon 2.2 jsp... again)

2008-02-06 Thread Andy Stevens

nanomonk wrote:

i have an error:
javax.servlet.ServletException: org.apache.cocoon.ProcessingException:
Exception
 JSPGenerator.generate()

Caused by: org.apache.avalon.framework.service.ServiceException: Component
with 'org.apache.cocoon.components.jsp.JSPEngine' is not defined in this
service manager. (Key='AvalonServiceManager')
what doing avalon here? this project closed as I know...


That's the beauty of open source - just because a project is no longer 
active, that doesn't stop you using it.  It just means you'll have to 
fix any remaining bugs yourself, but at least that's possible since 
you've got the source...




btw...just tell me can I use cocoon-jsp-2.1.9 for .jsp with parameters and
how?


I'm confused - which Cocoon version are you using?  2.2 like the title 
says, or 2.1.9?  Or are you trying to use 2.1.9's JSP block from a 
2.2-based application?



Andy.
--
http://pseudoq.sourceforge.net/  Open source java Sudoku generator

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



PDF forms

2008-01-29 Thread Andy Stevens
Hi again,

Is it possible to produce PDFs containing forms (of the type things
into the acrobat reader before printing or submitting electronically
AcroForms type, as opposed to just printing some empty boxes) using
Cocoon?  I can't find any mention of them on either the Cocoon or FOP
sites, which suggests to me it can't.  Nor do I see anything related
to forms in the w3's XSL:FO pages, so I suppose they're outside its
scope.  I see there's an itext block in the Cocoon sources (though the
itext serializer doesn't appear in the docs) which simply passes the
SAX stream through to iText's SAXiTextHandler.  Is the expected input
XML format for this documented anywhere?  Judging by the samples, it's
certainly not using XSL:FO.  And, before I forget, this is for Cocoon
2.1; there's no itext block listed in the 2.2 docs at
http://cocoon.apache.org/2.2/blocks/


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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



Is it possible to restrict file uploads to certain URLs?

2008-01-28 Thread Andy Stevens
Hi,

New year, new webmail; hopefully google mangles embedded xml less than
hotmail :-)

I have a new requirement for one of our sites to allow the users to
upload some files.  However, I read in the Cocoon docs/wiki that
switching on the enable-uploads init parameter will make it use the
multipart request factory etc. on all requests it receives.  This
seems to me like a lot of unnecessary work (and either disk IO or heap
churn) when only a couple of pipelines will be processing the uploaded
files.

Since the URLs that will handle the file Part(s) are all in a specific
area of the site (a subdirectory requiring the user to have logged
in), I was wondering whether it was possible to configure Cocoon (with
a regex, say) to only use the multipart parser on a subset of the URL
space.  If not, would this be a considered a generally useful feature
if I can come up with a patch?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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