mò &á¸Ec@sMdZdklZdklZdfd„ƒYZdefd„ƒYZdS(sZCatalog Findable class(sDTMLFile(saq_baset CatalogAwarecBs¡tZdZdZdZedeƒƒZed„Z d„Z d„Z d„Z d„Z d „Zd „Zd d „Zd „Zd„Zd„Zed„ZRS(s¥ This is a Mix-In class to make objects automaticly catalog and uncatalog themselves in Zope, and to provide some other basic attributes that are useful to catalog. Note that if your class or ZClass subclasses CatalogAware, it will only catalog itself when it is added or copied in Zope. If you make changes to your own object, you are responsible for calling your object's index_object method. RtCatalogsdtml/editCatalogerFormcCs:||_d}|dj o|i||d|ƒSndS(t sYour changes have been savedtmanage_tabs_messageN(tdefaulttselftdefault_catalogtmessagetREQUESTtNonet manage_main(RRRR((tE/data/zmath/zope/lib/python/Products/ZCatalog/CatalogPathAwareness.pytmanage_editCataloger!s   cCsm|iƒx\|iƒD]N}y |i}Wn d}nX|i||ƒ|djo|i ƒqqWdS(Ni( Rt index_objectt objectValuestobjectt _p_changedtstmanage_afterAddtitemt containerR t _p_deactivate(RRRRR((R R)s     cCsj|iƒxY|iƒD]K}y |i}Wn d}nX|i|ƒ|djo|i ƒqqWdS(Ni( RR RRRRtmanage_afterCloneRR R(RRRR((R R1s      cCsm|iƒx\|iƒD]N}y |i}Wn d}nX|i||ƒ|djo|i ƒqqWdS(Ni( Rtunindex_objectRRRRtmanage_beforeDeleteRRR R(RRRRR((R R9s     cCsNg}x8|iƒD]*\}}d|jo|i|ƒqqWdi|ƒS(s§Return a sequence of user names who have the local Owner role on an object. The name creator is used for this method to conform to Dublin Core.tOwners, N(tusersRtget_local_rolestusertrolestappendtjoin(RRRR((R tcreatorAs  cCs|iƒdS(sPObject delete handler. I think this is obsoleted by manage_beforeDelete N(RR(R((R tonDeleteObjectKscCsdi|iƒƒS(s'Return the physical path for an object.t/N(RRtgetPhysicalPath(R((R tgetPathPsiÈcCsdt|dƒpdSnt|dƒ}t|ƒo |ƒ}n|}t|t|ƒƒ}|| S(s3Return a summary of the text content of the object.t text_contenttN( thasattrRtgetattrtattrtcallablettexttmintnumtlentn(RR-R)R+R/((R tsummaryTs  cCs=t||iƒo&t||iƒi||iƒƒndS(s7A common method to allow Findables to index themselves.N(R'RRR(tcatalog_objectR$(R((R R _scCs:t||iƒo#t||iƒi|iƒƒndS(s9A common method to allow Findables to unindex themselves.N(R'RRR(tuncatalog_objectR$(R((R RescCs|iƒ|iƒdS(s Suprisingly useful N(RRR (R((R treindex_objectks cCs‰|djo |}ntt|ƒdƒo|iƒntt|ƒdƒo4|iƒ}x%|iƒD]}|i |ƒqjWndS(RR Rsdone!N( tobjR RR'taq_baseR RtsubRt reindex_all(RR4R6R((R R7ps   (t__name__t __module__t__doc__t meta_typeRtDTMLFiletglobalstmanage_editCatalogerFormR R RRRR R!R$R0R RR3R7(((R Rs          tCatalogPathAwarecBstZdZRS(s% 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. (R8R9R:(((R R?{s N(R:tGlobalsR<t AcquisitionR5RR?(RR?R<R5((R t?s  h