m .Ec @sdZdklZdklZdklZlZlZdkl Z dkl Z dk l Z dk lZdk lZd klZd klZd klZd klZd klZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdeeeeeee efdYZdefdYZ deee e fdYZ!d efd!YZ"d"ee"eee eeeef d#YZ#d$efd%YZ$d&efd'YZ%d(e#e%e eee$fd)YZ&d*ee&fd+YZ'd,e&efd-YZ(d.k)l*Z*d/e*fd0YZ+d1e+fd2YZ,d3e+fd4YZ-d5e*fd6YZ.d7S(8sMOFS z3 interfaces. $Id: interfaces.py 67823 2006-05-02 09:55:17Z philikon $ (s Attribute(s Interface(sBools BytesLinesTuple(sIOwned(s IRoleManager(s IAcquirer(s INavigation(s IUndoSupport(s IPersistent(sIDAVCollection(s IDAVResource(sIContainmentRoot(s IPossibleSitetIOrderedContainercBsntZdZedZdedZdedZedZedZedZ dZ d Z RS( s{ Ordered Container interface. This interface provides a common mechanism for maintaining ordered collections. cCsdS(s, Move specified sub-objects by delta. If delta is higher than the possible maximum, objects will be moved to the bottom. If delta is lower than the possible minimum, objects will be moved to the top. If subset_ids is not None, delta will be interpreted relative to the subset specified by a sequence of ids. The position of objects that are not part of this subset will not be changed. The order of the objects specified by ids will always be preserved. So if you don't want to change their original order, make sure the order of ids corresponds to their original order. If an object with id doesn't exist an error will be raised. Permission -- Manage properties Returns -- Number of moved sub-objects N((tidstdeltat subset_ids((t-/data/zmath/zope/lib/python/OFS/interfaces.pytmoveObjectsByDelta)sicCsdS(s Move specified sub-objects up by delta in container. If no delta is specified, delta is 1. See moveObjectsByDelta for more details. Permission -- Manage properties Returns -- Number of moved sub-objects N((RRR((Rt moveObjectsUp?s cCsdS(s Move specified sub-objects down by delta in container. If no delta is specified, delta is 1. See moveObjectsByDelta for more details. Permission -- Manage properties Returns -- Number of moved sub-objects N((RRR((RtmoveObjectsDownJs cCsdS(s Move specified sub-objects to top of container. See moveObjectsByDelta for more details. Permission -- Manage properties Returns -- Number of moved sub-objects N((RR((RtmoveObjectsToTopUscCsdS(s Move specified sub-objects to bottom of container. See moveObjectsByDelta for more details. Permission -- Manage properties Returns -- Number of moved sub-objects N((RR((RtmoveObjectsToBottom_scCsdS(s Order sub-objects by key and direction. Permission -- Manage properties Returns -- Number of moved sub-objects N((tkeytreverse((Rt orderObjectsiscCsdS(s Get the position of an object by its id. Permission -- Access contents information Returns -- Position N((tid((RtgetObjectPositionqscCsdS(s Move specified object to absolute position. Permission -- Manage properties Returns -- Number of moved sub-objects N((R tposition((RtmoveObjectToPositionys( t__name__t __module__t__doc__tNoneRRRRR R RR(((RR!s     t ICopySourcecBs_tZdZddZddZdZddZdZdZdZ d Z RS( s:Interface for objects which allow themselves to be copied.icCsdS(shCalled to make sure this object is copyable. The op var is 0 for a copy, 1 for a move. N((top((Rt_canCopyscCsdS(sOveride this to be pickly about where you go! If you dont want to go there, raise an exception. The op variable is 0 for a copy, 1 for a move. N((t containerR((Rt_notifyOfCopyToscCsdS(s N((R((Rt_getCopyscCsdS(syCalled after the copy is finished to accomodate special cases. The op var is 0 for a copy, 1 for a move. N((RR((Rt _postCopyscCsdS(s5Called to set the new id of a copied object. N((R ((Rt_setIdscCsdS(s+Is object copyable? Returns 0 or 1 N((((Rt cb_isCopyablescCsdS(s+Is object moveable? Returns 0 or 1 N((((Rt cb_isMoveablescCsdS(s N((((Rtcb_userHasCopyOrMovePermissions( RRRRRRRRRRR(((RRs        t IFTPAccesscBs tZdZdZdZRS(sProvide support for FTP accesscCsdS(sqReturns a stat-like tuple. (marshalled to a string) Used by FTP for directory listings, and MDTM and SIZEN((tREQUEST((Rtmanage_FTPstatscCsdS(s=Returns a directory listing consisting of a tuple of (id,stat) tuples, marshaled to a string. Note, the listing it should include '..' if there is a Folder above the current one. In the case of non-foldoid objects it should return a single tuple (id,stat) representing itself.N((R!((Rtmanage_FTPlists(RRRR"R#(((RR s  t ITraversablecBsJtZddZdZdZdZdddZddZRS(NicCsdS(s{Return the absolute URL of the object. This a canonical URL based on the object's physical containment path. It is affected by the virtual host configuration, if any, and can be used by external agents, such as a browser, to address the object. If the relative argument is provided, with a true value, then the value of virtual_url_path() is returned. Some Products incorrectly use '/'+absolute_url(1) as an absolute-path reference. This breaks in certain virtual hosting situations, and should be changed to use absolute_url_path() instead. N((trelative((Rt absolute_urlscCsdS(sReturn the path portion of the absolute URL of the object. This includes the leading slash, and can be used as an 'absolute-path reference' as defined in RFC 2396. N((((Rtabsolute_url_pathscCsdS(sReturn a URL for the object, relative to the site root. If a virtual host is configured, the URL is a path relative to the virtual host's root object. Otherwise, it is the physical path. In either case, the URL does not begin with a slash. N((((Rtvirtual_url_pathscCsdS(s%Get the physical path of the object. Returns a path (an immutable sequence of strings) that can be used to access this object again later, for example in a copy/paste operation. getPhysicalRoot() and getPhysicalPath() are designed to operate together. N((((RtgetPhysicalPathscCsdS(scLookup an object by path. path -- The path to the object. May be a sequence of strings or a slash separated string. If the path begins with an empty path element (i.e., an empty string or a slash) then the lookup is performed from the application root. Otherwise, the lookup is relative to self. Two dots (..) as a path element indicates an upward traversal to the acquisition parent. default -- If provided, this is the value returned if the path cannot be traversed for any reason (i.e., no object exists at that path or the object is inaccessible). restricted -- If false (default) then no security checking is performed. If true, then all of the objects along the path are validated with the security machinery. Usually invoked using restrictedTraverse(). N((tpathtdefaultt restricted((RtunrestrictedTraversescCsdS(s?Trusted code traversal code, always enforces security. N((R*R+((RtrestrictedTraverses( RRR&R'R(R)RR-R.(((RR$s     t IZopeObjectcBs2tZeddddZeddddZRS(NttitleuIs a folderish objectt descriptionu Should be false for simple itemsu Meta typeuThe object's Zope2 meta type(RRtBooltisPrincipiaFolderisht BytesLinet meta_type(((RR/s   t IManageablecBs}tZdZedZeddZdZdZdZ dZ e dZ d Z d Zd Zd ZRS( s'Something that is manageable in the ZMIsManagement tabsR0uManage optionscCsdS(sShow management screenN((tURL1((Rtmanage(scCsdS(s,Gets called after being added to a containerN((titemR((Rtmanage_afterAdd+scCsdS(s Gets called before being deletedN((R9R((Rtmanage_beforeDelete.scCsdS(sGets called after being clonedN((R9((Rtmanage_afterClone1scCsdS(s N((R!((Rtfiltered_manage_options4scCsdS(s6Dispatch to first interface in manage_options N((R!((Rtmanage_workspace8scCsdS(s N((R!((Rttabs_path_default<scCsdS(s N((tscriptR*((Rttabs_path_info@scCsdS(s N((((Rtclass_manage_pathDs(RRRt Attributet manage_tabstTupletmanage_optionsR8R:R;R<RR=R>R?RARB(((RR6s          tIItemc BstZeddZeddZeddddZdZdZd Zd Zdhddddd dd d Z RS( NR0uNameuTitleuIconR1u&Name of icon, relative to SOFTWARE_URLcCsdS(sReturn the id of the object as a string. This method should be used in preference to accessing an id attribute of an object directly. The getId method is public. N((((RtgetId\scCsdS(sBReturn the title if it is not blank and the id otherwise. N((((Rt title_or_idcscCsdS(sReturn the title if it is not blank and the id otherwise. If the title is not blank, then the id is included in parens. N((((Rt title_and_idgscKsdS(s!Show an 'edited' dialog. N((R!targs((Rtmanage_editedDialogmstc CsdS(s&Raise standard error message. N(( tclientR!t error_typet error_valuettbterror_tbt error_messaget tagSearcht error_log_url((Rtraise_standardErrorMessageqs( RRR4R0ticonRHRIRJRLRRV(((RRGLs      t IItemWithNamecBstZdZRS(sItem with name. (RRR(((RRXzs t ISimpleItemcBstZdZRS(sNot-so-simple item. (RRR(((RRYs tICopyContainercBstZdZdZdZedZdZdZeedZ eeedZ dZ eed Z e d Zgged Zed Zed ZdZdZddZRS(s=Interface for containerish objects which allow cut/copy/pastecCsdS(s N((R tobject((Rt_setObscCsdS(s N((R ((Rt_delObscCsdS(s N((R R+((Rt_getObscCsdS(s N((R!((Rtmanage_CopyContainerFirstItemscCsdS(s N((R!((Rtmanage_CopyContainerAllItemsscCsdS(s=Put a reference to the objects named in ids in the clip boardN((RR!((Rtmanage_cutObjectsscCsdS(s=Put a reference to the objects named in ids in the clip boardN((RR!tRESPONSE((Rtmanage_copyObjectsscCsdS(sAllow containers to override the generation of object copy id by attempting to call its _get_id method, if it exists. N((R ((Rt_get_idscCsdS(sPaste previously copied objects into the current object. If calling manage_pasteObjects from python code, pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument. N((t cb_copy_dataR!((Rtmanage_pasteObjectsssRename management viewcCsdS(sRename several sub-objectsN((Rtnew_idsR!((Rtmanage_renameObjectsscCsdS(sRename a particular sub-objectN((R tnew_idR!((Rtmanage_renameObjectscCsdS(sBClone an object, creating a new object with the given id. N((tobR R!((Rt manage_clonescCsdS(s3Return true if clipboard data seems valid. N((((Rt cb_dataValidscCsdS(s+List of objects in the clip board. N((((Rt cb_dataItemssicCsdS(sVerify whether the current user is allowed to paste the passed object into self. This is determined by checking to see if the user could create a new object of the same meta_type of the object passed in and checking that the user actually is allowed to access the passed in object in its existing context. Passing a false value for the validate_src argument will skip checking the passed in object in its existing context. This is mainly useful for situations where the passed in object has no existing context, such as checking an object during an import (the object will not yet have been connected to the acquisition hierarchy). N((R[t validate_src((Rt_verifyObjectPastes(RRRR\R]RR^R_R`RaRcRdRfRCtmanage_renameFormRhRjRlRmRnRp(((RRZs"            tIObjectManagercBsUtZdZeddddZeddZedZedZ edZ edZ e dZ dZe d Zd Zd Ze d Ze e d dZd dZdZe dZe dZe dZdZdZge dZdZde e e e dZe d dZd d dZdZ RS(soGeneric object manager This interface provides core behavior for collections of heterogeneous objects.R0u Meta typesR1u1Sub-object types that are specific to this objectuIs an object managert cCsdS(s N((t interfaces((Rtall_meta_typesscCsdS(s N((((Rt_subobject_permissionsscCsdS(srReturn a list of the types for which the user has adequate permission to add that type of object. N((tuser((Rtfiltered_meta_typesscCsdS(s N((R R[((RR\scCsdS(s N((R ((RR]scCsdS(s N((R R+((RR^ sicCsdS(s N((R R[trolesRwt set_owner((Rt _setObjectscCsdS(s N((R tdp((Rt _delObjectscCsdS(s7Indicate whether the folder has an item by ID. N((R ((Rt hasObjectscCsdS(sList the IDs of the subobjects of the current object. If 'spec' is specified, returns only objects whose meta_types match 'spec'. N((tspec((Rt objectIdsscCsdS(sList the subobjects of the current object. If 'spec' is specified, returns only objects whose meta_types match 'spec'. N((R((Rt objectValues!scCsdS(sList (ID, subobject) tuples for subobjects of the current object. If 'spec' is specified, returns only objects whose meta_types match 'spec'. N((R((Rt objectItems(scCsdS(sCReturn a tuple of mappings containing subobject meta-data. N((((Rt objectMap/scCsdS(siReturn all of the objects of a given type located in this object and containing objects. N((tt((Rt superValues3scCsdS(sYDelete a subordinate object The objects specified in 'ids' get deleted. N((RR!((Rtmanage_delObjects8scCsdS(s7Return a list of subobjects, used by tree tag. N((((RttpValues>sRMcCsdS(s2Exports an object to a file and returns that file.N((R tdownloadttoxmlRbR!((Rtmanage_exportObjectBscCsdS(sImport an object from a fileN((tfileR!Rz((Rtmanage_importObjectFscCsdS(s N((tfilepathtverifyRz((Rt_importObjectFromFileIscCsdS(s N((R ((Rt __getitem__Ms(!RRRREt meta_typesR2tisAnObjectManagerRCt manage_maintmanage_index_maintmanage_addProducttmanage_importExportFormRRuRvRxR\R]R^R{R}R~RRRRRRRRRRR(((RRrs8                     t IFindSupportcBstZdZedZedZedZedZeeeeeeeedeedd Z e Z eeeeeeeedeededdZ RS(sFind support for Zope FoldersRsiRMc CsdS(sZope Find interfaceN(( tobjtobj_idst obj_metatypestobj_searchtermtobj_exprt obj_mtimet obj_mspectobj_permissiont obj_rolest search_subR!tresulttpre((RtZopeFind^scCsdS(sZope Find interface and applyN((RRRRRRRRRRR!RRt apply_funct apply_path((RtZopeFindAndApplyhs( RRRRCtmanage_findFrametmanage_findFormtmanage_findAdvtmanage_findResultRRt PrincipiaFindR(((RRUs     -tIPropertyManagercBs+tZdZedZedZeddZeddZ edZ dZ dZ e dZdZd Zd Zd Zd d ZdZdZdZdZdZdZdZdZdZe dZdZe dZe dZ e e dZ!RS(sQ The PropertyManager mixin class provides an object with transparent property management. An object which wants to have properties should inherit from PropertyManager. An object may specify that it has one or more predefined properties, by specifying an _properties structure in its class:: _properties=({'id':'title', 'type': 'string', 'mode': 'w'}, {'id':'color', 'type': 'string', 'mode': 'w'}, ) The _properties structure is a sequence of dictionaries, where each dictionary represents a predefined property. Note that if a predefined property is defined in the _properties structure, you must provide an attribute with that name in your class or instance that contains the default value of the predefined property. Each entry in the _properties structure must have at least an 'id' and a 'type' key. The 'id' key contains the name of the property, and the 'type' key contains a string representing the object's type. The 'type' string must be one of the values: 'float', 'int', 'long', 'string', 'lines', 'text', 'date', 'tokens', 'selection', or 'multiple section'. For 'selection' and 'multiple selection' properties, there is an addition item in the property dictionay, 'select_variable' which provides the name of a property or method which returns a list of strings from which the selection(s) can be chosen. Each entry in the _properties structure may *optionally* provide a 'mode' key, which specifies the mutability of the property. The 'mode' string, if present, must contain 0 or more characters from the set 'w','d'. A 'w' present in the mode string indicates that the value of the property may be changed by the user. A 'd' indicates that the user can delete the property. An empty mode string indicates that the property and its value may be shown in property listings, but that it is read-only and may not be deleted. Entries in the _properties structure which do not have a 'mode' key are assumed to have the mode 'wd' (writeable and deleteable). To fully support property management, including the system-provided tabs and user interfaces for working with properties, an object which inherits from PropertyManager should include the following entry in its manage_options structure:: {'label':'Properties', 'action':'manage_propertiesForm',} to ensure that a 'Properties' tab is displayed in its management interface. Objects that inherit from PropertyManager should also include the following entry in its __ac_permissions__ structure:: ('Manage properties', ('manage_addProperty', 'manage_editProperties', 'manage_delProperties', 'manage_changeProperties',)), RsR0uTitleu PropertiescCsdS(s N((R ((Rtvalid_property_idscCsdS(s3Return true if object has a property 'id'. N((R ((Rt hasPropertyscCsdS(s{Get the property 'id'. Returns the optional second argument or None if no such property is found. N((R td((Rt getPropertyscCsdS(sYGet the type of property 'id'. Returns None if no such property exists. N((R ((RtgetPropertyTypescCsdS(s0Raise an error if an object is wrapped. N((R[((Rt _wrapperCheckscCsdS(s N((R tvalue((Rt _setPropValuescCsdS(s N((R ((Rt _delPropValueststringcCsdS(sSet property. For selection and multiple selection properties the value argument indicates the select variable of the property. N((R Rttype((Rt _setPropertyscCsdS(sUpdate the value of an existing property. If value is a string, an attempt will be made to convert the value to the type of the existing property. N((R R((Rt_updatePropertyscCsdS(s N((R ((Rt _delPropertyscCsdS(s'Return a list of property ids. N((((Rt propertyIdsscCsdS(s2Return a list of actual property objects. N((((RtpropertyValuesscCsdS(s/Return a list of (id,property) tuples. N((((Rt propertyItemsscCsdS(sEReturn a tuple of mappings, giving meta-data for properties. N((((Rt _propertyMapscCsdS(sReturn a tuple of mappings, giving meta-data for properties. Return copies of the real definitions for security. N((((Rt propertyMapscCsdS(s1Return a label for the given property id N((R ((Rt propertyLabel scCsdS(s N((((RtpropdictscCsdS(siAdd a new property via the web. Sets a new property with the given id, type, and value. N((R RRR!((Rtmanage_addPropertyscCsdS(s"Edit object properties via the web. The purpose of this method is to change all property values, even those not listed in REQUEST; otherwise checkboxes that get turned off will be ignored. Use manage_changeProperties() instead for most situations. N((R!((Rtmanage_editPropertiesscKsdS(sChange existing object properties. Change object properties by passing either a mapping object of name:value pairs {'foo':6} or passing name=value parameters N((R!tkw((Rtmanage_changeProperties$scCsdS(sReplace one set of properties with another Delete all properties that have ids in old_ids, then add a property for each item in props. Each item has a new_id, new_value, and new_type. The type of new_value should match new_type. N((told_idstpropsR!((Rtmanage_changePropertyTypes+scCsdS(s1Delete one or more properties specified by 'ids'.N((RR!((Rtmanage_delProperties4s("RRRRCtmanage_propertiesFormtmanage_propertyTypeFormR4R0REt _propertiestpropertysheetsRRRRRRRRRRRRRRRRRRRRRRR(((RRus8 >                       tIFoldercBstZdZRS(sFolders are basic container objects that provide a standard interface for object management. Folder objects also implement a management interface and can have arbitrary properties. (RRR(((RR9s tIOrderedFoldercBstZdZRS(sOrdered folder. (RRR(((RRCs t IApplicationcBstZdZeddZedZedZedZdZ e Z Z e dZ dZeZd ZeZd d Zd Zd ZdZd dZdZRS(sTop-level system objectR0u(Is top level Principa application objects Help systemRssMisc.cCsdS(s3Utility function to allow user-controlled redirectsN((t destinationR7((RtPrincipiaRedirectYscCsdS(sBobo traverse. N((R!tname((Rt__bobo_traverse__^scGsdS(s,Utility function to return current date/timeN((RK((Rt PrincipiaTimebscCsdS(soReturns an HTML fragment that displays the 'powered by zope' button along with a link to the Zope site.N((((RtZopeAttributionButtongsicCsdS(s=The absolute URL of the root object is BASE1 or "/". N((R%((RR&mscCsdS(sFThe absolute URL path of the root object is BASEPATH1 or "/". N((((RR'qscCsdS(s:The virtual URL path of the root object is empty. N((((RR(uscCsdS(s N((((RtgetPhysicalRootyscCsdS(s N((trebuild((RtfixupZClassDependencies}scCsdS(sCheck the global (zclass) registry for problems, which can be caused by things like disk-based products being deleted. Return true if a problem is foundN((((RtcheckGlobalRegistrys(RRRR2t$isTopLevelPrincipiaApplicationObjectRCtHelpSystp_tmisc_RtRedirectt ZopeRedirectRRRtZopeTimeRttest_urlR&R'R(RRR(((RRLs$              (s IObjectEventtIObjectWillBeMovedEventcBs>tZdZedZedZedZedZRS(sAn object will be moved.s'The old location parent for the object.s%The old location name for the object.s'The new location parent for the object.s%The new location name for the object.(RRRRCt oldParenttoldNamet newParenttnewName(((RRs    tIObjectWillBeAddedEventcBstZdZRS(s'An object will be added to a container.(RRR(((RRs tIObjectWillBeRemovedEventcBstZdZRS(s*An object will be removed from a container(RRR(((RRs tIObjectClonedEventcBstZdZRS(sEAn object has been cloned (a la Zope 2). This is for Zope 2 compatibility, subscribers should really use IObjectCopiedEvent or IObjectAddedEvent, depending on their use cases. event.object is the copied object, already added to its container. Note that this event is dispatched to all sublocations. (RRR(((RRs N(/Rtzope.interfaceRCt Interfacet zope.schemaR2R4REtAccessControl.interfacestIOwnedt IRoleManagertAcquisition.interfacest IAcquirertApp.interfacest INavigationt IUndoSupporttpersistent.interfacest IPersistenttwebdav.interfacestIDAVCollectiont IDAVResourcetzope.traversing.interfacestIContainmentRoottzope.app.component.interfacest IPossibleSiteRRR R$R/R6RGRXRYRZRrRRRRRtzope.component.interfacest IObjectEventRRRR($RGRRRRYRRERXRRRR$RRRRR R4RRR/RRRZRRCRRRRRR6R2RRrR((Rt?sD            d.F.+. U.v %  >