[Zope3-dev] Re: content factory and content type info

Jim Fulton jim@zope.com
Thu, 08 May 2003 10:50:09 -0400


Garrett Smith wrote:
> I think there are a couple features missing from IGlobalFactoryService:
> 
> - There's no way to read the list of factories that are "provided". The
> current "add content" mechanism relies on zmi menu declarations that
> link to the content factory ids using an action attribute. While this
> approach is fine for constructing browser UIs, I think it's important to
> be able to discover what content can be created without resorting to
> inference via UI menus.
> 
> - The title and description for content are never captured by the
> factory service. This information should be available along with the
> list of provided factories. E.g. there's currently no way to show a
> human readable 'type' column (ala Plone) for a component.


I agree.

> Possible API changes:
> 
>   IGlobalFactoryService
>   ----------------------------
>   provideFactory(name, factory, title=None, description=None) o
>   provideFactory(name, factory, info=None) -- info is a dictionary

I prefer the former.

>   GlobalFactoryService
>   ----------------------------
>   providedFactories(self) -- returns a tuple of names
>   getFactoryInfo(self, name) -- returns a tuple or a dictionary 
>      with title and description for the specified factory

Why isn't getFactoryInfo in the interface.

> Is there some reason the factory service is made available via global
> instances instead of through getService? 

It's available both ways.  Of course, getService could give a local
one instead.

 > Is there some reason
> IGlobalFactoryService is an abbreviation of GlobalFactoryService?

Huh? I don't know what you mean.IGlobalFactoryService is an interface
(in the wrong place) and GlobalFactoryService is the implementation.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org