Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install lineage.index

How to install lineage.index

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install lineage.index
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1b1 Available View build log
Windows (64-bit)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1b1 Available View build log
Mac OS X (10.5+)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1b1 Available View build log
Linux (32-bit)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1b1 Available View build log
Linux (64-bit)
0.4 Available View build log
0.3 Available View build log
0.2 Available View build log
0.1b1 Available View build log
 
License
GPL
Lastest release
version 0.4 on Jan 11th, 2012

Introduction

lineage.index is an addon to collective.lineage that lets you search for content within a certain childsite.

How does it work?

lineage.index registers an index childsite on all items implementing Products.CMFCore.interfaces.IContentish (which will be all Archetypes and Dexterity based content types).

The childsite's id can be used to search for content located in this childsite.

When listing items on the main portal, you can use the metadata-column childsite to indicate which childsites the content has been aggregated from.

How do I use it?

Once installed, new content gets indexed under the id of its closest childsite. Existing content requires a catalog update (see Installation).

You can search for content within a childsite using the index:

brains = portal_catalog(childsite='subsite1')

Each brain has a metadata column telling which childsite it's located in:

>>> brains[0].childsite
'subsite1'

If the item comes from the main portal (i.e. not inside a childsite), None will be indexed. This allows you to find only content from the main portal:

>>> brains = portal_catalog(childsite=None)
>>> brains[0].childsite is None
True

There's also a vocabulary lineage.childsites listing the available childsites with their title.

To show the title of the subsite of a brain you can use the utility view:

<ul tal:define="util context/@@childsite">
    <li tal:repeat="item folderContents">
        <span tal:replace="item/Title">Item 1</span> in
        <span tal:replace="python: util.titleForKey(item.childsite)>Subportal One</span>
    </li>
</ul>

Installation

Simply add lineage.index to your buildout eggs (no zcml slug is needed thanks to z3c.autoinclude).

Quickinstall Lineage Index.

In case you already have childsites and content that shall be indexed go to portal_catalog/manage_catalogAdvanced and click the Update Catalog button to populate the index and the catalog metadata.

Gotchas

The vocabulary caches all childsite titles until zope is restarted. If you add childsites you need to restart zope to make them show up in the vocabulary.

Changelog

0.4 (2012-01-10)
  • PEP8 fixes [claytron]
  • Use IContentish instead of IATContentType to ensure that all CMF, AT and Dexterity based content gets indexed properly. [claytron]
0.3 (2012-01-08)
  • Make non child site content be indexed as None so that "main site" content can be found via this index also. [claytron]
  • Make compatible with Plone 4.1 [jensens]
  • Add catalog.xml and remove setuphandlers logic. [jensens]
  • Add collective.lineage to metadata.xml dependencies. [jensens]
  • PEP8 fixes [jensens]
  • Change extensions of reStructuredText files so they preview correctly. [jensens]
  • Moved code to GitHub [jensens]
0.2 (2011-04-28)
  • Since Lineage's ChildSite is not implementing IPloneSiteRoot anymore, changed the indexing reference to implementing INavigationRoot [tbesluau]
  • For other versions of ATContentType, we need to try and import the interface(s) with and without the 's' [tbesluau]
0.1b1 (2010-03-16)
  • Initial release

Subscribe to package updates

Last updated Jan 11th, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.