[Zope-dev] Adding your own (complex) data types to property p ages: example a nd problems...nd problems...

Jason Spisak 444@hiretechs.com
Thu, 04 May 2000 19:40:10 GMT


Philip:

> Ty and I were planning to solve this problem in ZPatterns at some point,
> but taking a somewhat different approach.  Our idea was to address the
> issue through the RIPP model PropertyHandlers.  PropertyHandlers are like
> methods that have methods - so if an object had a date value called
> StartDate, you could do something like object.StartDate.HTMLeditor() to get
> an HTML snippet for editing that property, object.StartDate() to get the
> actual property value, and object.StartDate.set(data) to change the
> property.  This makes the system wildly extensible, while keeping the
> ZPublisher type marshalling clean. 

I agree totally.
 (One problem with adding new types to
> the registry is that it's not very isolatable for virtual hostingish
> applications' security.)  It's up to the PropertyHandler to determine how
> the data is marshalled to/from standard ZPublisher-supported types.
> 
> The other advantage to this approach is that it scales to properties which
> are actually relationships to other objects - for example, mapping a
> customer number property to establish a relationship with a customer
> object.  Relationship PropertyHandlers actually delegate their
> display/editor rendering and input marshalling to the Specialist
> responsible for the kind of object the relationship "points to".
> 
> None of this exists in code yet; just thought I'd bring it up as an
> alternative approach. 

I was about to write some of that, and then turned around and did a
"mapping" to html display and edit "widgets" in DTML because that's what I
know.


Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.