cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolfe Jenny <jenny.ro...@knowledgepool.com>
Subject RE: databaseaddaction...help me....
Date Fri, 05 Apr 2002 08:26:07 GMT
I've included the relevant section from the sitemap logs below. It looks as
if the pageid is being saved as a sitemap parameter but it is not being
picked up by 'key:page:pageid'. Now this database stuff is in the middle of
a whole heap of things, I'm picking up some form data on an xsp page,
sending some of it the the database and I'm also using the sourcewrite
thingy to save and xml stream to file. So it really is quite likely that
some thing is going wrong somewhere else. What I need to know is if
'key:page:pageid' is the way to pick up the previously auto incremented
value from the other table or whether there is another way to do this or
whether anyone with 'fresh eyes' can pick up on any obviously stupid
mistakes I've made.


pagetemplates/pagestructurexsl/getpagestructure.xsl
DEBUG   (2002-04-05) 09:03.29:492
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractComplementaryConfigurableAction: Using cached
configuration for context://descriptors/dbstuff.xml
DEBUG   (2002-04-05) 09:03.29:562
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/DatabaseAddAction: Add query: INSERT INTO page
(pageid, title, pagename, templatenum, techlocation, layoutnum) VALUES (?,
?, ?, ?, ?, ?)
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/DatabaseAddAction: Manually setting key to 9
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 2 named
pagetitle with value newpage
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 3 named
pagename with value newday
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 4 named
pagestructure with value 1
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 5 named
location with value 10/xmldump/newday
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 6 named
layoutnum with value 1
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/DatabaseAddAction: Add query: INSERT INTO boalinks
(parentboaid, childpageid) VALUES (?, ?)
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 1 named
parentboaid with value 6
DEBUG   (2002-04-05) 09:03.29:582
[sitemap.tutorial.action.dbAdd](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractDatabaseAction: Setting column 2 named
key:page:pageid with value null
DEBUG   (2002-04-05) 09:03.29:582   [sitemap](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/sitemap_xmap: Action set action_set_dbstuff
DEBUG   (2002-04-05) 09:03.29:582   [sitemap](/xcpt/getpagestructure1)
HttpProcessor[8080][3]/AbstractSitemap: 
Current Sitemap Parameters:
PARAM: 'pageid' VALUE: '9'
PARAM: '../1' VALUE: '1'
PARAM: '../0' VALUE: 'getpagestructure1'


Just in case it sheds any light here is the section from the sitemap:

<map:match pattern="getpagestructure*">
  <map:generate type="serverpages"
src="pagetemplates/getpagestructure{1}.xml" />
  <map:transform src="pagetemplates/pagestructurexsl/getpagestructure.xsl"
/>
  <map:act set="dbstuff"/>
  <map:transform type="sourcewriter"
src="pagetemplates/pagestructurexsl/getpagestructure.xsl" >
    <map:parameter name="serializer" value="xml"/>
  </map:transform>
  <map:transform src="pagetemplates/pagestructurexsl/getpagestructure.xsl"
/>
  <map:serialize type="html"/>
</map:match>

and here is the actionset:


<map:action-set name="dbstuff">
  <map:act type="dbAdd" action="add">
    <map:parameter name="descriptor"
value="context://descriptors/dbstuff.xml"/>
  </map:act>
  <map:act type="dbUpd" action="update">
    <map:parameter name="descriptor"
value="context://descriptors/dbstuff2.xml"/>
  </map:act>
</map:action-set>


And I do appologise if it seemed I was being overly impatient but the first
post was lost in a very old thread and pretty unreadable so I thought it
would be a better idea make it clearer and post it again rather than hope
someone was willing to wade through the messy email. 

jenny

-----Original Message-----
From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
Sent: Friday, April 05, 2002 8:51 AM
To: cocoon-users@xml.apache.org
Subject: Re: databaseaddaction...help me....


On 04.Apr.2002 -- 04:31 PM, Rolfe Jenny wrote:
> Okay so what I want to do is use the default database add action to update
> two tables, in one I automatically generate an id then I want to also put
> this id into the second table. So here's what I do:

I think the modular database actions are stable now and they know
about autoincrement columns. So perhaps you should have a look at it.

> <connection>xcpt</connection>
>   <table name="page">
>    	 <keys>
>          <key param="pageid" dbcol="pageid" type="int" mode="manual" />
>        </keys>
>     <values>
>    
> 	<value param="layoutnum" dbcol="layoutnum" type="string"/>
>  	...more values...
>     </values>
>   </table>
> 
>   <table name="boalinks">
>     <values>
> 	<value param="key:page:pageid" dbcol="childpageid" type="int" />
> 	...more values...
>    </values>
>   </table>
> 
> I've tried putting in a key, tried page.pageid, etc, etc, ect. Basically
I'm
> randomly trying stupid things now, pissing in the wind and getting very
> angry with it.

Since you quoted the last discussion about this in your last posting,
you've seen my advice on this and the solution we reached there
already. Printout all request attributes and see what's there. It
would greatly help if you could supply us with the relevant part of
your log, perhaps something else goes wrong.

> I'm using cocoon-2.0.2-dev on Tomcat 4.01
> 
> I may cry very soon...
> 
> And yes I know I've already double posted a big bloated version of this
plea
> for help but this will be the last time I ask, promise!

Considering that your posts were all dated on the 3th and this cry for
help is dated 4th, you should practice a little bit more patience when
dealing with volunteer based support. I'm sure you could get paid
support from most regulars on this list with shorter response times.

Ah, and although it is usually a very good idea to stay within the
same thread, traffic is too high to check threads that a) were
obviously resolved for good and b) are >1 month old, which is in your
case, a difference of 3249 mails in my cocoon-box (which merges
cocoon-users and cocoon-dev)

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

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

Mime
View raw message