;ò ûBc@s+dklZdklZdklZlZdklZdk l Z dk l Z l Z lZlZdklZlZdklZdklZd klZd klZd klZd klZd kl Z l!Z!dk"l#Z#dkl$Z$dk%l&Z&l'Z'defd„ƒYZ(e#e(ƒdS((sconfig(sReferenceException(slogslog_exc(sIReferenceable(sshasattr(saq_basesaq_chains aq_parentsaq_inner(sgetSecurityManagers Unauthorized(sBase(sBeforeDeleteException(s getToolByName(sCMFCorePermissions(s CopySource(sFolder(s getRelPaths getRelURL(sInitializeClass(sClassSecurityInfo(s get_cmapxsget_pngs ReferenceablecBs¢tZdZdZefZeƒZd„Ze d„Z e d„Z e d„Z e d„Z d„Zd„Ze d „Zd „Ze d „ZeZeZe d „Ze d „Ze d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z e d„Z!e d„Z"e e d„Z#e e d„Z$d„Z%dd„Z&d„Z'ei(e)i*d ƒd!„Z+ei(e)i*d"ƒe d#„Z,RS($s$ A Mix-in for Referenceable objects icCs#t|tiƒ}|i|ƒSdS(s?like absoluteURL, but return a link to the object with this UIDN(s getToolByNamesselfsconfigsREFERENCE_CATALOGstools reference_url(sselfstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys reference_url+scCs)t|tiƒ}|i|||ƒSdS(N(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolshasRelationshipTostargets relationship(sselfstargets relationshipstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pyshasRelationshipTo0scKs,t|tiƒ}|i||||SdS(N( s getToolByNamesselfsconfigsREFERENCE_CATALOGstools addReferencesobjects relationshipskwargs(sselfsobjects relationshipskwargsstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys addReference4scCs)t|tiƒ}|i|||ƒSdS(N(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsdeleteReferencestargets relationship(sselfstargets relationshipstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysdeleteReference8scCs&t|tiƒ}|i||ƒSdS(N(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsdeleteReferencess relationship(sselfs relationshipstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysdeleteReferences<scCs#t|tiƒ}|i|ƒSdS(s1What kinds of relationships does this object haveN(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsgetRelationships(sselfstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetRelationships@scCs#t|tiƒ}|i|ƒSdS(sO What kinds of relationships does this object have from others N(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsgetBackRelationships(sselfstool((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetBRelationshipsEscCsbt|tiƒ}|i||ƒ}|o/gi}|D]}||i ƒƒq9~SngSdS(s.get all the referenced objects for this objectN( s getToolByNamesselfsconfigsREFERENCE_CATALOGstools getReferencess relationshipsrefssappends_[1]srefsgetTargetObject(sselfs relationshipsrefstools_[1]srefs((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetRefsLs /cCst||iƒƒSdS(s;the url used as the relative path based uid in the catalogsN(s getRelURLsselfsgetPhysicalPath(sself((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_getURLTscCsbt|tiƒ}|i||ƒ}|o/gi}|D]}||i ƒƒq9~SngSdS(s3get all the back referenced objects for this objectN( s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsgetBackReferencess relationshipsrefssappends_[1]srefsgetSourceObject(sselfs relationshipsrefstools_[1]srefs((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetBRefsXs /cCs;t|tiƒ}|i||ƒ}|o|SngSdS(s1get all the reference objects for this object N(s getToolByNamesselfsconfigsREFERENCE_CATALOGstools getReferencess relationshipsrefs(sselfs relationshipstoolsrefs((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetReferenceImplds cCs;t|tiƒ}|i||ƒ}|o|SngSdS(s2get all the back reference objects for this objectN(s getToolByNamesselfsconfigsREFERENCE_CATALOGstoolsgetBackReferencess relationshipsrefs(sselfs relationshipstoolsrefs((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetBackReferenceImplls cCsO|iƒtj odSn|tjot|tiƒ}n|i|ƒdS(s0register with the archetype tool for a unique idN(sselfsUIDsNonesreference_managers getToolByNamesconfigsREFERENCE_CATALOGsregisterObject(sselfsreference_manager((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys _registerts  cCs#t|tiƒ}|i|ƒdS(s9unregister with the archetype tool, remove all referencesN(s getToolByNamesselfsconfigsREFERENCE_CATALOGsreference_managersunregisterObject(sselfsreference_manager((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys _unregister~scCsZtt|ƒtitƒ o t|tittiƒƒnt|tiƒi|ƒSdS(sPgiven an object extract the bag of references for which it is the sourceN( sgetattrsaq_basesselfsconfigsREFERENCE_ANNOTATIONsNonessetattrsFolders__of__(sself((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_getReferenceAnnotationsƒs  cCs4tt|ƒtitƒot|tiƒndS(s%Removes annotation from self N(sgetattrsaq_basesselfsconfigsREFERENCE_ANNOTATIONsNonesdelattr(sself((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_delReferenceAnnotationsŒscCst|titƒSdS(N(sgetattrsselfsconfigs UUID_ATTRsNone(sself((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysUID’scCs*|iƒ}|tjodSn|iƒ}xV|D]N}|i|jpt‚||_|}t t |ƒƒ}|i||ƒq4W|iƒ}xV|D]N}|i|jpt‚||_|}t t |ƒƒ}|i||ƒq™Wt|ti|ƒ|}t t |ƒƒ}|i||ƒdS(N(sselfsUIDsold_uidsNonesgetReferenceImplsfw_refssrefs sourceUIDsAssertionErrorsuidsitems aq_parentsaq_inners containersmanage_afterAddsgetBackReferenceImpls back_refss targetUIDssetattrsconfigs UUID_ATTR(sselfsuids containers back_refssitemsfw_refssold_uidsref((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_setUID•s.      cCsŒyt|tiƒ}Wn1tj o%t|ƒ}t|tiƒ}nXt|tiƒ}|i |d|ƒ|i |d|d|ƒdS(s.Update catalog after copy, rename ... sucsrcN( s getToolByNames containersconfigs UID_CATALOGsucsAttributeErrors aq_parentsselfsREFERENCE_CATALOGsrcs _catalogUIDs _catalogRefs(sselfs containersrcsuc((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_updateCatalogµs cCsƒt|dtƒ}|o!t|titƒ|iƒnt |ti tƒ}|i d|ƒ|i|ƒ|id||ƒdS(sQ Get a UID (Called when the object is created or moved.) s_v_is_cpsreference_managersmanage_afterAddN(sgetattrsitemsNonesisCopyssetattrsselfsconfigs UUID_ATTRs_delReferenceAnnotationss getToolByNames containersREFERENCE_CATALOGscts _registers_updateCatalogs_referenceApply(sselfsitems containersisCopysct((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysmanage_afterAddÉs cCs’t|tiƒ}t|dtƒ}| oKt |ti ƒ pt |d|i ƒƒƒot |ti tƒqwn|iƒ|i|ƒdS(sk Get a new UID (effectivly dropping reference) (Called when the object is cloned.) s_v_is_cpsUIDN(s getToolByNamesselfsconfigs UID_CATALOGsucsgetattrsitemsNonesisCopysshasattrs UUID_ATTRslensUIDssetattrs _registers_updateCatalog(sselfsitemsisCopysuc((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysmanage_afterCloneÛs0 c Cst|dtƒ}|tjo²t|tiƒ}|i |ƒ}|i |ƒ}yZ|ox|D]}|iƒq`Wn|ox|D]}|iƒq†Wn|iƒWqÑtj o}t|ƒ‚qÑXn|id||ƒ|i|ƒ|i|ƒdS(se Remove self from the catalog. (Called when the object is deleted or moved.) s _v_cp_refssmanage_beforeDeleteN(sgetattrsitemsNones storeRefss getToolByNamesselfsconfigsREFERENCE_CATALOGsrcs getReferencess referencessgetBackReferencessback_referencessrefsbeforeSourceDeleteInformTargetsbeforeTargetDeleteInformSourcesdeleteReferencessReferenceExceptionsEsBeforeDeleteExceptions_referenceApplys containers _uncatalogUIDs_uncatalogRefs( sselfsitems containersrefsback_referencessEs referencessrcs storeRefs((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysmanage_beforeDeleteðs*  cCs>| ot|tiƒ}n|iƒ}|i||ƒdS(N( sucs getToolByNamesaqsconfigs UID_CATALOGsselfs_getURLsurlscatalog_object(sselfsaqsucsurl((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys _catalogUIDs cCs;| ot|tiƒ}n|iƒ}|i|ƒdS(N(sucs getToolByNamesselfsconfigs UID_CATALOGs_getURLsurlsuncatalog_object(sselfsaqsucsurl((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys _uncatalogUIDs cCs¶|iƒ}|oŸ| ot|tiƒ}n| ot|ti ƒ}nx`|i ƒD]N}t ||i ƒƒ}|i||ƒ|i||ƒ|i|||ƒq\WndS(N(sselfs_getReferenceAnnotationss annotationssucs getToolByNamesaqsconfigs UID_CATALOGsrcsREFERENCE_CATALOGs objectValuessrefs getRelURLsgetPhysicalPathsurlscatalog_objects _catalogRefs(sselfsaqsucsrcsurlsrefs annotations((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys _catalogRefs%s  cCs|iƒ}|o†| ot|tiƒ}n| ot|tiƒ}nxG|i ƒD]5}t ||i ƒƒ}|i|ƒ|i|ƒq\WndS(N(sselfs_getReferenceAnnotationss annotationssucs getToolByNamesconfigs UID_CATALOGsrcsREFERENCE_CATALOGs objectValuessrefs getRelURLsgetPhysicalPathsurlsuncatalog_object(sselfsaqsucsrcsurlsrefs annotations((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_uncatalogRefs2s   cCs#ti||ƒ}d|_|SdS(Ni(s CopySources_getCopysselfs containersobs_v_is_cp(sselfs containersob((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_getCopy>s icCs|djo d|_ndS(sfkeep reference info internally when op == 1 (move) because in those cases we need to keep refsiN(sopsselfs _v_cp_refs(sselfs containersop((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_notifyOfCopyToFs cOs¯g}t|dƒo)d„}|it||iƒƒƒn|i|iƒiƒƒ|oLxI|D]=}tt |ƒo't t |ƒ}||f||ŽqfqfWndS(Ns objectValuescCs t|tƒS(N(s isinstancesobjs Referenceable(sobj((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysYs(schildrensshasattrsselfsncsextendsfilters objectValuess_getReferenceAnnotationsschilds Referenceables methodNamesgetattrsmethodsargsskwargs(sselfs methodNamesargsskwargsschildsncsmethodschildren((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys_referenceApplyOs  sgetReferenceMapcCst|ƒSdS(s/The client side map for this objects referencesN(s get_cmapxsself(sself((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetReferenceMapessgetReferencePngcCs,|o|iiddƒnt|ƒSdS(s'A png of the references for this objects content-types image/pngN(sREQUESTsRESPONSEs setHeadersget_pngsself(sselfsREQUEST((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pysgetReferencePngks(-s__name__s __module__s__doc__sisReferenceablesIReferenceables__implements__sClassSecurityInfossecuritys reference_urlsNoneshasRelationshipTos addReferencesdeleteReferencesdeleteReferencessgetRelationshipssgetBRelationshipssgetRefss_getURLsgetBRefss getReferencessgetBackReferencessgetReferenceImplsgetBackReferenceImpls _registers _unregisters_getReferenceAnnotationss_delReferenceAnnotationssUIDs_setUIDs_updateCatalogsmanage_afterAddsmanage_afterClonesmanage_beforeDeletes _catalogUIDs _uncatalogUIDs _catalogRefss_uncatalogRefss_getCopys_notifyOfCopyTos_referenceApplysdeclareProtectedsCMFCorePermissionssViewsgetReferenceMapsgetReferencePng(((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys Referenceable"sR                      (        N()sProducts.ArchetypessconfigsProducts.Archetypes.exceptionssReferenceExceptionsProducts.Archetypes.debugslogslog_excs,Products.Archetypes.interfaces.referenceablesIReferenceablesProducts.Archetypes.utilssshasattrs Acquisitionsaq_basesaq_chains aq_parentsaq_inners AccessControlsgetSecurityManagers UnauthorizedsExtensionClasssBasesOFS.ObjectManagersBeforeDeleteExceptionsProducts.CMFCore.utilss getToolByNamesProducts.CMFCoresCMFCorePermissionssOFS.CopySupports CopySources OFS.FoldersFoldersutilss getRelPaths getRelURLsGlobalssInitializeClasssClassSecurityInfos ref_graphs get_cmapxsget_pngs Referenceable(s get_cmapxs aq_parentsBeforeDeleteExceptions getToolByNamesFolders getRelURLsReferenceExceptions CopySources ReferenceablesBasesconfigslog_excsaq_innersIReferenceablesaq_bases UnauthorizedsClassSecurityInfosInitializeClasssaq_chainslogs getRelPathsgetSecurityManagersCMFCorePermissionssshasattrsget_png((sG/mnt/gmirror/ports/www/zope-archetypes/work/Archetypes/Referenceable.pys?s&            ÿP