Re: How to use xsp-request:get-parameter

2001-06-25 Thread Christian Haul

On 25.Jun.2001 -- 11:00 AM, Zeljko Rajic wrote:
 p
Parameter 'param1' value:
xsp-request:get-parameter as=string default=default Value
 xsp-request:nameparam1/xsp-request:name
/xsp-request:get-parameter
 /p

Looks OK

 I'm receiving the following error as it seems the xsp-request:name tag isn't
 recognized/transformed correctly.  Or is my usage wrong. I'm using Cocoon 2
 alpha 5.  The error is:

Please upgrade to C2b1 or CVS and try again. XSP has been broken at
some time.

In addition, please post (a bit more of) the relevant portion of the
generated JAVA source (eg.
$TOMCAT/work/yourhost/cocoon/org/apache/cocoon/www/your/uri/yourfile_xsp.java)

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]




Re: I'm confused about XSP , variables and session

2001-07-02 Thread Christian Haul

On 29.Jun.2001 -- 12:21 PM, [EMAIL PROTECTED] wrote:
 For instance , I have a XSP logicsheet that declares:
 
 String person = request.getParameter(person);
 
 I then use this variable in a custom XSP tag library that is declared in
 the namespace of the XSP logicsheet. Is this possible because the person
 variable is static?
 
 Also, In my XSP tag library that I created, I have instantiated several
 variables:
 
 private String sPrefix;
 private String sFirstName;
 private String sLastName;
 private String sMiddleName;
 
 These variables are behaving like static variables. Every session on the
 webserver will be looking at the same variable in the tag library. I wanted
 to use tag library because I really like the notion of separating content
 and logic and tag library made this very easy by just dropping in dynamic
 data place holders in your XML. But if every session is looking at one
 static variable in my tag library, then I can't use tag libraries the way I
 want.
 I was hoping somebody could explain the scope of variables declared in XSP
 taglibs versus variables declared in logicsheets.
 I basically want variables that persist only in a specific session.

Think of logicsheets aka TagLibs as macros -- that's what they
are. They are no functions to call. Tags on your XSP get *replaced* by
the contents of the tag definition in your logicsheet (this is not
100% accurate since it is possible to do some simple programming
e.g. xsl:for-each).

At the end of the process, one file (a java class) is produced that
combines the code snippets from your XSP and the logicsheets used.
Looking at this file is very interesting and will help you
understand. I believe the concepts section describes this very
well. Thus variables in logicsheets and XSPs basically have the same
scope.

BTW this is the reason why it is no good idea to declare variables in
logicsheets -- clashes might appear e.g. when a tag that declares a
variable is used more than once on a XSP. Extra care must be taken to
do this safely.

All variables that have not been declared static should be
reinitialized for every request.

For variables to persist in a specific session, they must be added and
retrieved from the session. There's a taglib provided with cocoon2
that does that.

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]




Re: form-validator?

2001-07-03 Thread Christian Haul

On 02.Jul.2001 -- 05:31 PM, java guru wrote:
 The problem with regular expression in that example is
 that:
 
 for email address i just put anything and it
 works..shouldnt it be of format [EMAIL PROTECTED] ???

Yes, indeed. Unfortunately, I'm not able to reproduce your
observation. I remember that the first draft of examples had a couple
of syntax errors in them, maybe that's it. Bug 2415 contains up to
date examples.

Please try the following descriptor.xml file

?xml version=1.0?
root

   parameter name=persons type=long min=2 default=9 max=99 nullable=yes/
   parameter name=deposit type=double min=10.0 max=999.99/
   parameter name=email type=string max-len=50 
matches-regex=^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$/

   constraint-set name=car-reservation
   validate name=persons/
   validate name=deposit min=50.0/
   validate name=email/
/constraint-set

/root

I hope that the new versions will show up in CVS really soon.

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]




Re: Query problems !

2001-07-04 Thread Christian Haul

On 03.Jul.2001 -- 02:16 PM, Gustavo Mejia wrote:
 Hi !!
 
 I am making a query passing it from a JSP file, my code is very simple
 but I got an error:
 
 java.lang.RuntimeException: Error executed prepared
 statement:  ?
  at
 
 My code is the next:
 
 esql:query
esql:parameter type=string
  request:get-parameter name=pQuery/
/esql:parameter
 /esql:query
 
 and I send the variable pQuery using the URL, something like:
 
 http://localhost/cocoon/m3/query_m3.xml?pQuery=select * from inmuebles
 
 I don't know what the error is, I think it is because the spaces in the
 query, I tried also putting my query directly, (no like a parameter) and
 it works fine.
 
 Could you help me ? how can I fix this error !!

Hi, I'm not 100% sure about this, but I believe JDBC's prepared
statements allow only replacement of one or more parameter, not of a
complete (sub) query, e.g. 
select * from person where social_sec_id=? and salary?

By using esql:parameter a prepared statement is
created, but your intent is a dynamic query, so if you omit the
esql:parameter and use 

esql:query
  request:get-parameter name=pQuery/
/esql:query

you'll be fine. This way no prepared statement is generated.

Of course you'll need to escape illegal characters in your request
string. The browser does that automatically when submitting forms;
the request api does as well.

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]




Re: outputting XML tags

2001-07-06 Thread Christian Haul

On 05.Jul.2001 -- 03:13 PM, Vartika Bhandari wrote:
 Hi!
 I am using cocoon for an application wherein in certain
 circumstances I need to display a dynamically generated XML document as
 plain text i.e with all markup as is. However cocoon strips off tags and
 never displays them..I would be grateful for some ideas
 as to how to manage this.

For C2

1) use views e.g. the predefined content view by adding a request
   parameter named cocoon-view, value content. The content view
   shows the result of the generation step.

2) change the serializer type to xml, in addition you might want to
   change its mime-type to text/plain. I think you could change the
   serializer using a selector e.g. based on a request parameter.

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]




Re: esql problem

2001-07-06 Thread Christian Haul

On 06.Jul.2001 -- 02:30 PM, JEULIN Olivier wrote:
 Well, esql:get-int needs a column name,
 so try:  select count(*) as thecount from...
 and use: esql:get-int column=thecount /

That's not true. It takes either a label or a number. So 
esql:get-int column=1/ should work (and it's translated correctly
to _esql_query_resultset.getInt(1). Problem seems to be something else.

Marco, have a look at the generated source, line 4816

/usr/local/home/siteadm/download/jakarta-tomcat-3.2.2/work/localhost_8080%2Fcocoon/org/apache/cocoon/www/elenco/prova_xsp.java

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]




Re: esql problem

2001-07-07 Thread Christian Haul

On 06.Jul.2001 -- 03:18 PM, JEULIN Olivier wrote:
 It seems you should put it inside xsp:logic like this
 xsp:logic
  rowNum = esql:get-int column=1/;
 /xsp:logic
 (if C2 is a bit like C1 ;) )

If you didn't want to assign to a variable, then you'd need to enclose
the rowNum=... code with a xsp:content element. I'll patch that
into the logicsheet on monday so that esql exhibits the expected
behaviour to output rowNum = 42 instead of producing the error.

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]




Re: AW: [C2] Redirects

2001-07-11 Thread Christian Haul

On 11.Jul.2001 -- 10:08 AM, Ulrich Mayring wrote:
 Carsten Ziegeler wrote:
  
 The right place for application flow and redirects is the sitemap in
 c2. So you can make redirects in the sitemap using the map:redirect-to
 element or you can write your custom action which can do a redirect.
 
 But how to do that conditionally then? Here's some code from one of my
 Cocoon1 apps:
 
 String param = request.getParameter(param);
 if (param == null||param.equals())
 response.sendRedirect(error.xml?apperror=1526);
 
 This redirects the user to an error page, if his input is not ok. I have
 lines like this in most of my XSP pages. Another example:
 
 if (status.startsWith(active)) {
   // Send notification mail
   response.sendRedirect(mail/NOTIFY_CUSTOMER.xml);
 else if (status.startsWith(begin)) {
   // Send error fax
   response.sendRedirect(fax/NOTIFY_CUSTOMER.xml);
 
 Doing a 'grep -r sendRedirect * | wc -l' on the above app I get 104.
 Does this mean I have to write 104 actions? Or is it possible to write a
 generic redirect action - in that case it should be included in the
 distribution :)

Have a look at the form validation action and request parameter value
selctor(*) provided with cocoon2

Chris.

(*) will appear today in HEAD

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




Re: AW: [C2] Redirects

2001-07-11 Thread Christian Haul

On 11.Jul.2001 -- 05:06 PM, Anders Lindh wrote:
 One of the issues is technical in nature.  Because of the SAX stream
 approach
 that Cocoon 2 uses, the XSP page is being serialized AS it is being parsed.
 What is happening is that each SAX event (startDocument, startElement,
 etc),
 is being propogated through the entire SAX chain and being transformed as
 they
 are called.  Once the root element has been propogated, there is no turning
 back.
 
 Ok.. Could you clarify a bit how and in what order things are done in
 Cocoon. What
 exactly does Cocoon do with a xsp page (that has been compiled into a java
 class)? The
 compiled java class constructs a SAX document, which in turn is XSLT
 processed if needed. Right?
 Isn't this the basic flow of things?

Only that there's no SAX document. While the XSP still generates SAX
events (document nodes), others are transformed and some are already
serialized and send to the client. Everything happens
concurrently. Thus when 50% (1%, 99%) of the document have already
reached the client what semantics should a redirect have?

C2 had a send-redirect in the response taglib. And if you were
lucky, the redirect was issued while the servlet engine's send buffer
was only filling up and nothing has been delivered, yet. Most of the
time the redirect never reached the client or two documents were
concatenated (i.e. IE)

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]




Re: C2 -- Actions and how do they work??

2001-07-12 Thread Christian Haul

On 12.Jul.2001 -- 11:14 AM, Sheshadri Mantha wrote:
 Hello All:
 I'm new to Cocoon2 and want to learn the steps involved in using actions
 instead of embedding java logic in xsp pages.  I've read the documentation
 page on action and admit that I fail to understand the constructs behind the
 HelloWorldAction and what it accomplishes (and hence am not able to
 extrapolate).  I get the next section that talks about the action sets and
 have a vague idea on how they get called etc.  So... I get some of the
 high-level stuff and what I'd like is a working example that I can disect.
 Perhaps an Action oriented solution to the problem in embedding java logic
 in xsp (as outlined in actions.html documentation page -- this is the first
 code sample on this page).

OK, have a look at the samples supplied with C2. The employee sample
uses actions as does the session-state example in the CVS
version. Both illustrate different usage patterns so get the CVS
version and look at the examples.

Action sets are a way to reference a couple of actions together. Which
ones get executed is determined by a request parameter named
cocoon-action.

 On my understanding, I'd like to present a step-by-step addition to the
 Actions documentation.

Great!

 Also, from my understanding of the documentation, the SQLTransformer class
 takes a SQL Statement and constructs an XML from the result set... is this
 true?

Yes.

 My ultimate goal is to tie the Actions in with my classes that implement
 business logic, db extraction, updates and inserts.

That's what they're for.

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]




Re: [c2] Selectors and Matchers vs components in sitemaps

2001-07-13 Thread Christian Haul

On 12.Jul.2001 -- 07:35 PM, HALLOWELL,KARL (HP-Cupertino,ex1) wrote:
 My apologies. This was meant to be a Cocoon 2 question.
 
 
 Karl Hallowell [EMAIL PROTECTED]
 
 
  From: HALLOWELL,KARL (HP-Cupertino,ex1) [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 11, 2001 3:26 PM
  To: [EMAIL PROTECTED]
  Subject: Selectors and Matchers vs components in sitemaps
  
  
  I noticed that the packages org.apache.cocoon.selection and
  org.apache.cocoon.matching contain a number of code 
  factories (writes a
  StringBuffer of java code) while none of the other packages 
  (in cocoon) do.
  Does this mean that if I write a selector or matcher that I 
  actually should
  write a CodeFactory object? Didn't spot anything about this 
  subject on the
  mailing lists. Thank you.

Personally, I like writing CodeFactories more than writing the
concrete matchers. But I think it doesn't matter what you do. The
outcome is that code produced by a factory is embedded in the
generated sitemap class while e.g. a matcher class will be used as an
instance of that class.

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]




Re: AW: forms in coocon2, is SchemoX dead ?

2001-07-17 Thread Christian Haul

On 16.Jul.2001 -- 09:28 PM, java guru wrote:
 I agree about the xform and xfdl..In future, i guess,
 these concepts would go beyond just form validation
 and handling..

To me it looks like xfdl is not actively maintained by W3C, since the
document is rather old.

 For now, from this discussion, I understand that we
 are all looking for some form of automated/simplified
 form generation/validation and handling..am i right?..

Right.

 And also, there are efforts on going with current
 cocoon reg form validation and other stuff...they seem
 to follow the xform approach from nanotech..but not
 sure if the original author has intent of extending it
 to be full blown form generator/validator/handler or
 not...

Well, I'm not the original author but have supplied some of the
validations. Indeed, I would like to extend this to a more complete
form generator/validator. But I haven't made up my mind, which way to
follow.

To me, XForms looks like the most importand standard on this but I
think it is not advisable to aim for a fully compliant implementation
for C2 because (please correct any errors)

a) XForms expects XML encoded parameters. I'm not 100% sure on
   this, but I think few to none of the available browsers
   support this. I don't think it would make sense to convert
   request parameters to a XML representation before processing
   them since this would probably be too costly. A Javascript
   solution to post parameters as XML is propably out of the
   question.

b) XForms allow besides the basic types arbitrary types definable
   in XML Schema. While this might be possible for validation, it
   is expensive but seems only necessary if parameters are XML
   encoded. 

c) XForms declare forms within the HEAD/ section of a
   document. XSP don't have such a concept.

d) XForms' forms can be mixed and nested. This is not possible
   with current XHTML forms.

e) XForms specify validation as XPath expressions. Makes only
   sense if form data is accessible through XPath.

f) XForms specify active behaviour: triggers, conditionals
   ... This is probably out of scope.

g) XForms provide sliders, subpages, lists c. This is too complex
   for short term availability.

h) XForms specify subpages. Whiles this could be done it's also
   probably too complex for short term availability.

i) XForms don't specify error messages.

j) Since validation is (at least additionally) server based, this
   should keep the already filled in elements.

From this follows, that a fully compliant implementation should not be
the goal.

To do would be (not necessarily in order of importance)

   1) enhance form validator action to validate more XForms basic
  types. 

   2) provide a taglib that combines necessary features from
  formval.xsl and request.xsl plus some form specification that
  produces valid XForms

   3) provide stylesheets that render HTML-4.0 forms (probably
  separate ones for IE, NS c), XSL-FO c.
 
   4) provide javascript routines that do client side checking (as
  well for major platforms)

Suggestions, ideas and helping hands welcome :-)

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]




Re: AW: forms in coocon2, is SchemoX dead ?

2001-07-17 Thread Christian Haul

On 17.Jul.2001 -- 10:07 AM, Berin Loritsch wrote:
  a) XForms expects XML encoded parameters. I'm not 100% sure on

 Which means that for the two standard submission types (url encoded
 and multipart), the XPath expression is used to reconstruct the XML
 document.

So, do you think this is advisable, to reconstruct the XML?

  c) XForms declare forms within the HEAD/ section of a
 document. XSP don't have such a concept.
 
 This is a markup issue.  Basically, the instance/schema/binding info
 is stored at the top of the document in an xform tag.

As there's no part of an XSP that is an equivalent of the HEAD/
part, the question arises where to put it instead. Just anywhere at
the top? Anywhere before the first form element? Or, what the hell,
like before with HTML forms, all form elements nested?

  d) XForms' forms can be mixed and nested. This is not possible
 with current XHTML forms.
 
 This is true.  There are two potential solutions:
 
 1) only have one form for the whole document and separate the
markup and validation at server side.

This is probably the way to go. Although different target URIs for
different forms would be cleaner, this could be achieved by action +
matchers on parameter values instead of URIs. Such matchers already
exist in C2.

 2) force the user to use XHTML form constraints.

 
  e) XForms specify validation as XPath expressions. Makes only
 sense if form data is accessible through XPath.
 
 In an XForms implementation this is a requirement.  Validation is
 done via Schema (current spec), as well as Dynamic Constraint Language
 (based in part on ECMAscript).
 
 References are by XPath.

I think this could be postponed to a later evolution of such a
package, can it? 

  f) XForms specify active behaviour: triggers, conditionals
 ... This is probably out of scope.
 
 This can only be in scope if you have a transformer that creates
 Javascript on the fly.  As different browsers have different methods
 of referencing form parts, this is where the BrowserSelector can
 come in handy.
 
 Again, this is not easy.

So, again, this shouldn't be part of an initial offering.

  h) XForms specify subpages. Whiles this could be done it's also
 probably too complex for short term availability.
 
 I would implement it as another page in the form.  In other words, we
 do validation on the information we have, and go to the subpage, etc.

This is a (minor?) breach from C2 philosophy, to split different views
into separate XSPs. OK, this is not really relevant here and therefore
more or less OK. Again, an issue for later revisions.

  i) XForms don't specify error messages.
 
 This is my biggest beef with it.  They have heard this complaint before.

Well, we could extent and embrace ;-) A similar functionality could be
done with the switch/ contructs in XForms and those triggers. For
usability error messages would be quite important to be available in a
clean and simple way. And as you said, XForms is a moving target, so
perhaps, this is going to happen anyway :-)

  To do would be (not necessarily in order of importance)
  
 1) enhance form validator action to validate more XForms basic
types.
 
 XForms is now completely Schema based.  Throw the generated XML through
 Xerces and see what gets kicked out.  I would implement the ErrorHandler
 so that all errors can be cached.

Mmmh, another source of errors in C2. Not valid Schema
definitions. And a reason to really reconstruct the XML. Think I'll
need to look a bit closer at XForms :-|

 3) provide stylesheets that render HTML-4.0 forms (probably
separate ones for IE, NS c), XSL-FO c.
 
 I started on this a while ago.  The overall style really depends on
 the site.  Bottom line is that XForms is a moving target.

Granted. But there need to be an example so that a form package is
usable and as a starting point for every one else to customize. Of
course there're a number of design alternatives in the XForms
spec. e.g. selectOne/ - radio buttons, check boxes (?!), drop down
boxes (select size=1/), select boxes (select/), ... and such a
stylesheet would probably provide only one or two of these i.e. based
on the number of item/s.

 4) provide javascript routines that do client side checking (as
well for major platforms)
 
 This really would have to be both platform and XForm specific.  The
 Javascript would need to be auto-generated.

I think some basic checking could be done independantly, check that a
field only contains numbers and display a pop-up if there's a
violation should be manageable.

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 

Re: Classpath Problems With Actions

2001-07-17 Thread Christian Haul

On 17.Jul.2001 -- 04:08 PM, Marks local account wrote:
 So I have three questions:
 
 1. What am I doing wrong?

The web.xml looks good. Package problems? (You know, package
foo.bar.xyz lives in foo/bar/xyz)

 2. Is there a prescribed way for me to let cocoon compile the
 LoginAction.java file on the fly like it does with everything else? I
 currently just compile the file from the command line.

No, unfortunately not.

 3. Can actions be written using xsp?

No, but AFAIK there's a new action checked in today that allows
arbitrary scripting languages like javascript.

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]




Re: Q on session validation example

2001-07-17 Thread Christian Haul

On 17.Jul.2001 -- 03:10 PM, HALLOWELL,KARL (HP-Cupertino,ex1) wrote:
 I have a question about Martin Man's session validation example (e.g.,
 http://localhost/cocoon/protected/login). Namely, the session validator is
 called every time that a match (map:match that is) is done in the sitemap.
 I.e., if I surf to protected/protected it first checks with the session
 validator action to see if I've logged in. I continue only if my request has
 the appropriate session parameter/cookie. At the time, the author, Martin
 noted that he didn't like having to put the action in every match entry in
 the sitemap that he wanted to protect against unauthorized logins. My
 question is whether this can be done. I.e., can I route everything though
 say URL match protected/**, do the session check in that map:match, set
 some sitemap parameter, and then redirect to another URL (say
 rootname/{1}).
 
 The idea is that the session validation appears only once in the sitemap,
 but is checked for a variety of URLs. Is there anything wrong with my idea?
 Are there simple ways this session validation can be bypassed?

There're several solutions to this:

a) mount a sub-sitemap and do the validation in the mount (probably
not nice, since this belongs to the application in the sub sitemap)

b) nest your pipelines. There's no reason why you shouldn't specify
matchers nested inside an action

c) use redirects to internal URIs or ressources. But then you'd need
matchers for those

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]




Re: Employee Database Sample

2001-07-18 Thread Christian Haul

On 18.Jul.2001 -- 06:46 PM, Madock Chiwenda wrote:
 I am trying to access employee sample bundledwith cocoon but I get the 
 following error:
 
 org.apache.cocoon.ProcessingException: Exception in 
 ServerPagesGenerator.generate():java.lang.RuntimeException: Could not get 
 the datasource java.sql.SQLException: You cannot get a Poolable before the 
 pool is initialized
 
 Can somebody help?

Did you build.sh -Dinclude -Dinstall.war=/path/to/webapps install ?

If you didn't, you'll find a number of ${install.war} in
cocoon.xconf and some XSPs. Replace those with the path to
webapps. Otherwise the included java database does not work / the jdbc
url is wrong.

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]




Re: Using Actions in Sitemaps

2001-07-23 Thread Christian Haul

On 23.Jul.2001 -- 03:16 PM, Max Larsson wrote:
 
 Is your LoginAction 1) without any package, and 2) in the classpath?
 Anytime you alter your classpath in ANY servlet, the servlet engine needs
 to be restarted.  It's a fact of life.
 
 It's no problem with the classpath. Cocoon loads the class and executes it.
 I've checked it in the logs. The problem is in the sitemap, but i don't
 find enough documentation to solve it. This piece:
 
   map:match pattern=*.html
   map:generate type=serverpages src=helpdesk.xsp/
   map:serialize/
/map:match
 
 works fine. OK the LoginAction class isn't called. But if if change it to
 use it in the following way:
 
map:match pattern=*.html
  map:act set=helpdesk
map:generate type=serverpages src=helpdesk.xsp/
  map:serialize/
  /map:act
/map:match
 
 C2 delivers resource not found. It's not a problem with the LoginAction
 class.
 It gets loaded and executed without any problems. I can post the source if
 needed.

Mmmh, does it make sense to nest a subpipeline in a action *set* ?
Perhaps you wanted to use a single action? E.g.

  map:match pattern=*.html
map:act type=helpdesk
!--  --
  map:generate type=serverpages src=helpdesk.xsp/
  !-- no transformation needed ? --
  map:serialize/
/map:act
!-- you should have an else case here, since what happens if
 the action did not complete successfully ? --
  /map:match

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]




Re: XSLT Trouble

2001-08-02 Thread Christian Haul

On 02.Aug.2001 -- 03:49 PM, Kazi the P i R @ t {- wrote:
 Well :) ... I am finally smiling... The trouble has finally gone away.. and
 i'd like to thank you all for
 your suggestions adn pointers... especially Scott Boag, cause what he
 mentioned really made the difference in the end.
 
 Initially i had
 xsl:stylesheet xmlns:xsl=http://www.w3c.org/1999/XSL/Transform/mmm
 version=1.0
 and then i had it changed (according to Mr Scott's mail) to:
 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 
 All was fine after that...
 
 But i read somewhere that the URI can be anything as long as its a
 unique string... then how come it has to be so specific... could anyone
 correct my concepts here???

You're right. However, cocoon determines the taglib to be used by
prefix + URI. Change anything and it doesn't find the right taglib.

With stylesheets this is not that restrictive, because you specify the
file in the sitemap. Still, you need to have the very same namespace
declaration in your document and your stylesheet. Since xsl is not a
stylesheet but built into the xsl processor and thus is unlikely to
have been changed by you, you need to use exactly the same namespace
URI that has been set by w3c. You might get away using a different
prefix though but I wouldn't bet on that.

I know that taglibs are usually implemented with stylesheets but I
find it very important to differentiate on the role that a stylesheet
takes. Therefore when I refer to stylesheets implementing taglibs I
use the term taglib. These are applied only when the document itself
changes, i.e. to generate java source code from an xsp. They are
registered with cocoon in your cocoon.xconf.

What I refer to as stylesheets are of course stylesheets, but those
that are applied to the document every time output is produced, or
more precise they are applied to the output of the generation
process. These stylesheets are specified in sitemap pipelines.

 Whats fumbling me now is the exact sequence an xsl stylesheet is processed.

It used to be reverse declaration order for taglibs. But since it
seems not necessary anymore to declare all namespaces (i.e. those that
are not present in the original document but get introduced by
taglibs), this might have changed.

Stylesheets get applied in the order specified in your sitemap
pipeline.

Anyway, with taglibs they should be written in a way that all taglibs
of one stage should be applicable in any order. When all declared
namespaces of a stage are resolved to taglibs, the next stage begins
with the namespaces added by the taglibs from previous stage.

Cocoon is very verbose. Look at the log and you see every taglib being
applied. 

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]




Re: ESQL - select * from any_table

2001-08-06 Thread Christian Haul

On 05.Aug.2001 -- 12:00 PM, Mauro Velasco wrote:
 Hi all,
 
 I'm using ESQL with (Tomcat 3.2.1, Cocoon 1.8.2, WinNT 4 sp6), and need 
 select all rows from any table, but I noticed before need know the columns 
 the be retrieved, exist a form to make this query. I'm usign Oracle 8.1.6, 
 Sql Server 7 and Mysql.

You're right, you need to know your columns in advance -- but you
could refer to them by number as well. This way it's a bit easier to
do it.

The CVS version (2.1) allows for expressions to refer to columns as
well. I will propably check it in for 2.0 as well today.

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]




Re: Quotes in query

2001-08-06 Thread Christian Haul

On 06.Aug.2001 -- 10:23 AM, Sébastien Lefebvre wrote:
 Hi all,
 
 I have a form where I can type text.
 The form is submited  with post method to a xsp page.
 This texte can of course have quotes in it. ex:  I'd like this to work
 How to insert it in MySQL ?
 Do I have to write XSP logic in order to replace ' by \'?
 Or is there any other solution ?
 (I'd like to make the operation server side so javascript's regexp is 
 not an issue for me).

I *think* a prepared statement doesn't care about a string's
content. Use esql:parameter in a query to get code that uses
a prepared statement.

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]




Re: esql get-colums NullPointerException

2001-08-06 Thread Christian Haul

On 06.Aug.2001 -- 05:24 PM, Arnaud Bienvenu wrote:
 When you use esql:get-columns and one of your column has a NULL value,
 you find yourself with a disgracefull NullPointerException. Here is a patch
 for Cocoon2 to have an empty tag instead :

Applied. Please check.

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]




Re: How to getConnection in Action ?

2001-08-07 Thread Christian Haul

On 07.Aug.2001 -- 03:42 PM, Ling Kok Choon wrote:
 Hi All,
 
I try to use Action in the Sitemap to dinamicaly select stylesheet file  base on 
the request 
 *.xml file. so in the Action, i need to get a connection from the connection pool to 
connect to 
 the database. But How to get the connection ? I have read the Cocoon2 Documentation 
( section 
 Using Databases) but the example code is wrong, i can't find the import classes 
(e.g. 
 org.apache.avalon.ComponentManager, org.apache.avalon.ComponentSelector ) from the 
Avalon's 
 package !
 
Do you have any idea ? 

Look at the Database*Actions.

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]




Re: HTTP request parameter

2001-08-09 Thread Christian Haul

On 09.Aug.2001 -- 01:17 PM, [EMAIL PROTECTED] wrote:
 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
 

 I'm using Cocoon 1.8.2

I'm not familiar with C1 but the above looks a lot like C2 syntax. In
C1 you need AFAIK processing instructions to apply taglibs. Should be
in the examples  xsp docs.

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]




Re: How to access attribute in Java?

2001-08-09 Thread Christian Haul

On 09.Aug.2001 -- 02:57 PM, Martin Benda wrote:
 Is it possible to access the value of an attribute inside of xsp:logic to
 use
 it in the Java Code?
 
 For example
 
 xsl:template match=timer-util:verify-user
 xsp:logic
 String driver = xsp:contentxsl:value-of
 select=@driver//xsp:content
 ...
 /xsp:logic
 /xsl:template
 
 When I look inside the code cocoon produces I find the following...
 
 ...
 String driver = this.characters(oracle.jdbc.driver.OracleDriver);
 ...
 
 ... and of course this won't work, but is there any workaround?

The use of the xsp:content/ tags as signals that the following is to
be outputted to the processing pipeline, what is obviously wrong
here. Just replace xsp:content/ with quotes.

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]




Re: request taglib + query

2001-08-14 Thread Christian Haul

Anne Marie,

as far as I can see, the resulting java source is OK. A comparison of
the two fragments that reference the request parameter are identical
which they should be as both return a String.

On 14.Aug.2001 -- 11:22 AM, [EMAIL PROTECTED] wrote:

Printing ID to greet the user:

 xspCurrentNode.appendChild(
   xspExpr(
   XSPRequestLibrary.getParameter(
 request,
   String.valueOf(userID),
 null
   )
 , document)
 );

Using the ID for the query:

 _esql_query.query = String.valueOf(
   
   
 +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 = 
   
 + 
   XSPRequestLibrary.getParameter(
 request,
   String.valueOf(userID),
 null
   )
 
 +  and user.userID = terminal.userID
 and deviceType.deviceType = terminal.deviceType and
 registration.terminalID = terminal.terminalID; 
   );

AFAICS this should run the query with the supplied parameter. 

Could you please
a) state what you expect and what happens instead
b) report all error messages
c) report the sql error message when using esql:parameter/
   Hint: esql:error-results/ / esql:get-message/
d) check that a manual query with the exact query string (including
   all spaces!) does produce the correct result
e) not open new threads for the same problem

Although I do not expect this to have an impact, see if

xsp:logic
String myQuery=. + xsp-request:parameter name=userID/ + ...;
/xsp:logic
[...]
pQuery is prexsp:exprmyQuery/xsp:expr/pre/p
[...]
esql:queryxsp:exprmyQuery/xsp:expr/esql:query

does change anything.

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]




Re: java.lang.NoSuchMethodError - StreamTarget.java:34

2001-08-15 Thread Christian Haul

On 15.Aug.2001 -- 01:22 AM, [EMAIL PROTECTED] wrote:
 
 Root Cause:
 java.lang.NoSuchMethodError
 at org.apache.log.output.io.StreamTarget.(StreamTarget.java:34)
 at org.apache.log.output.io.FileTarget.(FileTarget.java:40)

There has been a version conflict with velocity's logkit. The old
version has been removed at the expense of velocity being temporary
broken for C2. Please update your snapshot.

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]




Re: esql database results and XSL

2001-08-16 Thread Christian Haul

On 16.Aug.2001 -- 11:15 AM, Brent L Johnson wrote:
 Is it possible to process XML that comes from database results?  I'm not
 sure this would be possible or not - but here's an example...
 select Title from MyInfo order by Title;
 
 The resulting titles could be like:
 The Cocoon Mailing List myImage name=blah/
 
 Is there some XSLT tag or something that could process that esql results?
 Some like:
 xsl:processesql:get-string column=Title//xsl:process

Try
esql:get-xml column=Title/


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]




Re: Problem with cascading actions and parameters...

2001-08-17 Thread Christian Haul

Roman,

please RTFM, it's all explained in there. Solution is

[significant enclosing structures omitted!]

map:parameter name=constraint-set value={1}/ 
!--
Actually, this is *before* evaluating the action since
it is an extra parameter to it. Hence no new map has
been pushed. Current map is result from matcher.
--
map:redirect-to resource=form_page target={../1}/
!--
This, however, is *after* evaluating the action. Thus
a new map has been pushed onto the others. Since we
want to refer to the next to current map, we need to
refer to {../1} here. Current map is result from action.
--

[significant enclosing structures omitted!]

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]




Re: xsp-formval how get results

2001-08-21 Thread Christian Haul

On 20.Aug.2001 -- 11:29 AM, cib wrote:
 Hi,
 
 my form's target goes to do-register2, and here is the sitemap.
 
 
  map:match pattern=do-register2
  map:act type=form-validator
  map:parameter name=descriptor value=reg_desc.xml/
  map:parameter name=validate-set value=registered/
  map:redirect-to uri=testdb/
  /map:act 
 map:generate type=serverpages src=error.xsp/
 map:transform src=dyn.xsl/
 map:serialize/
 /map:match
 
 The errot.xsp has a namespace on formval: 
 
 ?xml version=1.0 encoding=ISO-8859-1?
 xsp:page
   language=java
   xmlns:xsp=http://apache.org/xsp;
   xmlns:esql=http://apache.org/cocoon/SQL/v2;
xmlns:xsp-formval=http://apche.org/xsp/form-validator/2.0;
   page
 
 Your error messages:
 xsp-formval:results/
 
   /page
 /xsp:page
 
 But here is the error page 's source I get.
 
 page
 Your error messages:
 xsp-formval:results xmlns:xsp-formval=http://apche.org/xsp/form-validator/2.0/
 /page

Cib,

your code looks OK to me. However, the result you get indicates, that
the formval taglib is not applied to your XSP. Check if the namespaces
and prefixes are correct and if the taglib is declared in
cocoon.xconf.

One thing though, results requires to be used within xsp logic or
expr. Besides the output is not really digestable but only suitable
for debugging.

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]




Re: [C2b2] esql tags in xsl stylesheets

2001-08-25 Thread Christian Haul

On 24.Aug.2001 -- 05:04 PM, Arnaud Vandyck wrote:
 Response below...
 
 Date: Fri, 24 Aug 2001 16:22:09 +0200
 From: Orgalist [EMAIL PROTECTED]
 
  I can't make it work, the esql tags are not interpreted
  i also use esql tags in file.xsp where it works
  if someone can help me thanks.
  (I know similar questions have been posted, but i could find a solution
  in the answers )
  
  C.
  
  here's the namespace in my xsp file
  ===file.xsp===
  xsp:page
  language=java
  xmlns:xsp=http://apache.org/xsp;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  
  ...
  /xsp:page
  
  
  the part of the xsl i'd like to see working :
  ==file.xsl=
  ?xml version=1.0 encoding=ISO-8859-1?
  
  xsl:stylesheet version=1.0
  
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  
  
 
 Impossible to do that! 
 
 The esql *must* be in an xsp or xml page, never in the stylesheet. The
 esql tags  will be removed when  processing by Cocoon so  you even can
 not match esql tags in xsl. Read the docs/samples/xsp/esql.xsp example
 or the  employee examples (see the  sitemap to know where  to find it,
 must be in docs/samples/forms/employee.x* (xsp and xml)). 

If it hasn't changed recently, this is not true. Otherwise it would be
impossible to chain taglibs. It is perfectly OK to use esql in a
taglib stylesheet. Actually, the code looks quite OK to me and I don't
have a clue why it shouldn't work.

Note that differentiating between taglib stylesheets and formating
stylesheets is important here: I usually refer to the former only as
taglib and to the latter as stylesheet. Arnaud is right about any
logic in stylesheets (including of course the use of esql), while I
refer above only to taglibs.

Unfortunately, orgalist didn't specify which he is refering to. But if
it didn't work, he could have meant indeed stylesheets. Orgalist,
please have a look at the sql transformer then, this might be the way
to go.

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]




Re: Action vs. Request

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 04:29 PM, Tobias Luikard wrote:
 Hi,
 
 this isn't the problem.
 
 In the Action I try to set XMLString as seen. But when I try to read it in the XSP 
with the following statement it's empty (I get
 EGAL as result):
xsp-request:get-parameter name=XMLString default=EGAL/
  
  request.setAttribute(XMLString, XMLString);
   ^
Obviously, you need to xsp-request:get-attribute name=XMLString default=EGAL/
^
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]




Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 03:47 PM, beje wrote:
 Hi,
 I have n dinamicaly generated (and identical) forms to fill-in;
 on submition I'd like to validate them by using just a descriptor file
 whitch contains just 1 form (since all are the same).
 
 Is there a way to achieve that ?

Sure, just have the same parameter names. You might even want to set
your descriptor as default descriptor.

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]




Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 11:09 AM, Per Kreipke wrote:
  Sure, just have the same parameter names. You might even want to set
  your descriptor as default descriptor.
 
 Where would I start to learn about this? Are 'descriptors' a velocity
 template thing or a Cocoon2?
 
 Per

Please see docs, section Forms  javadocs for the involved classes.

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]




Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 06:13 PM, beje wrote:
 From: Christian Haul [EMAIL PROTECTED]
  On 17.Sep.2001 -- 03:47 PM, beje wrote:
   Hi,
   I have n dinamicaly generated (and identical) forms to fill-in;
   on submition I'd like to validate them by using just a descriptor file
   whitch contains just 1 form (since all are the same).
  
   Is there a way to achieve that ?
 
  Sure, just have the same parameter names. You might even want to set
  your descriptor as default descriptor.
 
 Unfortunately, the fields are numbered like this:
 input name=country1 .../
 
 input name=country2 .../
 
 to
 input name=countryN .../

If there is no chance of renaming those parameters to country, you
would indeed need to duplicate the entries in your descriptor, there
is no wildcard match operator. Perhaps you could distinguish the
different forms by a hidden value (or the value of the submit
button?), referer URL or target URL? You might still be able to use
the same pipeline in your sitemap.

 And one more thing:
 I want to have in the sitemap a general entry for all validation actions,
 somehting like:
 
   map:match pattern=validate-*
 !-- first validate whether submitted values are ok --
 map:act type=form-validator
   map:parameter name=descriptor
 value=context://mysite/mydescriptors/{1}.xml/

This is OK, {1} is replaced by the match from the pattern matcher.

   map:parameter name=validate value=  /

You could use {1} here as well, perhaps it would be cleaner to switch
to the newer set-based method. See docs, section Forms for this.

 map:redirect-to uri=process-{1}.xsp/

This is no good, since AFAIK redirect is done by sending a redirect
message to the browser -- and the request parameters will be
lost. cocoon: protocoll might solve this (cocoon:/process-{1}.xsp,
don't know off head if this keeps parameter) or a redirect to a
ressource does (sure on this).

 /map:act
   /map:match
 
 Is there a wildcard for the validate parameter values ?

No. But it would be nice to have one, since this way it could be used
to validate input for the database add action when multiple rows are
to be inserted. A patch would be welcome :-)

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]




Re: programatically examine columns in a row

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 06:43 PM, Chris Newland wrote:
 Hi All,
 
 I'm looking for a generic way to examine the columns in a row retrieved using esql:
 
 esql:results
   xsp:logic
   int cols = esql:get-column-count/;
   String colname;
   /xsp:logic
   
   esql:row-results
   xsp:logic
   for (int i = 0; i lt; cols; i++)
   {

try
colname = esql:get-column-nameesql:param 
name=columnxsp:expri/xsp:expr/esql:param/esql:get-column-name;
 ^^
   ^^
xsp:attribute does not work as you'd expect -- it is needed to
construct XML tags dynamically that are outputted to the
transformation process. Here you'd need to construct different Java
code. Most included taglibs follow this convention to use
prefix:param tag for this.

   }
   /xsp:logic
   /esql:row-results
 /esql:results
 
 but this throws an exception: No method matching getColumnName() found in interface 
java.sql.ResultSetMetaData. (i.e. the column attribute is not being picked up)
 
 Is it possible to add attributes to a logicsheet tag? I don't think it is but I 
can't think of another way of passing the parameter to the get-column-name tag.
 
 Is this possible?

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]




Re: DTMDOMException + HTML Tables

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 09:05 PM, Aurelien wrote:
 Hi,
 
 Sorry, this is obviously a beginner's problem trying to fiddle with 
 Xalan:
 
 I have this long list of xml nodes that I have to format into an HTML 
 table. BTW, there *must* be some standard way to do this. However, I 
 tried to implement a java static method in a helper class, taking a 
 NodeList as parameter, with the following signature:
 
 public static String getTable (org.w3c.dom.NodeList nodelist );
 
 The xsl code is:
 
 xsl:value-of 
 select=java:be.fractals.soccer.servlet.TableFormatter.getTable(.)/
 
 
 But all I get is:
 
 org.apache.xml.dtm.DTMDOMException: java.lang.RuntimeException: 

Xalan is in progress of switching its internal structures from DOM to
DTM. The version currently shipped with Cocoon is broken in some
respects regarding extension functions. This might very well be the
case here, too. Please try a different version (e.g. D8) and report
this to xalan-dev mailing list.

BTW you might be able to use xsl:for-each to build your table.

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]




Re: No method matching in inner class

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 10:16 PM, cib wrote:
 Thanks to Luis Gois for correcting the first part.
 it now says:
 No method matching main() found in inner class
 org.apache.cocoon.www.pages.make1_xsp. make_xsl.
 (I really don't know why there is a space between make1_xsp. and  make_xsl.
 Is it normal?)
 

 class make_xsl {
   public void main(String[] args) throws IOException {

 anObject.main();

The signature does not match.

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]




Re: No method matching in inner class

2001-09-19 Thread Christian Haul

On 19.Sep.2001 -- 10:09 AM, cib wrote:
 Thanks for answering,
 unfortunately signature does not match sounds like a riddle to me.

Sorry cib, I thought it was obvious after I pulled the lines
together. You declare a method main(String[] args) and call main()
without arguments which is a totally different method, hence no
matching method found. Remove the argument from your method
declaration and try again. You seem not to use it anyway.

BTW I always though that main is used only as an entry point for
when no other method could be specified. Often it just invokes the
constructor which does the real work. Therefore you don't really need
main(String[]). Just call class methods or put the logic into a
constructor. 

 I'm trying to output an xsl and save it to the disk. As nobody knows how to
 do that I'm making a patchwork code of java bits I find anywhere: java
 classes are far beyond my capabilities: I'm only a postman.
 Thanks anyway.

I don't know if this works, but have you tried to use the cocoon:
protocol as source for a transformer? You might be able to obtain the
xsl through that.

map:match pattern=genxsl
   map:generate type=serverpages src=generateXSL.xsp/
/map:match

map:match pattern=foo
   map:generate ../
   map:transform src=cocoon:/genxsl/
/map:match

I haven't worked with this before but I understand that this should be
a valid application for it.

This way you XSL is not saved but I presume that the original
intention was to use it in a transformation with cocoon.


  On 17.Sep.2001 -- 10:16 PM, cib wrote:
   Thanks to Luis Gois for correcting the first part.
   it now says:
   No method matching main() found in inner class
   org.apache.cocoon.www.pages.make1_xsp. make_xsl.
   (I really don't know why there is a space between make1_xsp. and
 make_xsl.
   Is it normal?)
  
 
   class make_xsl {
 public void main(String[] args) throws IOException {
 
   anObject.main();
 
  The signature does not match.

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]




Re: abstract class

2001-09-22 Thread Christian Haul

Cib,

I'd really appreciate it if you'd care to read me responses and don't
post the same question over and over.

If you change your code the code as indicated it compiles OK.

On 22.Sep.2001 -- 04:42 AM, cib wrote:
 ?xml version=1.0 encoding=ISO-8859-1?
 
 xsp:page
   language=java
   xmlns:xsp=http://apache.org/xsp;
   xmlns:esql=http://apache.org/cocoon/SQL/v2;
 
 xsp:structure
   xsp:includejava.io.*/xsp:include
 /xsp:structure
 
 xsp:logic
 class make_xsl {
  public void main() throws IOException {
// before:public void main(String[]) throws IOException {

  FileReader entree = new
 FileReader((http//:localhost/cocoon/test/make.xsl));
   FileWriter sortie = new FileWriter(output.txt);
  int c;
  while ( (c = entree.read()) != -1 )
 sortie.write(c);
 sortie.close();
 entree.close();
  }
 }
 /xsp:logic
 
   page
 
 xsp:logic
 make_xsl anObject = new make_xsl();
 anObject.main();
 /xsp:logic
 
 
 If you see this, it works.
 
   /page
 /xsp:page

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]




Re: Actions in Sitemap

2001-10-01 Thread Christian Haul

On 01.Oct.2001 -- 04:17 PM, Henrik Hofmann wrote:
 Hi,
  
 I have a question to Actions.
 I’ve put an Action LogOnAction to the Sitemap. It works, but the problem
 is that he always performs the action. Wheter I append
 cocoon-action=logon or not.

 map:act type=logOn action=logOn

What you're refering to holds true for action sets. So if you'd put
multiple actions in a set, only those with a matchin action tag would
be triggered.

Here, however, you use a simple action. These are executed regardless
of any parameter.

The lower part will only be executed if your action fails or after the
statements within are completed (wich doesn't occur since these
terminate the pipeline).

So you might want to remove the statements within the action since
they are identical to the ones below it. But the action would still be
triggered for every request.

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]




Re: esql logicsheet get-column-name column=?

2001-11-19 Thread Christian Haul

On 07.Nov.2001 -- 07:56 AM, Roger I Martin PhD wrote:
 Apparently esql:get-column-name takes only column names and string representation of 
column indexes; no variables.  The generated java code shows either

 although it looks like it should be feasible.  Is there a way?
 
   Also I want to supply an index variable like
 
   xsp:logic
   for(int _esql_i=1;_esql_ilt;=esql:get-column-count/;_esql_i++)
   {
 /xsp:logic
   th
 xsp:logic
   esql:get-column-name column=_esql_i/
 /xsp:logic
   /th
 xsp:logic
   }
   /xsp:logic
 
   How?

You might have found out by now, if not, you'd need to 

 esql:get-column-nameesql:param 
name=columnxsp:expr_esql_i/xsp:expr/esql:param/esql:get-column

Sorry, for such a late response.

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]




Re: Look-and-feel approach with views

2001-11-27 Thread Christian Haul

On 26.Nov.2001 -- 06:20 PM, Alexander Smirnoff wrote:
 OK. Then how could I implement dynamically look-and-feel based on user
 credentials (customer-id, user_id) ? I see only one possible way: inserting
 action for each XSL transformation in each pipeline... That approach makes
 sitemap look even more ugly...

It depends a bit on how complex the differences for each user are. You
might get away with 

 map:transform src=resource:/styles/look+feel/{user_credentials}/

in every subpipeline. Or, if there are many subpipelines, you could
create a resource that does the styling (and serializing) and

 map:redirect-to resource=look+feel/

or, for more complex stylings even

 map:redirect-to resource=look+feel/{user_credentials}/

in every pipeline where it's applicable.

In addition, you could use selectors to chose between different
look+feels based on some user parameter.

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]




Re: LF: passing parameters to resource

2001-11-28 Thread Christian Haul

On 27.Nov.2001 -- 03:41 PM, Alexander Smirnoff wrote:
 Thanks Cris,
 
 Again you saved me, man. Thanks.

You're welcome :-)

 Approach with map:parameter name=target value=welcome/ generates code
 in wrong place, which cause compilation error of sitemap. So I guess it
 could be treated as a BUG.

I tend to disagree here. There's no language element that allows
setting of sitemap parameters er, variables. They are usually the
result of sitemap components execution. More in particular, from those
components that are used to determine the actual pipeline from the
given fragments (matchers, actions; selectors return only true /
false).

map:parameter/ is used to do runtime configuration of those
components. map:redirect-to/ is no component but a control
statement and thus doesn't take runtime configuration.

I agree, though, that @target is probably not as clean as possible. A
better solution would be, to introduce some construct to set those
variables without the need of an action, like

  map:variables
 map:parameter name=foo value=xyz/
 map:parameter name=bar value=uvw/
  /map:variables
  
that is translated by the following in sitemap.xsl (not tested!):

xsl:template match=map:variables
   Map map = new HashMap(xsl:value-of select=count(map:parameter)/);
   !-- actually, here we could as well use for-each since only
map:parameter would be allowed here. OTOH a common advice is
not to use for-each for performance reasons. See below for
alternative solution.
   --
   xsl:apply-templates/
   listOfMaps.add(map);
   this.dumpParameters();
/xsl:template

xsl:template match=map:variables/map:parameter priority=2
   map.put(xsl:value-of select=@name/, substitute(listOfMaps, xsl:value-of 
select=@value/));
/xsl:template


Or

xsl:template match=map:variables
   Map map = new HashMap(xsl:value-of select=count(map:parameter)/);
   xsl:for-each select=map:parameter
  map.put(xsl:value-of select=@name/, substitute(listOfMaps, xsl:value-of 
select=@value/));
   /xsl:for-each
   listOfMaps.add(map);
   this.dumpParameters();
/xsl:template


Team, shall we have a vote on this?

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]




Re: Redirect after Generation/Transformation

2001-11-30 Thread Christian Haul

On 29.Nov.2001 -- 06:02 PM, [EMAIL PROTECTED] wrote:
 Hello,
 
 I look for a possibility to redirect the processing of a resource in C2
 after a generator- and a transformer-call to another resource, the
 obvious solutions would be map:redirect-to or map:read at the
 end of the resource.
 I think of something like this:
 
  map:match pattern=**
   map:generate src=statistics.xml/
   map:transform type=statistics/
   map:redirect-to uri=barrier/{1}/
  /map:match
 
 But both alternatives do not work after generator- and transformer-calls.
 Do I oversee something ? Or do I have to implement an action...

Beware: resource != resource

resource = any URI = map:redirect-to uri=/ = not possible after generate

resource = map:resource/ = map:redirect-to resource=/ = possible everywhere 
in pipeline

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]




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

2001-12-04 Thread Christian Haul

On 04.Dec.2001 -- 06:20 PM, Hubert NEOtyk Iwaniuk wrote:
 Hi David,
 
  Your previous question was a little unclear, but I'll try my best to help.
  
  Generally the way I handle logicsheets and XSP is as follows:
  
  1) take an XML file (what you refer to in your message as my server page I would 
say is not a server page; it's just a regular xml file)
  
  2) at compile time (i.e., using Ant and Xalan, not Cocoon) I perform an XSLT 
against that XML file using the logicsheet.  The result is the XSP server page. (what 
you refer to in your message as output is I would say is your server page; this now 
needs to get executed)
 
 I'm no familiar with Ant, can you tell me how to do it (some build.xml i gues?).
 Or how to do it in cocoon, because that is what i was trying to do.
 I wanted to achieve this by using logicsheet, which is an xsl:stylesheet, as
 documented in c2docs. what i should do, i think, is to
   map:match patter=my_xsp.xsp
   map:generate type=file 
src=my_xsl-file-containing-logicsheet-tags.xml/
   map:transform type=xslt src=my-logicsheet.xsl/
   map:serialize type=xml/
   /map:match
 but that is what i thought c2 is doing with logisheet.
 if it's not then please let me know.
 

Wait a minute. stylesheet != taglib
taglib: used when creating .java from XSP. taglibs are aka logicsheets.
stylesheet: used when styling XML

usually, both are implemented in XSLT

you apply your taglib to XML - wrong

right: add your taglib to cocoon.xconf

search this ML for examples. this has been asked many times. see
concepts section in docs. it is all explained in great detail.

To David: yes, you could use your two pipeline setup. but then you
would need to know in which order to apply all taglibs. the official
way is much more comfortable.

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]




Re: Sitemap

2001-12-05 Thread Christian Haul

On 04.Dec.2001 -- 02:50 PM, Carlos wrote:
 I have the sitemap listed below and have the following questions:
 
 
 * Is it possible to refer to a single document and then refer to something
 more specific? For example; Is it valid to use:

?? something is missing ??

 
 * Also, in the second element. Is the map:transform src... / element
 valid?

yes.

 
map:match pattern=welcome
 map:generate src=site/index.xml/
 map:transform src=stylesheets/page-html.xsl/
 map:serialize/
/map:match
 
map:match pattern=welcome/**
 map:generate src=site/{1}.xml/
 map:transform src=stylesheets/page-html.xsl/
 map:serialize/
/map:match
 
 
 * Are the two sitemap expressions below valid? Where would I have to put
 The documents?

When mounting subsitemaps they are given a directory attribute. For
the main sitemap this defaults to the webapps root dir (e.g. when
unpacking cocoon.war this is $CATALINA_BASE/webapps/cocoon)

 * In the two snipets below, what difference does it make if I use ** instead
 of *

** matches across path separators as well while * only matches
path elements e.g. ** matches both (match in curly brackets)
{some/dir/foo}.pdf and {bar}.pdf while * would only match
{bar}.pdf. This _should_ be explained in the javadocs accompanying
the matcher you use or in the userdocs.

If you are using 2.0 or HEAD and have log level at least debug, all
sitemap variables are printed out whenever the environment is modified
by an action or matcher.

map:match pattern=*.pdf
 map:generate src={1}.xml/
 map:transform src=xsl/fo/docbook.xsl/
 map:serialize type=pdf/
/map:match
 
map:match pattern=*.html
 map:generate src={1}.xml/
 map:transform src=/xsl/html/docbook.xsl/
 map:serialize/
/map:match

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]




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

2001-12-05 Thread Christian Haul

On 05.Dec.2001 -- 10:30 AM, Hubert NEOtyk Iwaniuk wrote:
 Hello Chris,
 
 On Wed, Dec 05, 2001 at 12:24:51AM +0100, Christian Haul wrote:
  Wait a minute. stylesheet != taglib
  taglib: used when creating .java from XSP. taglibs are aka logicsheets.
  stylesheet: used when styling XML
  
  usually, both are implemented in XSLT
  
  you apply your taglib to XML - wrong
  
  right: add your taglib to cocoon.xconf
  
 
 That's what i'm trying to do, in my cocoon.xconf i have builtin-logicsheet
 and there i define my logicsheet.

This wasn't clear from your postings. Please attach your
cocoon.xconf. To the contrary, you explicitly apply the mytaglib.xsl
in your pipeline which is wrong for a taglib.

 But what have mentioned my logicsheet is applied, but after it is applied
 no esql logicsheet is applied, but esql namespace isn't lost (i have found
 it by using log transformation).

Actually, you cannot look inside the taglib replacement
procedure. It is done completely inside the generator - no
transformator call help you debug it. The only way I know of is
applying your taglib manually using xalan.

 This is even worse, one time it works as expectedm, other time it
 returns unprocessed esql.

This I don't believe.

 I have send in this thread mail with attachement where is my logicsheet and
 xsp wich use it. If any other file would be helpfull, let me know i'll
 post it.

Indeed, your cocoon.xconf would be helpful.


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]




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

2001-12-05 Thread Christian Haul

On 05.Dec.2001 -- 02:49 PM, Hubert NEOtyk Iwaniuk wrote:
 On Wed, Dec 05, 2001 at 01:34:52PM +0100, Christian Haul wrote:
  On 05.Dec.2001 -- 10:30 AM, Hubert NEOtyk Iwaniuk wrote:

  This wasn't clear from your postings. Please attach your
  cocoon.xconf. To the contrary, you explicitly apply the mytaglib.xsl
  in your pipeline which is wrong for a taglib.
 
 attached file problem.tgz has cocoon.xconf serverpages and logicsheet

OK, from what I have seen there, it should work as expected. At least
I couldn't spot any of the common mistakes like mismatching namespaces
c.

However the file URL to your logicsheet should really be relative to
your webapp. Otherwise the security model might prohibit loading
it. Another thing is, that I had problems with certain versions of
tomcat 4, please consider 4.0.1.

 about hour ago i have posted mail taling that problem is solved.
 indid it was working ok.
 i stoped tomcat, removed directory $TOMCAT_HOME$/work/localhost/cocoon
 started tomcat,
 and it is *NOT* working any more
 no file changes, i think that the coffee i drunk while restarting was
 a cause of this behavior.

That is wierd.

 I'm starting to be realy confused,
 my cocoon2 doesn't like me,
 please tell me how to persudate or force c2 to be a good pet and listen
 to what i'm talking to him,

I haven't found the time to install your logicsheets  and try myself,
but at first sight it looks good (apart from the file URL).

Sorry not to be able to help.

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]




Re: cannot install Cocoon 2 in Redhat linux

2001-12-19 Thread Christian Haul

On 19.Dec.2001 -- 09:54 PM, Jennifer Ho wrote:
 dear sir,
 
 I have downloaded cocoon 2 and try to install in Redhat linux 7 but unsuccessful.  
It causes by segmentation fault when compiling using ant when i run the script 
build.sh.

There exists a known problem with java and glibc2.2. Search
java.sun.com for segmentation fault glibc ulimit. Basically, a
ulimit -s 2048 might fix it. But this is only wild guessing. If you
could be more specific...

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]




Re: Cocoon ESQL stored procedures

2001-12-19 Thread Christian Haul

On 19.Dec.2001 -- 01:46 PM, Durrant, Peter wrote:
 Can ESQL handle calls to stored procedures?

AFAIK CallableStatements are currently not supported by ESQL.

 We have a java application that calls an Oracle stored procedure called
 get_titles with one parameter (104) in the following way:

   CallableStatement s = connection.prepareCall(query);

However, you might get away to execute procedure with a Statement or
PreparedStatement (you'd get a prepared statement if you use
esql:parameter) but that depends on your jdbc driver.

 This message may contain privileged and/or confidential information.  If you
 have received this e-mail in error or are not the intended recipient, you
 may not use, copy, disseminate, or distribute it; do not open any
 attachments, delete it immediately from your system and notify the sender by
 e-mail promptly that you have done so.  Thank You.

Hey, this is a public mailing list!

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]




Re: from session-attribute to xsl-variable

2002-01-14 Thread Christian Haul

On 13.Jan.2002 -- 09:11 PM, Uwe Stelzer wrote:
 Hello Cocoon fellows,
 
 How can I only copy the content of a session attribute to a xsl variable in my 
xsl-logicsheet?
 
 I have tried this here, but I only get an empty string in $usertype:
 xsl:variable name=usertypesession:get-attribute 
name=usertype//xsl:variable
 
 If I do a simple
 xsl:variable name=usertypestudent/xsl:variable
 then it works!
 
 If I put session:get-attribute name=benutzertyp/ elsewhere in my template, it 
works also.
 
 What am I doing wrong?

Mixing up concepts :-) When your logicsheet is executed, no session
attribute exists, even more: no request exists! You need to assign a
real i.e. java variable with session:.../. That would work
well. See cocoon introduction for an explanation of how this works.

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]




Re: A couple of ESQL Q's

2002-01-22 Thread Christian Haul

On 21.Jan.2002 -- 06:45 PM, NUGENT ROBERT (APP3RJN) wrote:
 First, I am trying retrieve an XML fragment stored as a CLOB in Oracle 8i.
 No problem using esql:get-ascii to retrieve the contents of the CLOB.
 Also no problem using esql:get-xml to retrieve an XML fragment stored as
 character data (ie, VARCHAR2 but not a CLOB)... But I am having problems
 using esql:get-xml to retrieve the same data stored as a CLOB... 

 The column theclob is a CLOB containing xml fragment... Seems simple
 enough... what am I missing?

esql:get-xml uses esql:get-string internally which has no support for
clobs. wonder if we could change that...

 Second question:  I am studying ways to generate nested XML from ESQL query
 results... have played with nesting an esql:execute-query (combined with
 esql:parameter and esql:get-string ancestor=1 to generate nested/
 correlated content) within a parent esql:results tag.  This works like a
 charm.  But I was wondering if ESQL supports nested Oracle CURSOR
 expressions... whereby the nested content just appears within the select
 list of the parent query...  
 
   esql:query
   select 'hi' as greeting1,
cursor(select 'there' as greeting2 from dual) as
 cursor1
   from dual
   /esql:query
 
 The above query seems to be handled OK, but at first blush I can't seem to
 get at the nested content... I can retrieve the first item using
 esql:get-string no problem but have tried various ways to manipulate the
 contents of the nested CURSOR, to no avail.  Do I have to somehow name and
 explicitly retrieve the nested resultset separately from the parent
 resultset prior to generating the result tree? 

If this results in the second returned value being a ResultSet you
should wait a little. I'm currently working on SP support for esql and
will try to add a way to use a ResultSet obtained from a query for
further processing. I'm thinking along the lines of 

esql:results from-column=cursor1
   esql:row-results
   [...]
   /esql:row-results
/esql:results 

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]




Re: cocoon userdocs/xsp/esql.html

2002-02-06 Thread Christian Haul

On 05.Feb.2002 -- 11:34 PM, Conrad Wood wrote:
 you refer to a database connection
 'ConnectionName' in the Example and a
 note 'ConnectionName' is defined is
 cocoon.xconf.
 I spent the last day trying to figure out how
 to add this to cocoon.xconf. Can you add a link
 to how to do this on the sample-page?

Conrad, have a close look at the sample cocoon.xconf. There's one
database connection defined as personnel:

  !-- Datasources:
  --
  datasources
jdbc name=personnel logger=core.datasources.personnel
  !--
  If you have an Oracle database, and are using the the
  pool-controller below, you should add the attribute
  oradb and set it to true.

  pool-controller min=5 max=10 oradb=true/

  That way the test to see if the server has disconnected
  the JdbcConnection will function properly.
  --
  pool-controller min=5 max=10/
  !--
  If you need to ensure an autocommit is set to true or
  false, then create the auto-commit element below.

  auto-commitfalse/auto-commit

  The default is true.
  --
  dburljdbc:hsqldb:hsql://localhost:9002/dburl
  usersa/user
  password/password
/jdbc
  /datasources

I believe the semantics of this should be pretty obvious (to someone
familiar with jdbc, but esql doesn't free you from that). To define a
new database connection, add another jdbc/ block.

If for some reason you don't want to use these connection pools, you
may as well specify on your xsp:

 esql:connection  
!--
Pool not used:
 esql:poolpersonnel/esql:pool
--
esql:dburljdbc:hsqldb:hsql://localhost:9002/esql:dburl
esql:usernamesa/esql:username
esql:password/esql:password

 esql:execute-query
   esql:queryxsp:exprthequery/xsp:expr/esql:query
   esql:results
  esql:row-results
   esql:get-columns/
  /esql:row-results
   /esql:results
   esql:error-results
  erroresql:get-message//error
   /esql:error-results
/esql:execute-query
/esql:connection

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]




Re: Escaping in xsp:expr (stupid question)

2002-02-12 Thread Christian Haul

On 12.Feb.2002 -- 04:44 PM, Andre Thenot wrote:
 Hi,
 
 I'd like to know if there is a way to have get data from a 
 helper class into a logicsheet without that data getting escaped.
I looked through xsp.xsl but still haven't been enlightened.

Andre, if I understand correctly you want to produce XML fragments
with your helper class. If that's  correct, you'd want to have a look
at the util logicsheet, esp. util:include-expr/

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]




Re: Cocoon, XForms, ExFormula,, Struts, etc

2002-02-13 Thread Christian Haul

On 12.Feb.2002 -- 11:48 PM, Ivanov, Ivelin wrote:
 Does Cocoon 2 have a mechanism for achieving automatic Form population and
 validation, similar to Struts ?

I don't know Struts, so I can't compare the two. Anyway:
Validation, yes. There's a FormValidatorAction that should be
sufficient for many (far from all!) purposes. Form population, I'd say, is
not really supported. Although there are mechanisms that help a lot.

 I've noticed that in the project archive XForms and ExFormula have been
 discussed on a number of ocasions, but they've been integrated in C2. Am I
 wrong?

Unfortunately, yes, you're wrong. Both projects never took off because
of lack of developer resources. Some ideas have made it in some way or
another into Cocoon, however.

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]




Re: Setting attributes of the esql tags dynamically

2002-02-13 Thread Christian Haul

On 13.Feb.2002 -- 03:43 PM, hugo burm wrote:
 
 How can I set the column attribute of the tags in the esql taglib
 dynamically? xsp:attribute generates an error.
 

 esql:results
esql:row-results
   xsp:logic
   for (ic=1; ic lt;= cnt; ic++)  {
   /xsp:logic
   esql:get-column-name
   esql:param name=columnxsp:expric/xsp:expr/esql:param
   /esql:get-column-name
 
   xsp:logic
  }
   /xsp:logic
/esql:row-results
 /esql:results

xsp:attribute/ adds attributes to tags that create SAX events,
e.g. those used for markup. Adding attribtues to logicsheet tags
requires support from that logicsheet. Most supplied logicsheets use
XXX:param/ for that.

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]




Re: ESQL doc.

2002-02-15 Thread Christian Haul

On 14.Feb.2002 -- 03:36 PM, Olivier Rossel wrote:
 I read the archives of the mailing-list about ESQL and nested queries.
 I read an interesting thing about ancestor in the declaration of inner 
 requests.
 But I can find no documentation at all, about that point.
 
 Anyone has a link?
 Any docs has been updated in addition to the page available at:
 http://xml.apache.org/cocoon/userdocs/xsp/esql.html ?
 
 My problem is to have something like:
 
 query1 select foobar, foo, bar from table1;
 for each foobar:  { 
   query2 select * from table2 where field1=current-value-of foobar;
for each barfoo (selected by the previous query, inside the '*'): {
query3 select * from table3 where field1=current-value-of barfoo;
}
esql:get-columns ancestor=1/
esql:get-columns/
esql:get-columns ancestor=2/
 }
 
 I do not plan to use a single complicated SQL request in order to have a 
 flat XML
 output.

Have a look at the esql docs and look at the grouping example. It
might suit your needs. The ancestor feature is very simple: add the
attribute ancestor with the count of queries to any
esql:get... element. 

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]




Re: I may be confused - can I put Saxon into cocoon, or run Xerces at the command line?

2002-02-17 Thread Christian Haul

On 17.Feb.2002 -- 06:21 AM, Stephen Clarke wrote:
 So I've been thinking, the thing to do is to figure out how to run xerces at
 the command line in order to test my code that way and check error messages.

This is what I do to run xalan (the XSLT processor) from command line (in a script):

C2_HOME=/path/to/xml-cocoon2
export 
CLASSPATH=$CLASSPATH:$C2_HOME/lib/core/xalan-2.2.0.jar:$C2_HOME/lib/core/xerces-1.4.4.jar:$C2_HOME/lib/core/xml-apis.jar
java org.apache.xalan.xslt.Process -IN $1 -XSL $2 $@

putting this into a .bat, replace export with set and $C2_HOME with %C2_HOME%
and all : with ;, set C2_HOME correctly and it should work on Windows.

Well, you get the idea: You need to include the three jars in your classpath
and then you can start Xalan by pointing java to the above class. Use -IN for
your XML, -XSL for your XSL and -OUT if you want the result saved to a file.
There are some debug switches which are quite useful, too:

 -TT trace templates
 -TG trace result element generation
 -TS trace selection events
 -TTC trace template children

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]




Re: Calling MS SQL stored procedure

2002-02-20 Thread Christian Haul

On 20.Feb.2002 -- 10:45 AM, Miller, Grant wrote:
 Hi,
 I'm having a problem calling an ms sql server stored procedure with the sql
 transformer (using cocoon 2.0.1 and tomcat 4).
 The code is:
 
 sql:execute-query
sql:query isstoredprocedure=true name=testformike
   begin dbo.testformike('hi');
   end;
/sql:query
 /sql:execute-query
 
 The error message is:
 
 Invalid call syntax: begin dbo.testformike('hi'); end;

Never used any of the above, but you might want to consider the JDBC
escape syntax

   {?= call procedure-name[arg1,arg2, ...]}
   {call procedure-name[arg1,arg2, ...]}

Maybe that'll make your driver happier

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]




Re: howto make use of default database add, delete, update action for mutilple table at a time

2002-02-23 Thread Christian Haul

On 22.Feb.2002 -- 11:13 PM, Pascal Davoust wrote:
 I read in a post a few days ago (or was it in the archive?) that there were
 some serious limitations with these actions, and that some work is currently
 done to overcome those (something is already available in the scratchpad to
 have a look, I believe).

A word of warning: The way the actions are used (declaration of modes and all 
classnames
will change very shortly. Actually, that work is already done but since I haven't
found the (spare) time to check they still work as expected it's not in the CVS,
yet. Hope to find some time over this weekend though.)

What is better with the new ones:
*) all actions work on arbitrary number of tables
*) all actions may work on arbitrary number of tuples
*) configuration is done in one file, table-sets select
   the tables to work on
*) autoincrement columns work better (currently mysql, hsqldb,
   informix, but it's very easy to support any other as well)
*) values can be obtained from arbitrary sources, source can
   be specified per table-set and column
*) results can be written to arbitrary destinations
*) in- / output helper modules can be used with other components
   like matchers, selectors, actions
   (currently, only one example exists)
*) currently available modules:
   request attributes (in/out), request parameters (in), request header (in)
   session attributes (in/out)
   more to come...

What is worse with the new ones:
*) descriptor file syntax has changed
*) uses additional components - more complex - slower (?)
*) changes are on the way

 Does anybody know if this *serious* limitation could be part of the new,
 future, top-notch database actions?

What limitation are you refering to? Updating multiple tables / rows? Yes, that
should be possible.

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]




Re: get-column-count

2002-02-26 Thread Christian Haul

On 25.Feb.2002 -- 10:58 AM, Joseph Rajkumar wrote:
   Could some one please confirm where
 the esql:get-column-count works as it says
 it should?

It should return the number of columns in a result set.

   I could get esql:get-column-label(number)
 to work, where number is the index of the column,
 but I am unable to get the get-column-count to work.

Joseph,

could you be a bit more especific? How do you use it, what is the result, 
what you were expecting, is there an error message (which?), and what 
does the relevant snippet of the generated java file look like?

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]




Re: Passing a '+' in a request parameter?

2002-02-27 Thread Christian Haul

On 27.Feb.2002 -- 08:36 AM, Derek Hohls wrote:
 Based on what you said below - I am now not completely sure what *is* 
 causing the problem, but I can see there is one...

Derek,
could you please check for me in core.log how your request parameters
are received by cocoon. It should look like

REQUEST: /cocoon/botox/your_page

CONTEXT PATH: /cocoon
SERVLET PATH: /botox/your_page
PATH INFO: null

[... snip ...]

REQUEST PARAMETERS:

PARAM: 'value2' VALUES: '[c d]'
PARAM: 'value1' VALUES: '[a b]'

For ?value1=a+bvalue2=c+d (because, as someone else put it, + is
really a space) or 

PARAM: 'value2' VALUES: '[c+d]'
PARAM: 'value1' VALUES: '[a+b]'

in case the data was entered with a form and thus uses %2B for a real
+. 

If that's *not* the case, what versions are you using? (cocoon,
tomcat, jdk, operating system, browser)

And how do you notice that data is missing? Have you checked on a SQL
shell or through Cocoon? If through Cocoon, how? Perhaps the data is
all there but there's a problem retrieving it? What DBMS are you
using?

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]




Re: Passing a '+' in a request parameter?

2002-02-28 Thread Christian Haul

On 28.Feb.2002 -- 12:38 PM, Derek Hohls wrote:
 I have now changed the key on the table to use an integer, which allows
 me to avoid these problems.

That's good. But actually, I would like to know whether there *is* an
issue with the actions that needs to be fixed. So if you could spare
the time to answer my last mail, others could benefit from it as well.

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]




Re: using MSQL's LAST_INSERT_ID() with DatabaseAddAction

2002-03-01 Thread Christian Haul

On 01.Mar.2002 -- 03:34 PM, Giuseppe Di Pierri wrote:
 Hi there,
 
 I have a problem using the DatabaseAddAction in MySQL.
 
 I would do two table insertions, one after an other like the following
 example:

The value is written to a request attribute (table.column) that you
can use if you were using the manual method of determining the id
(looks up current max value +1).

I was about to check in new database actions to scratchpad (atually,
new versions of the ones already there) but since I encountered
problems with datasources with today's CVS I cannot verify that they
still work. Those do understand mysql's autoincrement columns. But
they use a slightly different database.xml syntax *and* their name
and their configuration sitemap-wise will change with my checkin.

If you'd like to stay tuned should be only a matter of days
now.

   INSERT INTO base (id,...) VALUES(NULL,...); 
 # id is defined as INT NOT NULL AUTO_INCREMENT
 
   INSERT INTO derived (id,) VALUES(LAST_INSERT_ID(),);
 
 employee
   connectionpersonnel/connection
   table name=base
 keys
   key param=id dbcol=id type=int mode=manual/
 /keys
 values
   value param=myparam dbcol= type=string /
 /values
   /table
   table name=derived
 keys
   !-- how can I use the mysql LAST_INSERT_ID() here,
in order to insert the previous inserted auto_increment value
   key param=id dbcol=id type=int/
 ?--
key param=base.id dbcol=id type=int/
 /keys
 values
   value param=... dbcol=... type=string /
 /values
   /table
 /employee

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]




Re: Urgent: Execution of pipeline at startup

2002-03-02 Thread Christian Haul

On 01.Mar.2002 -- 11:04 PM, Chitharanjan Das wrote:
 Hello,
   I had raised this issue earlier...
 Please confirm if this is possible at all.
 
 I need to cache some data structures and some schema elements.
 
 Is there a way to execute a pipeline or any other possibilities to cache
 the information at COCOON'S startup.
 
 Currently, I am performing this caching at first access.
 
 I would surely like to cache the information at startup, rather than at
 first access...

I know of two possibilities: use the -precompile target when building your
war or use a spider after startup so that all pages are generated then.

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]




Re: [HELP] Cocoon 2.0 - Oracle DB connection problems...

2002-03-02 Thread Christian Haul

On 01.Mar.2002 -- 07:37 PM, CHERVIRALA Srinivas / FTRD / US wrote:
 
 Hi.
 
 I am facing problem in accessing the Oracle DB.
 
 My Environment:
 
 -
 Win NT 4.0 Client
 Apache Tomcat 4.0.2 (Standalone)

There has been problems reported running Cocoon on top of Tomcat 4.0.2
Try 4.0.1 instead.

If that doesn't help, find the portion in core.log (or any other log) that
shows the initialization of your connection pool and post it here. Search
for org.apache.avalon.excalibur.datasource or the name of your driver class.

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]




Re: [C2] esql:group, esql:member

2002-03-05 Thread Christian Haul

On 05.Mar.2002 -- 09:40 PM, Christian Joelly wrote:
 Hello!
 
 has anybody sucessfully used esql:group/esql:member in C2?
 
 i looked at the esql.xsl and the group and member templates are not in
 that taglib. maybe they are not implemented?

Perhaps you looked at the wrong version? It should be contained in Cocoon
2.0.1 and above. It certainly is contained in HEAD.

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]




Re: [HELP] Cocoon 2.0 - Oracle DB connection problems...

2002-03-06 Thread Christian Haul

Srinivas,

On 05.Mar.2002 -- 09:50 PM, CHERVIRALA Srinivas / FTRD / US wrote:
 
 I tried with Tomcat 4.01 with out any success.
 
 My error.log file contains the following:
 
 FATAL_E (2002-03-05) 21:10.56:416   [core] (Unknown-URI) 
Unknown-thread/LogKitLogger: Excalibur could not create any connections. Examine your 
settings to make sure they are correct.  Make sure you can connect with the same 
settings on your machine.
 ERROR   (2002-03-05) 21:13.11:932   [sitemap.generator.velocity] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/VelocityGenerator: ResourceManager : unable to find resource 
'VM_global_library.vm' in any resource loader.
 ERROR   (2002-03-05) 21:13.12:760   [sitemap.generator.velocity] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/VelocityGenerator: ResourceManager : unable to find resource 
'VM_global_library.vm' in any resource loader.
 ERROR   (2002-03-05) 21:13.13:385   [sitemap.generator.xmldb] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/XMLDBGenerator: There was a problem setting up the connection
 ERROR   (2002-03-05) 21:13.13:385   [sitemap.generator.xmldb] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/XMLDBGenerator: Make sure that your driver is available
 ERROR   (2002-03-05) 21:13.13:385   [sitemap.generator.xmldb] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/XMLDBGenerator: There was a problem setting up the connection 
 ERROR   (2002-03-05) 21:13.13:385   [sitemap.generator.xmldb] (/cocoon/xsp/esql1) 
HttpProcessor[8080][4]/XMLDBGenerator: Make sure that your driver is available
 ERROR   (2002-03-05) 21:13.13:401   [sitemap.generator.xmldbcollection] 
(/cocoon/xsp/esql1) HttpProcessor[8080][4]/XMLDBCollectionGenerator: There was a 
problem setting up the connection
 ERROR   (2002-03-05) 21:13.13:401   [sitemap.generator.xmldbcollection] 
(/cocoon/xsp/esql1) HttpProcessor[8080][4]/XMLDBCollectionGenerator: Make sure that 
your driver is available
 ERROR   (2002-03-05) 21:13.13:416   [sitemap.generator.xmldbcollection] 
(/cocoon/xsp/esql1) HttpProcessor[8080][4]/XMLDBCollectionGenerator: There was a 
problem setting up the connection
 ERROR   (2002-03-05) 21:13.13:416   [sitemap.generator.xmldbcollection] 
(/cocoon/xsp/esql1) HttpProcessor[8080][4]/XMLDBCollectionGenerator: Make sure that 
your driver is available
 ERROR   (2002-03-05) 21:13.49:573   [sitemap.generator.serverpages] 
(/cocoon/xsp/esql1) HttpProcessor[8080][4]/esql1_xsp: Could not get the datasource 
org.apache.avalon.excalibur.datasource.NoAvailableConnectionException: There are no 
connections in the pool, check your settings.

could you please look up the same portion in core.log? It is usually a
bit informative. 

 I would like to know whether I need to change any settings in any files
 other than the following:
 
 1) web.xml -- added Oracle JDBC driver in load-class section

OK

 2) cocoon.xconf -- added datasource

OK

 3) Copied classes12.jar to cocoon\web-inf\lib

OK (no idea about Oracle, though. Doesn't look like an Oracle driver
   to me)

 4) sitemap.xmap -- map:parameter name=use-connection
 value=MyOrclConn/

OK

 5) esql1.xsp --
 esql:connection
  esql:poolMyOrclConn/esql:pool
  esql:execute-query
esql:queryselect * from test/esql:query
esql:results
  esql:row-results
paraesql:get-string column=name//para
esql:get-columns/
  /esql:row-results
/esql:results
  /esql:execute-query
/esql:connection

OK

 When I tried to run the XSP file I got the following error:
 The org.apache.cocoon.www.sitemap_xmap notifies that
 org.apache.cocoon.ProcessingException says:
 
 Exception in ServerPagesGenerator.generate() 
 
 More precisely:
 
 org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): 
java.lang.RuntimeException: Could not get the datasource 
org.apache.avalon.excalibur.datasource.NoAvailableConnectionException: There are no 
connections in the pool, check your settings. 

Setting up the pool went wrong -- there's really no point in trying
the esql without the pool being established. You could try to connect
on your xsp using esql:driver/ esql:user/ esql:password/
esql:dburl/ (off my head, check exact element names) -- but I would
expect that to fail as well.

Which version of Cocoon are you using? If source distributions, how
did you build it (I have some problem with datasources, scratchpad and
current CVS but your logs don't show the relevant bits so I can't say
if it's related.)

 6) Finally I overwrote the esql.xsp with my esql1.xsp and accessed the
 esql.xsp, the output that I got is related to the earlier esql.xsp (which is
 sample xsp page). I stopped the tomcat and restarted ..no change in output.
 Isn't this crazy.

No surprise here. If it's the connection a correct XSP wouldn't change
the error.

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


Re: howto validate user input field via database data?

2002-03-07 Thread Christian Haul

On 07.Mar.2002 -- 03:35 PM, marco wrote:
 I have a program to let user add records to a table of country and the
 user has to input a new code for a new country. I have to check the
 existenance of the new user input code in the database table, before saving
 inserting the new record.
 
 What can I do?

If there is a uniqueness constraint (unique or primary key) for that
column, you could just try to insert it and display an error page if
the insert operation fails. Remember that actions can be used to
switch process flow within a pipeline.

Otherwise you would need to look up the value (esql or
DatabaseSelectAction) and act accordingly either on your XSP or
propagate the read value to the sitemap and use a selector or write
your own action that does this.

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]




Re: [C2.0.1] esql:group/eqsl:member

2002-03-08 Thread Christian Haul

On 07.Mar.2002 -- 09:08 AM, Christian Joelly wrote:
 Hi!
 
 i have a *strange* problem with esql:group/esql:member:
 
 when i add esql:group/esql:member to my xsp page then the loop fetching
 the results from the resultset changes to an endless loop, till i get an
 java.lang.OutOfMemoryError.

Have started to look at the code. Just one thought: Do you have enough
connections in your pool to do such deep nesting?

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]




Re: XML Stored in a Database

2002-03-15 Thread Christian Haul

On 15.Mar.2002 -- 06:51 PM, Alan Tibbetts wrote:
 Hi
 
 I've trawled the archives and samples, but can't see the answer to this one.

Alan, you haven't done a good job. This is a FAQ. Please look at the util
logicsheet. It allows you to include anything as XML.

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]




Re: logicsheets driving me insane

2002-03-21 Thread Christian Haul

On 21.Mar.2002 -- 08:26 AM, Peter Wieland wrote:

 * Even when using enclosing braces around the xsp:logic section, there's
 always the risk that the page author (or another logicsheet!) has previously
 defined variables called myConnection, previousConnection or mySession. This
 will result in multiply-defined variable compilation errors
 
 What do I have to take care about to bypass problems like that?

This is a big problem. But you can work around it by using specific
prefixes to your vars. Best is to avoid vars in your logicsheet. Use
one or two global vars as reference to some complex structures like
beans and set their properties. Once properties are set, call your
beans methods.

 What's a little strange is that I get the fine result to generate the select
 command but it doesn't work for the get-string calls.

Try to nest esql:param name=columnxsp:exprcolumn_number/xsp:expr/esql:param 
elements in your esql:get-string tags. Should suffice.
Or, if column is determined statically be logicsheet, you need
xsl:attribute name=columnxsl:value-of select=$column/xsl:attribute 
Mind you, perhaps you need to copy-of instead of value-of.

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]




Re: sessionstate matcher usage: What's wrong?

2002-03-21 Thread Christian Haul

On 21.Mar.2002 -- 12:07 PM, KOZLOV Roman wrote:
 processed, so that writeDOMsession is called always. Could you please
 point to errors?
 
map:match pattern=get_lub
map:match type=sessionstate pattern=**
map:parameter name=attribute-name value=designations/
map:transform type=readDOMsession
map:parameter name=dom-name value=designations/
map:parameter name=trigger-element value=//
map:parameter name=position value=in/
/map:transform
map:serialize type=xml/
/map:match
 
map:generate
 src=xmldb:xindice://localhost:4080/db/data/somecollection/#//Some_Element/
 
map:transform src=stylesheets/render_query.xsl/
map:transform type=writeDOMsession
map:parameter name=dom-name value=designations/
map:parameter name=dom-root-element value=dom/
/map:transform
map:serialize type=xml/
/map:match

Roman,
you seem to be missing a map:generate/ in the upper
pipeline. Anyway, could you check with core.log (?) that your session
actually contains an attribute called designations?

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]




Re: sessionstate matcher usage: What's wrong?

2002-03-21 Thread Christian Haul

On 21.Mar.2002 -- 05:18 PM, KOZLOV Roman wrote:
 Hello Christian,
 
 Thank you very much for response. I've not found any designations substring in
 core.log. For the moment I've divided the match on two matches - one for read and

I /think/ core.log dumps all about the known state for a request like
request parameters, request attributes, session attributes. If it's
not there, you can't match it. It might be one of the other logs,
though (access.log or sitemap.log).

  map:generate
 src=xmldb:xindice://localhost:4080/db/data/somecollection/#//Some_Element/
  map:transform src=stylesheets/render_query.xsl/
  map:transform type=writeDOMsession
  map:parameter name=dom-name value=designations/
  map:parameter name=dom-root-element value=dom/
  /map:transform

I'm sorry, I don't know enough about xmldb and writeDOMsession to be
of any help. :-|

I'd be happy to help with the matcher problem, though.

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]




Re: ESQL - mixed case in column names spits attribute lowercase -col umn-name not found on SELECT

2002-03-21 Thread Christian Haul

On 21.Mar.2002 -- 11:25 AM, von Schwerdtner, Thomas (GXS, FPI) wrote:
 Could this be a namespace problem if I'm using relatively generic tags of my
 own design (such as table and column)?

doubt it. is a SQLException, so the correct code is executed. to be
sure, verify with the generated java code.

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]




Re: Simple ESQL question: specifying dynamic column name in esql:get -string column=foo/

2002-03-21 Thread Christian Haul

On 21.Mar.2002 -- 02:19 PM, von Schwerdtner, Thomas (GXS, FPI) wrote:
 Hey folks,
 
   I've been digging through the archives and docs and I cant find an answer
 to this (at least not one I can decipher).

Please have a look my reply to dated 2002-03-21 
Re: logicsheets driving me insane

I've explained it there. Should be in the docs as well.

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]




Re: Where is META tag coming from?

2002-03-22 Thread Christian Haul

On 22.Mar.2002 -- 03:19 PM, Derek Hohls wrote:
 I've tried the (''+'head') without success... sorry.
 
 I've also tried including the function in a separate file, but with
 the same lack of result  - at the end, I think, because, its also
 processed by Cocoon - and, even if this did work, its only a
 quick fix because, in some cases, the javascript itself must be
 dynamically changed *in context* 
 
 Any other ideas as to how to disable this activity by Cocoon
 ('good' is, of course, relative...)

Derek, we would need to know how your pipelines look like. I assume
that you have inspected all transformation steps and generation as
well? So, your problem is with the serializer used, right? Have you
tried a different one or a different mime-type?

If nothing helps, I would expect a reader to leave the file as is and
not modify it.

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]




Re: Where is META tag coming from?

2002-03-22 Thread Christian Haul

On 22.Mar.2002 -- 10:26 AM, Derek Hohls wrote:
 No big deal?  But, whatever is doing this, is doing the same thing
 to a javascript snippet that has:
 
 write('html');
 write('head');

On another note: since XML doesn't know about JS strings, what happens
here is 
 ![#PCDATA[write(']]html![#PCDATA['); write('
and so on. But you want
 ![#PCDATA[write('lt;htmlgt;'); write('
IOW you don't want to create nodes but text.

Thus you should replace  with lt; and  with gt; in all
your strings or java code.

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]




Re: Session attribute - database

2002-04-02 Thread Christian Haul

On 28.Mar.2002 -- 10:22 AM, Alexander Kruth wrote:
 Hi!
 Is it possible to write a session-attribute to a database?

IMHO no, not using the database actions from main trunk. Database
actions in scratchpad support arbitrary sources.

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]




Re: xsp and esql

2002-04-04 Thread Christian Haul

On 04.Apr.2002 -- 11:33 AM, Bert Van Kets wrote:
 I've got the name of a column in a String variable and would like to use 
 the value contained in that column in my output.  How can I request that 
 value?  I need to nest an xsp:expr tag inside an esql:get-string tag.  Is 
 this possible?

No it is not. Since at compile time it needs to be know whether the
column is referenced by name or by number, only by number is
supported.

The syntax is a bit different as well:

   esql:row-results
 xsp:logic
   valueesql:get-string
 esql:param 
name=columnxsp:exprintSelectBoundColumnNo/xsp:expr/esql:param
 /esql:get-string/value
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]




Re: xsql

2002-04-04 Thread Christian Haul

On 04.Apr.2002 -- 08:25 PM, sushil Bhattarai wrote:
 Hi All,
 
 Does Cocoon2 support XSQL? I'm trying to find taglib for XSQL and have no 
 idea how to go about it. How can I use XSQL in Cocoon? Any suggestion?

Cocoon has four different packages that deal with relational database access.
1) ESQL taglib to embed SQL in XSPs
2) SQLTransformer to embed SQL in any page
3) actions that add, update, delete and read from a database
4) BlobSource (?) reads one column from a table

In addition there is a generator that accesses XMLDB.

You'll find more information on these three in the documentation
accompanying your Cocoon distribution.

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]




Re: Putting the esql:get-ascii inside CDATA block

2002-04-04 Thread Christian Haul

On 04.Apr.2002 -- 12:06 PM, Steven Sedlmeyer wrote:
 I'm trying to place the results of an esql:get-ascii column=foo/ tag
 into a cdata
 block.  I've been able to get close, with the  ending up in the text node
 as lt;
 and gt; but I can't get them inserted as an actual CDATA block.  Is there
 some simple
 solution I've missed or baring that, a hard one...?

I presume that you want the data inside the CDATA block for the sake
of the client? Since printing out the data would create a text node
for the internal processing and wouldn't be touched by Cocoon at all.

I think it should be possible to print the CDATA instruction
(lt;![CDATA[) and the ending instruction (]]gt;).

 1.  
 body_text
 ![CDATA[esql:get-ascii column=foo/]]
 /body_text

Effectively escapes the esql-tag from being replaced by the required
java code.

 2.
 
 xsp:logic
   ![CDATA[String cdOpen = ![CDATA[;  ]]
   String cdClose = ]]gt;
 /xsp:logic
 
 body_text
 xsp:exprcdOpen/xsp:expresql:get-ascii
 column=foo/xsp:exprcdClose/xsp:expr
 /body_text
 
 //with various combinations of CDATA blocks and escaped characters in the
 //xsp:logic/ block 

Mmmh, that _should_ work. Could you please provide us with the java
code produced by this? You'll find it in the work directory of your
servlet engine (e.g. $CATALINA_HOME/work/localhost/cocoon/)

 3.  
   xsp:logic
   ![CDATA[
   StringBuffer bodyText= new StringBuffer();
   bodyText.append(body_text![CDATA[);
   ]]
   bodyText.append(esql:get-ascii column=foo/);
   ![CDATA[
   bodyText.append(]]);
   bodyText.append(/body_text);
   ]]
   /xsp:logic
   xsp:expr disable-output-escaping=yes
 bodyText.toString()/xsp:expr
 
 // Same results except that the surrounding body_text node is now also
 escaped and
 // appears as part of the text node

Wait -- that sounds like a correct result. What are you trying to
achieve exactly?

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]




Re: databaseaddaction...help me....

2002-04-05 Thread Christian Haul

On 05.Apr.2002 -- 09:26 AM, Rolfe Jenny wrote:
 HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 2 named
 key:page:pageid with value null

From this we can conclude that the value is not found. OK, the issue
is a bit complicated here. And you coudn't have known unless
inspecting the source (which I did just now):

If you happen to insert a key column like Guiseppe did, you can use
   key param=key:base:id dbcol=id type=int mode=request-attribute/
Where the important part is the mode attribute.

If you want to insert into a value column, however, this is not
supported. Instead, you need to provide the complete request attribute
name which is prefixed with org.apache.cocoon.acting.AbstractDatabaseAction: 
thus it would be in your case 
org.apache.cocoon.acting.AbstractDatabaseAction:key:page:pageid

The action will first try to find a request parameter with that name
and then try a request attribute of that name.

 connectionxcpt/connection
   table name=page
keys
  key param=pageid dbcol=pageid type=int mode=manual /
/keys
 values

   value param=layoutnum dbcol=layoutnum type=string/
   ...more values...
 /values
   /table

   table name=boalinks
 values
value param=org.apache.cocoon.acting.AbstractDatabaseAction:key:page:pageid 
dbcol=childpageid type=int /
!--
If it were a key column:
key param=key:page:pageid dbcol=childpageid type=int 
mode=request-attribute/
--
   ...more values...
/values
   /table

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]




Re: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Christian Haul

On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
 Hi help on this problem would be much appreciated since I have been stuck
 with it for a few days of coding.
 I have a logicsheet that runs mysql statments and returns values from the
 database.
 
 In my logic (in the file using the logic sheet) I have the statment that
 trys to assign a value from the database. I have tested my logicsheet on its
 own and it works fine, however Cocoon returns the error below when I try to
 assign the value to a java variable. can anyone help?
 
 thanks
 
 Sharat Koya
 
 Calling code
 mercurySun = eclipse-data:get-planet-data data=sundist name=Mercury/;
 --
 Error:
 org.apache.cocoon.ProcessingException: Language Exception:
 org.apache.cocoon.components.language.LanguageException: Error compiling
 register_xsp:
 Line 1652, column 4:  illegal start of expression
 Line 0, column 0:
 1 error
 --
 This is the segment of code where the error occurs:
 
 line 1652:
   mercurySun =
 if (_esql_connection != null)
  {_esql_connections.push(_esql_connection);
 
  }
 _esql_connection = new EsqlConnectionCocoon2();
try {
 try {
 _esql_connection.datasource = (DataSourceComponent)
 _esql_selector.select(String.valueOf(  + (database) ));
 _esql_connection.connection =
 _esql_connection.datasource.getConnection();
   } catch (Exception _esql_exception_N10170) {
 getLogger().error(Could not get the
 datasource,_esql_exception_N10170);
 throw new RuntimeException(Could not get the datasource
 +_esql_exception_N10170);
   }
 

Sharat,
your logicsheet seems to expand eclipse-data:get-planet-data/ to more that 
a simple esql:get-XXX/. You should create a tag that does all the connection
setup and nest the eclips-data:get-planet-data/ inside.

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]




Re: C2.0.1 - esql stored proc problem

2002-04-06 Thread Christian Haul

On 05.Apr.2002 -- 05:57 PM, Argyn Kuketayev wrote:
 I have two nested queries and one nested stored procedure call. I couldn't
 get resluts from the stored procedure. Cocoon says: 
 org.apache.cocoon.ProcessingException: Exception in
 ServerPagesGenerator.generate(): java.lang.ClassCastException:
 oracle.jdbc.driver.OraclePreparedStatement 
 
 here's a fragment of XSP. 
 
   esql:execute-query
 esql:query
   select ...
 /esql:query
 
  esql:results
rowset name=quals
 
  esql:row-results
row
  esql:get-columns/
 
esql:execute-query 
  esql:call needs-query=true 
   {call PKG_STUDENT.STUD_QUAL_STATUS(
   esql:parameter direction=in type=stringesql:get-string
 ancestor=2 column=ID//esql:parameter,
   esql:parameter direction=in type=stringesql:get-string
 ancestor=1 column=qual_id//esql:parameter,
   esql:parameter direction=out type=String/,
   esql:parameter direction=out type=date/,
   esql:parameter direction=out type=Int/)}
  /esql:call
  esql:call-results
esql:results
 esql:resultxsp:expr(ResultSet)esql:get-object
 column=2 from-call=true //xsp:expr/esql:result
 esql:row-results
   statusesql:get-string column=3//status
   remdaysesql:get-int column=5//remdays
 /esql:row-results
/esql:results
  /esql:call-results
/esql:execute-query 
 
 
 
/row
  /esql:row-results
/rowset
/esql:results
  /esql:execute-query
 
 I couldn't get what's wrong.
 
 Thanks
 Argyn
 
 stack trace:
 =
 Original exception : java.lang.ClassCastException:
 oracle.jdbc.driver.OraclePreparedStatement 
 at
 org.apache.cocoon.components.language.markup.xsp.EsqlQuery.getCallableStatem
 ent(EsqlQuery.java:194) 
 at
 org.apache.cocoon.www.docs.samples.xsp.studentdata_xsp.generate(C:\JBoss-2.4
 .1_Tomcat-3.2.3\tomcat\work\localhost_8080%2Fargyn\cocoon-files\org/apache/c
 ocoon/www/docs/samples/xsp\studentdata_xsp.java:820) 

Could you please get me the source of the above file (sutdentdata_xsp.java) ?

For some reason ESQL does not obtain a CallableStatement. The java and the xsp
would help to debug that.

TIA

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]




Re: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Christian Haul

On 06.Apr.2002 -- 07:04 PM, Sharat Koya wrote:
 - Original Message -
 From: Christian Haul [EMAIL PROTECTED]
 
  On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
   mercurySun = eclipse-data:get-planet-data data=sundist
 name=Mercury/;
   --
 mercurySun =
   if (_esql_connection != null)
{_esql_connections.push(_esql_connection);
  
}
   _esql_connection = new EsqlConnectionCocoon2();
  try {
   try {
   _esql_connection.datasource = (DataSourceComponent)
   _esql_selector.select(String.valueOf(  + (database) ));
   _esql_connection.connection =
   _esql_connection.datasource.getConnection();
 } catch (Exception _esql_exception_N10170) {
   getLogger().error(Could not get the
   datasource,_esql_exception_N10170);
   throw new RuntimeException(Could not get the datasource
   +_esql_exception_N10170);
 }
  
 
  Sharat,
  your logicsheet seems to expand eclipse-data:get-planet-data/ to more
 that
  a simple esql:get-XXX/. You should create a tag that does all the
 connection
  setup and nest the eclips-data:get-planet-data/ inside.
 
 The function eclipse-data:get-planet-data data=sundist name=Mercury/
 expands as follows:
 connect to the database using esql and return the value as a double.

Yep, this translates to the code above. Don't forget that in the end,
*all* logicsheets are translated to java. Somewhere the connection has
to be obtained. Obviously, you can't do that in the middle of an assignment.

 All the function does is return the value from the database without any
 surronding tags.
 
 Since I first posted this message I changed the function so that instead of
 assigning mercurySun (java double variable) as follows:
 mercurySun = eclipse-data:get-planet-data data=sundist name=Mercury/;
 
 I now have:
 eclipse-data:get-planet-data data=sundist name=Mercury
 variable=mercurySun/
 where the function in the logicsheet assigns assigns the value. This works
 fine, I'm still not that advanced in using Cocoon and so cannot workout why
 I can't assign the value in the calling XSP file rather than the logicsheet.

see above.

 If you can it would be aprreciated. It is a bit annoying to do the above but
 it has shortend my code by quite a considerable amount compared to entering
 a multitude of esql commands and logic.

you could

  eclipse-data:connect
 xsp:logic
 mercurySun = eclipse-data:get-planet-data ./;
 .
 /xsp:logic
  /eclipse-data:connect

with eclipse-date:connect/ translating to 
esql:connectesql:execute-queryesql:query...

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]




Re: Putting the esql:get-ascii inside CDATA block

2002-04-06 Thread Christian Haul

On 05.Apr.2002 -- 11:22 AM, Steven Sedlmeyer wrote:
 I'm pulling out a CLOB that may or may not have embeded HTML which may or
 may not be XHTML...  
 
 I then need to pass it on through a couple of stylesheets to format the
 results for a browser.  I'm trying to put the text into a CDATA block so
 that the embeded tags will not get processed by later stylesheets.
 
 My thought to date has been that I need the text data to be inserted into
 the CDATA block without having the  and  chars escaped so that any
 HTML tags arrive at the end of the pipeline intact.  Additionally, in all
 three methods, the  and  of any XML tags I attempt to insert around
 the text (![CDATA[]] and in the last case body_text/ end up also
 escaped and thus treated as text by later stylesheets.

Sorry, but I still don't get what you want to achieve.

If the data is _not_ going to be processed by _cocoon_, you can just
print out the data. It will be contained in a text node and thus is
safe from further processing.

I believe that to the client HTML tags are reported, are they not?

If the data _shall_ be processed by _cocoon_, you'll need to ensure
valid (no: well-formed) XML is in your DB and can use e.g. esql:get-xml/

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]




Re: C2.0.1 - esql stored proc problem

2002-04-08 Thread Christian Haul

On 08.Apr.2002 -- 10:39 AM, Argyn Kuketayev wrote:
  
  For some reason ESQL does not obtain a CallableStatement. The 
  java and the xsp
  would help to debug that.
 
 The source is way too long, sorry.

Then I cannot be of any more help. Consider sending it in private
mail. Just one remark: I believe oracle does not need executeQuery
for SPs - needs-query not needed.

 I NEED HELP. I needa working example. Would appreciate any assistance.

The examples in the docs _are_ working examples.

Without more info I cannot help you.

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]




Re: esql and db-actions error handling

2002-04-12 Thread Christian Haul

On 12.Apr.2002 -- 09:18 AM, Jerzy Kut wrote:
 Hi cocooners!
 I want to handle errors coming from esql selects and actions operate on DB.
 ESQL - I try to do:
 
esql:connection
 esql:poolmypool/esql:pool
 esql:execute-query
  esql:query
   select EMPNO
   from EMP
  /esql:query
  esql:results
   esql:row-results
employee
 id
  valueesql:get-long column=EMPNO//value
 /id
/employee
   /esql:row-results
  /esql:results
  esql:no-results
   employee-lack/
  /esql:no-results
  esql:error-results
   employee-erroresql:get-message//employee-error
  /esql:error-results
 /esql:execute-query
/esql:connection
 
 and? When i make fail in select e.g. type SELCET not SELECT i get
 Cocoon error and cocoon error page! I have same when I define not exist
 DSN in DB connection at cocoon.xconf.
 Maybe anybody knows any howto document or the way what to handle this
 exceptions.
 I don't handle errors in sitemap.xmap (if it has any importance).
 
 And second question: how to handle db error when I would to use
 Database*Action? Is any method to handle this error in sitemap.xmaps
 pipeline ?

IMHO error-results refers to errors returned by the database
system. Any setup error would not be catched and lead to a cocoon
error. As for the SQL syntax error -- errors during execution are not
handled in error-results (why?) but only exceptions that occur while
retrieving the results.

Database*Actions will also cause cocoon errors when connectivity is
broken. Other errors can be handled by nesting sitemap elements inside
your action for the success branch and those for failure after it. The
elements nested will only be considered for your pipeline if the
action signalles success.

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]




Re: esql and db-actions error handling

2002-04-12 Thread Christian Haul

On 12.Apr.2002 -- 10:12 AM, Jerzy Kut wrote:
 If I understand Your explanation it is correct construct that should provide
 handling db errors. So how to handle this?

You're right. Sometimes I forget all the differences between the
original database actions and those in scratchpad

With the ones in scratchpad you could specify if they should throw an
exception or continue. The original actions don't offer this. Would be
easy to do it, though. Might have a go at it next week.

 During working of website it is possible to occur damages with DBServer. How
 to handle this errors? Often it will be connection errors. Or errors
 resulting from transaction fails or constraints violations.

I think connection errors would need to be resolved at sitemap level
with a new error handler but I may be completely wrong. The rest
should be possible with the above.

 Maybe good way to resolve it will be write own Database*Actions provides to
 handle this errors? What do You think? (But of course I welcome simplest
 method resolving this trouble..)

I would strongly suggest to use the database actions from
scratchpad. Or modify the original ones and send a patch :-)

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]




Re: ESQL Oracle StoredProcedues

2002-04-12 Thread Christian Haul

On 12.Apr.2002 -- 02:00 AM, Michael Raffenberg wrote:
 Hi,
I am using C2.0.1 with JDK1.3.1 and TOmcat 4.0.3
I have problems with calling oracle stored procedures from ESQL.
I have this simple Code:
  esql:execute-query
esql:call
  {call sp_proc(esql:parameter direction=inout 
type=Stringbullshit/esql:parameter)}
/esql:call
esql:call-results
  esql:results
esql:result
  esql:get-string column=1 from-call=true//esql:result
/esql:results
  /esql:call-results
  /esql:execute-query
 
  ,followed by this error:
 Language Exception
 
 More precisely:
 
 org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
Merci_Dics_xsp:
 Line 463, column -1: inconvertible types
 Line 0, column 0:

Could you please show us the code around line 463?
(Merci_Dics_xsp.java)

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]




Re: ESQL Oracle StoredProcedues

2002-04-15 Thread Christian Haul

On 13.Apr.2002 -- 02:25 PM, Michael Raffenberg wrote:
 org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
Merci_Dics_xsp:
 Line 470, column -1: inconvertible types
 Line 0, column 0:
 1 errorHere is the code:
 
 Here is Code from Merci_dics_xsü.java
 464-493
   // nested result set
 if (_esql_query != null) {
   _esql_queries.push(_esql_query);
 }
   _esql_query = new EsqlQuery((ResultSet) 
 
 (test)
   );

Any idea where this (test) might come from? The resulting code seems
not to by in sync with the example you posted.

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]




Re: ESQL Oracle StoredProcedues

2002-04-15 Thread Christian Haul

On 15.Apr.2002 -- 02:17 PM, Michael Raffenberg wrote:
 OK, once again. Here is actual code:
 
  esql:execute-query
esql:call{call cocoon_proc(esql:parameter direction=inout 
type=String'123'/esql:parameter)}
/esql:call
esql:call-results
  esql:results
esql:resultesql:get-string column=1 from-call=true//esql:result
  /esql:results
/esql:call-results
  /esql:execute-query
 
 returns:
 org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
Merci_Dics_xsp:
 Line 451, column -1: inconvertible types
 Line 0, column 0:
 Here is the Code from merci_dics.xsp (445-470):
 
   // nested result set
 if (_esql_query != null) {
   _esql_queries.push(_esql_query);
 }
   _esql_query = new EsqlQuery((ResultSet) 
 
 (_esql_query.getCallableStatement().getString(1)   -- 451
 )
   );

OK, I've been blind (and you've been stupid ;-) 

You try to construct a result set from a string. That is obviously
impossible. So, if you want to use the above syntax *and* your SP does
return a result set object for that parameter, you'd need to
esql:get-object/ inside esql:result/. Please be aware that line
breaks inside esql:result/ could spoil your party. But then you'd
need to have another esql:results/ nested inside your
esql:results/... 

If your SP does not return a ResultSet for that parameter, use
esql:call-results/ which are executed regardless of the result
returned by the SP. Use esql:get-string from-call=yes column=1/
to access it.

If your SP returns exactly one ResultSet through e.g. parameter 1, you
could use esql:call resultset-from-object=1{.}/esql:call and
save yourself the trouble of constructing a new query result.

Your example code mixes two of these approaches. 

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]




Re: form-validation

2002-04-16 Thread Christian Haul

On 16.Apr.2002 -- 10:24 AM, Niket Anand wrote:
 I want to return map in act() method as
 Map siteparams=new HashMap();
 siteparams(validate, true);
 return siteparams;
 
 How can I use variable validate in sitemap such that If it is true then redirect 
to resource1 else redirect to resource2.
 How can I deal it like if-else condition like xsl:if test= 

Please have a look at the document about actions. They provide such a
mechanism in that the code nested is only included in your pipeline if
the action succeeds.

Other possibilities include selectors (see document on matchers and
selectors for more info).

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]




Re: Splitting the request URL

2002-04-16 Thread Christian Haul

On 16.Apr.2002 -- 12:12 AM, Jason Foster wrote:
 What I would like to do is include a set of navigation links based on the 
 URL path, in this case {1}. Given a request like website/topics/academic/
 publications.html, the HTML source for the navigation links should be:
 
 a href=/websitewebsite/a /
 a href=/website/topicstopics/a /
 a href=/website/topics/academicacademic/a
 
 I'm not using XSP, and would like not to if possible.  At a guess I'll need 
 to create an action to parse {1}, and add to the sitemap an entry 
 containing the HTML for the navigation.  This approach just doesn't feel 
 elegant to me, but then again neither does using a Xalan extension function.

You can pass the parameter to a stylesheet and do it this way. Or
write a transformer that includes your navigation. Perhaps cinclude or
aggregation come in handy, too, depending on the complexity of the
task. 

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]




Re: Actions: FormValidator and dbAdd

2002-04-16 Thread Christian Haul

On 16.Apr.2002 -- 12:43 AM, Matthieu Sozeau wrote:
   map:action-sets
 map:action-set name=guestbook-process
   map:act type=form action=Add-guestbook-entry
 map:parameter name=validate-set value=add/
 map:act type=mydbAdd/   
   /map:act
 /map:action-set
   /map:action-sets

 But cocoon acts as if it only wanted just one at a time. I see my form parameters 
are succesfully valitated, but cocoon pass to the map:generate part directly. 

I fear that nesting does not work with action-sets. Check by looking
in the logs for the invocation of the db action. If there's none, look
at the code generated for your sitemap. I bet that you won't find any
reference to your db action in there.

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]




Re: esql based logicsheet get-row-count

2002-04-17 Thread Christian Haul

On 17.Apr.2002 -- 09:10 AM, Jerzy Kut wrote:
 Hi cocooners!
 I know that esql:get-row-count is unavailable yet. But I need to get this
 information from my DB.
 I try:
 
batch:element-countdbman:employees-count//batch:element-count

 batch.xsl
  xsl:template match=batch:navigator
   xsl:param name=element-count select=batch:element-count/

  (Long.parseLong(xsl:value-of select=$element-count/) - 1) /

OK, this is no briliant analysis of your code and certainly will not
readily solve your problem, however, you have an XSL problem here:

The last line is going to be expanded to something like

 (Long.parseLong(countesql:connectionesql:query./esql:connection/count)-1

which certainly was not your intention.

If you pass parameters this way, make sure that your templates really
expand to a single text node (in the end). This is not like calling
functions but programming with macros. Bear that in mind!

You might want to use java beans to communicate.

Anyway, this is not a trivial problem and I bet most new-comers hit
this wall at some time.

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]




Re: esql based logicsheet get-row-count

2002-04-19 Thread Christian Haul

On 18.Apr.2002 -- 02:37 PM, Jerzy Kut wrote:
 That was trouble with xslt processing indeed :)) ! But I have impression You
 keep in mind another resolve Christian ??? With JAVA BEANS.

That's just one possibility to handle parameters. Have a class that
takes parameters one-by-one through a setXYZ method and then fire the
method you'd like to execute. Such a get/set interface is about all
that makes beans special (mind you, this is about plain java beans, no
J2EE stuff).

On the whole a solution is often to employ proper nesting. Setup your
connection, nest your code, nest query.

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]




Re: esql:get-date doesnt work with a column type datetime

2002-04-22 Thread Christian Haul

On 22.Apr.2002 -- 02:14 PM, LEBRETON Philippe wrote:
 In my datase i have a column with datetime type and when i used
 esql:get-date i have a exeption.
 Does esql-get-date work with a datetime type or only with a date type?
 i want to use the format attribute of esql:get-date, with my datetime
 column.

It translate to a call to getDate() which should be compatible with
DATE and TIMESTAMP but not TIME.

It uses SimpeDateFormat which parses the resulting string. That
depends probably on the date format your driver outputs.

esql:get-time and esql:get-timestamp take the same format specs as
esql:get-date does.

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]




Re: sendmail xsl problem

2002-04-23 Thread Christian Haul

On 17.Apr.2002 -- 10:38 AM, Perry Molendijk wrote:
 Hello,
 
 When I run the sendmail logicsheet I get a problem with the
 transformation of sendmail.xsl.
 
 Somewhere in the process the values of sendmail:subject, sendmail:body
 and sendmail:smtphost are not added to the generated java code.

I've just checked a version into CVS that works for me (while the
previous showed the errors you see). Please check with CVS version.

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]




  1   2   3   4   5   >