Hello, I would like to know if it is possible to update "only" the new document instead of update the whole or update only specific type of object. I have tried with CatalogAware (i select CatalogAware as the base-class when I create a new type of Zclass.) but I still cannot keep track new document of that document type. I have to update my catalog manually every time I add the new document. From Zope Book about catagolizing content, it should work out but it didn't. I guess I did something wrong. When I add the new document, how the Catalogaware work? Besides, I wonder if we can set the timer (maybe from the machine or system) for updating catalog automatically? Thank you in advance for any answer. pattreeya.
Pattreeya Tanisaro wrote:
Hello, I would like to know if it is possible to update "only" the new document instead of update the whole or update only specific type of object. I have tried with CatalogAware (i select CatalogAware as the base-class when I create a new type of Zclass.) but I still cannot keep track new document of that document type. I have to update my catalog manually every time I add the new document. From Zope Book about catagolizing content, it should work out but it didn't. I guess I did something wrong. When I add the new document, how the Catalogaware work? Besides, I wonder if we can set the timer (maybe from the machine or system) for updating catalog automatically?
Thank you in advance for any answer. pattreeya.
CatalogAware looks for a ZCatalog named "Catalog" (with a capital "C"). Make sure the id of your ZCatalog is set to "Catalog" and it is acquirable by the CatalogAware objects. Therefore it needs to be at or above the CatalogAware objects in your Zope hierarchy. A caveat about CatalogAware, it only catalogs objects when the are created, deleted or moved. When you change their properties they are not automatically recataloged. To recatalog a CatalogAware object, call its reindex_object() method. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey, thanks. That means it must always be "Catalog" if I want to use CatalogAware? Therefore every time I search a new document which inherit CatalogAware as the base class, I will find this new item from searching? pattreeya.
CatalogAware looks for a ZCatalog named "Catalog" (with a capital "C"). Make sure the id of your ZCatalog is set to "Catalog" and it is acquirable by the CatalogAware objects. Therefore it needs to be at or above the CatalogAware objects in your Zope hierarchy.
A caveat about CatalogAware, it only catalogs objects when the are created, deleted or moved. When you change their properties they are not automatically recataloged. To recatalog a CatalogAware object, call its reindex_object() method.
Pattreeya Tanisaro wrote:
Casey, thanks. That means it must always be "Catalog" if I want to use CatalogAware? Therefore every time I search a new document which inherit CatalogAware as the base class, I will find this new item from searching?
As you add new CatalogAware objects, they are indexed and will be found by subsequent searches. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (2)
-
Casey Duncan -
Pattreeya Tanisaro