Menu

#60 Duplicate catalog entries

open
nobody
None
5
2011-03-21
2011-03-21
No

Lately I've been noticing duplicate catalog entries:

>>> idx.getrid('/mnt/projectdb/pims/pimsdb/df8f2a9b4ac37e8d7b2801b9e49a89bb')
-1003752553
>>> idx.getrid('/mnt/projectdb/pims/pimsdb/plomino_documents/df8f2a9b4ac37e8d7b2801b9e49a89bb')
-586300914

The same document is cataloged under two paths.

One possible source of problems is `PlominoDocument.doc_url`, which hides the `plomino_documents` path element. If you edit a document at the resulting URL, I think you'll get a duplicate catalog entry.

Possible solutions:
- investigate one of the existing "alias" implementations for Plone, e.g. http://pypi.python.org/pypi/collective.alias
- spend more time with bobo_traverse
- instead of using a Plone folder for docs, use a BTree annotation on the database to store the docs, and let the database handle all access to docs so that they always appear as direct children. (I.e. instead of managing only an _objects attribute, manage a _tree like BTreeFolder2).
- decide that it's good to have the document repository in the URL, and make sure it's always there (wish it was /doc/ rather than /plomino_documents/ though).

Discussion


Log in to post a comment.

MongoDB Logo MongoDB