[Zope3-dev] content factory and content type info

Garrett Smith garrett@mojave-corp.com
Tue, 6 May 2003 08:00:46 -0500


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.

Possible API changes:

  IGlobalFactoryService
  ----------------------------
  provideFactory(name, factory, title=3DNone, description=3DNone) or
  provideFactory(name, factory, info=3DNone) -- info is a dictionary

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

Is there some reason the factory service is made available via global
instances instead of through getService? Is there some reason
IGlobalFactoryService is an abbreviation of GlobalFactoryService?


 -- Garrett