RE: Re: Using spring configurator (for properties) in block

2009-01-29 Thread Robby Pelssers
Thx Luca,

You just saved me a lot of time.

I solved it by putting the environment (running mode) specific property
in a separate property file:

/META-INF/cocoon/properties/dev/repositorylocation.properties
repository.dir=D:/nxp/testdata

and the other shared properties in

/META-INF/cocoon/properties/reposistory.properties
repository.dir.flyerdefinitions=${repository.dir}/XML Repository/Flyer
Definitions

Works like a charm ;-)

Cheers,
Robby

-Original Message-
From: news [mailto:n...@ger.gmane.org] On Behalf Of Luca Morandini
Sent: donderdag 29 januari 2009 1:02
To: users@cocoon.apache.org
Subject: Re: Using spring configurator (for properties) in block

Robby Pelssers wrote:
 
 So I created following  property file in 
 /META-INF/cocoon/properties/application.properties
 repository.dir=D:/_testdata_
 repository.dir.released=${repository._dir_}/XML Repository
 repository.dir.flyerdefinitions=${repository._dir_.released}/Flyer 
 Definitions

Maven doesn't expand properties like Ant does, you either have to avoid 
it, like in:
repository.dir.flyerdefinitions=D:/_testdata_/XML Repository/Flyer 
Definitions

...or ...since Cocoon reads properties files according to their names, 
you can still enjoy properties expansion by splitting the properties 
into different files:

/META-INF/cocoon/properties/application.properties
repository.dir=D:/_testdata_

/META-INF/cocoon/properties/b-application.properties
repository.dir.released=${repository._dir_}/XML Repository

/META-INF/cocoon/properties/c-application.properties
repository.dir.flyerdefinitions=${repository._dir_.released}/Flyer
Definitions

Regards,


Luca Morandini
www.lucamorandini.it



-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Email connector

2009-01-29 Thread Peter Flynn
Is there an email connector for Cocoon? I am currently using my 
.procmailrc to grab some messages of interest to a research community 
and stick them in a mailbox file. I'd like to expose the n most recent 
(say 10) in a corner of a web page which is being generated by Cocoon.


In effect it needs to parse the RFC822 headers to get the subject and 
origin and date, and then reproduce the text-body untouched (replacing  
and  with character entity references), and drop all attachments on the 
floor.


I thought I saw a reference to a component that did this a couple of 
years ago, but I can't find it again.


///Peter

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Email connector

2009-01-29 Thread David Legg

Hi Peter,

In effect it needs to parse the RFC822 headers to get the subject and 
origin and date, and then reproduce the text-body untouched (replacing 
 and  with character entity references), and drop all attachments on 
the floor.


I thought I saw a reference to a component that did this a couple of 
years ago, but I can't find it again.


You may like to take a look at the Mime4j code which is a subproject of 
the James Apache mail server [1]


Regards,
David Legg

[1] http://james.apache.org/mime4j/index.html

-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



possible bug in SitemapSource

2009-01-29 Thread Thomas Markus

hi,

mimetype detection in in 
org.apache.cocoon.components.source.impl.SitemapSource seems not 
correct. field mimetype is initialized in init(). at this time the 
mimetype is not valid (always null). i modified getMimeType() (see below).


found in 2.1.7 , 2.1.8 , 2.1.11 , 2.2.0

public String getMimeType() {
   if (this.mimeType == null) {
   if (this.environment != null)
   this.mimeType = this.environment.getContentType();
   else if (this.redirectSource != null)
   this.mimeType = this.redirectSource.getMimeType();
   }
   return this.mimeType;
}

regards
thomas

begin:vcard
fn:Thomas Markus
n:Markus;Thomas
org:proventis GmbH
adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany
email;internet:t.mar...@proventis.net
tel;work:+49 30 29 36 399 22
x-mozilla-html:FALSE
url:http://www.proventis.net
version:2.1
end:vcard


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

mapping xml 2 java using cocoon (block)

2009-01-29 Thread Robby Pelssers
Hi all,

 

I have a project where I want to read xml from the filesystem and
unmarshall to Java.

 

Suppose I have a request 

http://localhost:/myproject/product/xyz-123

where xyz-123 is the product-id.  

 

Based on this information cocoon I know where to read the product-xml
from the filesystem.  I would like to map the xml now to my Product
Object.  However, the product-xml contains a reference to for instance a
file containing company information.

 

So I would like this information to be loaded as well.  Anyone done
something similar already?  Is using Castor an easy option to accomplish
this or are there easier ways.

 

Thx in advance.

Robby Pelssers

 

 

 

 

 

 

 



Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Klortho

Hi, I'm revisiting Cocoon after a long hiatus, and getting started with maven
and C2.2.
The first thing I've noticed is that the really nice exception pages are
completely gone.  Now, if I have a problem in my sitemap or in an XSLT, for
example, all I can see is the stack trace in the console window where I ran
mvn from.  
What happened to the really nice exception pages?  Is there any way I can
get them back?  Also, what about the suite of example pages that came boxed
up with C2.1?  Those were really nice too.
-- 
View this message in context: 
http://www.nabble.com/Getting-started-with-C2.2where%27s-the-exception-information--tp21736790p21736790.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Robby Pelssers
Try adding 

   map:handle-errors
 map:generate type=exception/ 
 map:serialize type=xml/
   /map:handle-errors 

To the pipeline.  

It will show you the exception (source, message, stacktrace) in the
browser

Cheers,
Robby Pelssers



-Original Message-
From: Klortho [mailto:voldr...@gmail.com] 
Sent: donderdag 29 januari 2009 22:57
To: users@cocoon.apache.org
Subject: Getting started with C2.2 -- where's the exception information?


Hi, I'm revisiting Cocoon after a long hiatus, and getting started with
maven
and C2.2.
The first thing I've noticed is that the really nice exception pages are
completely gone.  Now, if I have a problem in my sitemap or in an XSLT,
for
example, all I can see is the stack trace in the console window where I
ran
mvn from.  
What happened to the really nice exception pages?  Is there any way I
can
get them back?  Also, what about the suite of example pages that came
boxed
up with C2.1?  Those were really nice too.
-- 
View this message in context:
http://www.nabble.com/Getting-started-with-C2.2where%27s-the-excepti
on-information--tp21736790p21736790.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Klortho


Robby Pelssers-2 wrote:
 
 Try adding 
 
map:handle-errors
  map:generate type=exception/ 
  map:serialize type=xml/
/map:handle-errors 
 
 To the pipeline.  
 

Well, thanks much for the suggestion, but it didn't work.  I did some
experimenting, and tried pulling this out of a 2.1 sitemap and inserting it
at the top of my new sitemap:
  map:components
map:generators default=file
  map:generator name=exception 
 src=org.apache.cocoon.generation.ExceptionGenerator/
/map:generators
  /map:components
  
but it didn't seem to make any difference.  
The exception I'm testing is when you give it a URL that's doesn't match any
pipeline.
Well, I know I'm going to have to be patient, but so far my impression is
that version 2.2 was a giant step backwards.


-- 
View this message in context: 
http://www.nabble.com/Getting-started-with-C2.2where%27s-the-exception-information--tp21736790p21738877.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Derek Hohls
That's a little harsh - although my impression is that C2.2 is
perhaps a step sideways in terms of how many things are
done... but that's just an impression from reading all the 
mailing list QA.  So far, I have not needed to take the plunge.

 On 2009/01/30 at 01:51, in message 21738877.p...@talk.nabble.com, 
Klortho voldr...@gmail.com wrote:
...
Robby Pelssers-2 wrote:
...
Well, I know I'm going to have to be patient, but so far my impression is
that version 2.2 was a giant step backwards.



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Klortho



dhohls wrote:
 
 That's a little harsh - although my impression is that C2.2 is
 perhaps a step sideways in terms of how many things are
 done... but that's just an impression from reading all the 
 mailing list QA.  So far, I have not needed to take the plunge.
 
Yes, you're right ... too harsh.
I'm really just a newbie, but speaking as one, I think that 2.1 was a much
nicer experience out of the gate, which is pretty damn important for an
application to gain wider acceptance.

-- 
View this message in context: 
http://www.nabble.com/Getting-started-with-C2.2where%27s-the-exception-information--tp21736790p21742093.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: JX / Flowscipt variable not accessible in generated form?

2009-01-29 Thread Derek Hohls
Thanks Robby

Exactly what I needed - the only part that was different for me
was here:

map:match pattern=db/formtemplate/*
  map:generate src=forms/{1}_defn.xml type=jx
/map:match

as I already I had a match for generating the form (the
above fragment is any case incomplete); i.e.

map:match pattern=db/forms/*
map:generate src=tables/{1}_defn.xml type=jx
map:transform src=stylesheets/forms/reformat.xsl
map:serialize type=xml /
/map:match 

Derek

 On 2009/01/27 at 02:53, in message 
 7c655c04b6f59643a1ef66056c0e095e01ec0...@eusex01.sweden.ecsoft, Robby 
 Pelssers robby.pelss...@ciber.nl wrote:
Hi Derek,

How do you call your flowscript in the sitemap?

One way you could implement this:

SITEMAP
---
!--
  {1} formname
  {2} state
--
map:match pattern=db/forms/*/*
  map:call function=createform
map:parameter name=formname value={1}/
map:parameter name=state value={2}/
  /map:call  
/map:match


map:match pattern=db/formtemplate/*
  map:generate src=forms/{1}_defn.xml type=jx
/map:match

Formutil.js
---

function createform() {
var formname = cocoon.parameters.formname;
var state = cocoon.parameters.state;

cocoon.sendPage(db/formtemplate/ + formname,
{
state : state
}
);
}


From your flowscript you create the form:

var editCountryDataForm = new Form(cocoon:/db/forms/country/output);

Cheers,
Robby Pelssers


-Original Message-
From: Derek Hohls [mailto:dho...@csir.co.za] 
Sent: dinsdag 27 januari 2009 13:09
To: users@cocoon.apache.org 
Subject: JX / Flowscipt variable not accessible in generated form?

Using Cocoon 2.1.8

I am generating a form definition from flowscript:

var editCountryDataForm = new Form(cocoon:/db/forms/country,
{state:output});//dynamic

And generating it thus via the pipeline:

map:match pattern=db/forms/*
  map:generate src=forms/{1}_defn.xml type=jx

And in the country_defn.xml (form) file I have:

fd:field id=Code required=true state=${state}
  fd:labelCountry Code *${state}*/fd:label

But the state value never shows up at all in the resulting form, 
even when using different values in the flowscript, and the 
state of the field shows up as a normal form element.

I'm sure I am missing something simple... but what?

Thanks
Derek




-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Getting started with C2.2 -- where's the exception information?

2009-01-29 Thread Derek Hohls
You may be correct; but I have never felt that Cocoon was
striving for acceptance.  It simply is what it is; and you either
find it incredibly powerful and useful ... or become a mainstream
php/ruby developer.  If you are here, its because you have taken
the road (development route?!) less traveled!

 On 2009/01/30 at 08:24, in message 21742093.p...@talk.nabble.com, 
Klortho voldr...@gmail.com wrote:

dhohls wrote:
 
 That's a little harsh - although my impression is that C2.2 is
 perhaps a step sideways in terms of how many things are
 done... but that's just an impression from reading all the 
 mailing list QA.  So far, I have not needed to take the plunge.
 
Yes, you're right ... too harsh.
I'm really just a newbie, but speaking as one, I think that 2.1 was a much
nicer experience out of the gate, which is pretty damn important for an
application to gain wider acceptance.




-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org