On 21.10.2008 16:27 Uhr, Nico Grubert wrote:
Hi there

I use Zope 2.10.5 and I want to create a site tree using the ZCatalog
instead of iterating recursive trough the entire object tree.

I have the following site structure (all things are folders):

- about
--- company
--- staff
----- homepages
------- phelps
--- phonebook
--- jobs
- research
--- ocean
----- atlantic
----- pacific
--- lake
--- river

My ZCatalog contains these entries:
- /research
- /research/ocean
- /research/ocean/pacific
- /research/ocean/atlantic
- /research/lake
- /research/river
- /about
- /about/company
- /about/staff
- /about/staff/homepages
- /about/staff/homepages/phelps
- /about/staff/phonebook
- /about/jobs
- /about

What I need is a list of these entries ordered according to the site
structure. I would like to get this list:
   ['/about',
    '/about/company',
    '/about/staff',
    '/about/staff/homepages',
    '/about/staff/homepages/phelps',
    '/about/phonebook',
    '/about/jobs',
    '/research',
    '/research/ocean',
    '/research/ocean/atlantic',
    '/research/ocean/pacific',
    '/research/lake',
    '/research/river'
   ]

My Zcatalog is configured as follows:
Indexes:
   - path
   - position
   - title
   - id
Metadata:
   - physical_path
   - title
   - id

The index 'position' contains the a folder's position in it's parent folder.
In my example the folder "phonebook" contains "3" for position because
it is in the 3rd position inside it's parent folder ("about").

Is it possible to build an ordered site tree with the ZCatalog only and
if so, any ideas how I can do that?


Look at the ExtendedPathIndex implementation of Plone (can be used outside Plone).

-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to