You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Michael Ralston <mi...@ralston.id.au> on 2006/05/03 09:05:04 UTC

Fwd from Dev: EJB Content Generator

Nobody was interested on dev :) reposting here...

I'm working on a lenya project which requires a shopping cart to be built.

I would like to keep my products etc in a database and I'm using EJB
entity beans to store these products. I've already migrated the lenya ac
system to EJB and it's working great.

Now I'm trying to generate content from my ejb entities. I've made a
ServiceableGenerator which is able to look up the correct entity bean
from the publicationId, documentId, area and language. This is using an
implementation of DocumentIdentifier as an entity which then has a
reference to an implementation of a Lenya Node. The lenya node then has
a references to a bunch of ContentBeans (for different versions of
content, authoring live etc), which implement an interface which
requires the method:
void generate(org.xml.sax.ContentHandler ch)
this way I pass the contentHandler through from the
ServiceableGenerator, and each instance of my EJB Entity will be able to
generate xml content in it's own way.

What I want to know next, is how to configure my publication to use this
generator for specific document types? I've also contemplated using my
EJBGenerator for all document types in the same way the JCRGenerator
works. I'm having trouble understanding how this would work too. Any ideas?

Can anyone give me some ideas on what would be involved in implementing
a EJBGenerator to completely replace the filesystem based storage? I
believe this would have a number of advantages, especially if using the
generate(ch) interface I mention above. You would simply implement a new
Bean which implemented that interface and it could generate XML content,
this could then be passed through an XSLT in the same way all other
content is.

I'm interested in contributing the code I have written back into the
lenya project. However I have made substantial changes to much of the
core of lenya. I've defined interfaces for a bunch of lenya classes
which did not have them, I've then moved all the interfaces to a
src/common directory, so they can be shared between EJB and lenya. I've
rewritten alot of lenya code which used arrays to use Java1.5 typed
collections, and many for loops now use iterators instead of counting
through an array with an index. Any ideas on the best way to contribute
this code back? Maybe make a bunch of patches which are split into the
different areas they effect. Unfortunetly I'm under alot of pressure to
get the site I'm working on finished so I won't have alot of time to
create patches such as this... so it may be a while forthcoming.

Thanks for any help :)
Michael Ralston

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Fwd from Dev: EJB Content Generator

Posted by Thorsten Scherler <th...@apache.org>.
El vie, 05-05-2006 a las 22:29 +0100, Lee Carroll escribió:
> Hi Michael,
> 
> This post really looks like a post for the dev community. Your scaring
> people,
> well your scaring me.

Thanks for pointing this out Lee.

> 
> You need to win the arguments on the dev mail list :-) split development
> focus could be a bad thing?

You are totally right. I could not chose better wording.

> 
> HTH
> 
> Lee C
> 
> -----Original Message-----
> From: Michael Ralston [mailto:michael@ralston.id.au]
> Sent: 03 May 2006 08:05
> To: user@lenya.apache.org
> Subject: Fwd from Dev: EJB Content Generator
> 
> 
> Nobody was interested on dev :) reposting here...

> I'm working on a lenya project which requires a shopping cart to be built.
> 
> I would like to keep my products etc in a database and I'm using EJB
> entity beans to store these products. I've already migrated the lenya ac
> system to EJB and it's working great.
> 

Since it is a dev topic, please wait for people to think about it and
reply on dev. ;)

This is not user topic.

BTW Lee Carroll I am in the moderation team for this list and moderate
your valuable contributions. Mind the following hint. ;)
---------------------------------------------------------------------
To subscribe, e-mail: user-subscribe@lenya.apache.org

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Fwd from Dev: EJB Content Generator

Posted by Lee Carroll <le...@pear-partnership.co.uk>.
Hi Michael,

This post really looks like a post for the dev community. Your scaring
people,
well your scaring me.

You need to win the arguments on the dev mail list :-) split development
focus could be a bad thing?

HTH

Lee C

-----Original Message-----
From: Michael Ralston [mailto:michael@ralston.id.au]
Sent: 03 May 2006 08:05
To: user@lenya.apache.org
Subject: Fwd from Dev: EJB Content Generator


Nobody was interested on dev :) reposting here...

I'm working on a lenya project which requires a shopping cart to be built.

I would like to keep my products etc in a database and I'm using EJB
entity beans to store these products. I've already migrated the lenya ac
system to EJB and it's working great.

Now I'm trying to generate content from my ejb entities. I've made a
ServiceableGenerator which is able to look up the correct entity bean
from the publicationId, documentId, area and language. This is using an
implementation of DocumentIdentifier as an entity which then has a
reference to an implementation of a Lenya Node. The lenya node then has
a references to a bunch of ContentBeans (for different versions of
content, authoring live etc), which implement an interface which
requires the method:
void generate(org.xml.sax.ContentHandler ch)
this way I pass the contentHandler through from the
ServiceableGenerator, and each instance of my EJB Entity will be able to
generate xml content in it's own way.

What I want to know next, is how to configure my publication to use this
generator for specific document types? I've also contemplated using my
EJBGenerator for all document types in the same way the JCRGenerator
works. I'm having trouble understanding how this would work too. Any ideas?

Can anyone give me some ideas on what would be involved in implementing
a EJBGenerator to completely replace the filesystem based storage? I
believe this would have a number of advantages, especially if using the
generate(ch) interface I mention above. You would simply implement a new
Bean which implemented that interface and it could generate XML content,
this could then be passed through an XSLT in the same way all other
content is.

I'm interested in contributing the code I have written back into the
lenya project. However I have made substantial changes to much of the
core of lenya. I've defined interfaces for a bunch of lenya classes
which did not have them, I've then moved all the interfaces to a
src/common directory, so they can be shared between EJB and lenya. I've
rewritten alot of lenya code which used arrays to use Java1.5 typed
collections, and many for loops now use iterators instead of counting
through an array with an index. Any ideas on the best way to contribute
this code back? Maybe make a bunch of patches which are split into the
different areas they effect. Unfortunetly I'm under alot of pressure to
get the site I'm working on finished so I won't have alot of time to
create patches such as this... so it may be a while forthcoming.

Thanks for any help :)
Michael Ralston

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org