mò &á¸Ec@s@dZdkZdklZdklZdfd„ƒYZdS(s£ZCatalog Findable class **NOTE**: This module is deprecated, and should only be used for backward-compatibility. All new code should use CatalogPathAwareness. N(sDTMLFile(saq_baset CatalogAwarecBs­tZdZdZdZedeƒƒZed„Z d„Z d„Z d„Z d„Z d „Zeieid „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((tA/data/zmath/zope/lib/python/Products/ZCatalog/CatalogAwareness.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 R6s      cCsm|iƒx\|iƒD]N}y |i}Wn d}nX|i||ƒ|djo|i ƒqqWdS(Ni( Rtunindex_objectRRRRtmanage_beforeDeleteRRR R(RRRRR((R R>s     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 tcreatorFs  cCs|iƒdS(sPObject delete handler. I think this is obsoleted by manage_beforeDelete N(RR(R((R tonDeleteObjectPsc Csìt|dƒo-t|iƒod|iƒ|if}n |iƒ}||ƒ\}}||ƒ\}}|i d}| | f}|o td|i|ƒƒd}n|p d}n|ddjod|}nti|ƒS(s-Return a SCRIPT_NAME-based url for an object.tDestinationURLs%s/%st SCRIPT_NAMEit/N(thasattrRtcallableR"tidturlt absolute_urltftypettypeturitfhostthostRt script_namet__traceback_info__tfilterR tsplitturllibtunquote( RR*R-R(R,R/R0R.R+((R R(Us     iÈcCsdt|dƒpdSnt|dƒ}t|ƒo |ƒ}n|}t|t|ƒƒ}|| S(s3Return a summary of the text content of the object.t text_contenttN( R%RtgetattrtattrR&ttexttmintnumtlentn(RR;R8R9R=((R tsummarygs  cCs=t||iƒo&t||iƒi||iƒƒndS(s7A common method to allow Findables to index themselves.N(R%RRR7tcatalog_objectR((R((R R rscCs:t||iƒo#t||iƒi|iƒƒndS(s9A common method to allow Findables to unindex themselves.N(R%RRR7tuncatalog_objectR((R((R RwscCs|iƒ|iƒdS(s Suprisingly useful N(RRR (R((R treindex_object|s 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(RRBRDR((R REs   (t__name__t __module__t__doc__t meta_typeRtDTMLFiletglobalstmanage_editCatalogerFormR R RRRR R!R3t splittypet splithostR(R>R RRARE(((R Rs         (RHR3tGlobalsRJt AcquisitionRCR(RRJR3RC((R t?s