You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ned Jackson Lovely <nj...@njl.us> on 2008/08/10 00:37:37 UTC

T5: contributeValueEncoderSource

I'm using tapestry-hibernate, and I'm enjoying all the magic that it
provides, but I'm having one issue.

I'd like to provide my own ValueEncoderSources for my mapped entities.
I need to do some security checks and other housekeeping as I load
them.

Unfortunately, when I attempt to do something like this:

public static void
contributeValueEncoderSource(MappedConfiguration<Class,
ValueEncoderFactory> configuration, final ThingDao dao) {
        configuration.add(Thing.class, new ThingValueEncoderFactory());
}

I get the following warning:

[WARN] TapestryModule.ValueEncoderSource Service contribution (to
service 'ValueEncoderSource', by
njl.webapp.services.AppModule.contributeValueEncoderSource(MappedConfiguration,
ThingDao) (at AppModule.java:76)) conflicts with existing contribution
(by org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
HibernateSessionSource, Session, TypeCoercer, PropertyAccess,
LoggerSource) (at HibernateModule.java:149)) and has been ignored.

I realize I'm running up against the work done by the
contributeValueEncoderSource function in
org.apache.tapestry5.hibernate.HibernateModule

Is there a simple way to override this, or do I have to do something ugly?

-- 
njl

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


Re: T5: contributeValueEncoderSource

Posted by Howard Lewis Ship <hl...@gmail.com>.
Currently, it is all or nothing.

It would be easy to add support for making entity value encoding
optional (triggered by a symbol).

Please add a JIRA issue.

On Sat, Aug 9, 2008 at 3:37 PM, Ned Jackson Lovely <nj...@njl.us> wrote:
> I'm using tapestry-hibernate, and I'm enjoying all the magic that it
> provides, but I'm having one issue.
>
> I'd like to provide my own ValueEncoderSources for my mapped entities.
> I need to do some security checks and other housekeeping as I load
> them.
>
> Unfortunately, when I attempt to do something like this:
>
> public static void
> contributeValueEncoderSource(MappedConfiguration<Class,
> ValueEncoderFactory> configuration, final ThingDao dao) {
>        configuration.add(Thing.class, new ThingValueEncoderFactory());
> }
>
> I get the following warning:
>
> [WARN] TapestryModule.ValueEncoderSource Service contribution (to
> service 'ValueEncoderSource', by
> njl.webapp.services.AppModule.contributeValueEncoderSource(MappedConfiguration,
> ThingDao) (at AppModule.java:76)) conflicts with existing contribution
> (by org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
> HibernateSessionSource, Session, TypeCoercer, PropertyAccess,
> LoggerSource) (at HibernateModule.java:149)) and has been ignored.
>
> I realize I'm running up against the work done by the
> contributeValueEncoderSource function in
> org.apache.tapestry5.hibernate.HibernateModule
>
> Is there a simple way to override this, or do I have to do something ugly?
>
> --
> njl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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