Re: esql not working at all, no connection ever created!

2003-04-02 Thread Christopher Painter-Wakefield

I think it was there in his original posting.

-Christopher



|-+--
| |   Christian Haul |
| |   [EMAIL PROTECTED]|
| |   rmstadt.de|
| |  |
| |   04/02/2003 02:52 AM|
| |   Please respond to  |
| |   cocoon-users   |
| |  |
|-+--
  
--|
  |
  |
  |   To:   [EMAIL PROTECTED]  
|
  |   cc:  
  |
  |   Subject:  Re: esql not working at all, no connection ever created!   
  |
  
--|




On 01.Apr.2003 -- 01:48 PM, Christopher Painter-Wakefield wrote:

 Is this the whole XSP program?  If so, the problem is that you don't have
 the required single non-xsp child node of xsp:page.  E.g., you have:
 xsp:page ...
   esql:connection
 ...
   /esql:connection
 /xsp:page

 but you need to have:
 xsp:page ...
   some-node
 esql:connection
   ...
 /esql:connection
   /some-node
 /xsp:page

 If that isn't the problem, write back and we'll try something else.

Another one is the missing esql:execute-query tag.

 Chris.
--
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08







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



Re: esql not working at all, no connection ever created!

2003-04-01 Thread Christopher Painter-Wakefield

Is this the whole XSP program?  If so, the problem is that you don't have
the required single non-xsp child node of xsp:page.  E.g., you have:
xsp:page ...
  esql:connection
...
  /esql:connection
/xsp:page

but you need to have:
xsp:page ...
  some-node
esql:connection
  ...
/esql:connection
  /some-node
/xsp:page

If that isn't the problem, write back and we'll try something else.

-Christopher



|-+
| |   Not Available|
| |   [EMAIL PROTECTED]|
| |   hoo.com |
| ||
| |   04/01/2003 01:28 |
| |   PM   |
| |   Please respond to|
| |   cocoon-users |
| ||
|-+
  
--|
  |
  |
  |   To:   [EMAIL PROTECTED]  
|
  |   cc:  
  |
  |   Subject:  Re: esql not working at all, no connection ever created!   
  |
  
--|




Here is my xsp code:


xsp:page language=java xmlns:xsp=http://apache.org/xsp;
xmlns:esql=http://apache.org/cocoon/SQL/v2;

  esql:connection
   esql:pooldb_pool/esql:pool
  esql:execute-query
esql:query
 select * from antiques
/esql:query
  esql:results
   esql:row-results
esql:get-int column=id/
esql:get-string column=name/
  n! bsp;/esql:row-results
  /esql:results
  /esql:execute-query
  /esql:connection
/xsp:page


Here is my web.xml:


init-param
  param-nameload-class/param-name
  param-value
!-- For IBM WebSphere:
com.ibm.servlet.classloader.Handler --


!-- For Database Driver: --
org.hsqldb.jdbcDriver
  com.mysql.jdbc.Driver
!-- For parent ComponentManager sample:
org.apache.cocoon.samples.parentcm.Configurator
--
  /param-value
/init-param


Here is my cocoon.config:


jdbc name=antiques
 pool-controller min=5 max=10/
 dburljdbc:mysql://localhost/databasename?autoReconnect=true/dburl
 usermyusername/user
 passwordmypassword/password
   /jdbc


Here is my pipeline for testing:


map:pipeline
   map:match pattern=content/*.xml
map:generate type=xsp src=content/{1}.xsp/
map:serialize type=xml/
   /map:match
  /map:pipeline


Thanks again


 Christopher Painter-Wakefield [EMAIL PROTECTED] wrote:

 Please post your xsp code, or at least the portion with esql in it. Very
 hard to help, otherwise.

 -Christopher




 |-+
 | | Not Available |
 | | | | hoo.com |
 | | |
 | | 04/01/2003 03:47 |
 | | AM |
 | | Please respond to|
 | | cocoon-users |
 | | |
 |-+
 
 
--|

 | |
 | To: [EMAIL PROTECTED] |
 | cc: |
 | Subject: esql not working at all, no connection ever created! |
 
 
--|





 I have been trying to get esql to work now for about 3 days with no luck.
 I
 beleive i have configured ever! ything correctly but when I run any xsp
 page
 with esql it returns a duplicated page of my xsp page except that it stops
 at the esql:connection tag. When I look at the error log it says there was
 a null pointer exception. After examining the generated java file I think
 it is because a connection object is always null (never set to a valid
 connection). However I am pretty confident my pool is set up correctly and
 the drivers are being loaded ok.


 Here is the code that it points to in the java file:


 _esql_query = new EsqlQuery( _esql_connection, String.valueOf(
 


 +  select * from antiques 
 +  
 ) );


 No where above this code is the _esql_connection every initialized with a
 connection.


 I am using the latest release for java 1.4.1 and running windows me with
 mysql.


 Thanks,


 Kris






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



Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more









-
To unsubscribe, e-mail: [EMAIL PROTECTED

Re: mail function

2003-03-17 Thread Christopher Painter-Wakefield

There is a sendmail logicsheet, not documented on the website.  To use it
is pretty simple, here's an example of what you might do with a POST from a
message form:

xsp:page
  xmlns:xsp=http://apache.org/xsp;
  xmlns:sendmail=http://apache.org/cocoon/sendmail/1.0;

  page

 xsp:logic
   String from = request.getParameter(from);
   String to = request.getParameter(to);
   String cc = request.getParameter(cc);
   String bcc = request.getParameter(bcc);
   String subject = request.getParameter(subject);
   String body = request.getParameter(body);

   // the java sendmail interface apparently dislikes empty string
addresses
   if (.equals(cc)) { cc = null; }
   if (.equals(bcc)) { bcc = null; }
 /xsp:logic

 message-status
   xsp:logic
boolean success = true;
try {
   sendmail:send-mail
 sendmail:fromxsp:exprfrom/xsp:expr/sendmail:from
 sendmail:toxsp:exprto/xsp:expr/sendmail:to
 sendmail:ccxsp:exprcc/xsp:expr/sendmail:cc
 sendmail:bccxsp:exprbcc/xsp:expr/sendmail:bcc
 
sendmail:subjectxsp:exprsubject/xsp:expr/sendmail:subject
 
sendmail:bodyxsp:exprmessage/xsp:expr/sendmail:body
 sendmail:smtphostsmtp.mydomain.com/sendmail:smtphost
   /sendmail:send-mail
} catch (Exception e) {
   success = false;
}
if (success) {
   successxsp:exprto/xsp:expr/success
} else {
   errorxsp:exprto/xsp:expr/error
}
  }
   /xsp:logic
 /message-status
  /page
/xsp:page

HTH,
-Christopher



   
   
  boessem
   
  [EMAIL PROTECTED]To:   Cocoon-Users [EMAIL 
PROTECTED] 
  de  cc: 
   
   Subject:  mail function 
   
  03/17/2003 05:11 
   
  AM   
   
  Please respond to
   
  cocoon-users 
   
   
   
   
   




hi,

i am quite new to cocoon, and try to write a registration using xsp.

my question is, if there is a funktion like within php to automatically
send a mail to me, with the registration informations.

any comment would be helpfull. i searched for comments on this within the
cocoon mailinglist archive, but couldn#t even find questions related to
that subject. so if anyone knows links, to give me a brief overview how to
archive a function like this, please mail.

thanks
and regards





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



Re: ESQL Woes in XSP

2002-11-26 Thread Christopher Painter-Wakefield

Not true, you definitely can wrap logic, including while statements around
esql code.  (Remember, it just turns into more Java code, so...)  You can
even extract your esql and put it into a separate function, as long as you
don't have any XML output from it (you can still do it, but you have to
hack a little).

We use ESQL heavily, and there's no way we'd be able to function if we
couldn't do if blocks and the like around esql code.

-Christopher




Hi Tom,

On Tue, 26 Nov 2002, Tom Place wrote:

   class1 = esql:get-string column=CLASS/;

Try:

 class1 = esql:get-string column=CLASS/;

Although you may like to check that everything else is working: I'm not
sure you can have esql nested within xsp:logic, ie:

 while (class1 = null) {
  esql:connection etc /
 }

... probably won't work.


Hope that helps,

Andrew.







-
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 Woes in XSP

2002-11-26 Thread Christopher Painter-Wakefield

As someone else mentioned, change
  class1 = esql:get-string column=CLASS/;
to
  class1 = esql:get-string column=CLASS/;

Also, you might run into trouble with
...where SELECTION = 'xsp:exprcurrentSelection/xsp:expr'/esql:query

, as the XSP compiler might put the quotes and the content on separate
lines, which would give you the error you saw.  I would recommend you
change this code to:

...where SELECTION =
  esql:parameter type
=stringxsp:exprcurrentSelection/xsp:expr/esql:parameter

-Christopher




Hi all,

I was wondering if anyone could help me with the following. I am trying
to put the results from a row of results directly into String variables
as show below and Cocoon isn't happy. I get a unclosed character literal
compilation error.

The XSP I am executing is as follows (the problem area is highlighted
with +-+)

  while (class1 = null) {

esql:connection
  esql:poolautorevs_pool/esql:pool
   esql:execute-query
 esql:queryselect * from profile where SELECTION =
'xsp:exprcurrentSelection/xsp:expr'/esql:query
 esql:max-rows1/esql:max-rows
 esql:results
   esql:row-results
 xsp:logic

+---
---+

  class1 = esql:get-string column=CLASS/;
  engine1 = esql:get-string column=ENGINE_TYPE/;

+---
+

  titlexsp:exprclass1/xsp:expr/title
headingxsp:exprengine1/xsp:expr/heading

  /xsp:logic
   /esql:row-results
 /esql:results
 esql:no-results
   xsp:logic
   if (currentSelection.equals(Strongly Agree)) {
 currentSelection = Agree;
   } else if (currentSelection.equals(Agree)) {
 currentSelection = Undecided;
   } else if (currentSelection.equals(Undecided)) {
 currentSelection = Disagree;
   } else {
 currentSelection = null;
  class1 = error;
   }
   /xsp:logic
 /esql:no-results
   /esql:execute-query
 /esql:connection

  }

Any help greatly appreciated

Thanks

Tom Place





-
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: XSP Logicsheet Questions...

2002-11-11 Thread Christopher Painter-Wakefield

FWIW, we are using relative file paths for our logicsheets, and this is
supposed to cause pages to be recompiled if we modify the logicsheet.  Be
warned, though, that it seems to be somewhat flaky; it often works as
expected, but sometimes not.  In those cases, you have to touch the main
XSP source file.  This can be extremely frustrating when you are wondering
why a bugfix you just put in doesn't seem to be working!!

-Christopher




An update -

In looking into the issue regarding changes to
logicsheets, I found the following reference:
http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=102374809216737w=2

So, logicsheets declared with resource: in
cocoon.xconf are not checked for updates, but other
protocols are (including no protocol).

Geoff

--- Geoff Howard [EMAIL PROTECTED] wrote:
 I've been hoping someone would answer your questions
 with authority - I've just started using logicsheets
 as well.  My best answers follow:

 --- Andy Lewis [EMAIL PROTECTED] wrote:

  First, it appears that a logicsheet must declared
 to
  be used and that the only place to declare a
  logic sheet is in the xconf file. Is this correct?

 Yes, although there is an undocumented feature
 available because of the TreeProcessor
 implementation
 which allows components defined in the
 map:components
 section of the sitemap the same as cocoon.xconf.
 What
 I don't know and haven't had the time to test is
 what
 happens with a case like logicsheets when there are
 some defined in cocoon.xconf and some defined in
 sitemap?  Give it a try and let us know.

  Second, is the xconf file only reload at Cocoon
  restart time, or are there other events that
  trigger a reload as well?

 I think reload of the conf can also be triggered by
 sending an http request with the parameter
 cocoon-reload=true if you have not turned this
 option
 off in web.xml (or is it cocoon.xconf?)  While I
 have
 used this, I cannot recall if I carefully confirmed
 that the xconf file is actually re-read from disk
 correctly if modified.

  Third, are changes to a logicsheet picked up and
  used in a running Cocoon environment, or are they
  only caught when the configuration is read?

 In my experience, changes to a logicsheet are not
 picked up by a running cocoon, and I'm not even sure
 they are re-read with cocoon-reload.  I have been
 cycling tomcat to get changes visible.

  If
  changes are picked up, are they a dependancy of
 the
  pipeline, or are they only picked up when the XSP
  itself is recompiled due to another trigger,
  such as being updated.

 They are not re-read when the xsp is modified (don't
 know if this is a bug or intended functionality) but
 this raises two important points I've learned:

 - If you change the logicsheet, cycle the servlet
 container, and reload your page, the changes are not
 visible because the xsp is unmodified.  My current
 hack until I have time to look into how to do all
 this
 right is to touch the xsp (actually I make a
 trivial
 modification in the file and resave it)
 - You may be able to force reload of the logicsheet
 and recompile of the xsp without all of the
 histrionics reported above by using the
 xsp:dependency tag to manually report that your
 xsp
 relies on your logicsheet.

 I really hope I've missed some magic bullet that
 makes
 all this function as it seems it should.  I have a
 hard time believing that any logicsheet development
 happens the way I've been doing it (at least for
 long).

 HTH,
 Geoff Howard







-
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: AW: url rewriting

2002-10-23 Thread Christopher Painter-Wakefield


Chris,

sure, here you are.  I don't know if there are any version dependencies
(I'd guess not), but we compiled this against the C2.0.3 jar, so if you are
on 2.0.3 it should work fine.  The path is
org/apache/cocoon/transformation/EncodeURLTransformer.class.

I've also added a bug report on bugzilla, so hopefully this will get fixed
in 2.1.

-Christopher

(See attached file: EncodeURLTransformer.class)



hi,

sorry to write directly to you.

can you send my by attachement your compiled EncodeURLTransformer.class


greetings chris

-Ursprüngliche Nachricht-
Von: Christopher Painter-Wakefield [mailto:paint007;mc.duke.edu]
Gesendet: Dienstag, 22. Oktober 2002 19:34
An: [EMAIL PROTECTED]
Betreff: Re: url rewriting



Chris,

I don't know much about actions, so I can't help you too much with that.
However, I can offer some hints on the EncodeURLTransformer.  Basically,
it has a bug.  The first time you hit a page, it fails to rewrite the
URLs. This works for some frameworks, in which the first page is a login
page, with the form action manually rewritten in XSP, and then all
subsequent pages are rewritten.  Someone else posted on the mailing list
a while back
(http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=103241658409677w=2)
,
but it doesn't appear to have been picked up by the Cocoon developers;
it's been on my to-do list for a little while to add this to bugzilla,
so I'll try to take the time to do that today.

In the meantime, to fix the bug, we changed the source code for
EncodeURLTransformer, compiled it, and put it in our cocoon.jar in place
of the old one.  I think you can also just put it in WEB-INF/classes, if
you are using Tomcat, but we didn't try that.  Anyway, you can use the
fix suggested in the link above, or you can try ours.  Ours is maybe a
bit simpler, but you tend to get URLs rewritten on the first page
regardless of whether the browser needs it, which doesn't hurt anything
but might bother some people.  Our fix is:

replace:
  if ( request.isRequestedSessionIdFromURL()) {
with:
  if ( request.isRequestedSessionIdFromURL() ||
this.session.isNew()) {

in the setup() method.

-Christopher





EncodeURLTransformer.class
Description: Binary data
-
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: url rewriting

2002-10-22 Thread Christopher Painter-Wakefield

Chris,

I don't know much about actions, so I can't help you too much with that.
However, I can offer some hints on the EncodeURLTransformer.  Basically, it
has a bug.  The first time you hit a page, it fails to rewrite the URLs.
This works for some frameworks, in which the first page is a login page,
with the form action manually rewritten in XSP, and then all subsequent
pages are rewritten.  Someone else posted on the mailing list a while back
(http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=103241658409677w=2),
but it doesn't appear to have been picked up by the Cocoon developers; it's
been on my to-do list for a little while to add this to bugzilla, so I'll
try to take the time to do that today.

In the meantime, to fix the bug, we changed the source code for
EncodeURLTransformer, compiled it, and put it in our cocoon.jar in place of
the old one.  I think you can also just put it in WEB-INF/classes, if you
are using Tomcat, but we didn't try that.  Anyway, you can use the fix
suggested in the link above, or you can try ours.  Ours is maybe a bit
simpler, but you tend to get URLs rewritten on the first page regardless of
whether the browser needs it, which doesn't hurt anything but might bother
some people.  Our fix is:

replace:
  if ( request.isRequestedSessionIdFromURL()) {
with:
  if ( request.isRequestedSessionIdFromURL() || this.session.isNew()) {

in the setup() method.

-Christopher



hi all!

i use win200, cocoon2.0.2, weblogic6.0sp2

i tried url-rewriting in my action---

Map sitemapParams = new HashMap();
Request req = ObjectModelHelper.getRequest(objectModel);
Session session = req.getSession();

if (session.isNew()) {
 // data i want to read out in my xsp-site
 session.setAttribute(data, myObject);
 sitemapParams.put(nextpage, home);
}

as it is given in the documentation


my sitemap looks as following --

map:match pattern=startOR
 map:act type=ORAction
   map:generate src=orneu/{nextpage}.xsp type=serverpages/
   !--map:generate src=orneu/registrierung1.xsp
type=serverpages/--
   map:transform src=orneu/xml2html.xsl type=xslt/
   map:transform type=encodeURL/
 /map:act
 map:serialize type=html/
/map:match



also i configured my weblogic, not to use cookies -- see
may attached weblogic.xml


but every time, i go a second time in my action, it seems that
the action creates every time a new session and my session-data is lost

i studied the EncodeURLTransformer, but it doesn't helped me (i don't
know how to
in my action use this)


has someone a code-example who to write a cocoon-action with
url-rewriting.
what do i wrong? please help!

greetings, chris






-
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: xsp:logic how to ???

2002-09-26 Thread Christopher Painter-Wakefield


I'll take a stab at it...

You don't need java for looping over the rows, that is already done by the
esql logicsheet when you use esql:row-results.  You can mix xsp:logic
and ESQL tags as needed however.  Here's some code (below) that might be
close to what you want to do.  Note I wasn't sure everywhere what you were
trying to do with your queries, and some of them didn't make sense to me,
so I made guesses as to what your database schema looks like and rewrote
the queries accordingly.  Hopefully it will help make some sense of this
for you.  Also note I've used java to get a foreign key (I made up the
column name, but I assume it must exist) from the section table for use in
the chapter table, but ESQL also provides some features that would allow
you to avoid even this little bit of java.  I'm not real familiar with it,
but presumably it is documented in the ESQL documentation.  Anyway, this
shows you that you can easily mix xsp:logic and ESQL tags.

?xml version=1.0 encoding=UTF-8?
xsp:page
  xmlns:xsp=http://apache.org/xsp;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;

  Document
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:noNamespaceSchemaLocation=schema.xsd
  
!-- Get Document --
esql:connection
  esql:poolxmldb/esql:pool
  esql:execute-query
esql:queryselect * from document where DocID = 1/esql:query
esql:results
  esql:row-results
DocObjesql:get-string column=DocObject//DocObj
DocTitleesql:get-string column=DocTitle//DocTitle
DocVeresql:get-string column=DocVersion//DocVer
DocAuthesql:get-string column=DocAuthor//DocAuth
DocDateesql:get-date column=DocData//DocDate
  /esql:row-results
/esql:results
  /esql:execute-query

  !-- Get Sections --
  esql:execute-query
esql:queryselect * from section where DocID = 1/esql:query
esql:results
  !-- Loop over sections - no xsp:logic needed, this is already a
java loop --
  esql:row-results
Section
  SecTitleesql:get-string column=SecTitle//SecTitle
  SecContentesql:get-string column
=SecContent//SecContent
  xsp:logic
!-- Save your foreign key for the chapter table --
String section = esql:get-string column=SecID/;
  /xsp:logic

  !-- Get Chapters for this Section --
  esql:execute-query
esql:query
  select * from chapter
  where DocID = 1 AND Section=
esql:parameter type=string
  xsp:exprsection/xsp:expr
/esql:parameter
/esql:query
esql:results
  !-- Loop over Chapters --
  esql:row-results
Chapter
  ChapTitleesql:get-string column
=ChapTitle//ChapTitle
  ChapContentesql:get-string column
=ChapContent//ChapContent
/Chapter
  /esql:row-results
/esql:results
  /esql:execute-query

/Section
  /esql:row-results
/esql:results
  /esql:execute-query
/esql:connection
  /Document
/xsp:page




Hi, it's me again ... could some one give me a hint how to use xsp:logic
in the right way ?

I have to generate a document structure like this:
document
  section A
 chapter 1
 chapter 2
  section B
 chapter 3

  My problem is to combine the logic with my esql tags.

xsp:page laguage=java xmlns:xsp=http://apache.org/xsp;
xmlns:esql=http://apache.org/cocoon/SQL/v2;
 Document xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:noNamespaceSchemaLocation=schema.xsd
xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp=
http://apache.org/xsp;
  esql:connection
   esql:poolxmldb/esql:pool
 Document
 esql:execute-query
esql:queryselect * from document/esql:query
esql:results
 esql:row-results
  DocObjesql:get-string column=DocObject//DocObj
  DocTitleesql:get-string column=DocTitle//DocTitle
  DocVeresql:get-string column=DocVersion//DocVer
  DocAuthesql:get-string column=DocAuthor//DocAuth
  DocDateesql:get-date column=DocData//DocDate
 /esql:row-results
/esql:results
   /esql:execute-query
  Section
esql:execute-query
 esql:queryselect * from section where DocID 1/esql:query
  // Here I have to make an output first for the section A and all its
chapters and after that I have to realize an output of the section B and
all its chapters ...
   how can I realize it ?
xsp:logic
  for (int x=0; x =esql:row-results; x++){
 esql:results
  esql:row-results
   SecTitleesql:get-string column=SecTitle//SecTitle
   SecContentesql:get-string column=SecContent//SecContent
  /esql:row-results
 /esql:results
 

Re: Sun vs. PC

2002-09-24 Thread Christopher Painter-Wakefield


The most obvious thing that jumps out here other than raw MHz is that you
are running C2.1-dev on the Sun and C2.0.3 on the PC, so you aren't really
comparing apples to apples.  Maybe that isn't a factor, but I would
certainly want to check it out before anything else.  Especially with that
-dev dangling on the end.  Ditto with JDK versions - you could have a
quirky JDK1.4 release or something.  And ditto again with Tomcat versions;
you can run the full Tomcat 4.0.4 (not LE) under JDK1.4, works just fine.
You should also check that you have a level playing field in every other
way, e.g., make sure your Sun isn't running something else (like a database
server), make sure the Sun is on the same piece of network (instead of
across a slow T1 to another building), etc.

It appears you have an older Sun workstation, while your PC's are very,
very new technology.  If you are planning to deploy to a newer Sun server,
like a Sun Fire 280R with 900 MHz UltraSparc III Cu and 1 GB of memory, I
imagine you'll get better results.

FWIW, we deploy on one of Sun's cheapest servers, which has a single 500
MHz UltraSparc IIe and 1GB of memory.  The server is dedicated only for our
application.  On the other hand, we develop on older PC's with 500 MHz and
1 HGz PIII's and 256 MB of memory.  Performance on the servers is quite a
bit better than on our PC's :)

-Christopher



Hi all

We're developing a cocoon-application (so far only xslt pipelines,
no apps) on a SunOS server.
Everything works out well, but we're experiencing heavy
performance problems. To make sure our application could
be running fast, we tested it on a PC, which resulted in more
than ten times faster response times. Which would be perfect,
only SUN is our target platform.

Are there any known issues about different jdk-versions?
tomcat-versions? cocoon-versions? SunOS?, pitfalls? any
tips to boost performance OR is our Sun Machine simply to slow?
(see technical spec details below)

Thanks in advance.
Thomas Brusa


below technical spec about our boxes:
==
SUN:
SunOS 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-60
400Mhz
512Mb Physical Memory
jakarta-tomcat-4.0.4-LE-jdk14
cocoon-2.1-dev (xml-cocoon2_20020822041959)
jdk 1.4.0_01-b03
==
PC:
W2k
2.4Ghz
512Mb Physical Memory
jakarta-tomcat-4.0.4
cocoon-2.0.3
jdk 1.3.1_04
==




-
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: C2.0.3 silently ignoring exceptions

2002-09-04 Thread Christopher Painter-Wakefield


Sorry, I didn't realize you were one of the developers.

I'll file a bug report at least, and see what I can do about checking out
2.1, but I don't have much time for this, either.  Whatever changed,
changed between 2.0.2 and 2.0.3, which ought to help highlight the problem
code.

-Christopher



Christopher Painter-Wakefield wrote:
 Did any of the Cocoon developers read this thread?  Should I post it to
 cocoon-dev?  I want to make sure these bugs get addressed.

I am a Cocoon dev (I also wrote the error handling code, but it's not a
compliment ATM I guess), but I have limited time ATM to check it out.
The problem with this error stuff is that it encompasses all Cocoon.
If someone somewhere fails to catch or rethrow the error properly, all
sort of things can happen, mostly stacktraces that are not useful.

The error is most probably as you say:  It seems that somehow C2.0.3 is
applying the transform stage(s) in the original map:match block
regardless of whether an error occurs or is handled.

It seems like a TreeProcessor issue, but I'm not sure.
I tried making it appear in 2.1 but instead I get a general Cocoon Error.

Please try it in 2.1, file a bug report on bugzilla, it will be looked
at ASAP.



 Christopher Painter-Wakefield wrote:


Thanks for the reply.  I've attached some sample code that exhibits the
problem, and a sitemap, xconf, and web.xml in case they are relevant.
Using this code, if you choose the URL /home (e.g.,
http://localhost:8080/home , assuming the ROOT webapp), the XSP page
attempts to read a parameter named msg, then uppercase its value, and
pass it to the next stage.  The obvious bug here is that if no parameter

 is

provided, the value is null, and the attempt to call the toUpperCase()
method results in a NullPointerException (error.log also attached).

 Under

C2.0.2, this would be reported back to us through the browser along with

 a

stack trace and so forth, which is very important for debugging in
development.  For production, we merely implemented some simple error
handlers in the sitemap so our users would get a friendly message,

 without

all the gore.

I did try what you suggested.  If I use the XML serializer instead of the
default, it makes no change.  However, if I remove the stylesheet

 transform

step, I do get the error page as in C2.0.2.  So the question is, why is

 the

behavior different, and is it correct?  If so, is there any way to get

 back

to the C2.0.2 behavior for development?


 I don't see a handle-errors part in your sitemap.
 Thus, since you have told Cocoon to handle them, it should generate an
 internal server exception.
 Which somehow it doesn't send... hmmm...


This led me to wonder whether the error handlers are working correctly in
C2.0.3, and I found even more bizarre behavior here.  I put in my
production error handler, and it did, in fact, pick up the error and
display more or less the correct error page.


 Ok, good.


However, it somehow *also*
ran the index.xsl on the stream.  I'm not sure exactly what went on

 inside

Cocoon, but what displayed in my browser had my production error page on
top, and the styled output from index.xsl right below it.  Looking at the
source, I saw our entire production error page html, followed by the

 entire

html as seen without an error handler, e.g.

html
   body  our production error page ...
   /body
/html
html
  body  ... output from index.xsl ...
/html

Which isn't even correct HTML, I think, but IE displayed it anyway.

This is certainly not correct behavior!  So, I think I feel safe calling

 it

a bug now.  It seems that somehow C2.0.3 is applying the transform

 stage(s)

in the original map:match block regardless of whether an error occurs

 or

is handled.


 This is /another/ bug I guess :-/

 The former has to do with the CocoonServlet error handling, the latter
 about how the TreeProcessor handles errors probably.

 BTW, are you using the compiled sitemap or the interpreted TreeProcessor
 one?

 BTW, does the same error happen in 2.1?

 (ATM I don't have time to test it, just looked at the files)


--
Nicola Ken Barozzi   [EMAIL PROTECTED]
 - verba volant, scripta manent -
(discussions get forgotten, just code remains)
-




-
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: C2.0.3 silently ignoring exceptions

2002-09-03 Thread Christopher Painter-Wakefield


Did any of the Cocoon developers read this thread?  Should I post it to
cocoon-dev?  I want to make sure these bugs get addressed.

Thanks,
Christopher



Christopher Painter-Wakefield wrote:

 Thanks for the reply.  I've attached some sample code that exhibits the
 problem, and a sitemap, xconf, and web.xml in case they are relevant.
 Using this code, if you choose the URL /home (e.g.,
 http://localhost:8080/home , assuming the ROOT webapp), the XSP page
 attempts to read a parameter named msg, then uppercase its value, and
 pass it to the next stage.  The obvious bug here is that if no parameter
is
 provided, the value is null, and the attempt to call the toUpperCase()
 method results in a NullPointerException (error.log also attached).
Under
 C2.0.2, this would be reported back to us through the browser along with
a
 stack trace and so forth, which is very important for debugging in
 development.  For production, we merely implemented some simple error
 handlers in the sitemap so our users would get a friendly message,
without
 all the gore.

 I did try what you suggested.  If I use the XML serializer instead of the
 default, it makes no change.  However, if I remove the stylesheet
transform
 step, I do get the error page as in C2.0.2.  So the question is, why is
the
 behavior different, and is it correct?  If so, is there any way to get
back
 to the C2.0.2 behavior for development?

I don't see a handle-errors part in your sitemap.
Thus, since you have told Cocoon to handle them, it should generate an
internal server exception.
Which somehow it doesn't send... hmmm...

 This led me to wonder whether the error handlers are working correctly in
 C2.0.3, and I found even more bizarre behavior here.  I put in my
 production error handler, and it did, in fact, pick up the error and
 display more or less the correct error page.

Ok, good.

 However, it somehow *also*
 ran the index.xsl on the stream.  I'm not sure exactly what went on
inside
 Cocoon, but what displayed in my browser had my production error page on
 top, and the styled output from index.xsl right below it.  Looking at the
 source, I saw our entire production error page html, followed by the
entire
 html as seen without an error handler, e.g.

 html
body  our production error page ...
/body
 /html
 html
   body  ... output from index.xsl ...
 /html

 Which isn't even correct HTML, I think, but IE displayed it anyway.

 This is certainly not correct behavior!  So, I think I feel safe calling
it
 a bug now.  It seems that somehow C2.0.3 is applying the transform
stage(s)
 in the original map:match block regardless of whether an error occurs
or
 is handled.

This is /another/ bug I guess :-/

The former has to do with the CocoonServlet error handling, the latter
about how the TreeProcessor handles errors probably.

BTW, are you using the compiled sitemap or the interpreted TreeProcessor
one?

BTW, does the same error happen in 2.1?

(ATM I don't have time to test it, just looked at the files)




-
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: C2.0.3 silently ignoring exceptions

2002-08-30 Thread Christopher Painter-Wakefield





snip

 BTW, are you using the compiled sitemap or the interpreted TreeProcessor
 one?

The interpreted one.

 BTW, does the same error happen in 2.1?

I don't know; we've been working solely with the released code.

snip

-Christopher


-
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: C2.0.3 silently ignoring exceptions

2002-08-29 Thread Christopher Painter-Wakefield


I agree users shouldn't see the stacktrace, but neither should they get a
page that looks basically right but with no data, no errors, and no
explanation that a problem has occurred - this might be even worse, as it
might lead them to believe something (there is no data matching their
search, for instance) that isn't true.  The stacktrace is easy to avoid by
implementing error handler stylesheets and installing them in your
production sitemap, which is what we are doing.  The user gets a friendly
error message that exposes nothing internal, but lets them know something
is wrong.

-Christopher



On Wednesday, August 28, 2002, at 05:57 , Christopher
Painter-Wakefield wrote:

 This problem (I won't say bug, in case it is something we've
 done!) is very
 detrimental to development, since we have to go look in the
 logs to find
 out we got an exception.  Any help would be appreciated!

Although this is indeed annoying when developing, I would tend
to view this a A Good Thing(tm) for a production server, as
exposing a stacktrace to anyone who gets the error is kinda,
err... personal. It seems to me -- I could be wrong on this --
that the more internal information disclosed, the more
vulnerable one could be.
   I'm still using 2.0.2 so I haven't seen this.

A.





-
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: C2.0.3 silently ignoring exceptions

2002-08-29 Thread Christopher Painter-Wakefield

aggh!  The listserv host rejected my mail as too large.  Okay, I'll try it
again without the xconf and web.xml.  If these seem relevant, I'll send
them separately.

- Forwarded by Christopher Painter-Wakefield/mcis/mc/Duke on 08/29/2002
03:06 PM -

Thanks for the reply.  I've attached some sample code that exhibits the
problem, and a sitemap, xconf, and web.xml in case they are relevant.
Using this code, if you choose the URL /home (e.g.,
http://localhost:8080/home , assuming the ROOT webapp), the XSP page
attempts to read a parameter named msg, then uppercase its value, and
pass it to the next stage.  The obvious bug here is that if no parameter is
provided, the value is null, and the attempt to call the toUpperCase()
method results in a NullPointerException (error.log also attached).  Under
C2.0.2, this would be reported back to us through the browser along with a
stack trace and so forth, which is very important for debugging in
development.  For production, we merely implemented some simple error
handlers in the sitemap so our users would get a friendly message, without
all the gore.

I did try what you suggested.  If I use the XML serializer instead of the
default, it makes no change.  However, if I remove the stylesheet transform
step, I do get the error page as in C2.0.2.  So the question is, why is the
behavior different, and is it correct?  If so, is there any way to get back
to the C2.0.2 behavior for development?

This led me to wonder whether the error handlers are working correctly in
C2.0.3, and I found even more bizarre behavior here.  I put in my
production error handler, and it did, in fact, pick up the error and
display more or less the correct error page.  However, it somehow *also*
ran the index.xsl on the stream.  I'm not sure exactly what went on inside
Cocoon, but what displayed in my browser had my production error page on
top, and the styled output from index.xsl right below it.  Looking at the
source, I saw our entire production error page html, followed by the entire
html as seen without an error handler, e.g.

html
   body  our production error page ...
   /body
/html
html
  body  ... output from index.xsl ...
/html

Which isn't even correct HTML, I think, but IE displayed it anyway.

This is certainly not correct behavior!  So, I think I feel safe calling it
a bug now.  It seems that somehow C2.0.3 is applying the transform stage(s)
in the original map:match block regardless of whether an error occurs or
is handled.

-Christopher

(See attached file: sitemap.xmap)(See attached file: index.xsl)(See
attached file: index.xml)(See attached file: error.log)



Christopher Painter-Wakefield wrote:
 Since we upgraded to Cocoon 2.0.3, we've been experiencing a very
annoying
 problem, which is that Cocoon seems to silently handle all exceptions.
 I've tested it now with a couple of exceptions types: RuntimeExceptions
 (thrown by the ESQL logicsheet) and NullPointerExceptions.  The behavior
is
 that we actually get back a page styled by our stylesheet, but with no
 data.  Under C2.0.2, we'd get back a Cocoon error page complete with
 stacktrace.  What's going on?

Dunno :-/

Have you tried outputting the xml of teh xsp and error without other
steps (remove all xslt also in handle-errors and put the xml serializer)?
What do you get?

 I looked at the new web.xml init-param manage-exceptions, but changing
it
 to false made things even worse - then I wouldn't even get XSP java
compile
 error messages, just a generic internal server error message.

manage-exceptions=true should make Cocoon handle the exceptions, while
=false it gives them to the servlet engine.

 This problem (I won't say bug, in case it is something we've done!) is
very
 detrimental to development, since we have to go look in the logs to find
 out we got an exception.  Any help would be appreciated!

Please send us the page that is giving you problems, along with the
relevant log snippets, and anything that might help us to understand the
problem.
Thank you.

--
Nicola Ken Barozzi   [EMAIL PROTECTED]
 - verba volant, scripta manent -
(discussions get forgotten, just code remains)




sitemap.xmap
Description: Binary data


index.xsl
Description: Binary data


index.xml
Description: Binary data


error.log
Description: Binary data

-
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: C2.0.3 silently ignoring exceptions

2002-08-29 Thread Christopher Painter-Wakefield


did anyone get the mail with the attachments?  I had to resend it with
fewer attachments because it was rejected as too large the first time.  The
second time it seemed to go through (I received it from cocoon-users), but
I got a different message complaining about the size, plus a separate
message saying it was blocked for some reason (like it had a virus, but no
virus name was given, and the problem was supposedly in my attached
stylesheet).  Argh!  If nobody received it, I'll send it yet again and send
code snippets in the body of the text rather than attachments.

-Christopher


-
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: C2.0.3 silently ignoring exceptions

2002-08-29 Thread Christopher Painter-Wakefield


thank you.



I got it.

-Original Message-
From: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 12:14 PM
To: [EMAIL PROTECTED]
Subject: Re: C2.0.3 silently ignoring exceptions


did anyone get the mail with the attachments?  I had to resend it with
fewer attachments because it was rejected as too large the first time.  The
second time it seemed to go through (I received it from cocoon-users), but
I got a different message complaining about the size, plus a separate
message saying it was blocked for some reason (like it had a virus, but no
virus name was given, and the problem was supposedly in my attached
stylesheet).  Argh!  If nobody received it, I'll send it yet again and send
code snippets in the body of the text rather than attachments.

-Christopher

-
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]




C2.0.3 silently ignoring exceptions

2002-08-28 Thread Christopher Painter-Wakefield


Since we upgraded to Cocoon 2.0.3, we've been experiencing a very annoying
problem, which is that Cocoon seems to silently handle all exceptions.
I've tested it now with a couple of exceptions types: RuntimeExceptions
(thrown by the ESQL logicsheet) and NullPointerExceptions.  The behavior is
that we actually get back a page styled by our stylesheet, but with no
data.  Under C2.0.2, we'd get back a Cocoon error page complete with
stacktrace.  What's going on?

I looked at the new web.xml init-param manage-exceptions, but changing it
to false made things even worse - then I wouldn't even get XSP java compile
error messages, just a generic internal server error message.

This problem (I won't say bug, in case it is something we've done!) is very
detrimental to development, since we have to go look in the logs to find
out we got an exception.  Any help would be appreciated!

-Christopher


-
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: How to send redirect from an XSP?

2002-08-21 Thread Christopher Painter-Wakefield



 You shouldn't do it. Use an action for this. There are already a
 number of actions that perform this job. Use one of them, modify one
 of them, write a new one, or write an XSP action that does it.

What is an XSP action?  Can we now use XSP to write Actions?
Is there any documentation on it?

-Christopher



-
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: Cocoon bug ? XSLT transform before SQL transform

2002-06-20 Thread Christopher Painter-Wakefield


Konstantin,

we've experienced a similar problem, too.  We had input XML that used the
SQL transformer namespace, transformed with an XSLT stylesheet, and fed
into SQL transformer, with the same error.  We had a template that created
the SQL query tags for the transformer, and the namespace was declared only
in its output elements.  I theorized that there was some bug in the XSLT
transformer that was copying this namespace into other tags as well, which
definitely will cause an NPE (SQL transformer probably needs to do a better
job ignoring tags it doesn't know about).  However, I never could
conclusively prove that this was happening.

We did track the problem down, sort of, to the use of xsl:copy or
xsl:copy-of.  Essentially we had the usual default copy template to
handle the non-SQL transformer elements, like this:
xsl:template match=@*|node() priority=-1
  xsl:copy
 xsl:apply-templates select=@*|node()/
  /xsl:copy
/xsl:template

It appeared to me that the xsl:copy was adding in the SQL transformer
namespace URI to elements it was copying (even though that namespace was
declared in another template for a node that was sibling, never ancestor to
the non-SQL transformer nodes), because if we copied each element
explicitly (e.g: xsl:template match
=appleapplexsl:apply-templates//apple/xsl:template, etc.) the
problem went away.  I made a workaround by replacing this generic template
with two templates:
xsl:template match=node() priority=-1
  xsl:element name=local-name()
 xsl:apply-templates select=@*|node()/
  /xsl:element
/xsl:template

xsl:template match=@* priority=-1
  xsl:copy/
/xsl:template

This fixed our problem.  I started to write this up to send it to the list,
but it was just to weird to try to explain.  Also, I never could reproduce
it from scratch, only by using the code we had the problem on.  I still
can't explain it.

-Christopher



Paul,

I'm not sure that this is relevant for your case, but I was getting NPE
exactly at the same place when I had this template in my stylesheet:

  xsl:template match=doc
   html xmlns=http://www.w3.org/1999/xhtml;
  ...
  xsl:apply-templates/
   /html
  /xsl:template

Removing the 'xmlns' from html element solved the problem. This looks
like
a bug in Xalan.

Konstantin




-
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]




[C2] XSLT transform error messages

2002-06-12 Thread Christopher Painter-Wakefield


A request for the C2 developers:

*Please* find a way to send back a reasonable error message when there is a
problem with a stylesheet.  The generic Exception in creating Transform
Handler (below) is so unhelpful.  It doesn't give any clue as to the
nature of the problem, which is often subtle.  Surely the XSLT transform
classes have better error reporting that can be passed on?

Thanks,
Christopher


type fatal


message Exception in creating Transform Handler


description org.apache.cocoon.ProcessingException: Exception in creating
Transform Handler


sender org.apache.cocoon.servlet.CocoonServlet


source Cocoon servlet


stack-trace
org.apache.cocoon.ProcessingException: Exception in creating Transform
Handler
 at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:271)

 at
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:204)

 at
org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:295)

 at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:215)

 at
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:279)

 at
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:142)

 at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:320)

 at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:153)

 at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)

 at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:156)

 at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)

 at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:140)

 at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)

 at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:130)

 at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:323)

 at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:293)

 at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
 at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:998)
 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

 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.java:190)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

 at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

 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:566)

 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
  

RE: [C2] bug: still have to touch XSP file after changing logicsheet

2002-06-11 Thread Christopher Painter-Wakefield


Vadim,

thanks, that is illuminating.  We are using context://... to reference our
logicsheets, for portability.  Is there a way to use the file reference
relative to the context root (instead of an absolute path)?

-Christopher



 From: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]]


 I see.  For some reason, I thought this mechanism was deprecated along

 with all processing directive types of things.

 Since things are apparently working the way they are supposed to, then

 let me change this from a bug report to a request: it would be nice
 to have built-in logicsheets checked for changes, too.

Ok, after looking into sources, I can say that if logicsheet is built-in
or not is not important. It is important how it is referenced from the
XSP or cocoon.xconf.

If it is referenced as a file then it is checked for modification using
File java API. If not (like resource://) - then it is not checked.

The reason, AFAIU, is that resource URL does not have last modification
date, and other reason could be, you are right, performance.




-
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: [C2] bug: still have to touch XSP file after changing logicsheet

2002-06-11 Thread Christopher Painter-Wakefield


Thanks, we'll give it a try.

-Christopher



 From: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]]


 Vadim,

 thanks, that is illuminating.  We are using context://... to reference
our
 logicsheets, for portability.  Is there a way to use the file
reference
 relative to the context root (instead of an absolute path)?

References to logicsheets are resolved by URLFactory. With URLFactory,
it is possible to use either URL, or relative to the webapp context file
path.

So, you can use:

  parameter name=href value=logicsheets/request.xsl/

and it should work.


Vadim






-
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: [C2] bug: still have to touch XSP file after changing logicsheet

2002-06-03 Thread Christopher Painter-Wakefield


I see.  For some reason, I thought this mechanism was deprecated along with
all processing directive types of things.

Since things are apparently working the way they are supposed to, then let
me change this from a bug report to a request: it would be nice to have
built-in logicsheets checked for changes, too.  If there are performance
reasons to avoid this, perhaps there could be an attribute in the
logicsheet declarations in the cocoon.xconf that would allow us to specify
logicsheets that should be checked.  Sure would make things easier,
especially when working with files under SCC.

-Christopher



 From: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]]


 Cocoon doesn't recognize the dependencies of XSP files on the
logicsheet
 they use.  Changing a logicsheet does not force a recompile of the
 dependent XSP pages.  Instead we must manually touch each XSP page
using
 the logicsheet.

 I know this has been reported in the past, but it is a constant
annoyance,
 and I'm wondering if there is a time when we can expect a fix?

IIRC, this depends how you referencing your logicsheet. Changes in
built-in logicsheet are not monitored, but if logicsheet is referenced
directly from the XSP, changes are noticed.

Check out logicsheet.xsp sample - it works perfectly, and recognizes
dependencies in the hello.xsl logicsheet.

Vadim


 Thanks,
 Christopher




-
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]




[C2] bug: still have to touch XSP file after changing logicsheet

2002-05-31 Thread Christopher Painter-Wakefield


Cocoon doesn't recognize the dependencies of XSP files on the logicsheet
they use.  Changing a logicsheet does not force a recompile of the
dependent XSP pages.  Instead we must manually touch each XSP page using
the logicsheet.

I know this has been reported in the past, but it is a constant annoyance,
and I'm wondering if there is a time when we can expect a fix?

Thanks,
Christopher


-
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: how do I redirect in an Action?

2002-05-23 Thread Christopher Painter-Wakefield


I'm trying to implement a homegrown authentication scheme.  One of our
types of users will be authenticated by coming into the system with
appropriate credentials as request parameters in the URL (we will e-mail
them their unique URL).  This is to avoid generating a large number of user
ids and requiring all these users to remember credentials for a system they
will likely use once or twice a year.  None of the existing server-level
authentication schemes would seem to support this.

Once the user has logged in by providing the correct credentials, I
planned to store their identity and the fact that they have been
authenticated in their session.

So, each time a request is made to a protected page, I need to first check
the session to see if the user is already authenticated.  If not, I need to
check the request parameters, if available, against the database.  If both
of these fail, I need to redirect the user to a polite login failure page
(at some point we will have users that use a traditional login mechanism,
at which point we'll probably redirect to a login form).

I read the Action docs and searched through the mail archives, and I
thought I could do something like this:

map:act type=my-authenticator
  map:match pattern=some protected url
...
  /map:match

  map:match pattern=some other protected url
...
  /map:match
/map:act

As I understood it, if the authentication fails, I would redirect to my
failure page in the Action and return null to prevent anything inside the
map:act element from running.  If the authentication succeeds, I return
an empty Map and the stuff inside the map:act element will run as usual.
Now that I'm saying all that it doesn't sound very likely, but I swear I
got it all from the docs.

Any suggestions?

-Christopher



From: Christopher Painter-Wakefield [EMAIL PROTECTED]

 What is the proper way to redirect in an Action?

Why do you have to redirect in an action?
I would not suggest it.

Redirect instead in the sitemap based on the results of the Action.

--
Nicola Ken Barozzi   [EMAIL PROTECTED]
- verba volant, scripta manent -
   (discussions get forgotten, just code remains)
-




-
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: how do I redirect in an Action?

2002-05-23 Thread Christopher Painter-Wakefield


Thanks for all the suggestions.  I'm pretty confused at this point, as I
haven't used map:resource or map:select previously, so I need to spend
some time understanding the code you've offered.  One thing in particular I
don't see is where I should put my normal generate, transform, and
serialize steps for the protected URL.  Do they just go after the call to
the resource?

-Christopher



Hi Christopher and Edgar,

Couple things.  I could be wrong, but I believe in Edgar's example, the
redirect would always execute (since it sits outside the action).

Also, depending on how many protected url matchers you have, you can also
delegate all work to a resource where you could put all your authentication
and redirect logic (so you don't have to have it in each matcher).  So you
could do something like this:

 map:match pattern=some protected url
  map:call resource=authenticatedAccess
   map:parameter name=someIDForThisPipe
value=foo/
   ... any other params you might need to process this
pipe ...
  /map:call
 /map:match

 map:match pattern=some other protected url
  map:call resource=authenticatedAccess
   map:parameter name=someIDForThisPipe
value=bar/
   ... any other params you might need to process this
pipe ...
  /map:call
 /map:match

And the resource might look like:

 map:resource name=authenticatedAccess
  map:act type=my-authenticator
   map:select type=parameter
map:parameter
name=parameter-selector-test value={authStatus}/
map:when test=success
 ... stuff to process pipeline based
on params
/map:when
map:otherwise
 map:redirect-to
uri=loginpage.html/
/map:otherwise
   /map:select
  /map:act
 /map:resource


Anyway, hope that helps!

Harry




-
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: how do I redirect in an Action?

2002-05-23 Thread Christopher Painter-Wakefield



Chris,

if I do a redirect in an Action, does that effectively terminate the
pipeline also?

Also, is my understanding correct that if I create an Action that merely
returns a new Map, this is essentially a no-action and will leave the
pipeline unaffected?

-Christopher



On 23.May.2002 -- 05:00 PM, Graaf, Edgar de (fin) wrote:
 Christopher,

 map:act... can't contain matchers, how else would cocoon know that the
 action should be run?

Edgar, AFAIK this is not true. map:act can contain all other tags
that are allowed within a pipeline.

Depending on the amount of pipeline fragments protected by the
action it would be worthwhile to use a subsitemap, though.

Another misconception in this thread seems to be that the tags after
the action will always be processed. That is only true if it was
determined that they are part of the actual pipeline.

The whole process is made in two steps:
1) determine what the pipeline actually contains by evaluating
actions, matchers, selectors, call and redirect tags. A pipeline is
terminated when a serializer is found. For the sake of brevity I
consider a reader here to be a (generator + serializer).

2) Use the components (readers, generators, transformers, serializers)
determined in step 1. Note that in this step no actions, matchers, or
selectors are used.

IOW if a serializer is nested inside a map:act tag, it effectively
terminates the pipeline and tags beneath the map:act will not be
considered.

It works just like it was mentioned with redirects or calls.

HTH

 Chris.

--
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08




-
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]




C2: how do I redirect in an Action?

2002-05-22 Thread Christopher Painter-Wakefield


What is the proper way to redirect in an Action?

I presume we are supposed to use the Redirector object, since nothing else
seems able.  I've looked at the Redirector interface, but the API docs have
zero explanation (g!) of the methods.  If this is the right object,
then:
1) what is the difference between redirect() and globalRedirect() and which
one should I use?
2) what is the meaning of the boolean sessionmode parameter?

I've searched the list archives and looked through the source and am none
the wiser.

Thanks,
Christopher


-
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: JConnect / Sybase + Cocoon

2002-01-22 Thread Christopher Painter-Wakefield


Have you set up your Sybase for JDBC?  We were having similar problems
until we had our DBA run a script (provided with jConnect in the sp
subdirectory) to set up a bunch of stored procedures that jConnect needs.
See
http://manuals.sybase.com/onlinebooks/group-jc/jcg0520e/jconnig/@Generic__BookView

under Installation Instructions and then under Installing Stored
Procedures.

If that isn't the issue, then it sounds like you have some code that is
setting autocommit to false, modifying data, then failing to issue a
commit.  This leaves your transaction pending, and you can see why they
wouldn't want you changing the autocommit setting until the transaction is
done.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   Cocoon mailing list [EMAIL PROTECTED]
cc:

Subject:  JConnect / Sybase + Cocoon


Hi all,
I am having trouble on cocoon2 with the connection pool. It seems that
sybase doesn't allow to change the connection mode ( ie: setAutoCommit() )
after a chained transaction has taken place ( a transaction with the
autocommit to false ). Is there a fix for Avalon or some parameters i am
missing ?

Thanks in advance,

Christophe Rykiel
C.T.O
RECTANGLE




-
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: [c2] q: howto use ESQL inside own logicsheets?

2001-12-04 Thread Christopher Painter-Wakefield


Obviously the ESQL logicsheet is not being applied.  In Cocoon 1 this would
imply that you had removed the declaration of the esql logicsheet from
cocoon.properties, or that your namespace declaration URI didn't match the
one in the logicsheet.  I don't know how this works in Cocoon 2; maybe the
sitemap?  I know some of the namespace URI's have changed; is it possible
that the one for ESQL is something other than 
http://apache.org/cocoon/SQL/v2;?

If either of these is true then you shouldn't be able to even get a simple
XSP using ESQL to work.

If you *can* get ESQL to work using simple XSP, then it suggests that you
are somehow managing to strip out the ESQL namespace declaration with your
logicsheet.  If that is also not true, perhaps you have found a bug, and
should report it to cocoon-dev.

Sorry I can't help more - I haven't yet upgraded to C2.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  [c2] q: howto use ESQL inside own logicsheets?


Hi all,
i want my logicsheet to use ESQL, i try this:


!-- my logicsheet --
xsl:stylesheet version=1.0
 xmlns:esql=http://apache.org/cocoon/SQL/v2;
 xmlns:xsp=http://apache.org/xsp;
 xmlns:my-logicsheet=http://my.org/my-logicsheet;
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 xsl:template match=my-logicsheet:my-tag
  esql:connection
   esql:poolmy-pool/esql:pool

   esql:execute-query
esql:querySELECT * FROM my-table/esql:query

esql:results
 esql:row-results
  xsp:element name=my-element
   xsp:attribute name=my-attr
 esql:get-string column
=my-string-column/
   /xsp:attribute
  /xsp:element
 /esql:row-results
/esql:results
   /esql:execute-query
  /esql:connection
 /xsl:template

/xsl:stylesheet

!-- my server page --
xsp:page
 xmlns:esql=http://apache.org/cocoon/SQL/v2;
 xmlns:xsp=http://apache.org/xsp;
 xmlns:my-logicsheet=http://my.org/my-logicsheet;

 element-embding-my-tag
  my-logisheet:my-tag
 /element-embding-my-tag
/xsp:page


!-- output is --
element-embding-my-tag
 !-- namespace declarations --
 
 esql:connection
  esql:poolfp/esql:pool
  esql:execute-query
   esql:querySELECT * FROM my-table/esql:query
   esql:results
esql:row-results
 my-element my-attr=/
 !-- unprocessed esql tags --
 !-- xsp has been processed --
/esql:row-results
   /esql:results
  /esql:execute-query
 /esql:connection
/element-embding-my-tag


please tell me why i sthat so, and what i i need to understend to use this
properly.

thanks in advance,
 hubert.

-
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]








-
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: How do I use logicsheets parameters

2001-11-30 Thread Christopher Painter-Wakefield


Christopher,

you're welcome; I'm glad it was helpful.  Good luck to you.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  RE: How do I use logicsheets parameters


Christopher,

Many thanks for a model answer,

The missing penny has dropped because of your comment

remember that a logicsheet is just an XSL stylesheet that gets applied to
your XSP document to transform it into another XSP document.

I had forgotten-cum-misunderstood!

For your info C2 does things rather differently than C1, namely, instead of
using cocoon processing instructions,
you define pipelines in a sitemap.xmap file (an xml file that takes over
a
lot of what was cocoon.properties),
which says how the xml file is generated (xsp, jsp, Tidied html, etc)
then how it is transformed (generally xslt, but there are also transformers
for log, sql, xinclude etc)
then how it is serialized (html, xml, wap, svg2png, etc)

That was for me the biggest change from the way C1 worked and it took a
while to get the hang of, though I sense it has more power
but the same thing can be achieved as you suggested from C1.

Christopher







-
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: How do I use logicsheets parameters

2001-11-29 Thread Christopher Painter-Wakefield


Christopher,

first, may I suggest some general strategies for developing logicsheets?
- start simple and extend by small increments, e.g., instead of trying to
get this working by passing either an attribute or a child element, get it
working one way, then get it working *seperately* the other way, then put
them together.  On another dimension, get it working first using a plain
text element, then get it working with a Java variable.

- remember that a logicsheet is just an XSL stylesheet that gets applied to
your XSP document to transform it into another XSP document.  You can take
advantage of this for debugging by simply changing your processing
instructions to pass your XSP through your logicsheet using the XSLT
processor only, then viewing the output.  (Some XML editors will also let
you do this pretty easily.)  This will give you insight into what the
final XSP code looks like before conversion to Java.  (This is easy to do
in C1; I assume you can do it in C2.)

- in addition to the above, write a plain XSP first, without using a
logicsheet, that produces the expected output.  In other words, write and
debug an XSP that looks like the XSP you want after your logicsheet is
applied.  This will help you develop your logicsheet.

Okay, so here's what I think you need to do what you are trying to do:

  XSP - Calling page  

?xml version=1.0?

xsp:page
  language=java
  xmlns:xsp=http://apache.org/xsp;
  xmlns:mytags=http://dummy.org/mytags;


  xsp:logic
String bag=56891;
  /xsp:logic
  page
 rasp
   xsp:attribute name=bagagexsp:exprbag/xsp:expr/xsp:attribute
   foo
 mytags:get_my_param
   mytags:passedxsp:exprbag/xsp:expr/mytags:passed
 /mytags:get_my_param
   /foo
   goo
!-- This just flat won't work, ever.  The xsp:attribute doesn't do anything until
 *after* you run through the XSP processor and get converted to Java.  You want
 this attribute to be transformed by your logicsheet, which happens *before* you
 are converted to Java.  So don't do this!   --
!--
 mytags:get_my_param
   xsp:attribute name=passed23/xsp:attribute
 /mytags:get_my_param
--
!-- Instead, try this: --
mytags:get_my_param passed=bag/
  /goo
  hoo
mytags:get_my_param passed=23/
  /hoo
/rasp
  /page
/xsp:page

 Logicsheet 

?xml version=1.0?
xsl:stylesheet
  xmlns:xsp=http://apache.org/xsp;
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xmlns:mytags=http://dummy.org/mytags;
  version=1.0

xsl:template match=mytags:get_my_param
  myparam
!-- Note - you need to use xsp:attribute rather than xsl:attribute here
 since the xsl is applied *before* Java generation, but the value of
 the contents isn't available until the Java is running.  --
xsp:attribute name=horse
  xsp:exprxsl:call-template name=value-for-passed//xsp:expr
/xsp:attribute
  /myparam
/xsl:template

xsl:template name=value-for-passed
  xsl:choose
xsl:when test=@passedxsl:value-of select=@passed//xsl:when
xsl:when test=mytags:passed
  xsl:call-template name=get-nested-content
xsl:with-param name=content select=mytags:passed/
  /xsl:call-template
/xsl:when
  /xsl:choose
/xsl:template

xsl:template name=get-nested-content
  xsl:param name=content/
  xsl:choose
xsl:when test=$content/*
  xsl:apply-templates select=$content/*/
/xsl:when
xsl:otherwisexsl:value-of select=$content//xsl:otherwise
  /xsl:choose
/xsl:template

xsl:template match=@*|node()
  xsl:copyxsl:apply-templates select=@*|node()//xsl:copy
/xsl:template

/xsl:stylesheet

 Results 

page
 rasp bagage=56891
   foo
 myparam horse=56891/myparam
   /foo
   goo
myparam horse=56891/myparam
  /goo
  hoo
myparam horse=23/myparam
  /hoo
/rasp
  /page

Hope this helps.

Note that I did this all in C1, which has some different processing
instructions and namespaces and so forth to use logicsheets.  I've tried to
return everything to a form that looks like what you had originally, but be
warned I may have missed something.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   Cocoon-Users \(E-mail\) [EMAIL PROTECTED]
cc:

Subject:  How do I use logicsheets parameters


Could someone help me? I could benefit from a logicsheet parameters 101

I want to use my own logicsheet and pass in runtime parameter(s)

I have set up a logicsheet with the namespace mytags and a function
get_my_param,
to which I want to pass an xsp/java variable. In the following xsp I have
three goes at passing
a String variable called bag - with the value 56891 - but with no
success.

(The logicsheet is based on guesses from what I found in session.xsl,
util.xsl etc.)

  the results, and the logicsheet follow the listing of the page

Note that the xsp:exprbag/xsp:expr gets 'resolved' in the calling page,
but its value does not get passed into the logicsheet
The 

Re: what is wrong?

2001-11-28 Thread Christopher Painter-Wakefield


Move this line:
?cocoon-process type=xsp?
above this line:
?cocoon-process type=xslt?

You are currently running your xml through the stylesheet processor before
the XSP processor.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  what is wrong?



I have problems with XSP.

 this file is ok --
?xml version=1.0?
?xml-stylesheet href=foo.xsl type=text/xsl?
?xml-stylesheet href=foowap.xsl type=text/xsl media=wap?
?cocoon-process type=xslt?
main
 blamore bla/bla
/main
---
-- but this won't work 
?xml version=1.0?
?xml-stylesheet href=foo.xsl type=text/xsl?
?xml-stylesheet href=foowap.xsl type=text/xsl media=wap?
?cocoon-process type=xslt?
?cocoon-process type=xsp?
xsp:page xmlns:xsp=http://www.apache.org/1999/XSP/Core; xmlns:util=
http://www.apache.org/1999/XSP/Util;
main
 util:include-uriutil:href
  xsp:exprhttp://192.168.0.1:12346/cgi-bin/nm.cgi?; +
request.getQueryString()/xsp:expr
 /util:href/util:include-uri
/main
/xsp:page


the nm.cgi returns  something like this and it seems to be ok

Content-type: text/xml

?xml version=1.0 encoding=utf-8 standalone=yes?
bla a lot of bla /bla


Result of lynx http://192.168.0.1:12346/nm.xml?foo=bla
is absolutly nothing. There is only a warning in error.log:
[Wed XXX] [warn] [client 192.168.0.1] handler cocoon not found for:
/var/www/nm.xml

thanks for any help...
Ivo





-
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: [C2] using HTML nowrap in a TD

2001-10-26 Thread Christopher Painter-Wakefield


With Cocoon, you write XHTML and not HTML.  The main difference is that
XHTML is well-formed like XML, which is why you write e.g., br/ instead
of br by itself.  Also, all attributes must have a value.  See
http://www.w3.org/TR/xhtml1/#diffs for more info.  (This document, btw,
suggests that td nowrap=nowrap is the preferred approach.)

If you look at the source in your browser, though, you'll just see td
nowrap, because Cocoon formats your XHTML into HTML as a final step.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  [C2] using HTML nowrap in a TD


This is weird.

I just tried putting a nowrap param to my TD tag in my XSL file like
this:
  td nowrap

to prevent the table cell in HTML from wrapping and got this error on the
screen:
  Error creating the resource
Failed to execute pipeline.

and in the log:
   org.xml.sax.SAXParseException: Attribute name td must be followed by
the '=' character.

I was able to get around this by changing my tag to this:
  td nowrap=

While obviously not valid HTML, the browser still takes it (IE anyway --
haven't tested with NetScrape)

Comments?
-Mark





-
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: [C1] Cocoon SQL vs ESQL

2001-10-19 Thread Christopher Painter-Wakefield


You don't say in what way the code is not working; do you get an exception,
other error message, or just no data? If the latter, are you sure your XSL
stylesheet matches the structure of the XML you are creating?

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  [C1] Cocoon SQL vs ESQL


I have been struggling to get ESQL working... I had thought it was the
database setup, but turns out that is OK (see below) - now I am stuck
again.

Following previous suggestions, I have tried to get an equivalent of the
sample code shippped wiht Cocoon working.  I could not find any ESQL to
test, so I used the the SQL code instead - it worked!  But the - as far as
I can see - equivalent code in ESQL does not work.

I hope someone with a sharp pair of eyes can see why the first sample would
work, and the next one not??

Thanks!
Derek



!-- WORKING --

?xml version=1.0?

?cocoon-process type=sql?

page

 connectiondefs
  connection name=foo_connection
   driverorg.gjt.mm.mysql.Driver/driver
  dburljdbc:mysql://myhost.com/est/dburl
  usernameest/username
  passwordest/password
  /connection
 /connectiondefs

 query connection=foo_connection
  select * from computer
 /query

mysqlSELECT * FROM computer/mysql

/page


!-- NOT WORKING??? --

?xml version=1.0?

?cocoon-process type=xsp?
?cocoon-process type=xslt?
?xml-stylesheet type=text/xsl href=one_computer.xsl?

xsp:page
  xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  xmlns:request=http://www.apache.org/1999/XSP/Request;


page

esql:connection
  esql:driverorg.gjt.mm.mysql.Driver/esql:driver
  esql:dburljdbc:mysql://myhost.com/est/esql:dburl
  esql:usernameest/esql:username
  esql:passwordest/esql:password

  esql:execute-query
esql:querySELECT * FROM computer/esql:query

esql:results
  esql:row-results
computer
 systemesql:get-string column=System//system
/computer
  /esql:row-results
/esql:results

esql:no-results
  computer
 systemNo computer/system
  /computer
/esql:no-results

  /esql:execute-query

/esql:connection

mysqlSELECT * FROM computer/mysql

/page

/xsp:page





-
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 nested query not working - 1.8.2

2001-09-19 Thread Christopher Painter-Wakefield


do you get a different error message when you leave out the quotes?




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Re: esql nested query not working - 1.8.2


I've tried it both with and without the single quote and it still doesn't
work.

Here is another clue - the nested query works if I run it against a MySQL
database, it just doesn't work against a Access database.

In a couple of months - we'll be converting the access database.  In the
meantime, is there a solution ( that will work with the access database )?

marty
- Original Message -
From: Christopher Painter-Wakefield [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 9:41 AM
Subject: Re: esql nested query not working - 1.8.2



Try removing the single quotes around esql:parameter  type
=stringesql:get-string ancestor=1  column=rid//esql:parameter

I think by including the single quotes you are making a query that doesn't
use parameters (your where clause looks like ... Main.rid = '?' , e.g.,
the literal string '?').

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  esql nested query not working - 1.8.2




I would like to execute a nested query. When  I try to reference a
parameter from the ancestor query I get a  java.lang.RuntimeException:
Error setting parameter on statement : Select title  from Main where
Main.rid='?'

I would greatly appreciate any suggestions. I  have tried to emulate the
example esql - but I can not get it to pick up the  parameter. If I
hardcode the value - the nested query works.

In searching the list - I found a similar posting in January for this error
- but no suggestion/solution was posted.

I am running tomcat/cocoon 1.8.2 on Windows 98 and pointing to an access
database.

marty


I am attaching the related code below:


snip

!-- here is the problem line - if I hardcode the rid this works  --

esql:querySelect title from Main where Main.rid='esql:parameter  type
=stringesql:get-string ancestor=1  column
=rid//esql:parameter'/esql:query

snip





-
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 nested query not working - 1.8.2

2001-09-18 Thread Christopher Painter-Wakefield


Try removing the single quotes around esql:parameter  type
=stringesql:get-string ancestor=1  column=rid//esql:parameter

I think by including the single quotes you are making a query that doesn't
use parameters (your where clause looks like ... Main.rid = '?' , e.g.,
the literal string '?').

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  esql nested query not working - 1.8.2




I would like to execute a nested query.  When  I try to reference a
parameter from the ancestor query I get a  java.lang.RuntimeException:
Error setting parameter on statement : Select title  from Main where
Main.rid='?'

I would greatly appreciate any suggestions.  I  have tried to emulate the
example esql - but I can not get it to pick up the  parameter.  If I
hardcode the value - the nested query works.

In searching the list - I found a similar posting in January for this error
- but no suggestion/solution was posted.

I am running tomcat/cocoon 1.8.2 on Windows 98 and pointing to an access
database.

marty


I am attaching the related code below:


snip

!-- here is the problem line - if I hardcode the rid this works  --

esql:querySelect title from Main where Main.rid='esql:parameter  type
=stringesql:get-string ancestor=1  column
=rid//esql:parameter'/esql:query

snip




-
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: To those who are experts in using fop

2001-09-10 Thread Christopher Painter-Wakefield


I think you can just set the page-width and page-height attributes in your
page master element, e.g.,

fo:layout-master-set
fo:simple-page-master
page-master-name=pmaster
page-width=11in page-height=8.5in
...
/fo:simple-page-master
/fo:layout-master-set

However, I'm *not* an expert in using fop :)

-Christopher




Please respond to [EMAIL PROTECTED]

To:   Cocoon-Users-MailingList [EMAIL PROTECTED]
cc:

Subject:  To those who are experts in using fop


I want to create a pdf file in landscape format.
First, is it possible and if so, is it complexer than using portrait
format?

Sorry, if it's a stupid question, I have never worked with fop before.

JOERN_HEID





-
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: Nobody Knows HOW TO SAVE STREAM ON DISK!!

2001-09-10 Thread Christopher Painter-Wakefield


I think the reason nobody is answering is that nobody on this list knows
offhand how to do it.  They would have to spend time looking up the
appropriate Java references, etc., for your benefit.  I would suggest that
what you are trying to do is not basic xsp but very advanced, and therefore
requires some Java knowledge.  So you may need to take a little time
learning some Java, like it or not.  Otherwise, may I suggest that, since
nobody on this list has a quick answer for you, you take your question to a
Java newsgroup or mailing list, where there will be many Java experts to
help you.




Please respond to [EMAIL PROTECTED]

To:   Cocoon User Mail List [EMAIL PROTECTED]
cc:

Subject:  Nobody Knows HOW TO SAVE STREAM ON DISK!!


Hi,
I've been sending message everywhere and reading any book on jsp,
and nowhere it's told how I can get an xsp to record, or update a file.
It's crazy!!

I 've got an xsp which creates or recreate an xsl each time database is
changed.
But how can I save this stream from the xsp on my disk, on my server, so
that this xsl can be used on requests to transform my xml files.

Please, java is chinese to me, but i really need to record the file to my
disk for my app to work at last.

Cib

France, Bordeaux, xml and gay pride.





-
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: Building 1.8.2

2001-09-06 Thread Christopher Painter-Wakefield


try http://xml.apache.org/dist/xalan-j/old/

Although I don't see a 1.2.3 - the closest seems to be 1.2.2.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Building 1.8.2


hi,

it says I need xalan 1.2.3 which isn't available anymore, so which one do I
take? Or does someone have a URL to this?

Konstantin





-
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: Publishing Engine could not be initialized.

2001-09-05 Thread Christopher Painter-Wakefield


I'm sorry, I don't know the source of your problem, but I can help a little
bit.  My setup is mostly like yours.

The symbolic links shouldn't be a problem (I assume you are on some kind of
*nix).  My setup uses symlinks as well, and I've done that successfully on
both Solaris and Linux.  When you start Tomcat, it usually shows its
classpath.  Is it showing the xalan_1_2_D02.jar as part of its classpath?

I think most people just dump their jars in the tomcat/lib directory, and
let tomcat add them to the classpath.  You can easily hack the tomcat.sh
script for more control, though.  Mine now reads its jars from a file.

It seems like I've read about problems with JDK 1.3.1 on the list (I have
JDK1.3.0).  I don't remember the details, but you might want to search the
archives.  Maybe it is related somehow.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Publishing Engine could not be initialized.


 java.lang.RuntimeException: Error creating
org.apache.cocoon.transformer.XalanTransformer: make sure the needed
classes can be found in the classpath
 (org/apache/xalan/xpath/xml/XMLParserLiaison)


I'm trying to just set up Cocoon with Tomcat, no Apache yet.  I've
symlinked the
necessary .jar files to the Tomcat /lib directory reather than doing a copy
as per
README, could this be part of the problem?  I also noticed that the
xalan.jar that
comes from Sun is more recent than the one shipped with the Cocoon package.
I've
tried both, same problem.  Tomcat works fine.  Suggestions?

Thanks - Tod

---

java version 1.3.1
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

Cocoon-1.8
Tomcat 3.2.3





-
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: Dynamic XSP

2001-09-05 Thread Christopher Painter-Wakefield


This approach is strongly discouraged.  If you try to do it this way, your
pages will take a long time to load, every time, because your second XSP
program will have to be recompiled every single time.  So, even if you can
make it work, you won't *want* to.

Is there some reason you are trying to do it this way?  What is it you are
trying to accomplish?  Perhaps we can suggest a better approach.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   cocoon-users [EMAIL PROTECTED]
cc:

Subject:  Dynamic XSP


Hi ,

I am using cocoon 1.8.2,
My xsp page receives an request and it produces an another xsp page,
i.e. my logic is
request ---xsp1--xsl-1---xsp2--xsl-2--html--response

I have done xsp1 and xsl-1 and i got xsp2 as a response.
I need to process the result once again.
How can i give the instruction to cocoon for that..
Any of you have experience like this?
Expecting reply
Thangadurai





-
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: mod_Jk

2001-09-04 Thread Christopher Painter-Wakefield


I think you'll have to go to a jakarta mailing list for this one - this
isn't a Cocoon issue.  As I remember, when I installed Tomcat, the mod_jk
source was in the Tomcat source in the download, and I had to build it.  It
wouldn't be real surprising if you have to rebuild it for a new version of
Tomcat.

Based on the error message, though, is it possible that your workers.xml
file is incorrectly configured?  Or that it is in a different location from
the one specified in your Apache configuration files?

In either case, it sounds like you need to consult the mod_jk installation
and configuration docs on the jakarta website.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  mod_Jk



is there a new version of mod_jk out that goes with the new  jakarta-tomcat
or how is everyone else tying in apache with cocoon and  tomcat?

I have one version of mod_jk but it always fails saying  it cant load the
workers file. I am not good with apache modules really so dont  know what
else to do.

But would like to get rid of the 8080 in the url so i can use  it fluently
with apache.

-Matt







-
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: XSP code reuse problems

2001-09-04 Thread Christopher Painter-Wakefield


Alexandru,

look at your generated code, and I think you'll see why this doesn't work.
ESQL creates a number of local variables inside the populateDocument()
method, which it needs for its tags.  These local variables obviously
aren't available to other methods in the class.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  XSP code reuse problems


 Hello,
 Trying to implement the code reuse with the XSP method reusePart,
I've come into problems when the method should use the esql taglib.
 When I write a simple method, it works flawlessly and it's
reusable.
 But when I try to add a esql quey, I ran into problems.
 The pasted code below does not execute the esql part, and I think
this happend because the code fragment is locate above the page tag.

xsp:logic
private void TwoLevel(String param) throws SAXException {
 AttributesImpl xspAttr = new AttributesImpl();
 int k = 1;
 int idinf = 0;
 /xsp:logic

 esql:execute-query
   esql:query
select * from v_inf where (idinf_inf is
null and idtype_inf=1) order by name_itm
   /esql:query
   /esql:execute-query

  xsp:logic
   recordset1
xsp:exprparam/xsp:expr
   /recordset1
}
/xsp:logic

   Alexandru







-
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: Apache/Tomcat/mod_jk/C1 ?

2001-08-27 Thread Christopher Painter-Wakefield


RTFM.  Specifically,
http://xml.apache.org/cocoon/install.html

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Apache/Tomcat/mod_jk/C1 ?



Hi,

Is it possible to install Cocoon 1.8.x on Apache/Tomcat/mod_jk. If yes,
where could i find some information ?

Thanks,
Pat





-
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: C2 error in the page Session Logicsheet

2001-08-22 Thread Christopher Painter-Wakefield


How about copying the existing one into the Cocoon 1 documentation before
changing it?  It would also be nice for the original Request logicsheet
docs to be copied into the Cocoon 1 docs (they were originally for Cocoon
1, too).  There are still a lot of folks working with Cocoon 1 and asking
questions that could be answered if those docs were added to the Cocoon 1
docs.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  C2 error in the page Session Logicsheet


The page under the following URL:
http://xml.apache.org/cocoon2/logicsheet-sessions.html
is still having the old namespaces for the xsp,
session, etc.
How can we change this?
TIA
Drasko





-
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: [C2b2] document() function not working?

2001-08-22 Thread Christopher Painter-Wakefield


If you are getting nothing back when you use the document() function, make
sure the file you are opening with document() is valid XML.  I found out
the hard way that document() fails silently (at least in Cocoon 1.8.2) when
the XML is bad.  Try opening the XML document in IE or something like that
to make sure it parses successfully.

If this is still true in C2, it might make a good FAQ entry.

-Christopher



-
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: Naming folders...bug or what?? (1.8.2)

2001-08-22 Thread Christopher Painter-Wakefield


There shouldn't be any issues with folder naming; I use this pattern all
the time.  I believe the particular error you mention occurs when you try
to put text in the output at the root level (e.g., not inside an enclosing
element).  For example,

xsl:template match=/
  Hello, World!
  body.../body
/xsl:template

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Naming folders...bug or what?? (1.8.2)


Hi,

after hours of debugging (trying to figure out the fault that causes
cannot
output text before element or something equally useful error info.), I
moved my files to another folder.

I had:

welcome/welcome.xml
welcome/welcome-html.xsl

and changed to:

startpage/welcome.xml
startpage/welcome-html.xsl

and now it works!!!

I have lots of files in folders with the same name (e.g login.xml in
login/), so that shouldn't be a problem per se.

Does anybody know what causes the problem?

Cocoon 1.8.2

/AM




-
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: Dynamic stylesheets (Newbie question)

2001-08-22 Thread Christopher Painter-Wakefield


Kevin,

there are many ways of doing what you want to do, outside of modifying your
code as has already been suggested.

You can generate Cocoon processing instructions dynamically in your XML,
using the xsp:pi tag (see http://xml.apache.org/cocoon/xsp.html for
instructions on this.)  You can also chain stylesheets using the
xsl:processing-instruction tag, which is how I prefer to do it.

You can grab your request parameters (mode=view, etc.) either by using XSP
in your object.xml or using xsl:param name=mode/ at the root level of
your stylesheet (see Using query parameters during XSL transformation in
http://xml.apache.org/cocoon/guide.html for more info on that.)

For simplicity, let's assume your XML looks like this (either a static XML
file or the output from your XSP page):

page
  modeview/mode
  stuff.../stuff
/page

Your stylesheet would look like this:

xsl:template match=/page
  xsl:processing-instruction name=cocoon-process
  type=xslt
  /xsl:processing-instruction

  xsl:choose
xsl:when test=mode='view'
  xsl:processing-instruction name=xml-stylesheet
href=view.xsl
type=text/xsl
  /xsl:processing-instruction
/xsl:when

xsl:when test=mode='edit'
  xsl:processing-instruction name=xml-stylesheet
href=edit.xsl
type=text/xsl
  /xsl:processing-instruction
/xsl:when
  /xsl:choose

  xsl:apply-templates select=stuff/
/xsl:template

...

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Dynamic stylesheets (Newbie question)


I currently have two XML documents, object-view.xml and object-edit.xml.
Both are identical except for one word in one line.

object-view.xml calls this stylesheet:
?xml-stylesheet type=text/xsl href=view.xsl?

while object-edit.xml calls this one:
?xml-stylesheet type=text/xsl href=edit.xsl?

It seems silly and inefficient to have two XML documents for this.  What I
want to do is have just one XML file and access these two different
renditions like this (or some other easy method):

http://servername:8080/cocoon/object.xml?mode=view
http://servername:8080/cocoon/object.xml?mode=edit

I am surprised I cannot find an answer to this problem.  I learned that
XML/XSLT can't do this alone, and then I figured Cocoon can do this, but I
have searched FAQ, archive and docs.  Am I not looking in the right place
or
using the proper terms?  Any pointers appreciated.  I've got 1.8.2
installed
with Jakarta Tomcat 3.2.3.

Thanks,

--Kevin





-
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: What's wrong?

2001-08-21 Thread Christopher Painter-Wakefield


It sounds like you have a configuration file that is pointing to
[dir-to-cocoon]/conf/cocoon.properties instead of to a valid path.  If
you were using Tomcat, the file to edit would be web.xml in your WEB-INF
directory, which comes with a similar bogus setting in the download
package.  Look for web.xml or a similar file containing the
[dir-to-cooon] string and edit it to a valid path.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  What's wrong?



I have installed cocoon-1.8.2 on my  system(win2k+IIS+JRun3.0).Although
I've followed the installing instructions, I  couldn't get it worked. it
gives this err mess:
unable to open  resource:[dir-to-cocoon]/conf/cocoon.properties
I have modified the servlet init params  several times but it didn't
worked...?so what's wrong with this?
Thanx , Ekrem







-
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: XSP: Type and Identifier errors

2001-08-20 Thread Christopher Painter-Wakefield


Bobo,

the line numbers actually refer to the generated Java code, which is in a
repository directory as defined by your cocoon.properties file.  I think
your first error here is missing semicolons on the lines
 String fname = request.getParameter(fname)
...//some more request.getParameter()
 String email = request.getParameter(email)

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED], [EMAIL PROTECTED]
cc:

Subject:  XSP: Type and Identifier errors


Hello,
I am receiving this error:
java.lang.Exception: XSP Java Compiler: Compilation failed for
_newUser.java
72: Type expected.
 Class.forName(org.gjt.mm.mysql.Driver).newInstance();
   ^
240: Identifier expected.
xspParentNode = xspCurrentNode;
-^
The ligne 72: points to isIDduplicate()
 function while the line 240 points to  if-else.
I am using cocoon 1.8.2 and Tomcat3.2.1

Here is my code (this program is for form handling):

?xml version=1.0?
?cocoon-process type=xsp?
?cocoon-process type=xslt?
?xml-stylesheet href=../../userFactory.xsl type=text/xsl?
xsp:page language=java xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  xsp:structure
   xsp:include java.lang.*/xsp:include
   xsp:include java.sql.*/xsp:include
   xsp:includejava.sql.Date/xsp:include
   xsp:include java.sql.DriverManager/xsp:include
   xsp:include java.sql.SQLException/xsp:include
   xsp:includejava.sql.Connection/xsp:include
   xsp:includejava.sql.ResultSet/xsp:include
   xsp:includejava.sql.Statement/xsp:include
 /xsp:structure
  xsp:logic
 String fname = request.getParameter(fname)
...//some more request.getParameter()
 String email = request.getParameter(email)

Class.forName(org.gjt.mm.mysql.Driver).newInstance();
 String serverName =request.getServerName();
 String
URL=jdbc:mysql://+serverName+/ILSDB?user=Bobopassword=BoboPassword;
 Connection con  = DriverManager.getConnection(URL, ,  );
 Statement stmt1=
con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATAB

LE);
 Statement stmt2=
con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATAB

LE);


snip

-
I need your help.
Thank you.
Bobo,







-
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: [c1]esql:get-int ... as param for xsl:call-template ...

2001-08-16 Thread Christopher Painter-Wakefield


Hubert,

you are mixing two different things.  Keep in mind that when you are
writing a logicsheet, you are writing an XSLT stylesheet that will
transform based only on what is available to it in your XML file.  This
happens once and only once, statically, to generate Java code which will
then be compiled.  The output of the Java code will then be run to produce
the actual XML which feeds into the rest of the pipeline (stylesheets and
so forth).

The ESQL taglib is also a logicsheet, so it produces Java code.  The
results of the esql:get-int ... operation won't be available until after
it is transformed by the esql logicsheet into Java code, compiled, then
run.  Your logicsheet, however, is trying to use the result long before any
of that happens.  In other words, you are not passing the results of a
database operation as a parameter into your xsl:call-template, you are
passing XML that happens to look like esql:get-int   Or, if the esql
logicsheet happens to be applied first, then you are passing Java code,
*not* the results of running that code.

Hope this helps.

-Christopher





Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  [c1]esql:get-int ... as param for xsl:call-template ...


Hi all,

I want to get something like this:

elem id=top_el_id
sub_elements count=sub_cnt
elem id=sub_el_id_1/elem
elem id=sub_el_id_2/elem
elem id=sub_el_id_3/elem
elem id=sub_el_id_4/elem
/sub_elements
/elem

XML file:
?xml version=1.0 encoding=iso-8859-2?
?xml-logicsheet href=my_taglib.xsl?
?cocoon-process type=xsp?
xsp:page
xmlns:my_taglib=http://my_host/my_taglib;
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
xmlns:esql=http://apache.org/cocoon/SQL/v2;
...
my_taglib:loc id=1/
...
/xso:page

logcsheet: my_taglib.xsl:
?xml version=1.0 encoding=iso-8859-2?
xsl:stylesheet version=1.1

xmlns:my_taglib=http://my_host/my_taglib;
xmlns:esql=http://apache.org/cocoon/SQL/v2;
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

xsl:template match=xsp:page
...
/xls:template

xsl:template match=my_taglib:loc name=loc-tag
!-- selecting data from DB, based on parameter id,
parameter id is set to attribute id if attribute id is valid
number,
if element has any subelements, i want them to be in
sub_element
tag,
but ids of this subelements are stored in DB and are depending
on id of current
element, so i try: --

xsl:call-template name=loc-tag
xsl:with-param name=idesql:get-int
column=sl//xsl:with-param
/xsl:call-template

!-- unfortunetly esql:get-int column=sl/ is not substituted
with any value
and i get infinite recursion, beacause if id param or attribute
are not provided
i try to work, and process all elements in DB, but some
elements
have subelements,
and again xsl:call-template name=loc-tag with no param --
/xsl:template

I think error may be in order of inclusion taglibs, but can't find good
one,

Thanks in advance,
Hubert.







-
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: Java variable inside of document() function?

2001-08-16 Thread Christopher Painter-Wakefield


Martin,

first, are you trying to do this in a logicsheet or in a stylesheet?  In a
logicsheet, this won't work because your logicsheet exists to generate Java
code.  The Java code doesn't exist and hasn't been compiled and can't run
yet.  Only your XSL transformations are being applied.  The xsl:for-each
select=document([the Java variable]) can't use the value stored in the
Java variable, because it doesn't exist yet.

In a stylesheet, you can't do this, because you can't use XSP Java code in
a stylesheet.  It is too late.  All XSP code has already been run,
producing XML which is being processed by your stylesheet.  You can,
however, do this:

In your XML file:
...
xsp:logic
!-- do something here to set your variable, e.g. --
String doc = info.xml;
/xsp:logic

docxsp:exprdoc/xsp:expr/doc
...

then in your XSL stylesheet:
xsl:variable name=thefile select=doc/
xsl:for-each select=document($thefile)
...

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Java variable inside of document() function?


How can I use a Java variable in the document() funkction?

i.e.
xsl:for-each select=document([the Java variable])
 ...
/xsl:for-each

I have tried it with the help of

xsl:variable name=srcxsp:expr[the Java
variable]/xsp:expr/xsl:variable
xsl:for-each select=document([$src])
 ...
/xsl:for-each

but this doesn't work. xsp:expr/ won't be processed and so the value of
$name is
the String src. When I use xsp:exprsrc/xsp:expr outside of
xsl:variable/ it
works fine.

How can I solve this problem? Is there any workaround?

Thanks,
Martin





-
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: transfering variable values from the java side to the xsl side

2001-08-16 Thread Christopher Painter-Wakefield


See my reply to Martin.  You have the same problem: you can't mix XSP and
XSL.  You can use XSL in a logicsheet to generate XSP code, or you can run
XSP code to generate XML and then transform the output with XSL.

-Christopher




Please respond to [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   [EMAIL PROTECTED]
cc:

Subject:  transfering variable values from the java side to the xsl side


Hi to all,

I'm wondering what's wrong with a code like this in an xsp/xsl
stylesheet (both processing instructions are used):

xsp:logic
 String str = foo;
/xsp:logic
xsl:variable name=var
 xsp:exprstr/xsp:expr
/xsl:variable

The xsp:expr-tag is completely ignored and the textual value str
assigned to the variable var.

Can anybody help?

I'm still using Cocoon 1.8.2.

Regards,
Markus.




-
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: xml/xsl/xsp

2001-08-15 Thread Christopher Painter-Wakefield


Arif,

you aren't doing anything to obtain the user's input.  Are you familiar
with HTML forms in CGI or Servlet programming or anything like that?  If
not, you might want to get a book on Servlets or some such.

Anyway, try modifying your XML to something like this:

?xml version=1.0?
?cocoon-process type=xsp?
?cocoon-process type=xslt?
?xml-stylesheet href=ref.xsl type=text/xsl?

xsp:page
  xmlns:xsp=http://www.apache.org/1999/XSP/Core; language=java

  xsp:logic
String input = request.getParameter(user);
String msg;
if (input == null || .equals(input)) {
  msg = Hello, world!;
} else {
  msg = input;
}
  /xsp:logic

  title
xsp:exprmsg/xsp:expr
  /title

/xsp:page

Also take a look at the documentation on the Request logicsheet (it is on
the Cocoon2 site, but it is actually written for Cocoon 1).

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  xml/xsl/xsp



hi,
please could you give me a hand with this.

need help
ok ive got this far, needed to create an HTML form with a text input field
-
which ive done
what i need to do - using xmlxsl, create an HTML form
that submits to the page that i created i the(the xml  xsl file
i created that generated an HTML page saying Hello World)
which should be modified to display any text entered by the user instead of
Hello World.
i ran it it does not work, where am i going wrong?
my xml is not picking up what i type in the message field
any help please?
using apache webserver with cocoon


XML FILE

?xml version=1.0?
?cocoon-process type=xsp?
?cocoon-process type=xslt?
?xml-stylesheet href=ref.xsl type=text/xsl?

xsp:page
  xmlns:xsp=http://www.apache.org/1999/XSP/Core; language=java

  xsp:logic
String msg = Hello, world!;
  /xsp:logic

  title
xsp:exprmsg/xsp:expr
  /title

/xsp:page



xsl file

?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

xsl:template match=/
h1 style=color:green;xsl:value-of select=//title//h1

/xsl:template

/xsl:stylesheet


HTML FILE

html
head
/head
body
form name=input action=/resweb/arif/ref.xml
Message Text:
input id=user type=text name=user
input type=submit value=Submit
/form
/body
/html


thanks
arif





-
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: request taglib + query

2001-08-14 Thread Christopher Painter-Wakefield


Anne Marie,

this may sound completely stupid, but remove the semicolon at the end of
your query.  I copied your XML into a new file in my project and edited it
to make the query match tables in my database and changed the pool to one
of my own pools.  I also removed your stylesheets and used a simple source
formatter stylesheet.  I made no other changes.  When I ran the query with
an appropriate parameter, I got no results.  When I edited the file to
remove the semicolon, I got results.  Just to make sure, I added the
semicolon back in, and sure enough, I got no results again.  Perhaps this
is some JDBC thing.  I do know that all of the working examples I have
seen, and all of the queries in my own code, are not terminated in any way.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  request taglib + query


Hi all,

and thanks for helping me so much!

Unfortunately, I still cannot get my page to do what I want:

*I am able to pick up the http request parameter from the URL and display
it
*I am able to run the query if I hardcode the value
*But I am not able to run the query with the value that I pick up from the
URL!

I have also included the xml file and the generated java code. It looks
fine
to me. You can see that I have put a request in the xml document just to
display, and this displays OK on the screen. But for some reason it won't
work in the query... The java code generated in each case is the same,
isn't
it?

*I have tried with ?userID=55512345
   ?userID='55512345'
   ?userID=55512345
*I have tried to have the database field as a string and as an integer
*Using xsp-request instead of request doesn't work (I think maybe that's
for
C2?)
*I have tried EVERY other suggestion that I have received, but with no luck

I guess the reason must be that the query is attempted run BEFORE the
parameter is found. Does anybody have any idea how I can work around this
to
use the parameter in the query?

I would also like to try to store the parameter in a variable, and then try
and use the variable in the query to see if that works. Does anybody now
how
I can do that? Christopher and Max, you both had an idea of building the
query as a string with xsp:logic, but I am not able to do it right! If I
try
to use request.GetParameter I get error messages...

Thanks again!

Regards
Anne Marie

Welcome.xml:

?xml version=1.0 standalone=no?
?xml-stylesheet href=welcome-html.xsl type=text/xsl?
?xml-stylesheet href=welcome-wml.xsl type=text/xsl media=wap?

?cocoon-process type=xsp?
?cocoon-process type=xslt?

!-- Welcome.xml --
!-- Written by Anne Marie Hartvigsen --

!DOCTYPE document [
  !ENTITY email [EMAIL PROTECTED]
]

xsp:page language=java
  xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  xmlns:request=http://www.apache.org/1999/XSP/Request;


document
  head
pagetitle title=Titleinfo/
  /head

  body
h1
  Welcome,
  request:get-parameter name=userID/
/h1

p
  Below the query results should be displayed.
/p
p/

br/br

reg_data
esql:connection

  esql:pool
annemarie
  /esql:pool

  esql:execute-query
esql:query
  select name as reg_name,
 deviceID as reg_deviceID,
 description as reg_description,
 startTime as reg_startTime,
 endTime as reg_endTime
  from user, terminal, deviceType, registration
  where terminal.userID = request:get-parameter name=userID/
and user.userID = terminal.userID
and deviceType.deviceType = terminal.deviceType
and registration.terminalID = terminal.terminalID;
/esql:query
esql:results
  header
These are your registrations,
  /header
  esql:row-results
username
  esql:get-string column=reg_name/
/username
registration
  deviceID
esql:get-string column=reg_deviceID/
  /deviceID
  description
esql:get-string column=reg_description/
  /description
  startTime
esql:get-string column=reg_startTime/
  /startTime
  endTime
esql:get-string column=reg_endTime/
  /endTime
/registration
  /esql:row-results
/esql:results
  /esql:execute-query
/esql:connection

/reg_data



 br/br

signature
  Made by: email;
/signature
  /body
/document
/xsp:page






-
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: I can't make XSL to work for cocoon1.8.2

2001-08-14 Thread Christopher Painter-Wakefield


Could you be more specific as to what is different in your output from
Cocoon that with Xalan?  The code you put in your e-mail does have a typo:
xsl:processin-instruction - processing is missing its 'g'.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   '[EMAIL PROTECTED]' [EMAIL PROTECTED]
cc:

Subject:  I can't make XSL to work for cocoon1.8.2


Hi,
I have this XSL script which works with xalan (I use cooktop), but when
Itry the same code with cocoon1.8.2 I receive really different output
than my original output. I'd really appreciate if someone could explain
to me why it does not work and what should I do to make it work. Thank
you very much for your help.

?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xsl:output method = html encoding=Windows-1252 /
  xsl:template match=/
  xsl:processin-instruction
name=cocoon-formattype=text/html/xsl:processing-instruction
  html
 body
 h3xsl:textMedia Asset List for
/xsl:textxsl:value-of select=/Course/CourseInfo/title/para //h3
  xsl:for-each select=//Animation |
//Graphic 
   table width=40%
   tr
  tdbxsl:textAsset
Name/xsl:text/b/tdtdxsl:value-of select=@FileRef//td
   /tr
   tr
  tdbxsl:textAsset
Type/xsl:text/b/td
  xsl:choose
   xsl:when test=name(.) = 'Animation'
   tdxsl:textAnimation/xsl:text/td

   /xsl:when
   xsl:when test=name(.) = 'Graphic' 
 tdxsl:textGraphic/xsl:text/td
   /xsl:when
  /xsl:choose
  /tr
  tr
   tdbxsl:textAsset Title
/xsl:text/b/tdtdxsl:value-of select=@AssetTitle//td
   /tr
   tr
  tdbxsl:textDescription
/xsl:text/b/tdtd width=70%xsl:value-of
select=@FileDesc//td
  /tr
  tr
  tdbxsl:textFile Source
/xsl:text/b/tdtd width=70%xsl:value-of
select=@FileSource//td
  tr
  tdbxsl:textCopyright Status
/xsl:text/b/tdtd width=70%xsl:value-of
select=@CopyrightInfo//td
  /tr
  tr
  tdbxsl:textPop-up Image
/xsl:text/b/tdtd width=70%xsl:value-of
select=@HasClick//td
  /tr
  tr
  tdbxsl:textScreen Number
/xsl:text/b/tdtd width=70%xsl:value-of
select=@ScreenNum//td
  /tr
  /tr
  /table
  hr/
/xsl:for-each
   /body
   /html


 /xsl:template
/xsl:stylesheet

-
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]








-
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: HTTP request parameter

2001-08-09 Thread Christopher Painter-Wakefield


Anne Marie,

try
esql:query
  select name as reg_name,
 deviceID as reg_deviceID,
 description as reg_description,
 startTime as reg_startTime,
 endTime as reg_endTime
  from user, terminal, deviceType, registration
  where terminal.userID =
  esql:parameter type=int
   request:get-parameter name=userID/
  /esql:parameter
and user.userID = terminal.userID
and deviceType.deviceType = terminal.deviceType
and registration.terminalID = terminal.terminalID;
/esql:query

Replace int with long or string, as necessary to match your field
type.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  HTTP request parameter


Hi,

what is required to get the http request parameter to work? I have

[...]
xsp:page language=java
  xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  xmlns:request=http://www.apache.org/1999/XSP/Request;  ---HERE

[...]

esql:query
  select name as reg_name,
 deviceID as reg_deviceID,
 description as reg_description,
 startTime as reg_startTime,
 endTime as reg_endTime
  from user, terminal, deviceType, registration
  where terminal.userID = request:get-parameter name=userID/
---HERE
and user.userID = terminal.userID
and deviceType.deviceType = terminal.deviceType
and registration.terminalID = terminal.terminalID;
/esql:query
[...]

As far as I have understood, I can then put

?userID=123456

at the end of the url, e.g.
-
http://localhost/welcome.xml?userID=123456

and 123456 will be used. But it's not working, so I guess I'll have to add
something somewhere? I don't get any error messages, but I don't get any
data from the query either. The query works when I use

---
!ENTITY userID 123456 //(in the DTD)

[...]

and terminal.userID = userID; //(in the query)
---

I'm using Cocoon 1.8.2

/Anne Marie





-
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: Replacing \n with BR - cocoon pb ?

2001-08-09 Thread Christopher Painter-Wakefield


What about doing the replacements in your SELECT statement to create
well-formed XML, then using the esql:get-xml ... to retrieve it?  In
Oracle, it would look like:

SELECT 'mytext' || REPLACE(mytextfield, CHR(10), 'BR/') || '/mytext
FROM 

I would guess most RDBMS have a similar capability.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Replacing \n with BR - cocoon pb ?



Hi folks !

I have text in a database with \n characters in it.
I want to produce HTML and keep LF in my presentation.
So I have to convert \n to BR

I can't replace with  and  characters because they can be confusing
for the parser , am I right ?
In order to see if my template is ok, I tried it but I have a
StackOverFlowError ! (replacing \n with BR )
Any help is appreciated

Thanks

Sébastien






Here is what I did :

xsl:template name=remplaceCaracDansChaine
xsl:param name=chaineEntrante/!--Input String--
xsl:param name=caracEntrant/!--what I want to be replaced--
xsl:param name=caracSortant/!--the new piece of string--
xsl:choose
xsl:when test=contains($chaineEntrante,caracEntrant)
xsl:value-of
select=concat(substring-before
($chaineEntrante,$caracEntrant),$caracSortant)/
xsl:call-template name=remplaceCaracDansChaine
xsl:with-param name=chaineEntrante
select=substring-after($chaineEntrante,$caracEntrant)/
xsl:with-param name=caracEntrant select=$caracEntrant/
xsl:with-param name=caracSortant select=$caracSortant/
/xsl:call-template
/xsl:when
xsl:otherwise
xsl:value-of select=$chaineEntrante/
/xsl:otherwise
/xsl:choose
/xsl:template

Then, I call it like that :
xsl:variable name=monTextexsl:value-of
select=/page/rowfiche/texte//xsl:variable !--value coming from my
XML--
xsl:variable name=texteBR!--the destination variable with modified
text--
xsl:call-template name=remplaceCaracDansChaine
xsl:with-param name=chaineEntrante select=string($monTexte)/
xsl:with-param name=caracEntrant select=n/
xsl:with-param name=caracSortant select=BR/!--I can't use
BR because of  and  characters--
/xsl:call-template
/xsl:variable

xsl:value-of select=$texteBR/!--print the transformed string--


-
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]








-
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: [c1] xsp:logic compiling

2001-08-07 Thread Christopher Painter-Wakefield


Brent,

it sounds like you are getting there, maybe a few hints will close the gap
for you.

First off, you *can* apply multiple logicsheets to an XML document.  Use
the ?xml-logicsheet href=...? processing instruction multiple times for
logicsheets that aren't associated with a namespace in the
cocoon.properties file, and declare the appropriate namespaces for all
logicsheets.  You may also use one logicsheet inside another logicsheet, as
long as you declare the namespace for the secondary logicsheet both in the
using logicsheet and in the XML file (and add the appropriate
?xml-logicsheet ...? PI to the XML document if necessary).

The rest of your issues can be dealt with by looking at the sequence of
events when processing your XML.  First, the Cocoon processors get applied
in the order in which they are requested via ?cocoon-process type=...?
PI's.  If you are using XSP, then that processor should *always* be first.
(In Cocoon 1, you can get away with putting an XSP processing step later,
but it can work kind of funny and it is also slow, since you get a
compilation every time the page is requested.)

When the XSP processor is applied, things happen in roughly this sequence:
1.  All logicsheets are applied to the source document using normal XSLT.
So for instance, if you use two custom logicsheets using the
?xml-logicsheet ...? PI and also use the request logicsheet (and all
three namespaces are declared correctly), then each logicsheet will be
applied to the XML source as an XSL Transform in turn (the output of one
becomes the input of the next and so on).  I'm not sure of the exact order
in which the logicsheets will be applied, but common sense would suggest
that the order of ?xml-logicsheet? PI's and the order of namespace
declarations will be significant.
2.  After all logicsheets are applied, the XML is transformed into Java
code (this is also done mostly using XSLT, I believe - look for the
xsp-java.xsl file in your Cocoon src tree).
3.  The Java code is compiled.
4.  The resulting code is loaded and run to generate the XML page.

The resulting XML from this step is passed on to any other processors down
the line, including your XSLT processor.

This should explain a few things for you.  First, you can't really use the
request taglib from inside a stylesheet.  Even if the logicsheet were
applied, you'd just end up with uncompiled Java code, which won't do you
any good.  All logicsheets have to be used in the XSP step.  You can,
however, use the request logicsheet in your XSP program, storing the
results in a tag that you can later process in your stylesheet.

Second, you can't mix Java logic and XSLT logic, which is what you do when
you try to use xsl:choose syntax on the result of the
request:get-parameter.  Keep in mind that the XSLT is just what is
applied to the XML to help transform it into Java code.  The
request:get-parameter tag gets transformed in that way.  If you look at
the actual request.xsl logicsheet (in your src tree), you'll see that the
request:get-parameter tag gets transformed into something like
   XSPRequestLibrary.getParameter(
   request,
   String.valueOf(whatever),
   ,
   document
 );

So, the request code gets run and gives you a result much later in the
process than when your xsl:choose is applied.  Your xsl:choose is not
turned into Java code itself, it is applied as XSLT to generate the Java
code.  This is why you can get the results of the request tag in your
output but not use the xsl:choose in your logicsheet on the result.  One
is dynamic, giving a result at runtime.  The other is static, generating
code that will be compiled once and run many times.

Oh yeah, that's the other thing.  If you don't change your logicsheets or
source XML, then the next time a request is made to that XML, none of the
logicsheet application and compilation is done - the existing program is
merely re-run.

Anyway, to do what you want, you need to mix apples and apples as it were.
You can either mix Java with Java:
xsp:logic
  if (whatever.equals(request:get-parameter name=screen/)) {
xsp:content
  bThis screen is 'whatever'!/b
/xsp:content
  } else {
xsp:content
  font color=FFWrong screen!/font
/xsp:content
  }
/xsp:logic

or mix XML with XSLT:
(in your XSP program or logicsheet)
screenrequest:get-parameter name=screen//screen

(in your stylesheet, later in the chain)
xsl:template match=screen
  xsl:choose
xsl:when test=text() = 'whatever'
    and so forth.

Finally, if all that wasn't enough, note that you can gain access to
request parameters in your stylesheet (not your logicsheet!).  Coocon does
some sort of trick to make these available.  Merely declare XSL parameters
with the same name as your request parameter at the top level of your
stylesheet, like so:
xsl:param name=screen/
See the user guide (http://swift.mc.duke.edu/cocoon_docs/guide.html) for
more on this approach.

I 

Re: [c1] xsp:logic compiling

2001-08-03 Thread Christopher Painter-Wakefield


Brent,

is the code you've submitted from a logicsheet?  What does your XML file
look like?  If you are trying to run your XML through a stylesheet, and
then through the XSP processor, as it appears you might be doing, then you
need to rethink your approach.  For more info on logicsheets and how they
work in 1.8.2, see http://xml.apache.org/cocoon2/logicsheet-guide.html (yes
it is in the Cocoon 2 docs, but it was really written for Cocoon 1).

Based on your current code, the main thing I would suggest is putting
xsp:content.../xsp:content around your html nodes.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  [c1] xsp:logic compiling


I'm fairly new to Cocoon - but I've been muddling through it now for a few
days.  But I'm hoping this isn't too big of a newbie question, but I didn't
find any answers in the mailing list archives, the newsgroups, or the web.

* Cocoon 1.8.2 with Tomcat

I've created an XSL file which is working fine so far (it's a basic login)
with it's XML instance document counterpart.  When the user submit a
login/pw form, it submits back to the same XML file (which in my case is
index.xml).  Here's a quick snip of the XSL code:

  xsl:template match=page
xsl:processing-instruction
name=cocoon-processtype=xsp/xsl:processing-instruction
xsl:processing-instruction
name=cocoon-formattype=text/html/xsl:processing-instruction
xsp:page language=java
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
html


What I want to do is fairly simple.  Check to see if the form has been
submitted, by checking for the login parameter.  So here is what I
changed
the code to:

  xsl:template match=page
xsl:processing-instruction
name=cocoon-processtype=xsp/xsl:processing-instruction
xsl:processing-instruction
name=cocoon-formattype=text/html/xsl:processing-instruction
xsp:page language=java
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
xsp:logic
if (request.getParameter(login.x) == null) {
html
 the rest of the HTML which shows the login form 
/html
} else {
... check username exists, etc
response.sendRedirect(main.xml);
}
/xsp:logic

The problem seems to be how Cocoon is generating the java code.  It seems
as
though if I put the xsp:logic tags before the html tag it puts the code
outside of any method in the /* User Class Declarations */ part which is,
of
course, not valid Java syntax if I'm doing an if statement.

If I move the xsp:logic after the html tag my if statement goes into
the
populateDocument() method (which is OK - but after an HTML tag has been
sent
to the browser I can no longer redirect).

Can anyone give me a suggestion on how I should handle the redirects??

Also, how full-featured is Cocoon2?  It looks as though C2 has some nifty
logicsheets for request and response objects (of which, by the way, it
seems
as though I can use the request logicsheet in C1 and
request:get-parameter
seems to still work fine... response on the other hand does not).  With
those logic sheets I could just use an xsl:choose on the parameter and
then send the redirect.

I'm working on a live site for a client though, so stability is an
important
issue.

Anyways, any help would be appreciated, thanks,

- Brent





-
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: AW: [C2] Redirects

2001-07-11 Thread Christopher Painter-Wakefield


I agree.  It is fine to discourage use of redirects, but dictating it to
everyone by arbitrarily removing it from the framework is, in my opinion, a
poor choice.  Trust us to make mature choices about what constitutes good
design, even while educating us on a better way.  I think the point is also
well taken that, hey, redirects are a part of the current state of the art
in web programming.  Most programming languages have some dangerous
constructs (e.g., #become: in Smalltalk); maybe you avoid it like the
plague, but once in a long while, the benefits outweigh the problem, so you
use it.  So please, give us redirects even if you tell us not to use it.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  RE: AW: [C2] Redirects


 Ok, thanks a lot for your info. I now understand it is possible, but
 extremely complicated and verbose to do redirects in Cocoon2 :-)
Oh, you aren't being fair.  Just because it is too easy to do in
scripting frameworks, doesn't mean we should allow the same abuse
of redirects in Cocoon.  You just have to think harder.

I have to agree on the first point. Migration from C1 to C2 is everything
else than compile  run, just because of this one thing. I agree that
using actions in the sitemap is a more clean solution, and yes, I agree
that
program flow shouldn't be dictated in xsp pages. But couldn't this one
little
feature be implemented (with warnings, and some restrictions) just so that
C1 users could play around with C2 and enjoy the new features? I'd really
appreciate
it...

- Anders





-
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: cocoon2 + logicsheet

2001-06-25 Thread Christopher Painter-Wakefield


Kester,

sorry about that.  I wrote that particular document, but I intended it for
the Cocoon 1 site.  It was added to the Cocoon 2 docs, but I didn't say
anything because I thought perhaps it was applicable to both.  (I have no
experience with Cocoon 2.)  It sounds like it isn't a good match for Cocoon
2 at this time.  Perhaps one of the developers could move it over to the
Cocoon 1 site?  Also, I submitted Request and Session logicsheet docs, but
again, they may be only appropriate for Cocoon 1.  Could one of the
developers check and move these if necessary?  Thanks.

If we move to Cocoon 2 and I get some experience with it, I'll be happy to
update those docs for C2, but right now I don't know enough and wouldn't be
able to test the examples on C2.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  cocoon2 + logicsheet


Hi,

I am trying to get the example greeting3.xml from
http://xml.apache.org/cocoon2/logicsheet-guide.html
to work with cocoon2.

On the page it says:
  There is another way to apply a logicsheet, which doesn't require a
  processing instruction for each file that uses the logicsheet. The
  second way to use a logicsheet depends on whether you are using
  Cocoon 1 or Cocoon 2. For Cocoon 2, take a look at the Cocoon 2 Site

The Link Cocoon 2 Site points to http://xml.apache.org/cocoon/cocoon2/
which doesn't exist. I suppose it's supposed to be
http://xml.apache.org/cocoon2/ but I couldn't find the way to do it
there either; nor did I find anything appropriate in the FAQ.

I see two possible solutions:
  (1) remove the PIs from greeting3.xml and configure the sitemap (or
  maybe cocoon.xconf) to first do the xsp-processing and then the
  xslt- processing
  (2) make cocoon2 behave like cocoon1, so you can just access
  greeting3.xml and all the PIs will be processed.  I tried
  configuring this in the sitemap, but didn't succeed.  [ This
  isn't really the solution I want, I only tried it because I
  couldn't figure out how to do (1) ]

My efforts trying it like in (1), I removed the PIs and added rules to
the sitemap.

This is what I used in sitemap.xmap to tun greeting.xml and it works
(all files are in test/):
   map:match pattern=test/greeting.html
map:generate src=test/greeting.xml/
map:transform src=test/greeting.xsl/
map:serialize type=html/
   /map:match

With this I can run greeting2.xml:
   map:match pattern=test/greeting2.html
map:generate type=serverpages src=test/greeting2.xml/
map:transform src=test/greeting.xsl/
map:serialize/
   /map:match

[ But this wouldn't work until I changed
  xsp:page
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  
to
  xsp:page
xmlns:xsp=http://apache.org/xsp;
  
in greeting2.xml. Same change applied to greeting3.xml. ]

This applies the logic-sheet on greeting3.xml:
   map:match pattern=test/greeting3.html
map:generate src=test/greeting3.xml/
map:transform src=test/logicsheet.greeting.xsl/
map:serialize/
   /map:match
and the resulting file contains the correct xsp code. So I'd only have
to execute the xsp code and do the final xslt, but It won't work like
this:
   map:match pattern=test/greeting3.html
map:generate src=test/greeting3.xml/
map:transform src=test/logicsheet.greeting.xsl/
map:generate type=serverpages/
map:transform src=test/greeting.xsl/
map:serialize/
   /map:match

as cocoon won't run two generators.

I have no idea on how to do greeting3.xml with the logicsheet.

Could someone provide me with an example on how to do this in cocoon2?


Thanks in advance,

Kester.





-
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: generate dinamic page from a single index.xml

2001-06-15 Thread Christopher Painter-Wakefield


Simone,

this is very easy to do, and Cocoon provides many different ways you can do
it.

Here's a simple example using only XML and XSLT:

index.xml:
   ?xml version=1.0?

   ?cocoon-process type=xslt?
   ?xml-stylesheet type=text/xsl href=index.xsl?

   items
 itemone/item
 itemtwo/item
 itemthree/item
   /items

index.xsl:
   ?xml version=1.0?
   xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0

   xsl:param name=item-number/

   xsl:template match=/items
 html
   xsl:apply-templates/
 /html
   /xsl:template

   xsl:template match=item[position() = $item-number]
 Current item: xsl:value-of select=./
 br/
 a
   xsl:attribute name=href
 index.xml?item-number=xsl:value-of select=$item-number+1/
   /xsl:attribute
   Next
 /a
   /xsl:template

   xsl:template match=item[position() = 1 and not($item-number)]
 Current item: xsl:value-of select=./
 br/
 a href=index.xml?item-number=2Next/a
   /xsl:template

   xsl:template match=item priority=-1/

   /xsl:stylesheet


The reason this works is because Cocoon has nicely made it possible for you
to get query parameters in your XSLT stylesheet just by declaring an
xsl:param with the same name.  So, the link we create in the stylesheet
uses a query parameter (?item-number=n) and we pick it up with xsl:param
name=item-number/.

There are many more complex approaches you can try, particularly if you get
into XSP, where you have the whole range of Java and servlet programming
available to you.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  generate dinamic page from a single index.xml

Hi
My prior mail was been quite generic. The question  is about the
possibility of create dynamically web page starting from a  single
index.xml page and translate with cocoon and  XSLT. Following the links on
index.xml displayed on browser  the will load a new page that came from
index.xml new  rapresentation.

Is there some suggestion or can be implemented an  equivalent architecture?

Thank for all in advace.
Simone







-
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: xml page1 calls xml page2

2001-06-14 Thread Christopher Painter-Wakefield


Simone,

I think you'll need to be more specific.  From what you've described, a
simple hyperlink does what you are looking for, e.g.  a href
=page2.xmlNext/a.

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  xml page1 calls xml page2



My situation is just a standard case where from a  begin page (index.xml) i
want to navigate farward an back to other  page in my site.
The index.xml calls for example a  second.xml page in my browser.
Can i do this with C1? Is there a little  examples?
Thank in advance  Simone.







-
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: (urgent)ESQL question

2001-06-13 Thread Christopher Painter-Wakefield


Without looking at all of your code, it is hard to be sure what the problem
might be.  For instance, how is username declared in your program?  The
best way to debug these problems is to look at the generated Java code, so
that you can easily see where variables are being declared and set and so
forth.  The generated Java code is in your repository directory, the
location of which is defined in your cocoon.properties file.  The
repository directory basically follows the same hierarchy as your cocoon
context, except everything has a leading underscore.

-Christopher



HI ALL,
here i tried to keep esql results into varible and comparing with
other variable , but its not working ...plz help me out.

xsp:logic
 String uname=;
/xsp:logic

esql:connection
  xsp:logic
   uname=esql:get-string column=username/;
   if( username.equals(uname)){
   }
   else
{ do something}
  /xsp:logic
/esql:connection


but always it goes into else loop not going into if loop at all.
even i tried trimming the both variables ,even though its not working
plz help out..

Advance Thanks
Rammi.





-
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: rendering PDF only

2001-06-13 Thread Christopher Painter-Wakefield


FOP is a separate project from Cocoon, just used by Cocoon (just as you
want to do).  Go to the xml.apache.org site and click on the FOP links.




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  rendering PDF only


Hi all,

I would like to take advantage of cocoon only in rendering xml files into
PDF.
In fact I would like to embedd fop-0.18.1-dev with a servlet, that servlet
must take as parameter a reference to an xml file and display it in pdf
format.

can anyone tell me which packages in cocoon can I use?

Please help me.

regards,
adel





-
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: PDF generation

2001-06-13 Thread Christopher Painter-Wakefield


Are you using IE, by any chance?  Try Netscape.  If it comes up fine in
Netscape, then read the FAQ entry about IE and PDF.

-Christopher



I have tried all cocoon samples . it generated pdf  format but no data in
it.

Pls explain me the reason

i am using weblogic 5.1

janesh

Wed Jun 13 17:49:39 GMT+05:30 2001:I  ServletContext-General *.xml:
init (  test-fo.xml)
using renderer  org.apache.fop.render.pdf.PDFRenderer
using element mapping  org.apache.fop.fo.StandardElementMapping
using element mapping  org.apache.fop.svg.SVGElementMapping
building formatting object  tree
setting up fonts
formatting FOs into areas
 [1]
rendering  areas to PDF
writing out PDF
using renderer  org.apache.fop.render.pdf.PDFRenderer ( test2-fo.xml)
using  element mapping org.apache.fop.fo.StandardElementMapping
using element  mapping org.apache.fop.svg.SVGElementMapping
building formatting object  tree
setting up fonts
formatting FOs into areas
 [2] [3] [4]  [5] [6] [7]
rendering areas to PDF
writing out PDF





-
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: rendering PDF only

2001-06-13 Thread Christopher Painter-Wakefield


Adel,

sorry, I don't know Cocoon at the level you want.  Best I can offer is you
can start by looking at the Javadocs for the Cocoon project (there's a link
on the Cocoon docs pages).  Good luck.

-Christopher




Hi Cristopher,

I know that fop is responsible of rendering PDF but what I want to do is to
write a light cocoon which only displays PDF.
Now can you tell me which classes (*.java) shall I consult to write such
servlet?

regards,
adel





On Wed, 13 Jun 2001 09:56:22 -0400, [EMAIL PROTECTED] wrote:


  FOP is a separate project from Cocoon, just used by Cocoon (just as you
  want to do).  Go to the xml.apache.org site and click on the FOP links.




  Please respond to [EMAIL PROTECTED]

  To:   [EMAIL PROTECTED]
  cc:

  Subject:  rendering PDF only


  Hi all,

  I would like to take advantage of cocoon only in rendering xml files
into
  PDF.
  In fact I would like to embedd fop-0.18.1-dev with a servlet, that
servlet
  must take as parameter a reference to an xml file and display it in pdf
  format.

  can anyone tell me which packages in cocoon can I use?

  Please help me.

  regards,
  adel






-
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: Problem with my query

2001-06-13 Thread Christopher Painter-Wakefield


Gustavo,

try this:

esql:queryselect * from employee where empno=
  esql:parameterMY_VARIABLE/esql:parameter
/esql:query

You may need to specify a type, such as esql:parameter type=int,
otherwise it will assume a String.

-Christopher



Thanks,

I chanche my code to:
?xml version=1.0?

?cocoon-process type=xsp?
xsp:page
  xmlns:xsp=http://www.apache.org/1999/XSP/Core;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;


page
esql:connection
  esql:driveroracle.jdbc.driver.OracleDriver/esql:driver
  esql:dburljdbc:oracle:thin:@MyIP:MyPort:cta/esql:dburl
  esql:usernameUserID/esql:username
  esql:passwordPassword/esql:password
  esql:execute-query
esql:queryselect * from employee/esql:query
esql:results
  headerheader info/header
  esql:row-results
empleado
  empnoesql:get-string column=empno//empno
  lastnameesql:get-string column=lastname//lastname
 /empleado 
  /esql:row-results
  footerfooter info/footer
/esql:results
  /esql:execute-query
/esql:connection
/page
/xsp:page

And now It works, but now what I wanto to do i to make variable the
criteria of
my query, yes, something like

esql:queryselect * from employee where empno=MY_VARIABLE/esql:query

Do you know how can I do that ?

Thanks a lot !!

Gustavo







-
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: Problem with my query

2001-06-13 Thread Christopher Painter-Wakefield


Gustavo,

you want to use the request taglib, for which there isn't any documentation
(hopefully soon there will be).  Anyway, try this:
esql:query
  select * from employee where empno=
  esql:parameter
request:get-parameter name=VAR/
  /esql:parameter
/esql:query

You'll need to add a declaration for the request namespace in your xsp:page
element, like this:
  xmlns:request=http://www.apache.org/1999/XSP/Request;

I think you will need to take out the quotes on your query string, like this:
http://localhost/cocoon/servlet/sql/esql.xml?VAR=01

-Christopher




Thanks again,

Right, I need to do the first thing that you told me, I tried but with no
results, I have something like this:

esql:queryselect * from employee
where empno=esql:parameterVAR/esql:parameter
/esql:query

and in my browser the url is:

http://localhost/cocoon/servlet/sql/esql.xml?VAR=01;

but, doesn't show information.

Maybe it is not very difficult, but I really starting with this things.

Thanks

Gustavo





-
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]