cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corin Moss <>
Subject Re: Hibernate and Bean binding
Date Mon, 04 Apr 2005 05:36:33 GMT

At the risk of talking to myself, and being called mad I thought I'd 
report back on the following:

1. One way of doing what I described below is by using the fb:javascript 

I chucked the following:

<fb:javascript id="create_kw_rel" path="/">


    var programme_id = this.lookupWidget("programme_id").getValue()
    var keyword_id = this.lookupWidget("new_keyword_id").getValue()
    //create Hibernate session
    var factory = cocoon.getComponent(Packages.hib.PersistenceFactory.ROLE);
    var hs = factory.createSession();
    if (hs == null) {
      throw new"Hibernate session is 
null ");

    var create_rel_bean = new
            , new 
    //obviously this shouldn't be hard coded - but for the purposes of 
testing it's fine.
    new java.math.BigDecimal("4")


into my binding document.

Now, this doesn't strike me as the cleanest thing in the world - does 
anyone have any comments or thoughts?



Corin Moss wrote:

> Hi All,
> I sent an email a few days ago asking for some advice on how to map a 
> hibernate one-to-many relationship to cforms using the binding 
> framework.  My request may have been a bit vauge, as I haven't had any 
> response yet.   The original email can be seen here:
> Since then, I've tested my understanding of the hibernate side of the 
> question by doing the following in flowscript:
>    var create_rel_bean = new
>        new
>            new 
> java.math.BigDecimal("4"))
>            , new 
> java.math.BigDecimal("1")
>            )
>    ),
>    new java.math.BigDecimal("4")
>    );
> This creates a new keyword_relationship entry perfectly.  Of course, 
> the references to Keywords and Programme (with hard coded ids) is 
> where the binding should be happening - as part of the context of (for 
> example) a "Programme" bean. Given this, and the other material 
> included above,  is there a simple way to do this with binding, or 
> should I rely on using flow-script and getting a handle on form values 
> to do this?
> Thanks,
> Corin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message