cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <elad.mess...@eml-d.villa-bosch.de>
Subject AW: Accessing the cocoon session from my Hibernate User-Type
Date Mon, 01 Aug 2005 13:16:09 GMT
Hello Johannes 
	it is quite simple.
	I am following the solution offered by Gavin here :
	http://www.theserverside.com/blogs/showblog.tss?id=HibernateInternational

	Can you see the function : "User.current().getLanguage()"?
	So - for me this function is still not implemented. This is because Cocoon is managing the
Locale in the current HTTP session, and I do not know how to get to it.
	
	In general sense, I am using a flow script which uses the hibernate session opened to query
the hibernate object :

	var indexID = cocoon.parameters["id"];
	openHibernateSession();
	var index = Packages.de.emld.wlan.business.hibernate.dao.IndexDAO.get(hs, indexID);
	cocoon.sendPage("/template/dynamic/showIndex.jx", {"index" : index} );	

	Quite straight forward.

	Now, "Index" is a hibernate mapped class. One of the property is this special translated
property, which requires the locale.
	
	So my question is how from this hibernate user-type class I can gain Access to the Cocoon
current session?

	I hope this is more clear now.

Elad


-----Urspr√ľngliche Nachricht-----
Von: Johannes Textor [mailto:jc.textor@gmx.de] 
Gesendet: Montag, 1. August 2005 14:59
An: users@cocoon.apache.org
Betreff: Re: Accessing the cocoon session from my Hibernate User-Type

Hello,

could you please provide a few more details on how you are actually "taking the user locale"
in your hibernate object (constructor parameter / system property / etc.) ? How are you accessing
your objects - directly or via a Data Access Object (DAO) ?

Regards,
Johannes

> Hello all
>         I am a bit confused on how I should handle this :
>         I have a custom Hibernate user type, which is taking the user 
> locale, and get from the DB the translated text for a table column.
>
>         Now - the locale is in my cocoon session off course - as I am 
> using the cocoon locale action.
>
>         What will be the right way to let my hibernate user-type class 
> access this locale in the cocoon session ?
>
> Elad Messing
> Software Developer
> European Media Laboratory GmbH
> Schloss-Wolfsbrunnenweg 33
> D-69118 Heidelberg
>


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



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


Mime
View raw message