Re: Update Database by DatabaseUpdateAction

2008-06-18 Thread Johannes Hoechstaedter

I did it.

my problem was, to map the names of the request attributes and the table 
names properly.


cheers
Johannes

Johannes Hoechstaedter schrieb:

Hi everybody,

I try an database update by request. As you maybe already can imagin: 
It doesn't work. The request url looks as follows:


http://localhost:/myBlock1/runsql/process?sql%3Auser_id=140sql%3Aemail=DDeveloper%40home.com 



It calls a pattern in my sitemap pieline. That works fine. Then I want 
cocoon to decode this url an write these data into my database. I 
already have an descriptor file where I added some attributes for my 
own. The file looks like:


?xml version=1.0?
root
  connectionpersonnel/connection
  table name = user alias=Table User
  title
  Welcome to edit the user table
  /title
  description
  Try description
  /description
 keys
key mode=form param=sql:user_id name=user_id 
alias=User Id (PK) access=h delim=, type=int 
autoincrement=true

   mode name=auto  type=autoincr/
/key
 /keys
 values deleteable = true
  value access=r delim=, mode=form 
param=sql:login_name name=login_name alias=Login Name 
type=string/value
  value access=r delim=, mode=form 
param=sql:password_value name=password_value alias=PWD 
type=string/value
value access=rw delim=, mode=form param=sql:email 
name=email alias=Email type=string/value
value access=r delim=, mode=form param=sql:last_name 
name=last_name alias=Last Name type=string/value
value access=r delim=no mode=form 
param=sql:confirm_value name=confirm_value alias=Confirmation 
String type=string/value

 /values/table
/root


My sitemap components:

map:actions
   map:action name= dbUpdate src= 
org.apache.cocoon.acting.modular.DatabaseUpdateAction /

/map:actions

map:pipeline
map:match pattern=runsql/process
   map:act type=dbUpdate
   map:parameter name=descriptor 
value=resource/internal/sql/configuration/TURBINE_USER_descriptor.xml/

   /map:act
   map:serialize/
/map:match
/map:pipeline

Whats wrong? Thank you in advance for any helpful answer.

Johannes

-
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: Tutorial improvement suggestion

2008-06-18 Thread David Legg

Grek,

The only missing thing is the actual archetype catalog XML file. 
David, would you like to prepare own? I'm not sure how archetype 
plug-in supports this file generation but even if support is bad you 
could always prepare the catalog by hand (fortunately enough, the list 
is not long for us).


I've generated the archetype catalog.  I've attached it to this email.  
It wasn't too difficult... just had to run mvn archetype:crawl and it 
placed the new file in my local repository 
([MAVEN_REPO]/.m2/repository/archetype-catalog.xml).  I then edited this 
manually to change the order of the archetypes listed from simplest to 
most complex and added some human understandable descriptions.  I've 
confirmed that the following command works with a local copy of the 
catalog: -


 mvn archetype:generate 
-DarchetypeCatalog=file://c:\temp\archetype-catalog.xml


and generates the following interactive questions: -

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'archetype'.
 ...
 [INFO] [archetype:generate]
 [INFO] Generating project in Interactive mode
 [INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.

 archetypes:maven-archetype-quickstart:1.0)
 Choose archetype:
 1: local - cocoon-22-archetype-block-plain (Creates an empty Cocoon 
block)

 2: local - cocoon-22-archetype-block (Creates a minimal Cocoon block)
 3: local - cocoon-22-archetype-webapp (Creates a web application 
Cocoon block)

 Choose a number:  (1/2/3): Choose archetype:

There is a caveat though.  I noticed on the Maven bug list [3] that some 
earlier versions of the plugin didn't handle local or remote catalog 
files.  However this seems to have been fixed in the 2.0 alpha-3 version.


So if someone would place this file on the site and update the 
documentation page we should be good to go.  I registered on the Cocoon 
documentation site [2] to see if I could update the pages myself but 
quickly discovered this doesn't let me actually create or edit the 
documentation :-(


Of course this file will have to be updated from time to time.

I have a feeling that Reinhard Pötz is our man for this ;-)  He authored 
the Maven archetype plugin list [2].  This page isn't easy to find so 
there should at least be a link to it from the tutorial pages.


Regards,
David Legg

[1] http://cocoon.zones.apache.org/daisy/
[2] http://cocoon.apache.org/2.2/maven-plugins/
[3] http://jira.codehaus.org/browse/ARCHETYPE-124
?xml version=1.0 encoding=UTF-8?
archetype-catalog
  archetypes
archetype
  groupIdorg.apache.cocoon/groupId
  artifactIdcocoon-22-archetype-block-plain/artifactId
  version1.1.0-SNAPSHOT/version
  descriptionCreates an empty Cocoon block/description
/archetype
archetype
  groupIdorg.apache.cocoon/groupId
  artifactIdcocoon-22-archetype-block/artifactId
  version1.1.0-SNAPSHOT/version
  descriptionCreates a minimal Cocoon block/description
/archetype
archetype
  groupIdorg.apache.cocoon/groupId
  artifactIdcocoon-22-archetype-webapp/artifactId
  version1.1.0-SNAPSHOT/version
  descriptionCreates a web application Cocoon block/description
/archetype
  /archetypes
/archetype-catalog-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Properties and Cocoon Spring Configurator

2008-06-18 Thread Dominic Tootell
Hi guys,

Has anyone else encountered this problem, where you cannot specify a
directory as the setting for the system property
org.apache.cocoon.settings?

According to the docs:
http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurat
or/1.0/1310_1_1.html, point 8 states:

*   If the system property org.apache.cocoon.settings is specified
and points to a property file, this is read. If the system property
points to a directory all property files from this directory are read in
alphabetical order and all property files from the sub directory named
[RUNNING_MODE] are read in alphabetical order. 


I have a properties file environment.properties in the directory
C\cmc\metadataservices\config.  However, if I specify the directory as
the value for the property
(-Dorg.apache.cocoon.settings=c:\cmc\metadataservices\config)  the
properties file does not get read, and I get the error:
Could not resolve placeholder 'database.cis.driver'
at
org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPo
stProcessor.processProperties
But if I specific value of the property to be the file directly
(-Dorg.apache.cocoon.settings=c:\cmc\metadataservices\config\environment
.properties), then it works.

Am I mis-reading the documentation, or is this a bug?  Does anyone know
the url to the bug tracking for cocoon 2.2 that I could search for
future reference?
Thanks,
/dom




http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal 
views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on 
it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.



Cocoon 2.2 and JPA

2008-06-18 Thread Miles Elam

Hi Cocooners,

Has anyone got a simple step-by-step for setting up Cocoon for use  
with EJB3 persistence?  With Maven2, the new block architecture, and  
Spring, I'm at a loss as to where to go.  I could of course just hack  
around, but I'm betting that someone out there has a clean and elegant  
configuration solution.


Best case scenario for me would be to call the EntityManager directly  
from Flow.  Other alternatives such as calls through Spring are of  
course welcome provided that EJB3 Entities are still in the picture.


I realize that this is a Cocoon user list, but by adding Spring into  
the mix, Cocoon kinda owns the problem now.  I've been dabbling with  
Cocoon since the 1.x days of processing instructions in static XML  
files, so I'm not coming as a completely blank slate to this problem;  
however, v2.2 really pulled the rug out without providing much in the  
way of documentation.


Any ideas on the best way to tackle this?


Thanks in advance,

Miles

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



Re: Tutorial improvement suggestion

2008-06-18 Thread Grzegorz Kossakowski

David Legg pisze:

Grek,

The only missing thing is the actual archetype catalog XML file. 
David, would you like to prepare own? I'm not sure how archetype 
plug-in supports this file generation but even if support is bad you 
could always prepare the catalog by hand (fortunately enough, the list 
is not long for us).


I've generated the archetype catalog.  I've attached it to this email.  
It wasn't too difficult... just had to run mvn archetype:crawl and it 
placed the new file in my local repository 
([MAVEN_REPO]/.m2/repository/archetype-catalog.xml).  I then edited this 
manually to change the order of the archetypes listed from simplest to 
most complex and added some human understandable descriptions.  I've 
confirmed that the following command works with a local copy of the 
catalog: -


 mvn archetype:generate 
-DarchetypeCatalog=file://c:\temp\archetype-catalog.xml


and generates the following interactive questions: -

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'archetype'.
 ...
 [INFO] [archetype:generate]
 [INFO] Generating project in Interactive mode
 [INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.

 archetypes:maven-archetype-quickstart:1.0)
 Choose archetype:
 1: local - cocoon-22-archetype-block-plain (Creates an empty Cocoon 
block)

 2: local - cocoon-22-archetype-block (Creates a minimal Cocoon block)
 3: local - cocoon-22-archetype-webapp (Creates a web application 
Cocoon block)

 Choose a number:  (1/2/3): Choose archetype:

There is a caveat though.  I noticed on the Maven bug list [3] that some 
earlier versions of the plugin didn't handle local or remote catalog 
files.  However this seems to have been fixed in the 2.0 alpha-3 version.


AFAIK, Maven will pick up the latest version so that's not a problem.

Thanks for taking care of creating of this file. However, if we are going to upload it to our site 
we need an explicit sign of contribution for legal reasons. Therefore I would like to ask you to 
create a JIRA issue[4] and attach your file to it. Then we can proceed.


So if someone would place this file on the site and update the 
documentation page we should be good to go.  I registered on the Cocoon 
documentation site [2] to see if I could update the pages myself but 
quickly discovered this doesn't let me actually create or edit the 
documentation :-(


Take a look at:
http://cocoon.apache.org/1273_1_1.html

There you find instructions how to contribute to the documentation.


Of course this file will have to be updated from time to time.


Yep, every time new archetype is being released but it's not a big deal.

I have a feeling that Reinhard Pötz is our man for this ;-)  He authored 
the Maven archetype plugin list [2].  This page isn't easy to find so 
there should at least be a link to it from the tutorial pages.


David, what about the link in the horizontal menu below search field?

BTW We try to avoid establishing desolated islands of the responsibility/interest. Even though 
Reinhard's huge work is undeniable there are other folks that can share the responsibility. That's 
how community should work.


[4] https://issues.apache.org/jira/browse/COCOON

Thanks again for your sweet work!

--
Best regards,
Grzegorz Kossakowski

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



Re: Properties and Cocoon Spring Configurator

2008-06-18 Thread Grzegorz Kossakowski

Dominic Tootell pisze:

Hi guys,


Hi Dominic,

Has anyone else encountered this problem, where you cannot specify a 
directory as the setting for the system property org.apache.cocoon.settings?


According to the docs:  
_http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/1.0/1310_1_1.html_, 
point 8 states:


* If the system property org.apache.cocoon.settings is specified and
  points to a property file, this is read. If the system property
  points to a directory all property files from this directory are
  read in alphabetical order and all property files from the sub
  directory named [RUNNING_MODE] are read in alphabetical order.


I have a properties file environment.properties in the directory 
C\cmc\metadataservices\config.  However, if I specify the directory as 
the value for the property 
(-Dorg.apache.cocoon.settings=c:\cmc\metadataservices\config)  the 
properties file does not get read, and I get the error:


Could not resolve placeholder 'database.cis.driver'
at 
org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor.processProperties 

But if I specific value of the property to be the file directly 
(-Dorg.apache.cocoon.settings=c:\cmc\metadataservices\config\environment.properties), 
then it works.


Am I mis-reading the documentation, or is this a bug?  Does anyone know 
the url to the bug tracking for cocoon 2.2 that I could search for 
future reference?


This looks like a bug but after taking a quick look at the source code of Spring Configurator I fail 
to see the cause for it, though. Anyway, you can find information about issue tracking under 
Project information node in menu, see:

http://cocoon.apache.org/issue-tracking.html

General suggestion: before you try to run Cocoon with debugger you can see what's going on by 
checking logs (with DEBUG level set on). Spring Configurator puts a lot of useful information into logs.


--
Best regards,
Grzegorz Kossakowski

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



Re: Cocoon 2.2 and JPA

2008-06-18 Thread Grzegorz Kossakowski

Miles Elam pisze:

Hi Cocooners,


Hi Miles,

Has anyone got a simple step-by-step for setting up Cocoon for use with 
EJB3 persistence?  With Maven2, the new block architecture, and Spring, 
I'm at a loss as to where to go.  I could of course just hack around, 
but I'm betting that someone out there has a clean and elegant 
configuration solution.


Best case scenario for me would be to call the EntityManager directly 
from Flow.  Other alternatives such as calls through Spring are of 
course welcome provided that EJB3 Entities are still in the picture.


I realize that this is a Cocoon user list, but by adding Spring into the 
mix, Cocoon kinda owns the problem now.  I've been dabbling with Cocoon 
since the 1.x days of processing instructions in static XML files, so 
I'm not coming as a completely blank slate to this problem; however, 
v2.2 really pulled the rug out without providing much in the way of 
documentation.


Any ideas on the best way to tackle this?


Actually, amongst the other reasons we have integrated Spring into Cocoon in order to have solutions 
to many common problems in place. In this case, it's more like a question how to integrate a JPA 
with Spring not a Cocoon as it lives in higher layer delegating such kind of problems to Spring and 
staying focused on its own affairs.


Therefore I suggest to have a look at this:
http://static.springframework.org/spring/docs/2.5.x/reference/orm.html#orm-jpa

I hope that helps you a little bit.

--
Best regards,
Grzegorz Kossakowski

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



Re: Cocoon 2.2 and JPA

2008-06-18 Thread Thomas Soddemann

Hi Miles,

if I were you, I'd favor a data transfer object/data access object 
approach in order to more clearly decouple the persistence 
implementation from the presentation layer. This also gives you the 
benefit that you can completely independent of each other test each layer.


Cheers,
Thomas



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



cocoon 2.2 app with cforms in dev mode problems

2008-06-18 Thread rossputin

Hi guys,

I have a block which uses cforms, cocoon 2.2 final release versions.  It is
set up in development mode on my dev machine.  When I access the form pages
without clearing the cache, I get an error which is resolved when I refresh
the page in the browser.  If I clear the cache before working through the
webapp, I do not get any errors which require the page to be refreshed.

I run the app with the mvn jetty:run command for the time being, and use the
rcl file to link blocks.

Sorry, at this point I can not describe this in a better way.  I suppose I
have not read some documentation somewhere that tells me about modes or
something I need to setup or configure.

Thanks for your help in advance,

regards,

Ross


-- 
View this message in context: 
http://www.nabble.com/cocoon-2.2-app-with-cforms-in-dev-mode-problems-tp17991826p17991826.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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



Re: Cocoon 2.2 and JPA

2008-06-18 Thread Miles Elam

On Jun 18, 2008, at 12:22 PM, Grzegorz Kossakowski wrote:

Actually, amongst the other reasons we have integrated Spring into  
Cocoon in order to have solutions to many common problems in place.  
In this case, it's more like a question how to integrate a JPA with  
Spring not a Cocoon as it lives in higher layer delegating such kind  
of problems to Spring and staying focused on its own affairs.


Therefore I suggest to have a look at this:
http://static.springframework.org/spring/docs/2.5.x/reference/orm.html#orm-jpa


Any recommendations for how to integrate that in the Maven build?  The  
orm package does not appear to be part of the base Cocoon archetype.



Thanks,

Miles

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



Re: Cocoon 2.2 and JPA

2008-06-18 Thread Grzegorz Kossakowski

Miles Elam pisze:

On Jun 18, 2008, at 12:22 PM, Grzegorz Kossakowski wrote:

Actually, amongst the other reasons we have integrated Spring into 
Cocoon in order to have solutions to many common problems in place. In 
this case, it's more like a question how to integrate a JPA with 
Spring not a Cocoon as it lives in higher layer delegating such kind 
of problems to Spring and staying focused on its own affairs.


Therefore I suggest to have a look at this:
http://static.springframework.org/spring/docs/2.5.x/reference/orm.html#orm-jpa 



Any recommendations for how to integrate that in the Maven build?  The 
orm package does not appear to be part of the base Cocoon archetype.


You can see the listing of all spring artifacts here:
http://mvnrepository.com/artifact/org.springframework

Obviously, spring-orm is listed there so you can add to you pom:
dependency
groupIdorg.springframework/groupId
artifactIdspring-orm/artifactId
version2.5.4/version
/dependency

--
Grzegorz Kossakowski

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



Re: Tutorial improvement suggestion

2008-06-18 Thread David Legg


Thanks for taking care of creating of this file. However, if we are 
going to upload it to our site we need an explicit sign of 
contribution for legal reasons. Therefore I would like to ask you to 
create a JIRA issue and attach your file to it. Then we can proceed.


No problem.  I have created COCOON-2214 [1]

This page isn't easy to find so there should at least be a link to it 
from the tutorial pages.


David, what about the link in the horizontal menu below search field?


Doh!  Where'd that come from ;-)

Thanks for the information about how to contribute.  I've signed up.

Regards,
David Legg

[1] https://issues.apache.org/jira/browse/COCOON-2214


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