You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andrew Answer <cr...@mail.ru> on 2001/09/11 15:35:36 UTC

Re[6]: DatabaseXActions

Hello Chris,

I think what request parameters are immutable because of no method for
change it. Cocoon 2 HttpRequest call HttpServletRequest methods of
J2EE. HttpServletRequest is a standard interface and it don't present
way for setting/changing parameters. I don't know why, this question
we can send to Sun :). But i think what reasons for what are too
serious.
Instead of changing attributes you can try extend Cocoon
implementation of HttpRequest for parameters setting. At result you
get more simple actions and more transparent data flow. Hope what your
attempts are excellent.

Also look at these problems:
1) logger not print request attributes, only parameters
  When you start request, next log record write in file:
[
DEBUGGING INFORMATION:
REQUEST: /mysite/news_get.xsp

CONTEXT PATH:
SERVLET PATH: /mysite/news_get.xsp
PATH INFO: null

REMOTE HOST: localhost.ftc.ru
REMOTE ADDRESS: 127.0.0.1
REMOTE USER: null
REQUEST SESSION ID: null
REQUEST PREFERRED LOCALE: en_US
SERVER HOST: localhost
SERVER PORT: 80

METHOD: POST
CONTENT LENGTH: 37
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

CURRENT ACTIVE REQUESTS: 1
MAXIMUM ACTIVE REQUESTS: 2

REQUEST PARAMETERS:

PARAM: 'news_id' VALUES: '[1]'
PARAM: 'cocoon-action' VALUES: '[Add]'
PARAM: 'text' VALUES: '[test]'

SESSION ATTRIBUTES:


]
 No request attributes present. But i think what it's presence is very
 important for form data flow control.

2) When i try to use
    <values>
      <value param="pdate" dbcol="fdate" type="now"/>
    </values>
in descriptor file, i must get curent timestamp in database. But i get
null again...  I can't understand this problem. Anybody test ALL
datatypes described in AbstractDatabaseAction? I see what only string
type working.

Tuesday, September 11, 2001, 7:20:40 PM, you wrote:

> Hi Andrew, All,

> I've held off posting these patches as I don't think they address the bigger 
> issue of immutable request parameters. I posted a question about these last 
> week (form validator problems) but received no replies.

> I've fixed several bugs in FormValidationAction (nullable + default values 
> not picked up) + in DatabaseDeleteAction (always returns null) but 
> unfortunately these were done before the rotating logfile changes were made.

> I'm really busy atm but when I get a moment I'll update my local Cocoon to 
> use the latest code (I'll probably wait for the release candidate) and then 
> make these changes again + submit diffs.

> Can somebody please explain to me (even if its a 1-liner) why request 
> parameters are immutable?

> I would like to be able to pass the request through a chain of actions, each 
> one able to modify the request parameters so that the following action only 
> has to look in the request params. Currently I'm using request attributes as 
> an override mechanism (+ modifying the actions to look there) but this will 
> fail as soon as I want to use request attributes at the same time as request 
> parameters.

> Thanks + keep up the great work,

> Chris

> On Tuesday 11 September 2001 10:47, you wrote:
>> Hello Chris,
>>
>>   Your request attribute patches are applied?
>>   Last snapshot still not work with attributes.
>>
>> xsp-page:
>>     <xsp:logic>
>>       request.setAttribute("pdate",new Date());
>>     </xsp:logic>
>>
>> descriptor:
>>     <values>
>>       <value param="pdate" dbcol="fdate" type="time-stamp"/>
>>     </values>
>>
>> DatabaseAddAction can't find pdate (always null).
>> In addition to this logger also not print request attributes, only
>> parameters.
>>
>> Thursday, September 06, 2001, 6:21:50 PM, you wrote:
>> > Hi Andrew,
>> >
>> > I'm working with the latest Cocoon2b2 code from CVS.
>> >
>> > I've added support in AbstractDatabaseAction for:
>> >
>> > request attributes overriding request parameters
>> > "nullable" attribute in the AbstractDatabaseAction descriptor
>> > "default" attribute in the AbstractDatabaseAction descriptor
>> >
>> > I'll be submitting diffs today (if I can, my ISP is bad today :( )
>> >
>> > Having said that, these are only fixes. Christian Haul is working on a
>> > new architecture for this problem so I'm not sure if my diffs will make
>> > it into the codebase. If your not happy applying diffs I can send you the
>> > patched classes.
>> >
>> > Regards,
>> >
>> > Chris
>> >
>> >> -----Original Message-----
>> >> From: Andrew Answer [mailto:creator0@mail.ru]
>> >> Sent: 06 September 2001 11:43
>> >> To: Chris Newland
>> >> Subject: Re[2]: DatabaseXActions
>> >>
>> >>
>> >> Hello Chris,
>> >>
>> >> if you can send me your sources/patches, i will be very happy.
>> >> I'm not java-spec, while only try :)
>> >>
>> >> What version on C2 you change?
>> >>
>> >> I described on cocoon-dev mailing list and can send your sources to
>> >> developers. Or if you subscribed too, you can do it.
>> >> I think what this changes are very important.
>> >> Date/time requests is common task for any sites and i wonder why this
>> >> task can't decided earlier.
>> >>
>> >> Wednesday, September 05, 2001, 8:31:15 PM, you wrote:
>> >> > Hi Andrew,
>> >> >
>> >> > I'm currently modifying the Database<Add|Delete|Update>Action actions
>> >> > to allow request parameters to be overriden with request attributes.
>> >> >
>> >> > This will allow me to pass my form data through another action which
>> >> > manipulates the values and sets them in request attributes before the
>> >> > DatabaseAddAction adds them into the database.
>> >> >
>> >> > Regards,
>> >> >
>> >> > Chris
>> >> >
>> >> >> -----Original Message-----
>> >> >> From: Andrew Answer [mailto:creator0@mail.ru]
>> >> >> Sent: 05 September 2001 14:20
>> >> >> To: cocoon-users@xml.apache.org
>> >> >> Subject: DatabaseXActions
>> >> >>
>> >> >>
>> >> >> Hello cocoon-users,
>> >> >>
>> >> >>   i read thread named "Action to modify request parameters" and want
>> >> >>   to ask another questions.
>> >> >>
>> >> >>
>> >> >>   1. I try to use DatabaseAddAction for getting form data. In
>> >> >>   descriptor file i setup column type as timestamp
>> >> >>   <value param="datetime" dbcol="fdatetime" type="time-stamp"/>.
>> >> >>   How to set request parameter on NOW + 1 hour (for example)?
>> >> >>   I can get integer or string values from form through request
>> >> >>   parameters, but can't get timestamp.
>> >> >>   <util:time format="..."/> not work because of this is a string
>> >> >>   instead of date.
>> >> >>   <xsp:logic>request.setAttribute("date",new Date());</xsp:logic> not
>> >> >>   work because DatabaseAddAction read real parameters only, not
>> >> >>   attributes (as i understand).
>> >> >>   Now i use Hsqldb and not need to convert Java datatypes into
>> >> >>   another. This actions work without converting types?
>> >> >>
>> >> >>   2. Anybody use DatabaseSelectAction? How it work? It present into
>> >> >> my version (xml-cocoon2_20010831101539.tar.gz) of C2. When i use
>> >> >> other database actions, i call cocoon-action through pressing button.
>> >> >> How to run DatabaseSelectAction automatically when i open page?
>> >> >>
>> >> >> --
>> >> >> Best regards,
>> >> >>  Andrew                          mailto:creator0@mail.ru
>> >> >>
>> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> Please check that your question has not already been answered in the
>> >> >> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>> >> >>
>> >> >> To unsubscribe, e-mail: <co...@xml.apache.org>
>> >> >> For additional commands, e-mail: <co...@xml.apache.org>
>> >>
>> >> --
>> >> Best regards,
>> >>  Andrew                            mailto:creator0@mail.ru
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> Please check that your question has not already been answered in the
>> >> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>> >>
>> >> To unsubscribe, e-mail: <co...@xml.apache.org>
>> >> For additional commands, e-mail: <co...@xml.apache.org>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>> > For additional commands, email: cocoon-dev-help@xml.apache.org


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org




-- 
Best regards,
 Andrew                            mailto:creator0@mail.ru



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org