[Zope-CMF] Directory mapping under CMF

J C Lawrence claw@kanga.nu
Tue, 20 Aug 2002 01:30:04 -0700


On Tue, 20 Aug 2002 09:13:01 +0100 
Chris Withers <chrisw@nipltd.com> wrote:
> J C Lawrence wrote:

>> Could you give me a hint as to how to register it as a CMF addable
>> type?  I've written Install.py's for other products, but I don't yet
>> see where to plug into DirectoryView.py.

> grep the source code for registerDirectory and see where it's called.

The root seems to start with:

  _dirreg = DirectoryRegistry()
  registerDirectory = _dirreg.registerDirectory
  registerFileExtension = _dirreg.registerFileExtension
  registerMetaType = _dirreg.registerMetaType

which as I understand it just exposes registerDirectory() as a direct
call into _dirreg.registerDirectory() so that it can be easily imported.

Outside of that it gets called by
DirectoryInformation.prepareContents(), but that seems to only be
relevant when rendering an FSDV and finding a directory you didn't know
about before.  In sum the supports seem to be geared to having external
products add FSDVs, not CMF users.

Grepping the entire CMF base supporrts that view:

  $ fgrep -l registerDirector `find . -type f`    
  ./CMFCalendar/__init__.py
  ./CMFCollector/__init__.py
  ./CMFCore/DirectoryView.py
  ./CMFCore/tests/base/testcase.py
  ./CMFCore/tests/test_DirectoryView.py
  ./CMFCore/tests/test_FSSecurity.py
  ./CMFDefault/__init__.py
  ./CMFStaging/__init__.py
  ./CMFTopic/__init__.py
  ./CMFWiki/__init__.py
  ./CMFWorkspaces/__init__.py

as its only getting called in product initialisation.

Or am I missing something?

-- 
J C Lawrence                
---------(*)                Satan, oscillate my metallic sonatas. 
claw@kanga.nu               He lived as a devil, eh?		  
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.