Tapestry 2.4 and Cayenne

From: David Solis (dsoli..egosoft.com.mx)
Date: Wed Feb 19 2003 - 23:54:05 EST

  • Next message: Andrus Adamchik: "Re: Tapestry 2.4 and Cayenne"

    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 : Wed Feb 19 2003 - 23:56:41 EST