[Zope3-Users] Re: content type name
Tom Dossis
td at yoma.com.au
Wed Dec 1 09:50:41 EST 2004
Philipp von Weitershausen wrote:
> Tom Dossis wrote:
>
>>
>> How can I associate names for my content types, e.g. 'Custom
>> Document', 'My Image Type', etc. ?
>
>
> As Stephan said, you really don't. Content types in Zope are interfaces
> because those are more meaningful than simple strings. Whenever you need
> a name to be presented to a user, you use menu entries etc.
>
>> Also, is there a standard way to do this for standard content, e.g.
>> "Folder", "DTML Page", etc. ?
>>
>> This would correspond to portal_type/meta_type under Zope2.
>
>
> The content type interfaces correspond to portal_type/meta_type. Strings
> (really, unicode string) are only necessary for user presentation. This
> is covered by menu entries most of the time. If you have other use
> cases, feel free to present them here and we'll discuss them.
That's it exactly - I'm after the simple string for user presentation.
However my application isn't browser based, rather a gui which currently
is a fat client in that it accesses zope3 directly. I guess it should
probably have it's own presentation view, but I don't want to tackle
that at this stage.
In any case, a user could be viewing content other than in a browser.
For example, in an xmlrpc based folder listing to a character terminal,
it may be desirable to include a content type string.
It seems roundabout to obtain this from a browser menu title entry.
>
>> It appears it could defined via ZCML zope/content/factory/title. Is
>> this the case? How can I retrieve this?
>
>
> What you probably mean is:
>
> <content class="foobar.FooBar">
> <factory
> id="foobar.FooBarFactory"
> title="Create foobars"
> />
> </content>
>
> This registers a factory component and is in *no* correspondance of the
> content type that might or might not be implemented by the class
> foobar.FooBar.
I was looking for a way to associate a content type string which I
didn't think should be defined via a browser menu title...
Thanks
-Tom
More information about the Zope3-users
mailing list