Commit d784c5c1 authored by Chris McDonough's avatar Chris McDonough

Register CatalogPathAware (a bare subclass of CatalogPathAwareness

    .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.
parent 6773f409
......@@ -121,6 +121,18 @@ class CatalogAware:
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.
"""
......
......@@ -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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment