Package Products :: Package ZenRelations :: Module RelationshipManager :: Class RelationshipManager
[show private | hide private]
[frames | no frames]

Type RelationshipManager

     object --+                    
              |                    
           Base --+                
                  |                
EtagSupport --+   |                
              |   |                
   LockableItem --+                
                  |                
           Resource --+            
                      |            
             Collection --+        
                          |        
         object --+       |        
                  |       |        
               Base --+   |        
                      |   |        
          CopyContainer --+        
                          |        
         object --+       |        
                  |       |        
               Base --+   |        
                      |   |        
             Navigation --+        
                          |        
         object --+       |        
                  |       |        
               Base --+   |        
                      |   |        
         object --+   |   |        
                  |   |   |        
         Persistent --+   |        
                      |   |        
             Persistent --+        
                          |        
         object --+       |        
                  |       |        
               Base --+   |        
                      |   |        
                   Tabs --+        
                          |        
            Traversable --+        
                          |        
         object --+       |        
                  |       |        
               Base --+   |        
                      |   |        
               Acquirer --+        
                          |        
              ObjectManager --+    
                              |    
         object --+           |    
                  |           |    
               Base --+       |    
                      |       |    
        RoleManager --+       |    
                      |       |    
            RoleManager --+   |    
                          |   |    
         object --+       |   |    
                  |       |   |    
               Base --+   |   |    
                      |   |   |    
     object --+       |   |   |    
              |       |   |   |    
           Base --+   |   |   |    
                  |   |   |   |    
         CopySource --+   |   |    
                      |   |   |    
     object --+       |   |   |    
              |       |   |   |    
           Base --+   |   |   |    
                  |   |   |   |    
              Owned --+   |   |    
                      |   |   |    
     object --+       |   |   |    
              |       |   |   |    
           Base --+   |   |   |    
                  |   |   |   |    
               Tabs --+   |   |    
                      |   |   |    
        Traversable --+   |   |    
                      |   |   |    
                  ZItem --+   |    
                          |   |    
         object --+       |   |    
                  |       |   |    
               Base --+   |   |    
                      |   |   |    
               Acquirer --+   |    
                          |   |    
         PrimaryPathManager --+    
                              |    
         object --+           |    
                  |           |    
               Base --+       |    
                      |       |    
          CopyContainer --+   |    
                          |   |    
           RelCopyContainer --+    
                              |    
             object --+       |    
                      |       |    
                   Base --+   |    
                          |   |    
                UndoSupport --+    
                              |    
       PrimaryPathObjectManager --+
                                  |
             object --+           |
                      |           |
                   Base --+       |
                          |       |
           Node --+       |       |
                  |       |       |
            Element --+   |       |
                      |   |       |
  ElementWithAttributes --+       |
                          |       |
            PropertyManager --+   |
                              |   |
             ZenPropertyManager --+
                                  |
                                 RelationshipManager

Known Subclasses:
TestBaseClass, ZenModelRM, ZenModelRM

RelationshipManger is an ObjectManager like class that can contain
relationships (in fact relationships can only be added to a 
RelationshipManager).

Relationships are defined on an RM by the hash _relations.  It
should be defined on the class so that it isn't stored in the database.
If there is inheritance involved remember to add the base class _relations
definition to the current class so that all relationships for the class
are defined on it.

remoteClassStr - is a string that represents the full path to the remote
                class.  Its a string because in most cases the classes
                will be in different modules which would cause a recursive
                import of the two modules.

_relations = (
    ("toonename", ToOne(ToMany, remoteClassStr, remoteName)), 
    ("tomanyname", ToMany(ToMany, remoteClassStr, remoteName)), 
    )

Method Summary
  __init__(self, id, title, buildRelations)
  addRelation(self, name, obj)
Form a bi-directional relationship.
  buildRelations(self)
build our relations based on the schema defined in _relations
  cb_isMoveable(self)
Prevent move unless we are being called from our primary path.
  checkRelations(self, repair)
Confirm the integrity of all relations on this object
  exportXml(self, ofile, ignorerels, root)
Return an xml based representation of a RelationshipManager...
  exportXmlProperties(self, ofile)
Return an xml representation of a RelationshipManagers properties...
  exportXmlRelationships(self, ofile, ignorerels)
Return an xml representation of Relationships
  getRelationshipManagerId(self)
Return our simple id if we are called from our primary path else return the full primary id.
  getRelationshipNames(self)
Return our relationship names
  getRelationships(self)
Returns a dictionary of relationship objects keyed by their names
  lookupSchema(cls, relname)
Lookup the schema definition for a relationship. (Class method)
  manage_addRelation(self, name, obj, REQUEST)
make a relationship
  manage_beforeDelete(self, item, container)
handle cut/past vs.
  manage_removeRelation(self, name, id, REQUEST)
remove a relationship to be called from UI
  manage_workspace(self, REQUEST)
return the workspace of the related object using its primary path
  removeRelation(self, name, obj)
Remove an object from a relationship.
  _getCopy(self, container)
Create a copy of this relationship manager.
  _notifyOfCopyTo(self, container, op)
Manage copy/move/rename state for use in manage_beforeDelete.
  _setObject(self, id, object, roles, user, set_owner)
Inherited from PrimaryPathObjectManager: _delObject
Inherited from RelCopyContainer: manage_linkObjects, manage_renameObject, manage_unlinkObjects, _getRelName, _getSourceObjects, _verifyObjectLink, _verifyObjectPaste
Inherited from CopyContainer: cb_dataItems, cb_dataValid, manage_clone, manage_CopyContainerAllItems, manage_CopyContainerFirstItem, manage_copyObjects, manage_cutObjects, manage_pasteObjects, manage_renameObjects, validClipData, _delOb, _get_id, _getOb, _setOb
Inherited from ObjectManager: __class_init__, __getitem__, _checkId, all_meta_types, filtered_meta_types, hasObject, list_imports, manage_afterAdd, manage_afterClone, manage_delObjects, manage_exportObject, manage_FTPlist, manage_FTPstat, manage_hasId, manage_importObject, objectIds, objectIds_d, objectItems, objectItems_d, objectMap, objectMap_d, objectValues, objectValues_d, superValues, tpValues, _importObjectFromFile, _subobject_permissions
Inherited from Navigation: manage_zmi_logout
Inherited from Tabs: class_manage_path, filtered_manage_options, tabs_path_default, tabs_path_info
Inherited from Acquirer: __new__, __of__
Inherited from Persistent: __getattribute__, bobobase_modification_time, locked_in_version, modified_in_version
Inherited from Persistent: __delattr__, __getstate__, __reduce__, __setattr__, __setstate__, _p_activate, _p_deactivate, _p_delattr, _p_getattr, _p_invalidate, _p_setattr
Inherited from Collection: dav__init, DELETE, HEAD, listDAVObjects, PUT
Inherited from Resource: COPY, dav__simpleifhandler, dav__validate, LOCK, manage_DAVget, MKCOL, MOVE, OPTIONS, PROPFIND, PROPPATCH, TRACE, UNLOCK
Inherited from LockableItem: wl_clearLocks, wl_delLock, wl_getLock, wl_hasLock, wl_isLocked, wl_lockItems, wl_lockmapping, wl_lockTokens, wl_lockValues, wl_setLock
Inherited from EtagSupport: http__etag, http__parseMatchList, http__processMatchHeaders, http__refreshEtag
Inherited from Traversable: absolute_url, absolute_url_path, getPhysicalPath, restrictedTraverse, unrestrictedTraverse, virtual_url_path
Inherited from PrimaryPathManager: getPrimaryId, getPrimaryParent, getPrimaryPath, getPrimaryUrlPath, primaryAq
Inherited from ZItem: __len__, __repr__, getId, manage_editedDialog, raise_standardErrorMessage, this, title_and_id, title_or_id, tpURL
Inherited from CopySource: cb_isCopyable, cb_userHasCopyOrMovePermission, _canCopy, _postCopy, _setId
Inherited from Owned: changeOwnership, getOwner, getOwnerTuple, getWrappedOwner, manage_fixupOwnershipAfterAdd, owner_info, userCanTakeOwnership, _deleteOwnershipAfterAdd, manage_changeOwnershipType, manage_takeOwnership
Inherited from RoleManager: ac_inherited_permissions, access_debug_info, acquiredRolesAreUsedBy, get_local_roles, get_local_roles_for_userid, get_valid_userids, has_local_roles, manage_access, manage_defined_roles, manage_editRoles, manage_role, permission_settings, permissionsOfRole, possible_permissions, rolesOfPermission, userdefined_roles, users_with_local_role, valid_roles, validate_roles, validRoles, _addRole, _delRoles, _has_user_defined_role, _setRoles, manage_acquiredPermissions, manage_addLocalRoles, manage_changePermissions, manage_delLocalRoles, manage_permission, manage_setLocalRoles
Inherited from RoleManager: manage_getPermissionMapping, _isBeingAccessedAsZClassDefinedInstanceMethod, _isBeingUsedAsAMethod, manage_setPermissionMapping
Inherited from UndoSupport: get_request_var_or_attr, manage_undo_transactions, undoable_transactions
Inherited from ZenPropertyManager: deleteZenProperty, getZenRootNode, isLocal, manage_editProperties, saveZenProperties, setZenProperty, zenPropertyIds, zenPropertyItems, zenPropertyMap, zenPropertyOptions, zenPropertyPath, zenPropertyString, zenPropertyType, zenPropIsPassword, _setProperty, _setPropValue
Inherited from PropertyManager: getProperty, getPropertyType, hasProperty, manage_addProperty, manage_changeProperties, manage_changePropertyTypes, manage_delProperties, propdict, propertyIds, propertyItems, propertyLabel, propertyMap, propertyValues, valid_property_id, _delProperty, _delPropValue, _propertyMap, _updateProperty, _wrapperCheck
Inherited from ElementWithAttributes: getAttribute, getAttributeNode, getAttributes
Inherited from Element: getChildNodes, getElementsByTagName, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getParentNode, getPreviousSibling, getTagName
Inherited from Node: getNodeValue, getOwnerDocument, hasChildNodes
Inherited from Base: __getnewargs__
Inherited from object: __hash__, __reduce_ex__, __str__
Inherited from SRE_Pattern: _onlystars

Class Variable Summary
tuple __ac_permissions__ = (('Manage Relations', ('manage_remo...
PermissionRole manage_addRelation__roles__ = <PermissionRole object at ...
tuple manage_beforeDelete__roles__ = ('Manager',)
DTMLFile manage_main = <App.special_dtml.DTMLFile object at 0x286...
tuple manage_main__roles__ = ('Manager',)
tuple manage_options = ({'action': 'manage_main', 'help': ('OF...
PermissionRole manage_removeRelation__roles__ = <PermissionRole object ...
tuple manage_workspace__roles__ = ('Manager',)
str meta_type = 'Relationship Manager'
tuple meta_types = ()
int _operation = -1                                                                    
tuple _relations = ()
Inherited from CopyContainer: __implemented__, __providedBy__, __provides__, manage_clone__roles__, manage_CopyContainerAllItems__roles__, manage_CopyContainerFirstItem__roles__, manage_copyObjects__roles__, manage_cutObjects__roles__, manage_pasteObjects__roles__, manage_renameForm, manage_renameForm__roles__, manage_renameObject__roles__, manage_renameObjects__roles__
Inherited from ObjectManager: __roles__, isAnObjectManager, isPrincipiaFolderish, manage_addProduct, manage_afterAdd__roles__, manage_afterClone__roles__, manage_delObjects__roles__, manage_exportObject__roles__, manage_FTPlist__roles__, manage_FTPstat__roles__, manage_hasId__roles__, manage_importExportForm, manage_importExportForm__roles__, manage_importObject__roles__, manage_index_main, manage_index_main__roles__, objectIds__roles__, objectItems__roles__, objectValues__roles__, _objects
Inherited from Navigation: manage, manage__roles__, manage_copyright, manage_copyright__roles__, manage_form_title, manage_form_title__roles__, manage_menu, manage_menu__roles__, manage_page_footer, manage_page_footer__roles__, manage_page_header, manage_page_header__roles__, manage_page_style.css, manage_page_style.css__roles__, manage_top_frame, manage_top_frame__roles__, manage_zmi_logout__roles__, manage_zmi_prefs, manage_zmi_prefs__roles__, zope_quick_start, zope_quick_start__roles__
Inherited from Tabs: class_manage_path__roles__, filtered_manage_options__roles__, manage_tabs, manage_tabs__roles__
Inherited from Persistent: _p_changed, _p_jar, _p_mtime, _p_oid, _p_serial, _p_state
Inherited from Collection: __dav_collection__
Inherited from Resource: __dav_resource__, __http_methods__, COPY__roles__, DELETE__roles__, HEAD__roles__, listDAVObjects__roles__, LOCK__roles__, manage_DAVget__roles__, MOVE__roles__, OPTIONS__roles__, PROPFIND__roles__, PROPPATCH__roles__, TRACE__roles__, UNLOCK__roles__
Inherited from LockableItem: wl_clearLocks__roles__, wl_delLock__roles__, wl_getLock__roles__, wl_isLocked__roles__, wl_isLockedByUser__roles__, wl_lockItems__roles__, wl_lockmapping__roles__, wl_lockTokens__roles__, wl_lockValues__roles__, wl_setLock__roles__
Inherited from EtagSupport: __implements__
Inherited from Traversable: absolute_url__roles__, absolute_url_path__roles__, getPhysicalPath__roles__, getPhysicalRoot, getPhysicalRoot__roles__, restrictedTraverse__roles__, unrestrictedTraverse__roles__, virtual_url_path__roles__
Inherited from ZItem: __allow_access_to_unprotected_subobjects__, __name__, __propsets__, getId__roles__, icon, id, isTopLevelPrincipiaApplicationObject, REQUEST, title, _manage_editedDialog
Inherited from Owned: changeOwnership__roles__, getOwner__roles__, getOwnerTuple__roles__, getWrappedOwner__roles__, manage_changeOwnershipType__roles__, manage_fixupOwnershipAfterAdd__roles__, manage_owner, manage_owner__roles__, manage_takeOwnership__roles__, owner_info__roles__
Inherited from RoleManager: __ac_local_roles__, __ac_roles__, ac_inherited_permissions__roles__, access_debug_info__roles__, aclAChecked, aclEChecked, aclPChecked, acquiredRolesAreUsedBy__roles__, manage_access__roles__, manage_acquiredForm, manage_acquiredForm__roles__, manage_acquiredPermissions__roles__, manage_addLocalRoles__roles__, manage_changePermissions__roles__, manage_defined_roles__roles__, manage_delLocalRoles__roles__, manage_editLocalRoles, manage_editLocalRoles__roles__, manage_editRoles__roles__, manage_listLocalRoles, manage_listLocalRoles__roles__, manage_permission__roles__, manage_permissionForm, manage_permissionForm__roles__, manage_role__roles__, manage_roleForm, manage_roleForm__roles__, manage_setLocalRoles__roles__, permission_settings__roles__, permissionMappingPossibleValues, permissionsOfRole__roles__, rolesOfPermission__roles__, selectedRoles, smallRolesWidget, userdefined_roles__roles__, _method_manage_access, _normal_manage_access
Inherited from RoleManager: manage_getPermissionMapping__roles__, manage_setPermissionMapping__roles__
Inherited from UndoSupport: manage_undo_transactions__roles__, manage_UndoForm, manage_UndoForm__roles__, undoable_transactions__roles__
Inherited from ZenPropertyManager: manage_editProperties__roles__, manage_propertiesForm, manage_propertiesForm__roles__
Inherited from PropertyManager: getProperty__roles__, getPropertyType__roles__, hasProperty__roles__, manage_addProperty__roles__, manage_changeProperties__roles__, manage_changePropertyTypes__roles__, manage_delProperties__roles__, manage_propertyTypeForm, manage_propertyTypeForm__roles__, propdict__roles__, propertyIds__roles__, propertyItems__roles__, propertyLabel__roles__, propertyMap__roles__, propertysheets, propertyValues__roles__, valid_property_id__roles__, _properties, _reserved_names

Instance Method Details

addRelation(self, name, obj)

Form a bi-directional relationship.

buildRelations(self)

build our relations based on the schema defined in _relations

cb_isMoveable(self)

Prevent move unless we are being called from our primary path.
Overrides:
OFS.CopySupport.CopySource.cb_isMoveable

checkRelations(self, repair=False)

Confirm the integrity of all relations on this object

exportXml(self, ofile, ignorerels=[], root=False)

Return an xml based representation of a RelationshipManager
<object id='/Devices/Servers/Windows/dhcp160.confmon.loc' 
    module='Products.Confmon.IpInterface' class='IpInterface'>
    <property id='name'>jim</property>
    <toone></toone>
    <tomany></tomany>
    <tomanycont></tomanycont>
</object>

exportXmlProperties(self, ofile)

Return an xml representation of a RelationshipManagers properties
<property id='name' type='type' mode='w' select_variable='selectvar'>
    value 
</property>
value will be converted to is correct python type on import

exportXmlRelationships(self, ofile, ignorerels=[])

Return an xml representation of Relationships

getRelationshipManagerId(self)

Return our simple id if we are called from our primary path else return the full primary id.

getRelationshipNames(self)

Return our relationship names

getRelationships(self)

Returns a dictionary of relationship objects keyed by their names

manage_addRelation(self, name, obj, REQUEST=None)

make a relationship

manage_beforeDelete(self, item, container)

handle cut/past vs. delete If we are being moved (cut/past) don't clear relationshp if we are being deleted set all relationship to None so that our related object don't have dangling references
Overrides:
OFS.ObjectManager.ObjectManager.manage_beforeDelete

manage_removeRelation(self, name, id=None, REQUEST=None)

remove a relationship to be called from UI

manage_workspace(self, REQUEST)

return the workspace of the related object using its primary path
Overrides:
App.Management.Tabs.manage_workspace

removeRelation(self, name, obj=None)

Remove an object from a relationship. If no object is passed all objects are removed.

_getCopy(self, container)

Create a copy of this relationship manager. This involes copying relationships and removing invalid relations (ie ones with ToOne) and performing copies of any contained objects. Properties are also set on the new object.
Overrides:
OFS.CopySupport.CopySource._getCopy

_notifyOfCopyTo(self, container, op=0)

Manage copy/move/rename state for use in manage_beforeDelete.
Overrides:
OFS.CopySupport.CopySource._notifyOfCopyTo

Class Method Details

lookupSchema(cls, relname)

Lookup the schema definition for a relationship. All base classes are checked until RelationshipManager is found.

Class Variable Details

__ac_permissions__

Type:
tuple
Value:
(('Manage Relations', ('manage_removeRelation', 'manage_addRelation'))\
,)                                                                     

manage_addRelation__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0x10bf278>                                   

manage_beforeDelete__roles__

Type:
tuple
Value:
('Manager',)                                                           

manage_main

Type:
DTMLFile
Value:
<App.special_dtml.DTMLFile object at 0x286c5d0>                        

manage_main__roles__

Type:
tuple
Value:
('Manager',)                                                           

manage_options

Type:
tuple
Value:
({'action': 'manage_main',
  'help': ('OFSP', 'ObjectManager_Contents.stx'),
  'label': 'Contents'},
 {'action': 'manage_access',
  'filter': <function _isNotBeingUsedAsAMethod at 0x1492270>,
  'help': ('OFSP', 'Security.stx'),
  'label': 'Security'},
 {'action': 'manage_access',
...                                                                    

manage_removeRelation__roles__

Type:
PermissionRole
Value:
<PermissionRole object at 0x10bf278>                                   

manage_workspace__roles__

Type:
tuple
Value:
('Manager',)                                                           

meta_type

Type:
str
Value:
'Relationship Manager'                                                 

meta_types

Type:
tuple
Value:
()                                                                     

_operation

Type:
int
Value:
-1                                                                    

_relations

Type:
tuple
Value:
()                                                                     

Generated by Epydoc 2.1 on Thu Aug 16 09:55:10 2007 http://epydoc.sf.net