Re: RequestParameterModule

2003-11-27 Thread Christian Haul
Roman Hrivik wrote:
This can be reported as bug, I think.

When I try to access for parameter from request in sitemap and in
request is not such parameter I'll get null-exception.
I think that RequestParameterModule should return always not null value.
Nope since "" is different from null eg on database updates. If there is
a null pointer exception inside the sitemap engine, this is an error
since it should expect null values from an input module and replace it
with "". Could you provide a test case for this that shows the error?
(A short test of mine didn't reveal any problems.)
	Chris.

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


Re: portal engine on Cocoon 2.1.3

2003-11-27 Thread Christian Haul
David Geleyn wrote:
Hi all!

I'm looking at the (new) portal engine of cocoon and I
have some questions about it:
It is possible to make any coplet fullscreen, which is
great, but how exactly do you know whether you are in
full screen mode or not (when you are creating the
coplet)? It would be great to know this, because it
IIRC this is handled by the renderers. The rederer gets
this information because the layout object carries this information.
The layout in turn is modified by some component
(DefaultChangeAspectDataEventSubscriber) that is
subscribed to the appropriate portal event (ChangeAspectDataEvent).
If your coplet would be subscribed to the same event, it
would be informed of this change.
It would be great to have a coplet with some data that
depends on request parameters. The request parameters
are now read by all the coplets (correct me if I'm
wrong). Is it possible to make sure that request
All request parameters are made available to all coplets.

parameters are only processed by one coplet instance?
Maybe I can illustrate this with an example: If you
have a coplet that list all users and you want a
filter option (selection list) to view only the
administrators you have to use a request parameter.
This parameter is also read by the other coplet
instances. Now, If you want also an instance of the
same coplet in the same portal view, but with only the
'guest users' listed, you have a problem, I assume? Or
is there any way to avoid this? 
Those coplets would need to talk to each other through the
portal event mechanism.
It do not that that the coplets are meant to list only
administrators or guests. Both instances should be
able to show them both!
HTH

	Chris.

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


Re: Docs or examples for modular database actions?

2003-11-28 Thread Christian Haul
Steve Schwarz wrote:

ModularDb is quite stable and Christian has been very helpful in 
answering any questions. I can't quite put a finger on what is "wrong" 
:-D this saves me writing "go ahead, just ask" :-)

BTW I've been reading docs on SOFIA recently and am wondering if we
should provide a _second_, less powerful but simpler interface to esql:

  


  

and have the attribute names collected from the nested esql:get-...
tags. Maybe even allow for nesting and grouping in there but no paging,
no conditional result blocks etc.
compare to the current, more verbose version


  
 pool-name
 
   select * from list-of-tables where expression
 order by list-of-atttributes
   
  
 
  
   
 
  

Thoughts?

	Chris.

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


Re: Docs or examples for modular database actions?

2003-11-29 Thread Christian Haul
Thomas Nichols wrote:

BTW I've been reading docs on SOFIA recently
 From salmonllc.com? Looks interesting on paper - RAD for J2EE...
Yep. Although I believe Cocoon is well up to the job ;-)

 and am wondering if we
should provide a _second_, less powerful but simpler interface to esql:

  


  

and have the attribute names collected from the nested esql:get-...
tags. Maybe even allow for nesting and grouping in there but no paging,
no conditional result blocks etc.
compare to the current, more verbose version


  
 pool-name
 
   select * from list-of-tables where expression
 order by list-of-atttributes
   
  
 
  
   
 
  

Thoughts?

Chris.


The  approach took me a little time to get my head 
around - and the alternative syntax is a good deal simpler. Would this 
be an alternative syntax, with the old syntax still supported?
It's not really "old" vs "new" -- it would be an additional tag that
would expand to the very same code as the current combination. Hence,
it could be fully combined with all other esql tags that may appear
inside a esql:row-results. Well, that would be the plan.
Unless you can mix the old and new code together, though, this 
represents yet another choice between simplicity and power, of which 
there are several already :-)
Indeed. But maybe the current ESQL usage is a little too complex to just
list the contents of a table?
To be honest, I don't have a problem with embedding SQL SELECTs directly 
into the XSP or logicsheet. The row-results logic, once grasped, is also 
straightforward enough. More of an issue is the insert/update/delete 
logic. In your GT2003 slides, IIUC, you recommended against doing these 
using ESQL or SQLTransformer: this is my instinct also, but what are 
your reasons? And could these problems be overcome by an alternate 
"simple ESQL" interface? If so, that would to me make a more compelling 
reason for an "ESQL Simple" interface.
Nope. What I don't like about manipulating tables from XSP is that a)
application logic appears on the page b) different results (eg errors)
lead to different pages or ask for redirects which makes the pages too
complex to maintain.
Actions are a good step in the right direction if used correctly.

Honestly, the flow + o/r apprach is so much more elegant for complex
logic. Especially if you add CocoonForms aka Woody to it.
Cocoon has the best architecture I've worked with for a very long time - 
thanks for all your work.
Thank you! Now go and spread the word :-)

	Chris.

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


Re: How to show files from database / DatabaseReader problem

2003-11-30 Thread Christian Haul
Joerg Heinicke wrote:
On 30.11.2003 02:20, [EMAIL PROTECTED] wrote:

Hi,

I have a big problem with Database reader. I'd like to make a common 
stuff - in the database I are stored binary files (table structure 
looks: (id, content, filename, mimetype) and I'd like to map url 
"file/234" on the accordant file. Remind, that in the database can be 
stored everything possible stuff (images, documents etc.).

I tried to use databasereader. All works ok, until I'd like to change 
mime-type to appropriate mime-type stored in the database. For this 
purpose should be used parameter "content-type". But it doesn't work 
and doesn't return regular value from database. It just returns that 
string, I inserted with parameter. It is correct? If so, how can I 
solve my problem? I tried this solution:

Usual select: "select content, mimetype from files where id=123 and 
status=1"

Using databasereader:


  




Please have a look at the javadocs. content-type sets a fixed mimetype
for the generated data while type-column specifies the column that
stores the mimetype. So change it to
   

BTW the upload sample in the databases block demos this usage.

  

But that doesn't work. So how to solve that? Or do you know some 
alternative ways?


If you have a look at the source code
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/databases/java/org/apache/cocoon/reading/DatabaseReader.java?annotate=1.4#400 

you will see that the mime-type is not taken from database, but the 
parameter value itself, i.e. 'mimetype'. If that's useful or not - I 
don't know. Maybe you can patch the databasereader.
No need to -- that has already been done :-)

	Chris.

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


Re: Upload with incorrect encoding

2003-11-30 Thread Christian Haul
[EMAIL PROTECTED] wrote:
Db supports BLOBs, but I never did anything with them in java, less so 
cocoon :) Is it possible to use ESQL someways? Probably not, isn't it :) 
ESQL and (modular) database actions support blob, clob types.
AFAIR ESQL can only get them while the actions can insert and
update them.
	Chris.

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


Re: log messages of actions and modules

2003-12-02 Thread Christian Haul
Michael Wolf wrote:

Hello,
Is there a introduction to the cocoon log-system?
I look for log-messages in the WEB-INF/logs directory.
And I can also write my own error messages from the flow, but I cannot 
find any messages from my input/output modules and the modular 
database actions I use.


The modules log to core.log while the actions log to sitemap.log.
However, you'll need to set the log-level in WEB-INF/logkit.xconf to 
DEBUG for those
targets in order to see anything.

If you modify the logger attribute for the components (-> cocoon.xconf 
for modules,
-> sitemap.xmap for actions) you can introduce a new target or a 
subtarget in logkit.xconf
and let only those components you're interested in log more verbosibly.

Apart from that, I expect that you'll find documentation for logkit on 
the logkit pages http://avalon.apache.org/logkit

   Chris.

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


Re: Problems with simple-form transformer in 2.1.3

2003-12-02 Thread Christian Haul
Frederic Gaus wrote:

Hi! 

I used cocoon 2.1.1 with no problems (using Form-validation).
After a update to 2.1.3, I got very many problems with the 
simple-form-transformer. 

I have no solution to these problems, maybe someone could help me:

in my source-xml I used error-tags like:
Errormsg 
or
false
to get a line-break. This is not working any longer. After transforming
a few tags are missing (not the , but for example the -Tag)
and my xml gets invalid.


I get an other problem while validating a form with an upload-element
inside. To get the upload working I create a form-element with the
attribute 
enctype="multipart/form-data

Doing this, even a valid input is detected as not valid :(

This could also be a problem of the form-validator-action, but I don't
belive because there was iirc no change in the source since version
2.1.1...
Hope someone could help me..
 

Could you provide a test case that illustrates the problem? Could you 
check if the
samples included with Cocoon exhibit the same behaviour?

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


Re: Problems with simple-form transformer in 2.1.3

2003-12-02 Thread Christian Haul
Christian Haul wrote:
Frederic Gaus wrote:

Hi!
I used cocoon 2.1.1 with no problems (using Form-validation).
After a update to 2.1.3, I got very many problems with the 
simple-form-transformer.
I have no solution to these problems, maybe someone could help me:

in my source-xml I used error-tags like:
Errormsg 
or
false
to get a line-break. This is not working any longer. After transforming
a few tags are missing (not the , but for example the -Tag)
and my xml gets invalid.
I've tried to reproduce this with the samples to no avail. Everything
seems to work fine here.

I get an other problem while validating a form with an upload-element
inside. To get the upload working I create a form-element with the
attribute enctype="multipart/form-data
You need to move the enctype attribute to the form tag and enable 
uploads in Cocoon.

	Chris.

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


Re: Sitemap Syntax

2003-12-02 Thread Christian Haul
Juan Ignacio Jiménez de Luis wrote:
Greetings,

I'm trying to simulate a hashmap with the XMLFileModule input 
module..  I have an XML File with this structure



unmarde   
basic


unmarde   
shiny



I planned to reference that  in the sitemap as 
{xmlhashmap:/servers/[EMAIL PROTECTED]'{request:serverName}']/site} to 
emulate a NamedVirtualServer behaviour.

Unluckily, it seems that you can't nest variables in the sitemap.. 
Does anyone now any workarround to this limitation? Am I doing something 
wrong?
No. This is not possible. But there is an InputModuleAction to your 
recue. Use that to access the xmlhashmap module and pass the 
request:serverName value to it.

	Chris.

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


Re: modular database actions

2003-12-03 Thread Christian Haul
Garvin Riensche wrote:
hi there,

i tried to create a simple example with modular database actions. the only
thing i want cocoon to do is to store a number from a form field into my
database. but it seems like cocoon doesn't propagate the input number from
the form to the action as i always get this error:
Could not add record

org.apache.cocoon.ProcessingException: Could not add record:
java.sql.SQLException: General error, message from server: "Column 'number'
cannot be null"















input.html:






Number: 





By default the parameter name is expected to be table.column, hence
numbers.number. So you could either change the name of the input
element, explicitly ask for the attribute "number", or configure the
action to not prepend the table name.
To explicitly ask for "number" you would do


   
   number
   

Mind you that I might have mixed up @type and @name, so please
cross check with the docs.
	Chris.



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


Re: Problems with simple-form transformer in 2.1.3

2003-12-04 Thread Christian Haul
Frederic Gaus wrote:

On Tue, Dec 02, 2003 at 08:33:24PM +0100, Christian Haul wrote:
 

Christian Haul wrote:
   

Hi!
I used cocoon 2.1.1 with no problems (using Form-validation).
After a update to 2.1.3, I got very many problems with the 
simple-form-transformer.
I have no solution to these problems, maybe someone could help me:

in my source-xml I used error-tags like:
Errormsg 
or
false
to get a line-break. This is not working any longer. After transforming
a few tags are missing (not the , but for example the -Tag)
and my xml gets invalid.
   

I've tried to reproduce this with the samples to no avail. Everything
seems to work fine here.
   

I also modified example two. I just added  to every  and I
is not working any longer (well, the example is still working, but look
at the html-code produced. This is not well-formated any longer!)
Ok, this is what I changed in the example:
I comment out the css-style for error-tags
	--> Example is still working
I changed every error tag from:
	Text
to
	Text
	--> Example is not working any longer, I get a
	java.util.EmptyStackException
 

I assume this is a typo that is only in your mail and you did write 
 in the XML.

I did check this with my current checkout but it appears that there are 
no changes
after release. Anyway, I will double check tonight.

   Chris.

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


Re: Problems with simple-form transformer in 2.1.3

2003-12-05 Thread Christian Haul
Frederic Gaus wrote:

On Thu, Dec 04, 2003 at 01:47:39PM +0100, Christian Haul wrote:
 

Frederic Gaus wrote:
   

to get a line-break. This is not working any longer. After transforming
a few tags are missing (not the , but for example the -Tag)
and my xml gets invalid.
   

I also modified example two. I just added  to every  and I
is not working any longer (well, the example is still working, but look
at the html-code produced. This is not well-formated any longer!)
 

I've been able to confirm this bug and believe to have found the cause 
for this. I didn't have
enough time to thoroughly test the fix but I am confident to check in a 
fix tonight or tomorrow at
the latest. Please stay tuned and thanks for reporting the bug.

   Chris.

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


Re: flow: how to upload images into a database

2003-12-09 Thread Christian Haul
Joern Wallstabe wrote:

or can I use 
convert, setColumn etc.  from  org.apache.cocoon.util.JDBCTypeConversions ??
Guess so. But the input object must be of a supported type (the sample 
uses the raw-request-param module for this).

	Chris.

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


Re: Using Cron to call pipelines in background

2003-12-10 Thread Christian Haul
Dean Cording wrote:
Has anyone used the Cron block to invoke a pipeline in the background?
If you use the scheduler, you may not access cocoon: URLs because they
are only available from within a request. A workaround is to use http:
URLs and thus create an external request. To avoid others from calling
those URLs you could restrict them to access from localhost by matching
the client's IP address for example.
	Chris.

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


Re: Authentication context and modular database action.

2003-12-12 Thread Christian Haul
Simon Hutchinson wrote:
Hi,

I am using a ModularDatabaseAction to insert a row into a database.
Everything is working fine as most of the field values are available
as request parameters.However I also need to store a value that is
stored in the authentication context.
I am sure that writing my own InputModule for this is overkill as the
information is available already.
Either of the following types of solution would be cool if anyone could
point me in the right direction.(of course I am completely open to a 
better solution :))

1). Is it possible to access the authentication context using the 
session-context InputModule in the database descriptor ?

ie


 
authentication/authentication/ID
 

you need to tell the action when to use this mode with the type
attribute. For example, you might want to use it only on updates from a
specific form. This corrolates to the others-mode attribute for tables
in tablesets.
Since you most likely will use this mode for every operation, you need
to add type="all" to the mode:
 
  authentication/authentication/ID
 
2). Is it possible to pass values as parameters to the action directly 
from sitemap.
No, because input modules don't have access to parameters passed to the
action.
	Chris.

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


Re: Form validation problem

2003-12-15 Thread Christian Haul
Joe D. Williams wrote:
Working on the examples in Chapter 12 of Lajos and Jeremy's book, I cannot
get the new ticket form to return the results. It just keeps displaying the
blank form,
without updating the database.
I am running Cocoon 2.0.4 on Tomcat 4.1.27 standalone with J2SDK1.4.1 and
MySQL 4.0.16
The idea is to use the "org.apache.cocoon.acting.DatabaseAddAction" to put
the info from a set of forms into a db.
The info must first be validated using
"org.apache.cocoon.acting.FormValidatorAction". Looking at the sitemap log
for the logger "sitemap.action.validator" I find a number of messages where
it is validating the info from the forms.
After this, there is a message: "All form params validated. An error
occurred."
There will be a message in the sitemap.log indicating the validation 
error. In addition, the info is available as request attribute (so dump 
all request attributes on your page and you'll see).

Besides, you should consider to move to cocoon forms aka Woody or at 
least use the database actions from the modular package. Their interface
is a lot more consistent and have more docs.

	Chris.

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


Re: Complete database sample with Cocoon 2.1 ?

2003-12-18 Thread Christian Haul
Derek Hohls wrote:
Does anyone know of a more comprehensive sample
than the one supplied in the Cocoon samples directory?
(under cocoon/samples/databases/mod-db).  In the sitemap,
the comment is made that:
* no parameter validation is done (in a real application, you'd
want to check their values as well)
* you'd want to use an action set for this or even better, 
call these actions from the flow layer!
This last ability has been removed from flow. One can call actions
like any other component from flow, but considering the required setup
to fulfill the parameters needed for the act() method
(The sitemap for this example also seems very verbose;
considering just one table or two tables are being handled;
can this approach not be 'generalized' further so that it can
easily scale up to handle a more complex database - on the
order of 20-60 tables)
The key would be to use e.g. request parameters to select the right
table-set and validation-set. However, this approach does not scale
to complex transactions.
I assume that checking could (should?) be done with woody
form - is there any single sample (even for one database table)
that:
Adding cocoon forms aka woody and flow to the picture would also
suggest to use eg OJB or Hibernate for a persistence layer. There's
a OJB block in the distribution which illustrates the basic usage.
To use the mod-db actions (which is possible) would require to use
some JXPath enabled input module that can access the form model.
I believe there's no ready made one, but creating one should be
quite simple.
However, if there's (almost) no business logic involved and syntactic
validation of single values that can be done eg with regular
expressions, you might look into the simple form transformer and 
accompanying simple form instance transformer plus form validator
action. Anyway, this does not scale to complex business logic.

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


Re: Problem in passing http request parameters

2003-12-19 Thread Christian Haul
Ashish Kumar wrote:
2) I have to pass second parameter from a simple query, where I m using
the line:
&c_code=Please remember that "&" starts an entity in XML. Exactly for this
reason there is an entity representing "&": "&"
Hence the above code will complain about an error in the naming of
an entity since it considers &c_code (missing ";") as such. Replace with
&c_code= and all'll be fine.
	Chris.

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


Re: "Improved" handling of mod-db and actions in sitemap?

2003-12-19 Thread Christian Haul
Derek Hohls wrote:



  
  

  


This approach means that for each new table or table group you 
need to create a new set of entries in the sitemap.  I was
wondering if it is possible to set up a handling mechanism 
where the number of tables (and their various keys) are NOT
known in advance.   Perhaps something that looks like:


  

  


where * would be the name of the table-set involved,
BUT - I am not sure how and where to define what request 
parameters need to get handled - if any?  
Derek,
the sample does not do validation. The only thing it does is to check
whether some required parameters are present. To make it very simple and
not distract from demonstrating the database actions, I have chosen to
just check the presence using the above action.
A very similar result could have been achieved by using a constraint-set
with the same name as the table-set and just check for not-null of the
parameters. Please note that the form validation action has very limited
support to refer to another parameter definition.
Please note as well, that it is possible to merge validation descriptor
and datbase descriptor in one file.
To make it even more comfortable, one could think about creating the
validation descriptor automatically by applying an XSLT to the database
descriptor and setting not-null for all keys and checks based on the
datatype for all attributes.
Given that, you could do

 
   
  
  
  


  
   
 

 
   

   
 
 
   
   
 
In addition, you might want to look into eg Druid IIRC
http://druid.sf.net to generate the database descriptor from JDBC
metadata.
HTH
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: "Improved" handling of mod-db and actions in sitemap?

2003-12-19 Thread Christian Haul
Derek Hohls wrote:

Chris

Thank you for all the help - I will need to go and "process"
this to see how it all works - one quick question ... is it possible
for Woody to be part of the process outlined below i.e. could
it serve as the "form descriptor" file and help with validation... 
Derek,
to be honest, I'm not deep enough into woody to tell. But as long as
there is something accessible from an input module, it can be stored in
the database using the actions. There's enough flexibility to tune the
generation of parameter names by redefining path separators and using eg
the simple mapping module so it is possible to create eg XPath
expressions for every attribute.
Creating custom input modules is really easy.

I'll (hopefully) dig into woody over the hollidays and can answer more
on this then.
> or does the db-descriptor file have to be in the format outlined in
> the "database actions" doc on the Cocoon site?
Yes, but this is completely independent of validation.

	Chris.

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


Re: Newbie: DatabaseSelectAction modes?

2003-12-21 Thread Christian Haul
Joe D. Williams wrote:
I want to authenticate users by a username and password, using
DatabaseAuthenticatorAction and then pull information from the same database
table that contains the authentication information. For example, a custom
greeting or whatever, using columns that were not parameters from the input
form.
All attributes' values are returned as sitemap variables and are 
available as request attributes (if the default output module is used, 
otherwise they could be written eg to session attributes or whatever).

So, I have managed to create a pipeline and descriptor file for the
authentication, but am not sure what to use for the "mode" parameter in the
descriptor for the select action.
This is to chose different (input) modules for reading the attributes' 
values. For the select action, only key attributes are considered and 
only one mode type ("others") is used. However, a different mode type 
could be requested by adding the others-mode="foo" attribute to the 
table tag inside a table-set. The above requests a mode type "foo".

This way the same structure description can be used for different inputs.

What are the acceptable values, or where can I find them?
Any value is acceptable as long as it is requested. Otherwise it is just 
ignored.

	Chris.

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


Re: Newbie: Nested in sitemap for DatabaseAuthenticatorAction and DatabaseSelectAction?

2003-12-22 Thread Christian Haul
Joe D. Williams wrote:
Thanks to Christian Haul for answering my previous post. Still can't get the
parameter I want passed to the session.
I want to authenticate users by a username and password, using
DatabaseAuthenticatorAction and then pull information from the same database
table that contains the authentication information. For example, a custom
greeting or whatever, using values provided from the db, and not from user
input.
The DatabaseAuthenticatorAction does little more than the 
DatabaseSelectAction. Actually, I believe the latter can do everything 
the former can and more. You might need a second view to the same table 
by defining it twice in your descriptor with a different alias and 
different key set. Eg usually one would access the user table through 
the username. For authentication, username _and_ password are required.
And if you would like to not store clean passwords, you can easily add 
the DigestMetaModule and thus store and compare only SH-1 hashes

Put another way, for the username and password provided by the user through
a login form, can I select a third value from the database, perhaps through
a nested  block for the DatabaseSelectAction within the 
block for the DatabaseAuthenticatorAction?
Sure, you can. Not really necessary since you can list additional 
columns to retrieve by the authenticator action. Note, you cannot use 
the values returned to sitemap from the action but need to access the 
values stored in the session.

	Chris.

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


Re: Need Help with SessionAttributeSelector in Sitemap

2003-12-22 Thread Christian Haul
Jürgen Haas wrote:
Hello,

unfortunately I could not find what I am searching for neither by using a
search engine nor by browsing cocoon faq or mail archives. Maybe You can help
me.
I tried to use the SessionAttributeSelector in my sitemap as follows:

--


  
  pc



  
The @type does not match the selector declaration above. Use 
type="session-attribute"


  
  
  


  

  

--
If you were running 2.1 I would recommend to use the SimpleSelector in
conjunction with an input module, ie the session attribute input module.
	Chris.

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


Re: Syntax

2003-12-23 Thread Christian Haul
Damon van Opdorp wrote:

Hi All,

I'm trying to use a parameter to specify which action set to use in a
pipeline as below:
...

... 


...
The parameter doesn't seem to be getting substituted, as I get the
error:
Unknown action-sets named '{3}-actions' at file:...

Does the act component support substitution?  Any workarounds or
suggestions on where to fix?
No, it does not. Workarounds are to use a selector with hasrd coded
actions, an action-set or a MultiAction that can fire different methods
based on a parameter.
	Chris.

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


Re: Newbie: Nested in sitemap for DatabaseAuthenticatorAction and DatabaseSelectAction?

2003-12-23 Thread Christian Haul
Joe D. Williams wrote:


 
  
  
   
Mmmh, sure the file location is right?

  

  

 
 

You could use a single action BTW.

> 
>  support
>  
>   
>   

>  
> 
or, using the select action

> 

funny root tag :-)

>  support
>  
>   
>
wait a minute. OK, so you are using the original database actions :-|
Personally, I prefer the more recent "modular" ones, they have a more
consistent API. Well, anyway using the "other" select action, you could
spare the authenticator action.
And I get the following error:

org.apache.cocoon.ProcessingException: Could not prepare statement :position
= 0: org.apache.avalon.framework.configuration.ConfigurationException: Error
trying to load configurations for resource: null
Could you search for a stack trace that accompanies this error? It would 
help to identify the problem.

	Chris.

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


Re: How to get an array form request in flowscript?

2003-12-23 Thread Christian Haul
Stephan Coboos wrote:
Hello,

I have a html form with some checkboxes in it. The checkboxes have all 
the same name but different values:




In my flowscript now I want to get all checked checkboxes in an array 
like in Servlets, but everytime I got only the first checkbox, not an 
array? Why?

// Should return an array if all boxes are checked
var myArray = cocoon.request.del;
This maps to cocoon.request.get("del") which is (more or less) identical 
to cocoon.request.getParameter("del") but you need to call 
cocoon.request.getParameterValues("del"). So, no luck using the short 
hand, you need to write the dirty details :-)

	Chris.

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


Re: Pipeline matching problem

2003-12-23 Thread Christian Haul
[EMAIL PROTECTED] wrote:

Hi,

I cannot imagine I'm the first to stumble onto this so I hope some of you
have a solution to this problem:
How can I refer to an "absolute" path, but relative to the root directory of
my webapplication, both in the sitemap and in any content file.
Situation:
/tomcat/webapps/cocoon/myWebApp
Screen consists of tables, one of them contains the menu. How can I make
sure that the links in the menu always start relative to the root of
myWebApp? E.g. 
Link1 = /subdir1/somepage.html
Link2 = /subdir2/someOtherPage.html

I've tried "/subdir1/somepage.html", but this is turned into 
localhost:8080/subdir1/somepage.html 
This is trickier than it sounds. The request contains the information 
you need: getSitemapURI() gives the sitemap part and getServletPath() 
the path your application (cocoon) is mounted in the servlet. Combine 
both and there you are.

To access this information, you could either use XSP (request 
logicsheet, input logicsheet) or pass the information from the sitemap 
to a sitemap component and obtain it with the request input module 
"{request:servletPath}/{request:sitemapURI}".

You could use XSLT to add this to all URIs, or you could use the 
LinkRewritingTransformer for this.

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


Re: Pipeline matching problem

2003-12-23 Thread Christian Haul
Christian Haul wrote:

[EMAIL PROTECTED] wrote:

Hi,

I cannot imagine I'm the first to stumble onto this so I hope some of you
have a solution to this problem:
How can I refer to an "absolute" path, but relative to the root 
directory of
my webapplication, both in the sitemap and in any content file.

Situation:
/tomcat/webapps/cocoon/myWebApp
Screen consists of tables, one of them contains the menu. How can I make
sure that the links in the menu always start relative to the root of
myWebApp? E.g. Link1 = /subdir1/somepage.html
Link2 = /subdir2/someOtherPage.html
I've tried "/subdir1/somepage.html", but this is turned into 
localhost:8080/subdir1/somepage.html 


This is trickier than it sounds. The request contains the information 
you need: getSitemapURI() gives the sitemap part and getServletPath() 
the path your application (cocoon) is mounted in the servlet. Combine 
both and there you are.

To access this information, you could either use XSP (request 
logicsheet, input logicsheet) or pass the information from the sitemap 
to a sitemap component and obtain it with the request input module 
"{request:servletPath}/{request:sitemapURI}".
"{request:requestURI}" could do it as well. Anyway, in both cases you
still need to remove some parts of the URI.
You could use XSLT to add this to all URIs, or you could use the 
LinkRewritingTransformer for this.

HTH
Chris.


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


Re: Pipeline matching problem

2003-12-23 Thread Christian Haul
[EMAIL PROTECTED] wrote:

Hi,

Thank you all for trying to solve this problem. As far as possible I've
tried your suggestions but so far I only realized I haven't provided enough
information. BTW. Christian: I haven't been able to find any info on the
LinkRewritingTransformer. Could you give a URL?
Sorry, slight misspelling:
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/transformation/LinkRewriterTransformer.html
OK, there are two problems. One is to make all links relative to some
application root and the second is to compute this application root.
For the first problem, you could add the application root to all links
by using eg XSLT or you could use relative links and add
http://foo.bar.invalid/my/app/base/url"/>

to the  of your . COnsequently, all relative links will
be considered relative to , not the current URL.
Of course, this  needs to be computed again, which leaves us
with solving problem 2. However, this is much harder to solve because
while the servlet path is available as well as the request URL or the
sitemap URL, your application root is a fuzzy concept not known to
cocoon. So, you need to compute this from the data given or configure
it. For the full URL you need the servlet path + some path into cocoon.
Server name and port are optional but could even be read from the
request if so desired.
This leaves "some path into cocoon". Best is to configure that (doesn't
change anyway). Options include global configurations, configuration
file, system properties, servlet init parameter
	Chris.

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


Re: how to configure JXPathMetaModule?

2004-01-04 Thread Christian Haul
joakim verona wrote:
Hello,

I would like to URL encode in the sitemap, and I figured the 
JXPathMetamodule would be useful.
However, I cant figure out how to configure it.

The docs mention a "function" element that can be used to define java 
classes to be used with jxpath:



But where do I put this statement?
Wherever the module is declared or used and may have a nested 
configuration. If you are going to use it from sitemap, you need to add 
this to the declaration.

Then I would like to use the new input module like this:


http://www.test.com/{urlencode:encode({1})}"
Nested substitution is not supported. But there is an action for this: 
InputModuleAction. Please see the javadocs.

	Chris.

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


Re: [mod-db] Pb with input module

2004-01-04 Thread Christian Haul
Laurent Trillaud wrote:
Hello
I want to override the default request-param input module in the
database.xml by another input module.
For example, if I change name filed in the database.xml provided in
/samples/databases/mod-db/ to this snippet 

...

   
  
   
   ...



I got the current date instead of the name given in the query string. All is
fine.
But I got a problem when I use another input module.
For example 
return a blank string.
This is old syntax. Please try

  
 remoteAddr
  
HTH
Chris
And how can I specify the context with the session-context input module. Or
in another word how can I get the ID in the authentication context
initialize by the authentication framework?
Any help will be greatly appreciated.
Laurent Trillaud
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Chaining modules and prefixes

2004-01-04 Thread Christian Haul
g[R]eK wrote:
<. Hi users! .>

  I want to chain request-param and session-context modules. The problem is with
  context name for session-context module. For example if I ask request-param
  module for 'view' value, the session-context module should be asked for
  'user/view' where 'user' is a name of context for session-context and should
  be always passed as a prefix.
  What should I do to solve this problem? Maybe there is some option in
  configuration of ChainMetaModule?
See SimpleMappingMetaModule javadocs

	Chris

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


Re: PATCH: RawRequestParameterModule

2004-01-04 Thread Christian Haul
joakim verona wrote:
Hello list,

This is a patched version of RawRequestParameterModule so that it 
returns URLencoded request parameters.

The docs say that whats this module is supposed to do, and I'm shure it 
did/does in some circumstances.

I'm trying to do a proper patch entry in bugzilla to,  but I thought the 
patch might be discussed here first.

 * RawRequestParameterModule accesses request parameters without 
 * decoding or casting. It uses the get() method instead of the getParameter() 

return java.net.URLEncoder.encode((String)obj);
Doing the cast contradicts the comment and breaks the use for uploads. 
You need to check for an instance of String first and re-encode it only 
if it is a String IIUC.

	Chris.

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


Re: parameter value from xsp?

2004-01-04 Thread Christian Haul
julien bloit wrote:
Isn't there a work-around for this ?
I'm not a java expert, and I'm in a testing phase for my project where using
xsp would be much more straight-forward, as in my case, the logic needs to
make database and session-context accesses to set the parameter value.
use an xsp-action

	Chris.

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


Re: XSL template from database

2004-01-05 Thread Christian Haul
Jorg Heymans wrote:
You could make a custom transformer that reads the stylesheet from the 
This is not necessary. One could use the cocoon: protocol when
specifying the source for the stylesheet. Next, a pipeline for the
stylesheet is needed that consists only of the database reader et voilà.
And if you don't like the extra pipeline, consider creating a source for
relational databases.
	Chris.

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


Re: [mod-db] Pb with input module

2004-01-05 Thread Christian Haul
Jean Farenc wanadoo recevoir wrote:

But this one

<*mode* name="request" type="all">
 remoteAddr

 
Works.
Sorry, thought to have done copy and paste :-( but you're right, it
should read "mode", not "module".
Where I can found the parameters list for this input module.
Please see the javadocs for the module in question.

	Chris.

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


Re: Cocoon + postgreSQL

2004-01-05 Thread Christian Haul
Tommy Smith wrote:

Thank you and Luca for your replies.

I'm getting closer to what I want now.

My problem now is processing the resultset from my stored procedure.






This works *only* if the driver will return a resultset with the call
which is unlikely. Usually, the resultset is returned as out parameter
which can then be casted to a resultset object.
From the docs:

| If a result set is returned through the (only) return parameter of a
| stored procedure, e.g. resultset-from-object="1" as attribute to
| to automatically use this result set. For a more general
| alternative see further below.
| {? = foo(1)}
| 
| 
|   
| (ResultSet)
| 
|   
| 
|   
| 
|   
| 
HTH
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: PATCH: RawRequestParameterModule

2004-01-06 Thread Christian Haul
joakim verona wrote:
Thanks Chris,

As you might suspect I'm new to the cocoon internals and will try to 
make a better patch according to your comment.

Some other questions:
- Do you think it should still be "RawRequestParameterModule" or should 
it be a new module?
not sure. maybe just use JXPathMetaModule (see below)

- I guess I dont understand how this module would be used in an Upload 
scenario. Do you have any pointers?
pls look into the samples/databases/mod-db/file-upload-blob.xsp one

when using just existing modules for encoded request parameter "bar":

 


 
...

  
might work as well. (note: I haven't checked if this actually works, it 
shouldn't be far off, though)

	Chris.

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


Re: Sendmail attachment : cocoon:/// - why 3 /s ?

2004-01-07 Thread Christian Haul
Joerg Heinicke wrote:
I have never used it myself, but I know that some are using it through 
reading mails on this list. I searched the archives a bit and nobody 
complains about a similar error, for everybody cocoon: with 1 and 2 
slashes seem to work.

Where are the people having sendmail with internal cocoon pipeline 
attachements working? Christian, do you have any experience with this?
Not really. All the work on attachments had been triggered by requests
on the list or were patches provided by others (that I might have worked
on a little ;-)
Basically, it just uses the normal source resolving procedures that can
be found anywhere in cocoon. So, this shouldn't be a problem showing
only with sendmail.
It appears that Sandhu is using the logicsheet. Mmmh, could be related
to XSP then. Maybe a wrong resolver is used??
Sorry, I don't have the time to look into this in depth.

	Chris.

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


Re: Impossible to use reader as source of XSLT?

2004-01-08 Thread Christian Haul
[EMAIL PROTECTED] wrote:
Hi,

I have a problem. I want to use transformer, it gets XSL stylesheets not from 
filesystem, but from database. As some good mind advised, I used cocoon:/ 
protocol to call another pipeline with databasereader, which returns 
appropriate XSL stylesheet. But cocoon reports: "Streaming of an internal 
pipeline is not possible with a reader."
OK, I was afraid that this will happen.

I see basically three options:

a) try the blob source instead of the cocoon one. See javadocs on 
BlobSource and BlobSourceFactory from the databases block for details.

b)You might do the trick using eg XSP (+ esql logicsheet) to retrieve 
the stylesheet. However, IIRC you
will need to enclose the output with a tag otherwise the XSP will not
work correctly, so you will need to filter out this additional root tag.

c) write your own source / generator

	Chris.

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


Re: XSL template from database

2004-01-08 Thread Christian Haul
Jorg Heymans wrote:
Hi,

Can you elaborate a bit on what you mean by creating a source? Is this 
an avalon component? I've seen this word popup every now and then, just 
curious :)
please see http://avalon.apache.org/excalibur/api/

	Chris.

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


Re: XSL template from database

2004-01-08 Thread Christian Haul
Joerg Heinicke wrote:
I guess this means, you can not access a reader via cocoon:. This error 
is rather logical: internal pipelines normally spit out SAX events, a 
reader does not. So I guess further, that the suggested solution won't 
work and you have to go on with the other proposal of writing a Source. 
Christian, yes, you again :), do you have something working using 
cocoon: with a reader?
Probably not ;-)

	Chris.

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


Re: Updating XML datas in a SQL database

2004-01-09 Thread Christian Haul
Vincent Charlot wrote:

Hi!
 
I'm using a mySQL Database. One of the columns is a string column 
where I want to store XML datas.
 
I'd like to update (or insert) XML datas in the column. The problem is, 
when the update is processed : instead of having 
blablaabcd>/col2>
in the column, I obtain : blablaabcd  (the tags are removed!!).
 
I tried to use  and also ,
but, I didn't succeed
If you could share some more details like how you store the data, obtain 
the XML for storing, test the result of the insert statement. IOW 
without more or less the complete example, we're not able to help you.

	Chris.

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


Re: Checkbox and simple-form-validation

2004-02-08 Thread Christian Haul
Frederic Gaus wrote:
Just a simple thing .. but I can not find any hint :(

I'm validating a form using the simple-form-vatidation. The Problem is,
the form should only be successfully validated, if the user enables a
checkbox (to agree the licenses).
The Validator can check agains String, long and double... nothing fits
in this case. Also, none of the constrains fits in this case. But I'm
sure there is a possibility to validate checkboxes :)
Shouldn't the browser omit the parameter if not checked (or report "") 
and report the @value value otherwise? Then you could check for this
string and state that it may not be null.

	Chris.

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


Re: Cocoon and informix stored procedures

2004-02-14 Thread Christian Haul
Anna Bikkina wrote:
Hi,

I have to some a web app that runs stored procedures in informix. Gets the 
data in xml and converts to html,(tables),excel and other formats. Hence I 
choose cocoon to write my webapp.

 Is there a way I can call a stored procedure from cocoon and convert the 
resultset into xml. The database we are using is informix. The data obtained 
from the stored procedure could be in tens of thousands or records.
I'd go for ESQL (and XSP) in this case. Pls see docs on ESQL. When 
calling INFORMIX SP bear in mind that you may not use execute() but
executeQuery() (at least last time I looked at the driver) and you need
to set the corresponding flag for ESQL.

Can cocoon handle such huge data?
Yes.

	Chris.

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


Re: Best practice for "database" manipulation?

2004-02-16 Thread Christian Haul
[EMAIL PROTECTED] wrote:

Note: I cannot use ESQL or any SQLTransformer for my databases, I'll have to
write any connection/retrieval/storage myself.
Why?

	Chris.

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


Re: Combining database actions and Woody

2004-02-16 Thread Christian Haul
Derek Hohls wrote:

In the Cocoon sample set for modular database actions,
the author says:
"Note,  that we do no parameter validation here, just see if 
some parameters are present. For a real application, you'd  
want to check their values as well. "

* First question - has anyone created an application that uses
Woody form processing to do some data validation before the
map:act processing takes over - if so, even a simple example
of how best to integrate all the myriad files would be appreciated!
I haven't done this. But one idea might be to access the data through
JXPath and tweak a little the defaults for the actions, so that table
and attribute are not separated by "." but by "/" and setting a prefix
or whatever. If you can access the object holding the data through an
input module, you're almost done.
Since I haven't done this, I cannot provide much more than this.
However, you should seriously consider to use a persistence layer
like OJB or Hibernate. The database actions are really very similar
but less powerful.
The author of the example also says:

"Note too, that in a more complex setup you'd want to use an action 
set for this rather than spell it out everywhere."

* Second question: Has anyone got an example of how this might
work and how it might change (improve?) the example as shown?
In an action set the action to fire is dependent on a parameter named
"cocoon-action" (IIRC this can be changed). So you group several actions
into a set and reference only the set in your pipeline.
HTH

	Chris.

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


Re: Best practice for "database" manipulation?

2004-02-16 Thread Christian Haul
[EMAIL PROTECTED] wrote:

Due to the very specific nature of the interface to the databases. If you're
interested: they are PIDS and COAS servers (see
http://www.omg.org/healthcare, search for Person Identification
Specification and Clinical Observation Access Specification).
Basically they don't support SQL but use specific queries.
OK, so if the interface is sufficiantly similar to JDBC, you might be 
able to adapt the DatabaseActions in the 
org.apache.cocoon.acting.modular package. Adapting OJB or Hibernate is 
probably out of question although it would be the preferred way.

Other than that, my advice is to put your database access into a java 
class (better: Avalon components) and access it from flow. If you cannot 
or don't want to use flow, use actions to access it.

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


Re: [ESQL] esql:more-results seems broke with Oracle

2004-02-16 Thread Christian Haul
Rob Gregory wrote:
Please could anyone confirm that they are using Oracle with ESQL on 
Cocoon 2.1+ with the  tag working??
 Thanks in advance for any input.  
There have been some refactorings of the code that determines the
number of rows in a resultset. These are most likely the cause of your
troubles :-|
Please have a look at 
org.apache.cocoon.components.language.markup.xsp.OracleQuery and super 
classes. Maybe you can give some advice how to adjust it to your needs
or point out different cases we need to distinguish.

	Chris.

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


Re: Sendmail.xsp and whitespace gives error ?

2004-02-17 Thread Christian Haul
Stefan Geelen wrote:
Hi,
 
following sendmail action (partially reproduced) runs fine:
 

  request.get("from")
...
==> Note that you should read the  as one line (in case 
your mail program wraps it).
 
Now, with following an Lanaguage Expeption is generated:
 

  
request.get("from")
  
...
 
Note that the sendmail:from is now split over 3 lines.
 
The error I get is :
 
 org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
update_announcement_list_xsp: ERROR 1 
(org\apache\cocoon\www\xmlmill\xsp\update_announcement_list_xsp.java): 
.. _sendmail_mms.setFrom(String.valueOf( "" // start error (lines 
545-545) "String literal is not properly closed by a double-quote" + " 
// end error " + .. Line 545, column 0: String literal is not properly 
closed by a double-quote
 
This is quite annoying as xmlSpy will automatically split these lines 
each time I open this xsp file.
 
What I want to know: Is this normal Cocoon behavior and/or is there a 
simple way to solve this problem ?
Err, yes. This is a known limitation of some (all?) logicsheets. Problem
here is that the whitespace usually is important and thus is converted
to java strings.  However, the linebreak isn't converted to a \n, so
If you have a patch that handles this smarted, I'm sure it'll be welcomed.

	Chris.

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


Re: Best practice for "database" manipulation?

2004-02-17 Thread Christian Haul
[EMAIL PROTECTED] wrote:
Other than that, my advice is to put your database access into a java 
class (better: Avalon components) and access it from flow. If 
you cannot 
or don't want to use flow, use actions to access it.


Hmm. Could you give a more detailed example of how this would look like with
either flow or actions? I do have some Java classes now that do the actual
database connection, which I now call from my XSP page. So it would be very
helpful if you could write down a (set of) sitemap pattern(s) with a round
trip (i.e. put query into "DatabaseConnection", put result through Woody on
screen, put result back into "DatabaseConnection").
Well, I can't really help on the Woody part.

For an action, tha pattern is

match pattern="use case 1"
   act type="guard that conditions are satisfied"
  act type="do something with connection"
 call resource="display results handed down from action through 

eg. request attributes"
  /act
  call resource="display error message for connection"
   /act
   call resource="display error message for conditions"
/match
For flow, the pattern is:

function useCase1() {
  userDate = new UserData();
  do {
 send_start_page_and_optional_condition_errors(userData);
 userData = read_parameters_back();
 done = check_conditions(userData);
  } while (!done);
  if (do_something_with_connection(userData)) {
 send_query_result_page();
  } else {
 send_connection_error_page();
  }
}
If the logic is contained in avalon components, you'd need to obtain 
them first (AFAIR cocoon.newInstance(MYCOMPONENT.ROLE)) and release them
afterwards. Remember to release components before creating a 
continuation, though.

I don't like the idea of handling _everything_ in flow (like the petstore
example), which would make me look in two places (flow and sitemap) to find
out what's going on. I do use flow with Woody, but then I prefer to use and
reuse generic functions where all the variables (which
template/binding/definition and where to redirect to) are passed in as
parameters from the sitemap. I guess that I prefer flow to actions because
it's easier to debug and modify.
The key is to use flow _only_ to call your business logic (which is in 
avalon components) in correct order and react to exceptions (error 
conditions, user faults).

Personally, I would try to avoid redirects where possible and hide a 
complete use case (or user story) under a single URL.

	Chris.

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


Re: Best practice for "database" manipulation?

2004-02-17 Thread Christian Haul
Bastian Breithaupt wrote:
Hello:


If the logic is contained in avalon components, you'd need to obtain 
them first (AFAIR cocoon.newInstance(MYCOMPONENT.ROLE)) and release them
afterwards. Remember to release components before creating a 
continuation, though.


I have a flow script:

   var facade = cocoon.getComponent( Packages.ROLE );

var cmd = cocoon.request.getParameter("cmd");

if ( cmd == "soSomething" ) {
doSomething( facade , form );
form.finish("page/admin.xsp");
} else {
cocoon.sendPageAndWait("page/admin.xsp"); 
}
The Avalon component is a business facade which sends messages to the logic and delivers objects to the GUI. Where in this script do I have to realease the component (and how?) ?

And, by the way, is that a recommended approach?
OK, I'm not the local flow guru so take everything with a grain of
salt or jusk ask someone else ;-)
You should release components before a continuation is created, 
otherwise you risk a memory leak. There have been discussions on
doing it automatically, but AFAIR they were turned down because
of complexity.

A continuation is always created when sendPageAndWait is called, in
addition, you may create continuation explicitly.
Besides, the approach you describe seems perfect.

HTH

	Chris.

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


Re: Debugging Modular Database Actions...

2004-02-18 Thread Christian Haul
Derek Hohls wrote:
I am struggling to get a simple database "add" performed
when using the  Modular Database Action (and, no, I do
not want to do this in flow or some other way ;-).  The log
files do not show any errors - the database connection works
OK for retrieving data (and I have checked the field names 
and types and so on...).

Any ideas on what to test or look for to get this working?
The actions quite verbosely log to the sitemap.log
If nothing appears, maybe the path to the metadata is not correct.
Anyway, it has to be something during the startup of the action.
Look for source resolver errors.
	Chris.

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


Re: JXPathMetaModule configuration and sample use for function, package

2004-02-18 Thread Christian Haul
Roman Hrivik wrote:

Hi

Does anyone uses JXPathMetaModule with function or package parameter ?

I have this in my cocoon.xconf :


   



I tried to use this module in sitemap like this





but nothing was working
it seems that this module is always looking in 'request-attr' module
what is wrong ?
can anybody point me to right direction ?
Pls see javadocs for module. A meta module works on the output of
another module which you haven't specified in your declaration. Thus the 
default, "request-attr" is used.
You cannot nest modules in your sitemap. See InputModuleAction javadocs
for a possible solution.

	Chris.



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


Re: JXPathMetaModule configuration and sample use for function, package

2004-02-18 Thread Christian Haul
Roman Hrivik wrote:

OK I put chain module to cocoon.xconf


 
class="org.apache.cocoon.components.modules.input.JXPathMetaModule" 
 logger="core.modules.input.utils" name="jxpath">
		


		



in chain module is always string attribute "dn" ()

  
  
  
  


so how can I access to length of the string in dn attribute ?
the example str:length(dn) do not work
The output of the wrapped module is the new context object in JXPath 
speak. So it should be {jxpath:str.length(.)} (?)
Please see JXPath homepage for correct syntax.

	Chris.

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


Re: Documentation: all {variables} for sitemap.xmap

2004-02-21 Thread Christian Haul
Litrik De Roy wrote:
Philippe Bajoit wrote:

Hello,

I have found a lot of examples of variables eg {host} 
{request:contextPath} that I can use in sitemap.

However does it exist somewhere in the documentation an exhaustive 
list of all these variables?

I always check http://localhost/samples/modules/index.xsp
Look at the javadocs for 
"org.apache.cocoon.components.modules.input.InputModule" and look at the 
classes implementing this interface.
Most (not all) of those are delared in cocoon.xconf. Their name 
attribute is the part in front of the colon.

Look at
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/package-summary.html
	Chris.

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


Re: Processing errors from Database Actions

2004-02-21 Thread Christian Haul
Derek Hohls wrote:
Perhaps I have used the wrong keywords, but I
cannot find anything in the docs that deals with this
I am trying to present to the user the reason why a
Database Add (or Update) action may have failed.  The
sitemap is set up for the entry form to be redisplayed 
on failure (via XSP)... but I would like to know how to
access the specific error condition that triggered the
failure, from within the XSP and then present a suitable
message.

Any help or a pointer to examples would be appreciated.
Action may only return values to the sitemap when they were
successful. Therefore error conditions cannot be communicated that way.
Because of this, everything that is would be returned is additionally
stored using an output module. This includes the JDBC error message.
The default is to use the request attribute module.
	Chris.

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


Re: Best practice for "database" manipulation?

2004-02-21 Thread Christian Haul
[EMAIL PROTECTED] wrote:
Hello Christian, 


-Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED] 
Sent: Monday, 16 February 2004 13:51
To: [EMAIL PROTECTED]
Subject: Re: Best practice for "database" manipulation?


Other than that, my advice is to put your database access into a java 
class (better: Avalon components) and access it from flow. If 


This sounds like a good idea. I've been studying several *.js files and I
get a general idea of how it should work, but...what do I get from building
my classes into Avalon components and... what should I do to convert my
classes into Avalon components? I cannot afford to spend a considerable
amount of time to study yet another framework.
You gain flexibility and if your classes hold state or configuration, 
the Avalon component manager (soon service manager) manages them for you.

The pattern is to define an interface as contract to fulfill and 
configure at startuo time the "right" implementation to use. Avalon
provides a number of lifecycle interfaces that allow the manager to
setup your components. E.g. give access to other components or pass
configuration data to them. It also manages concurrent access to a
component by instantiating additional ones, pooling instances or
sharing instances across thread depending on the marker on the component.

Cocoon is based on this principle and whenever you access a generator
for example, the Avalon component manager directs the play.
If your classes don't have any such requirements, converting a normal
class to a component is to
a) create a corresponding interface
b) add a ROLE constant to the interface as individual name
c) declare your component in cocoon.xconf using 

d) access the component from other components that implement the
   "servicable" interface. (your component gets a reference to its
   managing component manager)
e) use manager.lookup(YourInterface.ROLE) to access it
f) release the component when done using manager.release(myComponent)
d) does not apply for flow
e+f) there are methods on the "cocoon" object in flow for this.
Avalon is very easy to program to.

	Chris.

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


Re: MORE: [ESQL] esql:more-results seems broke with Oracle

2004-02-28 Thread Christian Haul
Rob Gregory wrote:
Hi All

I have been looking into the issue of EQSL paging no longer working with
Oracle since upgrading Cocoon from 2.0.3 to 2.1.4 and although I can't
see any direct reason in the code for this problem I have noticed that
if I use jdbc as the limit clause instead of our default setting of auto
the paging seems to work again and the  is output.
Can anyone (hopefully Chris) expand on this issue and advise on any
further suggestions on how to fix this as I would prefer not to have to
visit all our XSP's and change the limit clause setting to be JDBC as we
plan on supporting more than just Oracle sometime in the future.
I believe the problem is burried in the code that tries to determine the
number of rows in the result set. JDBC2 does not allow to ask the result
set the size. Most database management systems don't know the exact 
result set size before having delivered all rows. One way is to use a 
scrollable result set and try to position the cursor at a position that 
would require another result page ("more-results"). Another is to use 
another query, that just returns the number of resulting rows.

IMHO both solutions suck from a performance POV.

OTOH, paging through results makes most sense with ordered results, so
the DBMS would need to have retrieved all rows anyway, so additional
costs could be transfer over the network if the select is not limited or
locks preventing concurrent queries / additional overhead to maintain
the scrollable resultset.
Retrieving just one row too many is fine but you'll know only at the end
that there's still more data to be displayed -- thus you couldn't put 
the "more" button at the top of the page unless you're using eg XSLT
to move the button up. You probably wouldn't want this for large results :-)

Back to your question: You'll need to look at AbstractEsqlQuery, 
JdbcEsqlQuery, and OracleEsqlQuery at the getQueryString() method.

Pick the one model that suits you best and works with your Oracle.
We'll happily incorporate a patch that allows Oracle to use the
"more-results" feature again :-))
Good luck.

	Chris.

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


Re: sendmail:attachment dynamic parameter?

2004-03-15 Thread Christian Haul
julien bloit wrote:
Hi,

I use cocoon 2.1.3 and having a little trouble to send mail with dynamic
content, using the sendmail logicsheet.
Here's an xsp snippet that works :

   ISO-8859-1
   smtphost
   [EMAIL PROTECTED]
   email
   shop : your command
   mailBody
   
cocoon:/recap_cmd/24
   
  
but I need the attachment 'url' parameter to be dynamic , i.e. like this :

cocoon:/recap_cmd/
which doesn't work (although pulling in the sitemap parameter works
elsewhere in the xsp).
Has someone got any clue on how I could fix this?
AFAIK this should work. Could you check the generated source or even
better, check with an XSL debugger (or just apply the sendmail.xsl 
manually)?

	Chris.

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


Re: DatabaseUpdateAction and "{session-attr:custid}

2004-04-16 Thread Christian Haul
Stefan Geelen wrote:
Hi,
I posted this question a month ago or so but did not get any reaction.
 
I hope I've more luck now...
 
Basically the question is: How can I passs the a session attribute to  a 
DatabaseUpdateAction ?
 
 
More info below:

I have following in my sitemap:


context://test/database/database-descriptor.xml 
true 

and














I would like to pass the custid (kept in the session) to the action:


You can't pass any data to be stored through the sitemap to the action.
All data needs to be accessible through an input module. Fortunately, there
is a module to access session attributes (or any request property).
You need to wire that module (and some parameters like attribute name)
in the database-descriptor.xml
HTH
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sql type for request parameter with multiple values

2004-04-16 Thread Christian Haul
Carlos Dias wrote:

Thanks Christopher for the answer, but how can I convert the parameter
enumeration to an array inside the sitemap?!
Can I use the RequestParamAction action?!
No, but you may use the CollectionMetaModule for that. Wraps any other
input module and returns an Object[]. The database actions from o.a.c.acting.modular
support the array type.
HTH
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: HTML fragment from database come escaped

2004-04-16 Thread Christian Haul
[EMAIL PROTECTED] wrote:

hi all

i try to post the html fragment as content  of a text area in a xsp-action 
that add this content to a database (msaccess), everything works fine and 
when i check the table's content i see the posted html fragment.

but when i use xsp to make a SELECT query, when i try to send this 
fragment to the browser, the content is escaped

so if the posted data are word instead i get a bold 
"word" i see 

"word"

because < and > came escaped.

has anyone try to do something similar?

any hint ?
returns the value of the given column interpeted as an xml fragment.
 The fragment is parsed by the default xsp parser and the document element is returned.
 If a root attribute exists, its value is taken to be the name of an element to wrap 
around the contents of
 the fragment before parsing.

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


Re: Generic Table printout for Oracle ORDBMS

2004-04-16 Thread Christian Haul
Frank Thilo Mueller wrote:

Dear Apache Community,

I am a cocoon newbie and would like to implement an Oracle database
frontend.
The database tables are user generated, therefore I know neither the table
names nor the type of the contents of the rows. They could be filled with
ORDBMS Oracle specific constructions.
I would like to implement a generic "pretty print" function. I found out
after a while that the first column name will be found using
. I have tried to change this 1 to an
variable i using i but with no success so far.

  i

I would be really thankful for a working example. I suppose others will
have the same problem, too. So, implementing a pretty print with table
names could be an idea.
results in a set of elements whose names are the names of the columns.
the elements each have one text child, whose value is the value of the column
interpreted as a string. No special formatting is allowed here. If you want
to mess around with the names of the elements or the value of the text field,
use the type-specific get methods and write out the result fragment yourself.


like


   

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


Re: ESQl and Stored Procedures

2004-04-16 Thread Christian Haul
Carlos Dias wrote:

Hi,
I'm trying to use a stored procedure for making an update in an Oracle 
database.
Here is the xsp+esql code:

 

 language="java"
 xmlns:xsp="http://apache.org/xsp";
 xmlns:xsp-request="http://apache.org/xsp/request/2.0";
 xmlns:esql="http://apache.org/cocoon/SQL/v2";>
 
 
  java.lang.String
 
 
 
  
   sca
   
   
String   app_id   = request.getParameter("app_id");
String   user_id  = request.getParameter("user_id");
if (app_id != null || user_id != null) {
   
 
You are at least missing a  tag surrounding the 

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


Re: Generic Table printout for Oracle ORDBMS

2004-04-18 Thread Christian Haul
Frank Thilo Mueller wrote:
Dear Christian,

thank you very much for your answer. I already had tried both ways
before but I couldnt reach the result I am heading at.
Im using the esql example to print out table column name number i.



  i



If I replace this i with a 1, everything is fine. If I define int 1=1
outside of the  then it gives me an error:
org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
esql_xsp: ERROR 1
(org\apache\cocoon\www\samples\databases\xsp\esql_xsp.java): ... default:
this.characters("\n "); // start error (lines 588-588) "String literal is
not properly closed by a double-quote"
XSPObjectHelper.xspExpr(contentHandler,
_esql_query.getResultSet().getMetaData().getColumnName(" // end error i
")); this.characters("\n\n\t"); ... Line 588, column 0: String literal is
not properly closed by a double-quote
Which says nearly nothing to me.
It boils down to Leon's advice to remove whitespace. Note that I wrote
  i
while you write
  
i
  
The key is that the macro needs to determine whether it's a string or a
number to deal with. A string would translate to a column name while a
number would translate to a - well - column number.
The whitespace causes it to be considered as column name.

BTW Leon's other advice to use xsp:attriubte does not work since it 
targets the SAX stream while you need to pass it to a logicsheet.

	Chris.

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


Re: Database Actions - Multiple Deletion

2004-04-18 Thread Christian Haul
Davide wrote:
Hi all i'm having a problem.

I've a db with 2 tables, one takes posts and one other takes comments. 
there can be more comments related to a post, so when i delete a row 
form posts i want to delete every related comment from comments. How to do?

this is the descriptor i use to delete a post:


mcblogger








and it run. How to delete also related comments from table comment?
to delete a comment i use this descriptor:

mcblogger








i tried this but it doesn't run:


















You're almost there.

Two issues: First, deletion considers only key columns and second 
missing is how the Post_ID is communicated to the Comments table.

Since you probably don't want to change the schema design, and you
don't want to do the SQL yourself but stay with the database actions,
the easiest way would be to have a second schema description for the
Comments table that claims that Post_ID is the key and use that for
the delete action. This way you don't event need to care how the ID
is read from the other table :-)
 
 
 
 
 
 
 
 
HTH
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: need help with xsp:formval

2004-04-20 Thread Christian Haul
Vlad Ali wrote:
Hi all!

i'm newbie in cocoon/

Explain to me  pls where i can write  logicsheet's tags?
I have not found clear explanation this question on cocoonwiki and google
You can write then anywhere on your XSP. However, IMO you should 
consider to use the SimpleFormTransformer instead or even better,
using Cocon Forms aka Woody.

	Chris.

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


Re: Database Insert Across Multiple Tables

2004-04-24 Thread Christian Haul
Mike Dickson wrote:
We are using Cocoon 2.1/MySQL 4.0.16 and have user data from a HTML form
that needs to be inserted into two tables inside a single transaction.
Inserts into a single table seem to be simple, but into multiple tables is
little harder...
How should I accomplish this?

I have looked at  in the new Cocoon 2.1 Database Actions, but am
stumped as to how to use them from the docs.  Sorry Reinhard Horn!  :-)
Could you elaborate a little more on were you're stuck? Essentially, you
just list multiple tables in a table set and ask the action to use it.
The sample that comes with Cocoon does it BTW.
	Chris.

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


Re: HTML SendMail Help

2004-05-11 Thread Christian Haul
Sun, Chris wrote:
Hello,

I am having problems sending HTML email through the sendmail/mail tags
provided by cocoon in XSP. I can send HTML email using the body tag and
cocoon utility tag but not through the src/srcMimeType tags. I am trying to
execute the XSP via the command line interface.
Any help is greatly appreciated.

My XSP looks like the following:

http://apache.org/xsp";
xmlns:esql="http://apache.org/cocoon/SQL/v2";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:mail="http://apache.org/cocoon/sendmail/1.0";
xmlns:util="http://apache.org/xsp/util/2.0";



[EMAIL PROTECTED]
[EMAIL PROTECTED]
This is a test
10.2.6.68


http://www.yahoo.com"/>

-->

http://www.yahoo.com
text/html


Email successfully sent.




An error occurred: 






The error I receive is the following:

An error occurred: Sending failed;
  nested exception is:
class javax.mail.MessagingException: IOException while sending
message;
  nested exception is:
java.io.IOException: No content
There has been a bug when using the src way to add a message body. Please upgrade
to latest CVS version and report back.
	Chris.

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


Re: AW: Sendmail Action HTML-Mail & Attachment

2004-05-09 Thread Christian Haul
Nils wrote:
Hi Christian,

Thanks for your answer.

The lack of the Body-part wasn't the real problem. The problem ist, that it
throws an exception as soon as i have an attachment and a html-mail. As far
as I know the body-part is only used, when theres no src etc.
Nils,

I believe to have found the problem - a not initialized variable that
mattered only in your case. Funny it hasn't surfaced earlier.
Anyway, I've just comitted a fix to the repository. Please cross check
and report back.
Thanks for spotting this one!

	Chris.

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


Re: How do I use sendmail from jxt?

2004-05-10 Thread Christian Haul
Ugo Cei wrote:

Derek Hohls wrote:

So... how is this done in flow, then??


Via javamail, possibly. Any Java API can be used from flowscript.
Plus, I've just made a component out of the MailMessageSender helper class
that is used by the SendmailAction and logicsheet. This way you don't need
to deal with low-level javamail API.
	Chris.	

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


Re: Database Insert Across Multiple Tables

2004-04-27 Thread Christian Haul
Mike Dickson wrote:
When you hit the "new user" button in the Modular Database Actions demo
application it does a GET with the user info and the group info.  Why are
only the user data listed below as params?  Shouldn't the group data be also
listed as params?
Oh well, this is only a guard -- a condition that protects the 
invocation of the insert with a check that the most important attributes 
are present. The add action reads the data directly from the request.

In other words, how are the group params being passed in?
Please have a look at the descriptor.xml (I've removed the comments):

   
  
 


org.apache.cocoon.components.modules.output.OutputModule:user.uid[0]

 
 

 
  
   
There are two  declarations for the UID column. The second is the 
one you may care about: It accesses a request attribute instead of a 
request parameter. The attribute will be set by the preceeding insert
to the users table! This is necessary, since the UID is a autoincrement 
column and the value is known only after the insert.

However, the "GID" data is read from a request parameter again (because 
it has been entered by the user on the form).

	Chris.

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


Re: sitemap.java

2004-04-29 Thread Christian Haul
Carmona Perez, David wrote:
Hi all,

Where can I find the generated sitemap.java in order to debug some problems I have?
In Cocoon 2.0.4 I could find it in the configured work directory of my servlet.
You won't -- in 2.1.x the sitemap is not compiled to java code anymore. Instead, 
the
result of parsing the file (and setting some things up) is kept in memory for 
interpreted
excecution. (It's in the o.a.c.components.treeprocessor package in case you'd like to 
browse
the sources).
	Chris.

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


Re: Database Insert Across Multiple Tables

2004-05-01 Thread Christian Haul
Mike Dickson wrote:
 means that there is a param
named request?
No - it means that the value should be obtained from an input module 
called "request-param" but only if the table-set indicated to use
the modes labled "request". IOW, "request" is just an arbitrary lable 
with no inherent meaning.

   
  
   
Chris.

-----Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED]
Please have a look at the descriptor.xml (I've removed the comments):

   
  
 


org.apache.cocoon.components.modules.output.OutputM
odule:user.uid[0]

 
 

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


Re: Sendmail Action HTML-Mail & Attachment

2004-05-07 Thread Christian Haul
Joerg Heinicke wrote:


On 04.05.2004 13:07, Nils Köster wrote:

I'm trying to send mail via the sendmail action with html-body and
pdf-attachment, my sitemap looks like this:
  











  

In request-param:attachment i have something like:
context:/nkpm/resources/documents/some.pdf
But it doesn't send the mail when I have both in it: attachment and
html-src. With one of them it works.
Does anybody have a clue?


In the error.log I get:
---
ERROR   (2004-05-02) 22:25.32:156   [sitemap.action.sendmail] 
(/mailer/mail)
http8080-Processor25/Sendmail: SendmailAction: An exception was thrown 
while
sending email. java.lang.NullPointerException
at
org.apache.cocoon.mail.MailMessageSender.send(MailMessageSender.java:323)
at org.apache.cocoon.acting.Sendmail.act(Sendmail.java:253)


 From the code the NPE is obvious:

306BodyPart bodypart = null;
307
308if (this.src != null) {
309DataSource ds = null;
310
311Source source = resolver.resolveURI(this.src);
312sourcesList.add(source);
313if (source.exists()) {
314ds =
315new SourceDataSource(
316source,
317(this.srcMimeType == null
318? source.getMimeType()
319: this.srcMimeType),
320this.src.substring(this.src.lastIndexOf('/') + 1));
321}
322
323bodypart.setDataHandler(new DataHandler(ds));
324bodypart.setFileName(ds.getName());
325
326multipart.addBodyPart(bodypart);
bodypart was never set/is still null in line 323.

Unfortunately I don't know how to fix it and I don't have the time to 
dive in at the moment. Christian wrote the code and could probably fix 
it in the shortest time as he knows what should happen. Unfortunately he 
made himself very rare on the lists in the last weeks, so I guess he has 
not much time ATM neither.
Hi Nils, Joerg,

sorry that I can't look into this ATM but I believe the original idea was
that every mail should contain a plain text body, not just attachments.
However, we could for example provide a default text like "please see attachment"
or the like but I feel like it would make more sense to do this application
specific.
So, the simplest solution for Nils would be to add such a body text and add the
pdf as attachment.
I need to dig up the specs to see if it is allowed to have no bodypart. Will try
to look into this over the weekend.
Cheers,
Chris.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multiple records add with original db actions ????? help

2003-07-15 Thread Christian Haul
On 07.Jul.2003 -- 09:24 AM, Dirk Fabrig wrote:
> Hi,
> 
> i want to add mutliple different rows in a table with original database act=
> ions.

I would strongly suggest to switch to the "modular" actions since
handling of multiple rows is not great with the original 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

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



Re: mod-db-add: How to use ManualAutoIncrementModule?

2003-07-15 Thread Christian Haul
On 10.Jul.2003 -- 03:56 PM, [EMAIL PROTECTED] wrote:
> Hi -
> 
> is there an example on how to use the modular database actions (esp. 
> mod-db-add) with 
> manual autoincrement. I use mysql, but do not want to acivate autoincrement for 
> the 
> database column. How can I configure the database descriptor file to use 
>org.apache.cocoon.components.modules.database.ManualAutoIncrementModule

You can always specify the mode to use explicitly. 

Another way is to

   
  database.xml
  false
  auto
   

Specify the default mode for autoincrements. IIRC this currently
defaults to "manual" and not "auto" -> you could as well name the
manual autoincrement module to "manual" in cocoon.xconf and don't fuzz
with the default mode.

> In cocoon.xconf all autoincrement modules are named "auto" and according to 
> http://cocoon.apache.org/2.0/userdocs/concepts/modules.html
> this should not be changed.
> Could someone give me a hint based on the AutoIncrement sample included in the 
> cocoon2.1 
> distribution (requiring autoincrement activated for the table column in 
> database):
> 
>  
>

I'm not sure if the  line above really works. I'm afraid
that there is a bug somewhere I will try to look into that but you
should be alright with the suggestions above.

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

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



Re: mod-db-add: How to use ManualAutoIncrementModule?

2003-07-16 Thread Christian Haul
On 16.Jul.2003 -- 10:01 AM, [EMAIL PROTECTED] wrote:
>   
> 
> Hi Christian - 
> thank you for your hints! 
> 
> I managed to activate the ManualAutoIncrementModule in cocoon.xconf,
> however I keep getting an error
> 
>   org.apache.avalon.framework.configuration.ConfigurationException: Could not 
> find mode description auto for column 0



> when using 
>   
> 
> in database.xml.

(after looking at the code again) this translates to 
- use autoincrement -> look for a mode "autoincr", if not found use
  "manual" as shorthand for the module
- use the shorthand "auto" as name to locate the actual module that
  implements the autoincrement feature

Therefore you need to have in cocoon.xconf:

   

as the only component instance with the name "auto".

If you change  you would need to have

   

in cocoon.xconf instead.

Another option is to change your table-set:

  
 
  

and have in database.xml



and have
  
   

in cocoon.xconf

> When I delete the mode line, I get the same error. So still I did not find a 
> way 
> to use ManualAutoIncrement. Is there any other way to use ManualAutoIncrement 
> (with a different mode description)?
> Is there (at the moment) just an error in the cocoon code or am I using the 
> wrong code?  

If this doesn't work for you, please post / send me your sitemap.xmap,
the database.xml and cocoon.xconf (relevant parts only). In addition,
you could try to set the debug level in logkit.xconf to "DEBUG" for
the sitemap and look into sitemap.log. The actions should be relative
verbose on what's going on.

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

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



Re: trouble with session attribute

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 09:36 AM, Lionel Crine wrote:
> Hi,
> 
> I've some trouble with session attribute. Here is what I try :
> 
> The sitemap:
>  
> 
> 
> 
>   
>   
> 
>  value="{session-attr:errorUser}" />
> 
>   
>   
> 
>  value="{session-attr:errorUser}" />
> 
>  
> 
> 
>   
> 
> 
> 
> In MyTransformerAddUser,I manage the session like this :
> 
> public class IXIASOFTTransformerAddUser
> extends AbstractDOMTransformer
> implements Transformer, DOMBuilder.Listener, Composable, Disposable, 
> Recyclable {
> 
> public void setup(SourceResolver resolver, Map objectModel, String src, 
> Parameters par)
> throws ProcessingException, SAXException, IOException {
> 
> ...
> this.session = null;
> this.session = this.request.getSession();
> ...
> }
> 
> private Document addUser(Document doc) {
> ...
> if (!isUser) {
> ...
> this.session.setAttribute("errorUser", "UserOk");
> ...
> }
> else {
> this.session.setAttribute("errorUser", "UserAlready");
> ...
>  }
> ...
> }
> 
> In the transformer, all is working fine.
> But from the sitemap, tha session attribute errorUser is one time late.
> For example, if errorUser is UserAlready the first time, I have to go 
> throught the transformer twice if I want to set errorUser to UserOk.
> 
> 
> Any Idea what's going on.

The sitemap is executed *before* any of the sitemap pipeline
components. So, when your transformer sets the attribute, the sitemap
has already tried to read it in order to setup the other transformer.
Only when you do it with an action, the data would be available at
setup time for the transformer. Or your transformers need to
communicate inline through the data stream.

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

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



Re: trouble with session attribute

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 01:34 PM, Lionel Crine wrote:
> Thanks for the answer  :
> 
> 
> At 12:52 28/07/2003 +0200, you wrote:
> >Or your transformers need to
> >communicate inline through the data stream.
> 
> 
> Is there a way to do that ?

Sure. Your first transformer can add any XML to the data stream and
the second can act on it since it needs to read all XML anyway.

BTW you can access the session in your transformers since the object
model is passed at setup time to it -- you just may not pass the
session data through the sitemap to the second transformer! But
beware: both transformers *run in parallel* so if the first
transformer modifies the session at the end, the second sees the
change only very late in the process!

 tG T  T  T  S
 iroot-->-->-->-->
 mh1>-->-->-->
 e/h1--->-->-->-->
 |/root->-->-->-->
 V

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

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



Re: Cocoon and MySQL databases

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 12:22 PM, Kieran Kirwan wrote:
> I'm using Apache Tomcat 4.0 and Cocoon 2.0.4.

> java.lang.ClassNotFoundException: 
> org.apache.avalon.excalibur.datasource.Jdbc3Connection

JDBC2 vs JDBC3 problem?

Are you using a jkd1.4 with a Cocoon for jdk1.4 and a JDBC driver for
JDBC3? Try a jdk1.3 with a Cocoon for jdk1.3 to see if it makes a
difference...

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

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



Re: Cocoon and MySQL databases

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 01:58 PM, Geert Van Damme wrote:
> 
> We had the same problem (not with MySQL).
> Problem is that the excalibur-datasource-vm12-20021121.jar distributed with Cocoon2 
> does not contain the Jdbc3Connection class, which it should.

The Cocoon version for jdk1.4 should contain the correct library. The
version for jdk1.3 and below does not because they are JDBC2 and you
will get runtime errors accessing JDBC3 methods.

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

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



Re: action vs transformer --> request attributes

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 03:37 PM, Geert Van Damme wrote:
> 
> Hi,
> 
> I'm writing an action to make request attributes available to the sitemap (like the 
> RequestParamAction does for request parameters)
> 
> Problem is in the action the attributes don't seem to be available ???



> The filewriter (= custom transformer, doesn't matter) puts an attribute on the 
> request.
> In the ftp-put transformer, I can get back the correct value from the request 
> attribute, but would rather have the action making the attribute(s) available to the 
> sitemap.

This is correct behaviour.

Please see my today's answers to Lionel Crine under the subject
"trouble with session attribute" for an explanation.

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

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



Re: action vs transformer --> request attributes

2003-07-28 Thread Christian Haul
On 28.Jul.2003 -- 04:58 PM, Geert Van Damme wrote:
> 
> Hi, thanks for the answer, this is exactly what I need, but I can't seem to get it 
> to work...
> I got the input modules defined in the cocoon.xconf :

Please look at my other mail. This will not work. Period.

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

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



Re: Databse Action debugging

2003-08-01 Thread Christian Haul
On 01.Aug.2003 -- 01:15 PM, Mariusz Sieraczkiewicz wrote:
> How to debug (Cocoon 2.0.4) Database Actions?
> I use simple DatabaseUpdateAction and something goes
> wrong, where can I find inormation about it ?(I dont
> use Form Validator, my debug
> level is DEBUG)

See sitemap.log for any traces. However, you should consider moving to
The Other Ones (TM) or even to something like OJB.

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

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



Re: Input modules

2003-08-04 Thread Christian Haul
On 03.Aug.2003 -- 10:53 PM, Ralph Goers wrote:
> I'm trying to write an Input Module but am a little unclear on where and how
> they get used.  Although I have seen several input modules that support
> wildcards, I can't find any examples that do that in the sitemap.  

These are AFAIR the request-param, request-attr, and session-attr
modules. Actually, this functionality is a concession to the original
database actions. (modules were created during an overhaul of the
database actions.) I believe it's not a very useful feature since it
mimics the getAttributeValues() functionality with several differently
named attributes instead of multiple attributes with the same name in
case of request parameters. There is a difference, though: This way
one can guarantee that multiple fields use the same ordering
e.g. firstname-1:peter, firstname-2:paul, lastname-1:smith,
lastname-2:baker while firstname:{peter,paul} lastname:{smith,baker}
it is not clear that the ordering is correct.

> What would happen if I coded  value="{request-param:*}"/> in the sitemap?

You'll get a parameter named "*" with the some request parameter. The
actual value depends on the names of the request parameters and might
be the empty string.

> getAttributeNames() doesn't take a name parameter, so if I specify
> {request:a*} how is the list limited - or does it always call
> getAttributeValues()?  This is of some concern to me because my input module

It does.

> should never return the full list of elements (that could be huge), so I
> expect that getAttributeNames() will have to return an empty Iterator.

getAttributeNames will return an iterator over all attribute
names. This contract is somewhat weak: jxpath based modules for
example return only a subset of available attribute names.

> What other components might call an input module to get a list of
> attributes? 

No idea. All of them might -- IIRC there's one meta module that
creates a XML representation of the available attributes.

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

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



Re: How to enumerate parameters values with xsp-request logicsheet

2003-08-04 Thread Christian Haul
On 04.Aug.2003 -- 02:12 PM, Mariusz Sieraczkiewicz wrote:
> As in subject. There exists 
> 
> xsp-request:get-parameter-names
> 
> that enumerates parameters names, but how to build
> pairs 'name <-> value'?

I'm afraid you'll need to do that manually with
java. get-parameter-names returns an enumeration of all parameter
names. Walk over that, retrieve the name, call get-parameter-values on
the name and add it to a map or something.

But -- if you need this, you might be better off reconsidering your
design. Maybe there is too much logic on your XSP.

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

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



Re: [Solution] Re: SimpleFormTransformer - invalid XML generated?

2003-08-12 Thread Christian Haul
Steve Schwarz wrote:
Christian

My bad. It looks like the form validation action is the one that doesn't 
like the enctype="multipart/form-data" together with method="post" but 
multipart with put is fine as is no enctype with post. In the 
sitemap.log it reports all fields as null with that encoding/post.
Since I'm using simpleform in both the success and failure cases for the 
validation action I wrongly thought simpleform wasn't working.
Since 2.1 processing of uploads needs to be enabled in web.xml. The 
default case is disabled and you've seen the result :-)

Although I think I will try to put a wiki together for the very simple 
use case; the added complexity of sfinstance in the simpleform sample 
really had me scratching my head for a while about the simple-form 
transformer declaration (as a newbie I still haven't gotten my head 
around the modular mechanism and the classes implementating it).
Right. So it ain't "simple" anymore :-| But agreed, the sample is crap. 
I will try to come up with a better one.

I also think I'll try to write a transformer that can transform the 
descriptor.xml file and into all the  entries for each of the 
 validation attributes (min-len, max-len, nullable, etc). I'd 
hate to enter that info for each error type manually for all my 
validating forms. To me this is the real power of Cocoon; define the 
model(s) and drive the site's views entirely from the data models 
through actions/transformations.
A very good idead. And by using the cocoon: protocol this can easily be 
done with XSLT in an internal 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
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Solution] Re: SimpleFormTransformer - invalid XML generated?

2003-08-14 Thread Christian Haul
Steve Schwarz wrote:
Christian,
Thank you very much (especially for "pushing" me into 2.1). It took me a 
while to figure it out but the problem was my form:


If I remove the enctype attribute/value everything works correctly.
It shouldn't affect the transformer! If you could send me a minimal 
sample that shows the problem, I will try to fix it.

This is really a great transformer; it sure doesn't seem to get much 
"press" but it does exactly what I need.
Glad you like it :-)

If you like this one, you might want to look at its companion, the 
SimpleFormInstanceTransformer, which basically allows to separate the 
form data from the form definition:


   
  Doe
  John
   
   
   

Unfortunately, I haven't come around providing a good sample for this -- 
 a very small one is located in the simpleform directory (not 
accessible through the sample pages). I have a better one but that 
requires a java bibtex parser that is GPLed so I cannot provide that one 
from the Apache CVS.

Anyway, you still might want to look into the more powerful forms 
approaches in 2.1 like JXForms and Woody.

	Chris.

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


Re: How to store an xml fragment in a database column ?

2003-08-14 Thread Christian Haul
Vincent De Groote wrote:
In a pipeline, I need to store an xml fragment in a column of a relational
database (mysql).  Esql xsp provides a function to "convert" the content of
a column to xml (esql:get-xml), but I can't find the inverse function.
Any suggestion?
If the fragment posesses a useful toString() method just treat it as a 
varchar or a CLOB. If it doesn't, there are helper classes in 
org.apache.cocoon.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
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [newbie] Questions about esql, xsl

2003-08-14 Thread Christian Haul
On 09.Aug.2003 -- 05:00 PM, Rolf Heckemann wrote:
> To acquaint myself with the sitemap and the ESQL logicsheet, I wrote a
> small application that takes a database named IXIDB, lists the tables
> and shows the table contents.  The goal was not to have to adapt the
> application if database tables were to change.  One of the problems I
> found difficult to deal with was extracting the table descriptions so
> I could turn the fields into headers () in the output.  I solved
> this with a dynamically generated XSL sheet.  Now I'm wondering:
> 
> Is this 'The Way' or are there more elegant/ more flexible/ easier/
> approaches to solve this problem?  Would nested queries help?  I
> tried, but found them difficult to debug.

A dynamic XSLT seems unneeded. A static XSLT like the stupid.xsl from
the samples should do (it's not brilliant, thus "stupid") Another
option is to use the ResultSetMetaData (see esql.xsl) and use JAVA in
your XSP to create the table heading.

> Is this likely to work with future versions of Cocoon (I did it in
> 2.0.4)?  Or is ESQL going to be superceded by the SQL Transformer?

Historically, ESQL was supposed to replace the transformer IIRC but I
believe both have their merrits and will stay in Cocoon.

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

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



Re: SimpleFormTransformer - invalid XML generated?

2003-08-14 Thread Christian Haul
On 09.Aug.2003 -- 04:50 PM, Steve Schwarz wrote:
> Hi
> I'm using SimpleFormTransformer to process the results of 
> FormValidatorAction and I am getting invalid xml generated after applying 
> the transformation. It looks like when  elements are removed from 
> within surrounding  elements I end up with an empty element  
> followed by a closing element .

In 2.0.x there are a number of issues with this transformer. I believe
all are solved in 2.1. Please upgrade and report back.
(I believe the fixes are not in 2.0.5)

> I'm using 2.0.4 but I diffed the SimpleFormTransformer source against 2.1 
> and didn't see any obvious differences related to this..(??) Do I need to 
> specify some config/pipeline parameters to resolve this?

see above. 

> I also have a dumb question:
> What is the difference between using:  and 
>  ?

The former is displayed when the result is "error" or worse (when-ge translates
to "when greater or equal") while the latter is displayed _only_ in case of 
"error" e.g. not when it is "too_small".

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

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



Re: Repost: Error with esql and multiple results

2003-08-15 Thread Christian Haul
On 15.Aug.2003 -- 03:27 PM, Ariane Ibig, Infonic AG wrote:
> Hi
> I just upgraded my Coconn 2.1.dev to Cocoon 2.1 and have a problem with the
> generation of esql in my xsp-files.
> 
> Although I have the Multiple results set to yes, I only get the first
> resultset from the database. If my xsp for example tries to acces the second
> resultset there occurs a null exception.

Ariane, could you please check the CVS ID of the esql.xsl file of the
working version? It's the third line and mine shows for example



This is version 1.4 of the file. Knowing the last known good would
allow us to see the delta. In addition, could you post the relevant
parts of your XSP (i.e. all the esql tags)?

There has been a change to explicitly free the result set at the end
of the esql:execute-query tag but that shouldn't affect multiple
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

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



Re: Repost: Error with esql and multiple results

2003-08-18 Thread Christian Haul
On 15.Aug.2003 -- 06:27 PM, Ariane Ibig, Infonic AG wrote:
> Hi Chris
> This is the line
> 
> I have a shortened xsp page attached, hope it helps

I can't see any differences that are related to your problem :-( 
However, it appears that a new result set is never retrieved after
checking for more results (did it really work with 2.1-dev??)

I have added a 
  resultSet = preparedStatement.getResultSet()
to AbstractEsqlQuery. Please update from CVS and report back as I
don't own a DBMS that ever returns multiple result sets.

BTW the processing instructions you have in your XSP are ignored in
Cocoon 2

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

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



Re: form to make an upload

2003-08-19 Thread Christian Haul
On 19.Aug.2003 -- 12:07 PM, Lionel Crine wrote:
> I have create a form wich have a strange behavior.
> 
> When the method attribute is set to POST, the request parameters are lost.
> When the method attribute is set to TRUE, the request parameters are found.
> 
> 
> Do I have to set something particular in the sitemap ?

You need to enable uploads in web.xml

> By the way i use cocoon 2.1

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

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



Re: Simple form handling

2003-08-21 Thread Christian Haul
On 21.Aug.2003 -- 09:38 AM, g[R]eK wrote:
> <. Hi users! .>
> 
>   I just read how-to about XMLForms in cocoon. I think they are too complex for
>   me. I don't want wizard forms, and I don't know Java to code my own actions.
>   The question is:
>   Does exist some simple way of handling forms in Cocoon? I just want to
>   generate form, get input from user, validate and if it's incorrect send back
>   the information why is incorrect.

Please have a look at the "Simple Form Handling" sample coming with
2.1.1-dev (CVS snapshot) ;-) (It's hidden with the older releases as
well but it should be better understandable with the updated
sample. Besides, the involved components are a little easier to use.)

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

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



Re: Problem getting result set from Oracle stored procedures

2003-09-05 Thread Christian Haul
On 05.Sep.2003 -- 09:02 AM, Martin Rusnak wrote:
> Hello all,
> 
> I am trying to get result set from a stored procedure (function)
> in Oracle database, using Cocoon 2.1 ESQL. My working Java code
> looks like the following:
> 
> 
> CallableStatement cstmt = conn.prepareCall("{?=call sp_resultset()}");
> cstmt.registerOutParameter(1,OracleTypes.CURSOR);
> cstmt.execute();
> ResultSet rs = (ResultSet)cstmt.getObject(1);
> 
> 
> I tried to use esql:call element with the @resultset-from-object
> attribute, but the page processing failed with LanguageException.
> Here is the XSP code snippet I used:
> 
> 
> 
>   {?=call 
>   sp_resultset()}
>   

Use call results *only* if you are accessing regular out
parameters. You have asked to convert the first out parameter to a
ResultSet for you and use that. Hence you need to proceed with

   

>   
>   
>   
>   
>   
>   
> 
> 
> 
> 
> The exeption message is:
> 
> 
> org.apache.cocoon.components.language.LanguageException: Error compiling 
> servers_ora_xsp:
> ERROR 1 (org/apache/cocoon/www/noc/docs/servers_ora_xsp.java):
> ...
> "resultset-from-object",
> "resultset-from-object",
> "CDATA",
> "1"
> 
> // start error (lines 518-518) "Syntax error on token ";", ")" expected"
> );
> 
> // end error
> 
> 
> this.contentHandler.startElement(
> "http://apache.org/cocoon/SQL/v2";,
> 
> ...
> Line 518, column 0: Syntax error on token ";", ")" expected

The above error message indicates, however, that you have omitted a
necessary tag or used a wrong ordering. Could you post the complete
XSP, pls?


> The question is if there is a bug in ESQL transformation and possibly
> in my ESQL code...

Your ESQL 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

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



Re: Problem getting result set from Oracle stored procedures

2003-09-05 Thread Christian Haul
On 05.Sep.2003 -- 02:11 PM, Martin Rusnak wrote:
> Here is full source of the page:
> 
> 
>xmlns:xsp="http://apache.org/xsp";
>   xmlns:esql="http://apache.org/cocoon/SQL/v2";>
> 
> 
>   oracle-connection
>   
> {?=call sp_test()}
> 
>   
> 
>   
> 
>   
> 
>   
> 
> 
> 

Processing of @resultset-from-object has been broken. I've updated CVS
just now. Please update and verify. Anyway, you will still need to
enclose the result with esql:results. Apart from that, you may use



 
   (ResultSet)
   
   ...
   
 

  
Which is a little more verbose but IMHO preferable to the
@resultset-from-object syntax.

see http://cocoon.apache.org/2.1/userdocs/xsp/esql.html

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

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



  1   2   >