[Zope-CMF] Getting folder contents of objects derived form portal folder

Carl Rendell cer@sol43.com
Sun, 9 Jun 2002 09:41:56 -0700


Rainer,

I could be incorrect in this assessment, and if so you can ignore 
this altogether.

It sounds as if you want a folder which is automatically cataloged 
and has metadata associated with it for each employee.

Next you want to add 'assets' for each employee to the folder. At 
some point you want to view a 'composite' of the employee 
information via the assigned view.

I do similar things quite often, but take a different tack - There 
are two products I use to get an automatically cataloged folder -

  1. PortalContentFolder from Florent Guillaume

     http://www.zope.org/Members/efge/PortalContentFolder

  2. PortalCatalogFolder (my adaptation of PortalContentFolder)

     http://www.zope.org/Members/crendell/PortalCatalogFolder

The difference between the two is #1 is 'contentish' and uses a 
view, and #2 is 'folderish' and inherits index_html for its view.

Once installed, I can ZClasses, or file based products from either 
one. You can also add properties as you ended each one for things 
base information of each employee's dossier.

Also, there is a CMF package from Alan Runyan that you might 
consider - CMFEmployment. Its not exactly where you are coming 
from, but the implementation might help with some ideas. It 
certainly demonstrates the technique for registering products with 
CMF, should you choose to go file based -

http://www.zope.org/Members/runyaga/CMFEmployment

~C
On Sunday, June 9, 2002, at 09:00  AM, zope-cmf-request@zope.org wrote:

> Message: 4
> Date: Sun, 9 Jun 2002 16:27:16 +0200
> From: Rainer Thaden <Thadi@gmx.de>
> Reply-To: Rainer Thaden <Thadi@gmx.de>
> To: zope-cmf@zope.org
> Subject: [Zope-CMF] Getting folder contents of objects derived 
> form portal folder
>
> Since i got no answer to my question, maybe i should go more into
> detail:
>
> I derived a ZClass 'Employee' from PortalContent, PortalFolder and
> DefaultDublinCoreImpl. It's a class for handling employees which
> should contain images etc. I implemented a view and edit method, added
> information in the portal_types tool and set isPrincipiaFolderish=1.
> Everything works fine except for one thing:
>
> When i add an image to an Employee instance (let's call them 'img'
> and 'emp') via the 'New...' button in the folder contents, the image
> is inside the object and can be accessed via http://.../emp/img.
>
> But the image is not listed in the folder contents of 'emp'.
> Even a call of objectValues() on 'emp' returns no results.
> It seems as if the instance emp is not considered as a folder in the
> ZMI (no '+' sign in the tree view).
>
> I tried to build a new ZClass derived form the above ZClasses and
> addtionally from ObjectManager but that doesn't solve the problem. I
> think Portal Folder is already derived from ObjectManager.
>
> Did i miss something when i created the ZClass?
>
> I use Zope 2.5.1 and python 2.1.3 on Win2k and CMF 1.2
>

Carl E. Rendell
Solution43
Information Distribution Consulting        |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z