Skip to content

Commit

Permalink
Register CatalogPathAware (a bare subclass of CatalogPathAwareness
Browse files Browse the repository at this point in the history
    .CatalogAware) as a
    ZClass base class.  Its reason for existence is to make the name
    that shows up in the ZClass Product list different than 'ZCatalog:
    CatalogAware', which is the name registered by
    CatalogAwareness.CatalogAware.  The fix should *really* be to
    change the product registry to keep the whole module/class path
    and to make the ZClass add UI show the whole path, but this is
    nontrivial, we don't want to spend a lot of time on ZClasses, and
    this works.

    Now when we tell people to use CatalogPathAware instead of CatalogAware,
    they will actually be able to do it without a lot of effort.

    The reason we can't replace CatalogAware with CatalogPathAware is
    backwards-compatibility and the desire to not force people to do
    data conversion on their existing instances.
  • Loading branch information
mcdonc committed Apr 12, 2002
1 parent 104c577 commit 474810b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CatalogPathAwareness.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ def reindex_all(self, obj=None):
reindex_all(self, item)
return 'done!'

class CatalogPathAware(CatalogAware):
"""
This is a stub class that gets registered in __init__.py as a
ZClass base class. Its reason for existance is to make the name
that shows up in the ZClass Product list different than 'ZCatalog:
CatalogAware', which is the name registered by
CatalogAwareness.CatalogAware. The fix should *really* be to
change the product registry to keep the whole module/class path
and to make the ZClass add UI show the whole path, but this is
nontrivial, we don't want to spend a lot of time on ZClasses, and
this works.
"""



Expand Down
6 changes: 4 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

"""ZCatalog product"""

import ZCatalog, Catalog, CatalogPathAwareness, ZClasses
import ZCatalog, Catalog, CatalogAwareness, CatalogPathAwareness, ZClasses
from Products.PluginIndexes.TextIndex import Vocabulary
from ZClasses import createZClassForBase

createZClassForBase( ZCatalog.ZCatalog , globals()
, 'ZCatalogBase', 'ZCatalog' )
createZClassForBase( CatalogPathAwareness.CatalogAware, globals()
createZClassForBase( CatalogAwareness.CatalogAware, globals()
, 'CatalogAwareBase', 'CatalogAware' )
createZClassForBase( CatalogPathAwareness.CatalogPathAware, globals()
, 'CatalogPathAwareBase', 'CatalogPathAware' )

def initialize(context):
context.registerClass(
Expand Down

0 comments on commit 474810b

Please sign in to comment.