mò %á¸Ec@sCdZdfd„ƒYZdfd„ƒYZdfd„ƒYZdS(s Transient Objects tTransientObjectContainercBs€tZdZd„Zed„Zd„Zd„Zd„Zdd„Z d„Z d „Z d „Z d „Z d „Zd „ZRS(s  TransientObjectContainers hold transient objects, most often, session data. You will rarely have to script a transient object container. You'll almost always deal with a TransientObject itself which you'll usually get as 'REQUEST.SESSION'. cCsdS(sh Returns a meaningful unique id for the object. Permission -- Always available N((tself((tL/data/zmath/zope/lib/python/Products/Transience/help/TransienceInterfaces.pytgetIdscCsdS(s« Return value associated with key k. If value associated with k does not exist, return default. Permission -- 'Access Transient Objects' N((Rtktdefault((Rtget#scCsdS(s˜ Return true if container has value associated with key k, else return false. Permission -- 'Access Transient Objects' N((RR((Rthas_key+scCsdS(s  Creates a new subobject of the type supported by this container with key "k" and returns it. If an object already exists in the container with key "k", a KeyError is raised. "k" must be a string, else a TypeError is raised. If the container is 'full', a MaxTransientObjectsExceeded will be raised. Permission -- 'Create Transient Objects' N((RR((Rtnew3scCsdS(s© If an object already exists in the container with key "k", it is returned. Otherwiser, create a new subobject of the type supported by this container with key "k" and return it. "k" must be a string, else a TypeError is raised. If the container is 'full', a MaxTransientObjectsExceeded exception be raised. Permission -- 'Create Transient Objects' N((RR((Rtnew_or_existingCsicCsdS(sl Set the number of minutes of inactivity allowable for subobjects before they expire (timeout_mins) as well as the 'timeout resolution' in seconds (period). 'timeout_mins' * 60 must be evenly divisible by the period. Period must be less than 'timeout_mins' * 60. Permission -- 'Manage Transient Object Container' N((Rt timeout_minstperiod((RtsetTimeoutMinutesSscCsdS(s› Return the number of minutes allowed for subobject inactivity before expiration. Permission -- 'View management screens' N((R((RtgetTimeoutMinutes]scCsdS(sn Return the 'timeout resolution' in seconds. Permission -- 'View management screens' N((R((RtgetPeriodSecondsescCsdS(su Returns the current 'after add' function, or None. Permission -- 'View management screens' N((R((RtgetAddNotificationTargetlscCsdS(s] Cause the 'after add' function to be 'f'. If 'f' is not callable and is a string, treat it as a Zope path to a callable function. 'after add' functions need accept a single argument: 'item', which is the item being added to the container. Permission -- 'Manage Transient Object Container' N((Rtf((RtsetAddNotificationTargetss cCsdS(s~ Returns the current 'before destruction' function, or None. Permission -- 'View management screens' N((R((RtgetDelNotificationTarget€scCsdS(sb Cause the 'before destruction' function to be 'f'. If 'f' is not callable and is a string, treat it as a Zope path to a callable function. 'before destruction' functions need accept a single argument: 'item', which is the item being destroyed. Permission -- 'Manage Transient Object Container' N((RR((RtsetDelNotificationTarget‡s (t__name__t __module__t__doc__RtNoneRRRR R R RRRRR(((RRs          tTransientObjectcBs˜tZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d d „Z d „Z d „Zd„Zd„Zd„ZRS(sL A transient object is a temporary object contained in a transient object container. Most of the time you'll simply treat a transient object as a dictionary. You can use Python sub-item notation:: SESSION['foo']=1 foo=SESSION['foo'] del SESSION['foo'] When using a transient object from Python-based Scripts or DTML you can use the 'get', 'set', and 'delete' methods instead. Methods of transient objects are not protected by security assertions. It's necessary to reassign mutuable sub-items when you change them. For example:: l=SESSION['myList'] l.append('spam') SESSION['myList']=l This is necessary in order to save your changes. Note that this caveat is true even for mutable subitems which inherit from the Persistence.Persistent class. cCsdS(sh Returns a meaningful unique id for the object. Permission -- Always available N((R((RR³scCsdS(sâ Returns the key under which the object is "filed" in its container. getContainerKey will often return a differnt value than the value returned by getId. Permission -- Always available N((R((RtgetContainerKeyºscCsdS(së Invalidate (expire) the transient object. Causes the transient object container's "before destruct" method related to this object to be called as a side effect. Permission -- Always available N((R((Rt invalidateÃscCsdS(s¡ Return the time the transient object was last accessed in integer seconds-since-the-epoch form. Permission -- Always available N((R((RtgetLastAccessedÍscCsdS(sh Cause the last accessed time to be set to now. Permission -- Always available N((R((RtsetLastAccessedÕscCsdS(s› Return the time the transient object was created in integer seconds-since-the-epoch form. Permission -- Always available N((R((Rt getCreatedÜscCsdS(sZ Return sequence of key elements. Permission -- Always available N((R((RtkeysäscCsdS(s\ Return sequence of value elements. Permission -- Always available N((R((RtvaluesëscCsdS(sc Return sequence of (key, value) elements. Permission -- Always available N((R((RtitemsòstmarkercCsdS(sº Return value associated with key k. If k does not exist and default is not marker, return default, else raise KeyError. Permission -- Always available N((RRR((RRùscCsdS(si Return true if item referenced by key k exists. Permission -- Always available N((RR((RRscCsdS(sU Remove all key/value pairs. Permission -- Always available N((R((RtclearscCsdS(s\ Merge dictionary d into ourselves. Permission -- Always available N((Rtd((RtupdatescCsdS(s_ Call __setitem__ with key k, value v. Permission -- Always available N((RRtv((RtsetscCsdS(sV Call __delitem__ with key k. Permission -- Always available N((RR((Rtdeletes(RRRRRRRRRRRR RRR"R$R&R'(((RR•s             tMaxTransientObjectsExceededcBstZdZRS(s‹ An exception importable from the Products.Transience.Transience module which is raised when an attempt is made to add an item to a TransientObjectContainer that is 'full'. This exception may be caught in PythonScripts through a normal import. A successful import of the exception can be achieved via:: from Products.Transience import MaxTransientObjectsExceeded (RRR(((RR($s N(RRRR((RRR(((Rt?sƒ�