[Zope] Building a site tree with the ZCatalog

Andreas Jung lists at zopyx.com
Tue Oct 21 11:22:17 EDT 2008


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20081021/7bc18071/attachment.vcf 


More information about the Zope mailing list