Re: Tapestry 2.4 and Cayenne

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 20 2003 - 00:04:55 EST

  • Next message: Howard M. Lewis Ship: "RE: Another problem due to changes PageRecorder in 2.4 version"

    Thanks for posting this!

    Once 2.4 becomes more stable we should include this into one of our
    Tapestry examples.

    Andrus

    David Solis wrote:
    > As Howard and Craig suggested, I implememented a Tapestry extension
    > named CayenneValuePersister subclass of DefaultValuePersister which
    > registers ImmutableValueCopier as the value copier for interface
    > DataObject.
    >
    > Here the code:
    >
    > -------------------------------------------------
    > /*
    > * $Id: CayenneValuePersister.java,v 1.4 2003/02/20 02:12:00 dsolis Exp
    > $
    > * LegoSoft, Feb 19, 2003
    > * Copyright (C) 2001-2003 LegoSoft
    > */
    > package com.ixe.isis.util;
    >
    > import net.sf.tapestry.record.DefaultValuePersister;
    > import net.sf.tapestry.record.ImmutableValueCopier;
    > import net.sf.tapestry.IRequestCycle;
    > import org.objectstyle.cayenne.DataObject;
    >
    > /**
    > * In order to assure the uniqueness of Cayenne DataObject within a
    > DataContext/ObjectStore,
    > * this class registers ImmutableValueCopier as the value copier for
    > interface DataObject.
    > *
    > * It is necessary to add the extension to application spec, i.e.
    > * <pre>
    > * <extension name="net.sf.tapestry.value-persister"
    > class="com.ixe.isis.util.CayenneValuePersister"/>
    > * </pre>
    > *
    > *..uthor David Solis
    > *..ersion $Revision: 1.4 $ $Date: 2003/02/20 02:12:00 $
    > */
    >
    > public class CayenneValuePersister extends DefaultValuePersister {
    >
    > public void initialize(IRequestCycle cycle) {
    > registerValueCopier(DataObject.class, new
    > ImmutableValueCopier());
    > super.initialize(cycle);
    > }
    > }
    >
    > -------------------------------------------------
    >
    > Regards
    >
    > David



    This archive was generated by hypermail 2.0.0 : Thu Feb 20 2003 - 00:05:50 EST