|
From: Nathan D. <na...@ch...> - 2002-11-01 17:30:38
|
Sean asked . . .
------------------------------------------------------------------------
<field name="related"
label="Related Press Releases"
type="org.bacfug.modus.fields.contentObject"
multiple="yes">
<objectType name="modustest.contentObjects.pressRelease"/>
</field>
So this is an array of modustest.contentObjects.pressRelease? What has
"type=..." got to do with this? What value has the type got to do with
anything?
I'm still confused by this XML example - it seems very strange to have,
effectively, two types specifies for this field... Nathan, can you
elaborate?
---------------------------------------------------------------------------
Well, this is not flushed out yet, but the idea is that there is a field
type called "contentObject" that knows how to deal with having a
contentObject (or a collection of them) as its value. That way, the
baseContentObject nor the baseField needs to have the machinery for dealing
with this case -- we can build a field type that knows about this, since it
is seems like a special case. Thus, I say this is a fieldType of
org.bacfug.modus.fields.contentObject (which probably should go back to
being contentObjectCollection) and I then need to tell it which
contentObject type it will hold. I do like Jeremy's suggestion of having a
"key" and I would probably add a "label" (so that I could know how to render
the SELECT field for choosing which of the press releases were related ;)
This also brings up the more generic question of how to best manage having
"custom" configuration within the descriptor, but that's another thread
altogether.
While we're on this topic, I am not sure how Jeremy's suggestion would work:
<field name="posts"
label="Posts"
type="org.bacfug.modus.fields.objectcollection"
key="postid"/>
I do not understand how it knows it is dealing with the post component.
Please explain.
- n
|