mò &á¸Ec@sxdZdkZdkZdkZdklZdklZdkZdk Z dk Z dk l Z l Z l Z dklZdklZdklZdklZd klZlZed ƒZeiieiieƒd ƒZd „Zd fd„ƒYZ de fd„ƒYZ!defd„ƒYZ"e i#e"ƒd„Z$d„Z%edeƒZ&d„Z'fe(dd„Z*dS(s^Mount point (stored in ZODB). $Id: MountedObject.py 41720 2006-02-21 09:41:31Z andreasjung $ N(sStringIO(s getLogger(saq_basesaq_inners aq_parent(sguarded_getattr(s SimpleItem(sFolder(sPageTemplateFile(sMountedStorageErrorsConnectionStateErrorsZope.ZODBMountPointtwwwcCsdkl}|ƒiS(N(sgetConfiguration(t App.configtgetConfigurationtdbtab(R((tD/data/zmath/zope/lib/python/Products/ZODBMountPoint/MountedObject.pyR(s tSimpleTrailblazercBs2tZdZdZd„Zd„Zdd„ZRS(s`Follows Zope paths. If a path is not found, creates a Folder. Respects Zope security. icCs ||_dS(N(tbasetself(RR((Rt__init__4scCsLt|dƒd}t|dƒ}||ƒ|i|ƒ}tidƒ|S(s%Creates and returns the named folder.tmanage_addProducttOFSPtmanage_addFolderiN( tguarded_getattrtcontextt dispatchertfactorytidtrestrictedTraversetot transactiontcommit(RR RRRR((Rt _construct7s  icCsÍ|i}td|idƒƒ}|o2t |ƒdjot d|‚n|d }nxl|D]d}y0|i o|i |ƒ}n|i|ƒ}Wqattfj o|i||ƒ}qaXqaW|S(s/Traverses a path, constructing it if necessary.t/is!Path %s is not a valid mount pathiÿÿÿÿN(RRt containertfiltertNonetpathtsplittpartst omit_finaltlent ValueErrortpartt restrictedRtunrestrictedTraversetKeyErrortAttributeErrorR(RRRRRR ((RttraverseOrConstructBs   (t__name__t __module__t__doc__R!RRR%(((RR,s   tCustomTrailblazercBs)tZdZdZed„Zd„ZRS(s©Like SimpleTrailblazer but creates custom objects. Does not respect Zope security because this may be invoked before security and products get initialized. icCsr||_|p d}n|idƒ}|djotdt|ƒƒ‚n|| |_||d|_dS(NsOFS.Folder.Foldert.isNot a valid container_class: %si( RRtcontainer_classtrfindtposRtreprt module_namet class_name(RRR+R-((RR^s    cCsy|ii}|iƒi||i|iƒ}||ƒ}|i |ƒ|i ||ƒ|i|ƒ}tidtƒ|S(s%Creates and returns the named object.t optimisticN(RRt_p_jartjartdbt classFactoryR/R0tklassRtobjt_setIdR t _setObjectR"Rt savepointtTrue(RR RR7R3R6((RRis !  (R&R'R(R!RRR(((RR)Us  t MountedObjectcBs×tZdZdZdZeZdZhdd<dd