Re: mod-db example not working.

2002-10-22 Thread Christian Haul
On 21.Oct.2002 -- 01:09 PM, Nicholas Hemley wrote:
   value name=hint_type_id type=int 
 mode name=request parameter=hint_type_request_link.hint_type_id 
type=request/
  ^^^explicitly select InputModule with short request
   /value
   value name=request_id type=int
 mode name=request parameter=hint_type_request_link.request_id 
type=request/
  ^^^explicitly select InputModule with short request
   /value
 /values

 !-- declare actions for database operations --
map:action name=mod-db-add 
src=org.apache.cocoon.acting.modular.DatabaseAddAction
   descriptorxml/descriptor.xml/descriptor
   inputrequest-param/input
   ^select default to request-param which indicates a 
more recent CVS version.

 I am using a dev version of cocoon2.1 from 16/10/2002 with tomcat 4.1.12 and win2k.

a version = 02/10/19 should not need the input/ tag anymore. But
the explicit mode @name should either be removed or changed to
request-param as well.

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

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-21 Thread Nicholas Hemley
Hi,

I also have null values being entered into my DB (MySQL) from a DatabaseAddAction. 
Here is the sitemap.log extract:

Current Sitemap Parameters:
LEVEL 4
PARAM: 'row-count' VALUE: '1'
PARAM: 'hint_type_request_link.hint_type_id[0]' VALUE: 'null'
PARAM: 'hint_type_request_link.request_id[0]' VALUE: 'null'
LEVEL 3
PARAM: '../request_id' VALUE: '914'
PARAM: '../hint_type_id' VALUE: '1'
LEVEL 2
PARAM: '../../context' VALUE: '/cocoon2.1dev1610'
PARAM: '../../requestURI' VALUE: '/cocoon2.1dev1610/hint/info_requests/update_request'
PARAM: '../../requestQuery' VALUE: ''
LEVEL 1
PARAM: '../../../0' VALUE: 'update_request'

Somehow I am loosing the values between level 3 and 4.

My descriptor is as follows:
?xml version=1.0?

root
  connectionmysql_pool/connection
  table name=hint_type_request_link alias=hint_type_request_link
keys
/keys
values
  value name=hint_type_id type=int 
mode name=request parameter=hint_type_request_link.hint_type_id 
type=request/
  /value
  value name=request_id type=int
mode name=request parameter=hint_type_request_link.request_id 
type=request/
  /value
/values
  /table

table-set name=hint_type_request_link
  table name=hint_type_request_link others-mode=request/
/table-set

/root

and the sitemap entry is:
!-- declare actions for database operations --
   map:action name=mod-db-add 
src=org.apache.cocoon.acting.modular.DatabaseAddAction
  descriptorxml/descriptor.xml/descriptor
  inputrequest-param/input
  outputrequest-attr/output
  throw-exceptionfalse/throw-exception
   /map:action

and

!-- insert hint_types into db --
  map:act type=req-params
map:parameter name=parameters value=hint_type_id request_id/
map:act type=mod-db-add
  map:parameter name=table-set value=hint_type_request_link/
/map:act
  /map:act

any ideas? I have no keys in the table since it is a link table. 

I am using a dev version of cocoon2.1 from 16/10/2002 with tomcat 4.1.12 and win2k.

Cheers,
Nic Hemley



**
The information contained in this message may be confidential or legally privileged 
and is intended for the addressee only,

If you have received this message in error or there are any problems please notify the 
originator immediately.

The unauthorised use, disclosure, copying or alteration of this message is strictly 
forbidden.
**


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




mod-db example not working.

2002-10-16 Thread Antonio Gallardo Rivera

I am trying to start the example of mod-db using PostgreSQL.

Currently, I have the autoincr, working, but the problem now is inserting a 
new row in the table groups - the easier one ;).

In the database.xml there is defined as:

table name=groups
keys
key name=gid type=int autoincrement=true
mode name=auto type=autoincr/
/key
/keys
values
value name=gname type=string/
/values
/table

Also

table-set name=groups
table name=groups/
/table-set

In the userlist.xsp there is a form that handle the new-group action:

sqltblrow
  gname
form
  input type=text name=groups.gname size=20 maxsize=20/
  input type=submit name=add-group value=new group/
   /form
 /gname
/sqltblrow

But when I try to Add a new group, It cannot get the groups.gname parameter. 
It store a null. In the sitemap.log I found the following:

Current Sitemap Parameters:
LEVEL 2
PARAM: 'add-group' VALUE: 'new group'
PARAM: 'groups.gname' VALUE: 'wsqa'
LEVEL 1
PARAM: '../0' VALUE: 'user-list'
PARAM: '../1' VALUE: 'user-list'

Thread-9/DefaultComponentFactory: ComponentFactory creating new instance of 
org.apache.cocoon.acting.modular.DatabaseAddAction.
Thread-9/DefaultComponentFactory: no logger attribute available, using 
standard logger

Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading database.xml
Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
Thread-9/DatabaseAction: i=0
Thread-9/DatabaseAction: requested mode was autoincr returning autoincr
Thread-9/DatabaseAction: i=1
Thread-9/DatabaseAction: requested mode was others returning others
Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
Thread-9/DatabaseAction: Trying to set column groups.gname from request using 
getAttribute method
Thread-9/DatabaseAction: Setting column groups.gname [0] null
Thread-9/DatabaseAction:  row no. 0
Thread-9/DatabaseAddAction: Automatically setting key
Thread-9/DatabaseAction: Setting column groups.gname[0] to null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DefaultComponentFactory: ComponentFactory decommissioning instance of  
org.apache.cocoon.acting.modular.DatabaseAddAction.

Also, the sitemap is:

  !-- add own new group --
  map:act type=req-params
 map:parameter name=parameters value=add-group groups.gname/
 map:act type=mod-db-add
   map:parameter name=table-set value=groups/
 /map:act
  /map:act


Please help,

Regards,

Antonio Gallardo.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Christian Haul

On 16.Oct.2002 -- 07:53 AM, Antonio Gallardo Rivera wrote:
 Thread-9/DatabaseAction: Could not select output mode attribute:null

So, you are using a CVS version, eh? The default outputmode used to be
(and still is) attribute which was recently renamed
request-attr. You need to add / change the output-mode/ tag of the
action declaration accordingly. Most likely you will need to add
inputrequest-param/input as well.

I'm currently creating a block for the database stuff. When that is
done, I'll change all the defaults to the new values. Sorry for now.

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

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Bobby Mitchell

Antonio Gallardo Rivera wrote:

I am trying to start the example of mod-db using PostgreSQL.

Currently, I have the autoincr, working, but the problem now is inserting a 
new row in the table groups - the easier one ;).

In the database.xml there is defined as:

table name=groups
   keys
   key name=gid type=int autoincrement=true
   mode name=auto type=autoincr/
   /key
   /keys
   values
   value name=gname type=string/
   /values
/table

Also

table-set name=groups
   table name=groups/
/table-set

In the userlist.xsp there is a form that handle the new-group action:

sqltblrow
  gname
form
  input type=text name=groups.gname size=20 maxsize=20/
  input type=submit name=add-group value=new group/
   /form
 /gname
/sqltblrow

But when I try to Add a new group, It cannot get the groups.gname parameter. 
It store a null. In the sitemap.log I found the following:

Current Sitemap Parameters:
LEVEL 2
PARAM: 'add-group' VALUE: 'new group'
PARAM: 'groups.gname' VALUE: 'wsqa'
LEVEL 1
PARAM: '../0' VALUE: 'user-list'
PARAM: '../1' VALUE: 'user-list'

Thread-9/DefaultComponentFactory: ComponentFactory creating new instance of 
org.apache.cocoon.acting.modular.DatabaseAddAction.
Thread-9/DefaultComponentFactory: no logger attribute available, using 
standard logger

Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading database.xml
Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
Thread-9/DatabaseAction: i=0
Thread-9/DatabaseAction: requested mode was autoincr returning autoincr
Thread-9/DatabaseAction: i=1
Thread-9/DatabaseAction: requested mode was others returning others
Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
Thread-9/DatabaseAction: Trying to set column groups.gname from request using 
getAttribute method
Thread-9/DatabaseAction: Setting column groups.gname [0] null
Thread-9/DatabaseAction:  row no. 0
Thread-9/DatabaseAddAction: Automatically setting key
Thread-9/DatabaseAction: Setting column groups.gname[0] to null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DefaultComponentFactory: ComponentFactory decommissioning instance of  
org.apache.cocoon.acting.modular.DatabaseAddAction.

Also, the sitemap is:

  !-- add own new group --
  map:act type=req-params
 map:parameter name=parameters value=add-group groups.gname/
 map:act type=mod-db-add
   map:parameter name=table-set value=groups/
 /map:act
  /map:act


Please help,
  


Check the documentation at User Documentation/Actions/Database. Read 
closely the sections How to obtain Values and How to store Values 
e.g. in your Session.

It's not completely clear, but it helps. Here are some examples from 
what I have done so far. I hope they are right.

1. Declaration of the modular action in the sitemap:
  map:action name=mod-db-add
src=org.apache.cocoon.acting.modular.DatabaseAddAction
!--  throw-exceptiontrue/throw-exception  --
!--  If this is set false, when the action fails it does not 
produce an error
inputrequest-parameter/input  
!--This input module has to be described in 
cocoon.xconf. --
outputsession-attribute/output
!--Ditto for the output module--
  /map:action
2. Define map:act/ in the sitemap:
   map:act type=mod-db-add src=optional src 
map:parameter name=descriptor value=database.xml/
map:parameter name=table-set value=table-set value/
!--  You can also map parameters for the action, such 
as map:parameter name=throw-exception value=true/  --
  /map:act

Hope this helps.



Regards,

Antonio Gallardo.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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



-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638





-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Bobby Mitchell

Bobby Mitchell wrote:

 Antonio Gallardo Rivera wrote:

 I am trying to start the example of mod-db using PostgreSQL.

 Currently, I have the autoincr, working, but the problem now is 
 inserting a new row in the table groups - the easier one ;).

 In the database.xml there is defined as:

 table name=groups
 keys
 key name=gid type=int autoincrement=true
 mode name=auto type=autoincr/
 /key
 /keys
 values
 value name=gname type=string/
 /values
 /table

 Also

 table-set name=groups
 table name=groups/
 /table-set

 In the userlist.xsp there is a form that handle the new-group action:

 sqltblrow
  gname
form
  input type=text name=groups.gname size=20 maxsize=20/
  input type=submit name=add-group value=new group/
   /form
 /gname
 /sqltblrow

 But when I try to Add a new group, It cannot get the groups.gname 
 parameter. It store a null. In the sitemap.log I found the following:

 Current Sitemap Parameters:
 LEVEL 2
 PARAM: 'add-group' VALUE: 'new group'
 PARAM: 'groups.gname' VALUE: 'wsqa'
 LEVEL 1
 PARAM: '../0' VALUE: 'user-list'
 PARAM: '../1' VALUE: 'user-list'

 Thread-9/DefaultComponentFactory: ComponentFactory creating new 
 instance of org.apache.cocoon.acting.modular.DatabaseAddAction.
 Thread-9/DefaultComponentFactory: no logger attribute available, 
 using standard logger

 Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading 
 database.xml
 Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
 Thread-9/DatabaseAction: i=0
 Thread-9/DatabaseAction: requested mode was autoincr returning 
 autoincr
 Thread-9/DatabaseAction: i=1
 Thread-9/DatabaseAction: requested mode was others returning others
 Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
 Thread-9/DatabaseAction: Trying to set column groups.gname from 
 request using getAttribute method
 Thread-9/DatabaseAction: Setting column groups.gname [0] null
 Thread-9/DatabaseAction:  row no. 0
 Thread-9/DatabaseAddAction: Automatically setting key
 Thread-9/DatabaseAction: Setting column groups.gname[0] to null
 Thread-9/DatabaseAction: Could not select output mode attribute:null
 Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
 Thread-9/DatabaseAction: Could not select output mode attribute:null
 Thread-9/DatabaseAction: Could not select output mode attribute:null
 Thread-9/DefaultComponentFactory: ComponentFactory decommissioning 
 instance of  org.apache.cocoon.acting.modular.DatabaseAddAction.

 Also, the sitemap is:

  !-- add own new group --
  map:act type=req-params
 map:parameter name=parameters value=add-group 
 groups.gname/
 map:act type=mod-db-add
   map:parameter name=table-set value=groups/
 /map:act
  /map:act


 Please help,
  


 Check the documentation at User Documentation/Actions/Database. Read 
 closely the sections How to obtain Values and How to store Values 
 e.g. in your Session.

 It's not completely clear, but it helps. Here are some examples from 
 what I have done so far. I hope they are right.

 1. Declaration of the modular action in the sitemap:
  map:action name=mod-db-add
src=org.apache.cocoon.acting.modular.DatabaseAddAction
!--  throw-exceptiontrue/throw-exception  --
!--  If this is set false, when the action fails it does not 
 produce an error
inputrequest-parameter/input !--This input 
 module has to be described in cocoon.xconf. --
outputsession-attribute/output
!--Ditto for the output module--
  /map:action
 2. Define map:act/ in the sitemap:
   map:act type=mod-db-add src=optional src 
map:parameter name=descriptor value=database.xml/
map:parameter name=table-set value=table-set 
 value/
!--  You can also map parameters for the action, such 
 as map:parameter name=throw-exception value=true/  --
  /map:act

 Hope this helps.

Forgot a couple of things.
In the descriptor file:
value name=ID  type=int
mode name=session-attribute 
parameter=org.apache.cocoon.components.modules.output.OutputModule:ID[0] 
type=attrib/
!-- if others-mode=attrib, use this one --
mode name=request-parameter parameter=ID type=request/
!-- if others-mode=request, use this one --
mode name=something parameter=ID type=all/
!-- I don't care what others-mode is, always use this one --
/value


mode name=request-parameter parameter=PREFIX type=request

table-set name=MAILLIST-upd
table name=NIAC_MAILLIST others-mode=request/
/table-set
Here others-mode request is saying get the values from however I 
defined type=request in the mode name.
Other values are: attrib - get values from attributes; session if 
input/ is session, request if input/ is request. others -- I'm not 
sure.
I could be absolutely wrong on this one, but it seems to work.

It would be 

Re: mod-db example not working.

2002-10-16 Thread Antonio Gallardo Rivera

Thanks Bobby.

Antonio Gallardo

El Miércoles, 16 de Octubre de 2002 08:53, Bobby Mitchell escribió:
 Bobby Mitchell wrote:
  Antonio Gallardo Rivera wrote:
  I am trying to start the example of mod-db using PostgreSQL.
 
  Currently, I have the autoincr, working, but the problem now is
  inserting a new row in the table groups - the easier one ;).
 
  In the database.xml there is defined as:
 
  table name=groups
  keys
  key name=gid type=int autoincrement=true
  mode name=auto type=autoincr/
  /key
  /keys
  values
  value name=gname type=string/
  /values
  /table
 
  Also
 
  table-set name=groups
  table name=groups/
  /table-set
 
  In the userlist.xsp there is a form that handle the new-group action:
 
  sqltblrow
   gname
 form
   input type=text name=groups.gname size=20 maxsize=20/
   input type=submit name=add-group value=new group/
/form
  /gname
  /sqltblrow
 
  But when I try to Add a new group, It cannot get the groups.gname
  parameter. It store a null. In the sitemap.log I found the following:
 
  Current Sitemap Parameters:
  LEVEL 2
  PARAM: 'add-group' VALUE: 'new group'
  PARAM: 'groups.gname' VALUE: 'wsqa'
  LEVEL 1
  PARAM: '../0' VALUE: 'user-list'
  PARAM: '../1' VALUE: 'user-list'
 
  Thread-9/DefaultComponentFactory: ComponentFactory creating new
  instance of org.apache.cocoon.acting.modular.DatabaseAddAction.
  Thread-9/DefaultComponentFactory: no logger attribute available,
  using standard logger
 
  Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading
  database.xml
  Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
  Thread-9/DatabaseAction: i=0
  Thread-9/DatabaseAction: requested mode was autoincr returning
  autoincr
  Thread-9/DatabaseAction: i=1
  Thread-9/DatabaseAction: requested mode was others returning others
  Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
  Thread-9/DatabaseAction: Trying to set column groups.gname from
  request using getAttribute method
  Thread-9/DatabaseAction: Setting column groups.gname [0] null
  Thread-9/DatabaseAction:  row no. 0
  Thread-9/DatabaseAddAction: Automatically setting key
  Thread-9/DatabaseAction: Setting column groups.gname[0] to null
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DefaultComponentFactory: ComponentFactory decommissioning
  instance of  org.apache.cocoon.acting.modular.DatabaseAddAction.
 
  Also, the sitemap is:
 
   !-- add own new group --
   map:act type=req-params
  map:parameter name=parameters value=add-group
  groups.gname/
  map:act type=mod-db-add
map:parameter name=table-set value=groups/
  /map:act
   /map:act
 
 
  Please help,
 
  Check the documentation at User Documentation/Actions/Database. Read
  closely the sections How to obtain Values and How to store Values
  e.g. in your Session.
 
  It's not completely clear, but it helps. Here are some examples from
  what I have done so far. I hope they are right.
 
  1. Declaration of the modular action in the sitemap:
   map:action name=mod-db-add
 src=org.apache.cocoon.acting.modular.DatabaseAddAction
 !--  throw-exceptiontrue/throw-exception  --
 !--  If this is set false, when the action fails it does not
  produce an error
 inputrequest-parameter/input !--This input
  module has to be described in cocoon.xconf. --
 outputsession-attribute/output
 !--Ditto for the output module--
   /map:action
  2. Define map:act/ in the sitemap:
map:act type=mod-db-add src=optional src 
 map:parameter name=descriptor value=database.xml/
 map:parameter name=table-set value=table-set
  value/
 !--  You can also map parameters for the action, such
  as map:parameter name=throw-exception value=true/  --
   /map:act
 
  Hope this helps.

 Forgot a couple of things.
 In the descriptor file:
 value name=ID  type=int
 mode name=session-attribute
 parameter=org.apache.cocoon.components.modules.output.OutputModule:ID[0]
 type=attrib/
 !-- if others-mode=attrib, use this one --
 mode name=request-parameter parameter=ID type=request/
 !-- if others-mode=request, use this one --
 mode name=something parameter=ID type=all/
 !-- I don't care what others-mode is, always use this one --
 /value


 mode name=request-parameter parameter=PREFIX type=request

 table-set name=MAILLIST-upd
 table name=NIAC_MAILLIST others-mode=request/
 /table-set
 Here others-mode request is saying get the values from however I
 defined type=request in the mode name.
 Other values 

Re: mod-db example not working.

2002-10-16 Thread Antonio Gallardo Rivera

Thanks, Chris.

Yes, I am using the lastest 2.1 CVS, like always ;)

I made this changes in the sitemap:

map:action name=mod-db-add
src=org.apache.cocoon.acting.modular.DatabaseAddAction
  descriptordatabase.xml/descriptor
  inputrequest-param/input
  output-moderequest-attr/output-mode
  throw-exceptionfalse/throw-exception
/map:action

map:action name=mod-db-upd
src=org.apache.cocoon.acting.modular.DatabaseUpdateAction
  descriptordatabase.xml/descriptor
  inputrequest-param/input
  output-moderequest-attr/output-mode
  throw-exceptionfalse/throw-exception
/map:action

map:action name=mod-db-del
src=org.apache.cocoon.acting.modular.DatabaseDeleteAction
  descriptordatabase.xml/descriptor
  inputrequest-param/input
  output-moderequest-attr/output-mode
  throw-exceptionfalse/throw-exception
/map:action

I will put a copy on this on the Wiki now :)

Thanks again,

Antonio Gallardo.

El Miércoles, 16 de Octubre de 2002 08:12, Christian Haul escribió:
 On 16.Oct.2002 -- 07:53 AM, Antonio Gallardo Rivera wrote:
  Thread-9/DatabaseAction: Could not select output mode attribute:null

 So, you are using a CVS version, eh? The default outputmode used to be
 (and still is) attribute which was recently renamed
 request-attr. You need to add / change the output-mode/ tag of the
 action declaration accordingly. Most likely you will need to add
 inputrequest-param/input as well.

 I'm currently creating a block for the database stuff. When that is
 done, I'll change all the defaults to the new values. Sorry for now.

   Chris.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Antonio Gallardo Rivera

Sorry, I made and error, I needed to change:

output-mode to output in the below description.

Antonio Gallardo

El Miércoles, 16 de Octubre de 2002 09:09, Antonio Gallardo Rivera escribió:
 Thanks, Chris.

 Yes, I am using the lastest 2.1 CVS, like always ;)

 I made this changes in the sitemap:

 map:action name=mod-db-add
   src=org.apache.cocoon.acting.modular.DatabaseAddAction
   descriptordatabase.xml/descriptor
   inputrequest-param/input
   output-moderequest-attr/output-mode
   throw-exceptionfalse/throw-exception
 /map:action

 map:action name=mod-db-upd
   src=org.apache.cocoon.acting.modular.DatabaseUpdateAction
   descriptordatabase.xml/descriptor
   inputrequest-param/input
   output-moderequest-attr/output-mode
   throw-exceptionfalse/throw-exception
 /map:action

 map:action name=mod-db-del
   src=org.apache.cocoon.acting.modular.DatabaseDeleteAction
   descriptordatabase.xml/descriptor
   inputrequest-param/input
   output-moderequest-attr/output-mode
   throw-exceptionfalse/throw-exception
 /map:action

 I will put a copy on this on the Wiki now :)

 Thanks again,

 Antonio Gallardo.

 El Miércoles, 16 de Octubre de 2002 08:12, Christian Haul escribió:
  On 16.Oct.2002 -- 07:53 AM, Antonio Gallardo Rivera wrote:
   Thread-9/DatabaseAction: Could not select output mode attribute:null
 
  So, you are using a CVS version, eh? The default outputmode used to be
  (and still is) attribute which was recently renamed
  request-attr. You need to add / change the output-mode/ tag of the
  action declaration accordingly. Most likely you will need to add
  inputrequest-param/input as well.
 
  I'm currently creating a block for the database stuff. When that is
  done, I'll change all the defaults to the new values. Sorry for now.
 
  Chris.

 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Antonio Gallardo Rivera

Bobby:

Are you using the lastes CVS too?

Antonio Gallardo

El Miércoles, 16 de Octubre de 2002 08:53, Bobby Mitchell escribió:
 Bobby Mitchell wrote:
  Antonio Gallardo Rivera wrote:
  I am trying to start the example of mod-db using PostgreSQL.
 
  Currently, I have the autoincr, working, but the problem now is
  inserting a new row in the table groups - the easier one ;).
 
  In the database.xml there is defined as:
 
  table name=groups
  keys
  key name=gid type=int autoincrement=true
  mode name=auto type=autoincr/
  /key
  /keys
  values
  value name=gname type=string/
  /values
  /table
 
  Also
 
  table-set name=groups
  table name=groups/
  /table-set
 
  In the userlist.xsp there is a form that handle the new-group action:
 
  sqltblrow
   gname
 form
   input type=text name=groups.gname size=20 maxsize=20/
   input type=submit name=add-group value=new group/
/form
  /gname
  /sqltblrow
 
  But when I try to Add a new group, It cannot get the groups.gname
  parameter. It store a null. In the sitemap.log I found the following:
 
  Current Sitemap Parameters:
  LEVEL 2
  PARAM: 'add-group' VALUE: 'new group'
  PARAM: 'groups.gname' VALUE: 'wsqa'
  LEVEL 1
  PARAM: '../0' VALUE: 'user-list'
  PARAM: '../1' VALUE: 'user-list'
 
  Thread-9/DefaultComponentFactory: ComponentFactory creating new
  instance of org.apache.cocoon.acting.modular.DatabaseAddAction.
  Thread-9/DefaultComponentFactory: no logger attribute available,
  using standard logger
 
  Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading
  database.xml
  Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
  Thread-9/DatabaseAction: i=0
  Thread-9/DatabaseAction: requested mode was autoincr returning
  autoincr
  Thread-9/DatabaseAction: i=1
  Thread-9/DatabaseAction: requested mode was others returning others
  Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
  Thread-9/DatabaseAction: Trying to set column groups.gname from
  request using getAttribute method
  Thread-9/DatabaseAction: Setting column groups.gname [0] null
  Thread-9/DatabaseAction:  row no. 0
  Thread-9/DatabaseAddAction: Automatically setting key
  Thread-9/DatabaseAction: Setting column groups.gname[0] to null
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DatabaseAction: Could not select output mode attribute:null
  Thread-9/DefaultComponentFactory: ComponentFactory decommissioning
  instance of  org.apache.cocoon.acting.modular.DatabaseAddAction.
 
  Also, the sitemap is:
 
   !-- add own new group --
   map:act type=req-params
  map:parameter name=parameters value=add-group
  groups.gname/
  map:act type=mod-db-add
map:parameter name=table-set value=groups/
  /map:act
   /map:act
 
 
  Please help,
 
  Check the documentation at User Documentation/Actions/Database. Read
  closely the sections How to obtain Values and How to store Values
  e.g. in your Session.
 
  It's not completely clear, but it helps. Here are some examples from
  what I have done so far. I hope they are right.
 
  1. Declaration of the modular action in the sitemap:
   map:action name=mod-db-add
 src=org.apache.cocoon.acting.modular.DatabaseAddAction
 !--  throw-exceptiontrue/throw-exception  --
 !--  If this is set false, when the action fails it does not
  produce an error
 inputrequest-parameter/input !--This input
  module has to be described in cocoon.xconf. --
 outputsession-attribute/output
 !--Ditto for the output module--
   /map:action
  2. Define map:act/ in the sitemap:
map:act type=mod-db-add src=optional src 
 map:parameter name=descriptor value=database.xml/
 map:parameter name=table-set value=table-set
  value/
 !--  You can also map parameters for the action, such
  as map:parameter name=throw-exception value=true/  --
   /map:act
 
  Hope this helps.

 Forgot a couple of things.
 In the descriptor file:
 value name=ID  type=int
 mode name=session-attribute
 parameter=org.apache.cocoon.components.modules.output.OutputModule:ID[0]
 type=attrib/
 !-- if others-mode=attrib, use this one --
 mode name=request-parameter parameter=ID type=request/
 !-- if others-mode=request, use this one --
 mode name=something parameter=ID type=all/
 !-- I don't care what others-mode is, always use this one --
 /value


 mode name=request-parameter parameter=PREFIX type=request

 table-set name=MAILLIST-upd
 table name=NIAC_MAILLIST others-mode=request/
 /table-set
 Here others-mode request is saying get the values from however I
 defined type=request in the 

Re: mod-db example not working.

2002-10-16 Thread Christian Haul

On 16.Oct.2002 -- 10:53 AM, Bobby Mitchell wrote:
 Here others-mode request is saying get the values from however I 
 defined type=request in the mode name.
Other values are: attrib - get values from attributes; session if 
 input/ is session, request if input/ is request. others -- I'm not 
 sure.
I could be absolutely wrong on this one, but it seems to work.

If a mode @name is omitted, the default is used which is set using the
input/ tag when configuring the action. If that is missing as well,
the actions default to request (will be request-param).

Any other InputModule could be used instead. What modules exist is
constantly changing, their description can be found in the javadocs in
the o.a.c.components.modules.input package.

 It would be really nice if we could list all combinations of values with 
 a short description(not too short) about what each setting accomplishes 
 and put it in the docs for the mod-db actions.

Could you be a bit more specific, what values you are referring to?

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

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: mod-db example not working.

2002-10-16 Thread Bobby Mitchell

Antonio Gallardo Rivera wrote:

Bobby:

Are you using the lastes CVS too?

Yes, from about 2 weeks ago.


Antonio Gallardo

El Miércoles, 16 de Octubre de 2002 08:53, Bobby Mitchell escribió:
  

Bobby Mitchell wrote:


Antonio Gallardo Rivera wrote:
  

I am trying to start the example of mod-db using PostgreSQL.

Currently, I have the autoincr, working, but the problem now is
inserting a new row in the table groups - the easier one ;).

In the database.xml there is defined as:

table name=groups
keys
key name=gid type=int autoincrement=true
mode name=auto type=autoincr/
/key
/keys
values
value name=gname type=string/
/values
/table

Also

table-set name=groups
table name=groups/
/table-set

In the userlist.xsp there is a form that handle the new-group action:

sqltblrow
 gname
   form
 input type=text name=groups.gname size=20 maxsize=20/
 input type=submit name=add-group value=new group/
  /form
/gname
/sqltblrow

But when I try to Add a new group, It cannot get the groups.gname
parameter. It store a null. In the sitemap.log I found the following:

Current Sitemap Parameters:
LEVEL 2
PARAM: 'add-group' VALUE: 'new group'
PARAM: 'groups.gname' VALUE: 'wsqa'
LEVEL 1
PARAM: '../0' VALUE: 'user-list'
PARAM: '../1' VALUE: 'user-list'

Thread-9/DefaultComponentFactory: ComponentFactory creating new
instance of org.apache.cocoon.acting.modular.DatabaseAddAction.
Thread-9/DefaultComponentFactory: no logger attribute available,
using standard logger

Thread-9/AbstractComplementaryConfigurableAction: (Re)Loading
database.xml
Thread-9/DatabaseAction: modeTypes : {1=others, 2=attribute, 0=autoincr}
Thread-9/DatabaseAction: i=0
Thread-9/DatabaseAction: requested mode was autoincr returning
autoincr
Thread-9/DatabaseAction: i=1
Thread-9/DatabaseAction: requested mode was others returning others
Thread-9/DatabaseAction: query: INSERT INTO groups (gname) VALUES (?)
Thread-9/DatabaseAction: Trying to set column groups.gname from
request using getAttribute method
Thread-9/DatabaseAction: Setting column groups.gname [0] null
Thread-9/DatabaseAction:  row no. 0
Thread-9/DatabaseAddAction: Automatically setting key
Thread-9/DatabaseAction: Setting column groups.gname[0] to null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Setting column groups.gid[0] to 10
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DatabaseAction: Could not select output mode attribute:null
Thread-9/DefaultComponentFactory: ComponentFactory decommissioning
instance of  org.apache.cocoon.acting.modular.DatabaseAddAction.

Also, the sitemap is:

 !-- add own new group --
 map:act type=req-params
map:parameter name=parameters value=add-group
groups.gname/
map:act type=mod-db-add
  map:parameter name=table-set value=groups/
/map:act
 /map:act


Please help,


Check the documentation at User Documentation/Actions/Database. Read
closely the sections How to obtain Values and How to store Values
e.g. in your Session.

It's not completely clear, but it helps. Here are some examples from
what I have done so far. I hope they are right.

1. Declaration of the modular action in the sitemap:
 map:action name=mod-db-add
   src=org.apache.cocoon.acting.modular.DatabaseAddAction
   !--  throw-exceptiontrue/throw-exception  --
   !--  If this is set false, when the action fails it does not
produce an error
   inputrequest-parameter/input !--This input
module has to be described in cocoon.xconf. --
   outputsession-attribute/output
   !--Ditto for the output module--
 /map:action
2. Define map:act/ in the sitemap:
  map:act type=mod-db-add src=optional src 
   map:parameter name=descriptor value=database.xml/
   map:parameter name=table-set value=table-set
value/
   !--  You can also map parameters for the action, such
as map:parameter name=throw-exception value=true/  --
 /map:act

Hope this helps.
  

Forgot a couple of things.
In the descriptor file:
value name=ID  type=int
mode name=session-attribute
parameter=org.apache.cocoon.components.modules.output.OutputModule:ID[0]
type=attrib/
!-- if others-mode=attrib, use this one --
mode name=request-parameter parameter=ID type=request/
!-- if others-mode=request, use this one --
mode name=something parameter=ID type=all/
!-- I don't care what others-mode is, always use this one --
/value


mode name=request-parameter parameter=PREFIX type=request

table-set name=MAILLIST-upd
table name=NIAC_MAILLIST others-mode=request/
/table-set
Here others-mode request is saying get the values from however I
defined type=request in the mode name.
Other values are: attrib - get values from attributes; session if
input/ is session, request if input/ is request. others 

Re: mod-db example not working.

2002-10-16 Thread Bobby Mitchell



Could you be a bit more specific, what values you are referring to?
  

I had the most trouble figuring out the descriptor file.
   
keys 
   key name=ID type=string autoincrement=false
   mode name=request parameter=ID type=all/
!-- if mode is not defined it defaults to request parameter --
!-- name=the name of the input-module or autoincrement-module 
as defined in cocoon.xconf/ --
!--parameter=the name of the parameter that the data is 
retrieved from, choices could be session attribute, request attribute, 
request parameter/--
!--type=defined in table-set/table/others-mode, choices are: 
request, attrib, all/ --
   !-- if type=autoincr , then name will be an 
autoincrement-module --
!-- retrieve data from the mode tag with type=others-mode--
!-- if a mode tag has a type=all this tag is always used 
regardless of others-mode --
/key
/keys

!-- mode tags are only useful in key/ elements --


I know that a lot of info is included in the database.xml file in the 
sample, but I think it would be helpful to slow people like me to have 
it in the documentation, also.

Bobby

-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638





-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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