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

# Class RelationshipManager

source code

                       ExtensionClass.Base --+
                                             |
                 OFS.CopySupport.CopyContainer --+
                                                 |
                   RelCopySupport.RelCopyContainer --+
                                                     |
                       ExtensionClass.Base --+       |
                                             |       |
                 OFS.CopySupport.CopyContainer --+   |
                                                 |   |
                       ExtensionClass.Base --+   |   |
                                             |   |   |
                     App.Management.Navigation --+   |
                                                 |   |
                       ExtensionClass.Base --+   |   |
                                             |   |   |
                           App.Management.Tabs --+   |
                                                 |   |
                          Acquisition.Implicit --+   |
                                                 |   |
                        Persistence.Persistent --+   |
                                                 |   |
                   ExtensionClass.Base --+       |   |
                                         |       |   |
    webdav.EtagSupport.EtagSupport --+   |       |   |
                                     |   |       |   |
          webdav.Lockable.LockableItem --+       |   |
                                         |       |   |
                  webdav.Resource.Resource --+   |   |
                                             |   |   |
                  webdav.Collection.Collection --+   |
                                                 |   |
                   OFS.Traversable.Traversable --+   |
                                                 |   |
                   OFS.ObjectManager.ObjectManager --+
                                                     |
                       ExtensionClass.Base --+       |
                                             |       |
                   ExtensionClass.Base --+   |       |
                                         |   |       |
                OFS.CopySupport.CopySource --+       |
                                             |       |
                   ExtensionClass.Base --+   |       |
                                         |   |       |
                       App.Management.Tabs --+       |
                                             |       |
               OFS.Traversable.Traversable --+       |
                                             |       |
                 AccessControl.Owned.Owned --+       |
                                             |       |
                                   ZItem.ZItem --+   |
                                                 |   |
                          Acquisition.Implicit --+   |
                                                 |   |
                AccessControl.Role.RoleManager --+   |
                                                 |   |
       PrimaryPathObjectManager.PrimaryPathManager --+
                                                     |
                           ExtensionClass.Base --+   |
                                                 |   |
                              App.Undo.UndoSupport --+
                                                     |
     PrimaryPathObjectManager.PrimaryPathObjectManager --+
                                                         |
                                            object --+   |
                                                     |   |
                           ExtensionClass.Base --+   |   |
                                                 |   |   |
                         OFS.ZDOM.Node --+       |   |   |
                                         |       |   |   |
                          OFS.ZDOM.Element --+   |   |   |
                                             |   |   |   |
                OFS.ZDOM.ElementWithAttributes --+   |   |
                                                 |   |   |
               OFS.PropertyManager.PropertyManager --+   |
                                                     |   |
                 ZenPropertyManager.ZenPropertyManager --+
                                                         |
                                                        RelationshipManager

Known Subclasses:
  - ZenModel.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)),
        )

Instance Methods | [hide private]
__init__(self, id, title=None, buildRelations=True) | source code
getRelationshipManagerId(self) Return our simple id if we are called from our primary path else return the full primary id. | source code
addRelation(self, name, obj) Form a bi-directional relationship. | source code
removeRelation(self, name, obj=None, suppress_events=False) Remove an object from a relationship. | source code
_setObject(self, id, object, roles=None, user=None, set_owner=1) Track __primary_parent__ when we are set into an object | source code
_getCopy(self, container) Create a copy of this relationship manager. | source code
_notifyOfCopyTo(self, container, op=0) Manage copy/move/rename state for use in manage_beforeDelete. | source code
cb_isMoveable(self) Prevent move unless we are being called from our primary path. | source code
moveMeBetweenRels(self, srcRelationship, destRelationship) Move a relationship manager without deleting its relationships. | source code
moveObject(self, obj, destination) Move obj from this RM to the destination RM | source code
buildRelations(self) build our relations based on the schema defined in _relations | source code
getRelationships(self) Returns a dictionary of relationship objects keyed by their names | source code
getRelationshipNames(self) Return our relationship names | source code
checkRelations(self, repair=False) Confirm the integrity of all relations on this object | source code
exportXml(self, ofile, ignorerels=[], root=False, exportPasswords=False) Return an xml based representation of a RelationshipManager... | source code
exportXmlProperties(self, ofile, exportPasswords=False) Return an xml representation of a RelationshipManagers properties... | source code
exportXmlRelationships(self, ofile, ignorerels=[]) Return an xml representation of Relationships | source code
manage_addRelation(self, name, obj, REQUEST=None) make a relationship | source code
manage_removeRelation(self, name, id=None, REQUEST=None) remove a relationship to be called from UI | source code
manage_workspace(self, REQUEST) return the workspace of the related object using its primary path | source code
Inherited from `PrimaryPathObjectManager.PrimaryPathObjectManager` (private): `_delObject` Inherited from `RelCopySupport.RelCopyContainer`: `manage_linkObjects`, `manage_unlinkObjects` Inherited from `RelCopySupport.RelCopyContainer` (private): `_checkId`, `_getRelName`, `_getSourceObjects`, `_verifyObjectLink`, `_verifyObjectPaste` Inherited from `OFS.ObjectManager.ObjectManager`: `__class_init__`, `__contains__`, `__delitem__`, `__getitem__`, `__iter__`, `__len__`, `__nonzero__`, `__setitem__`, `all_meta_types`, `filtered_meta_types`, `get`, `getSiteManager`, `hasObject`, `items`, `keys`, `list_imports`, `manage_FTPlist`, `manage_FTPstat`, `manage_afterAdd`, `manage_afterClone`, `manage_beforeDelete`, `manage_delObjects`, `manage_exportObject`, `manage_hasId`, `manage_importObject`, `objectIds`, `objectIds_d`, `objectItems`, `objectItems_d`, `objectMap`, `objectMap_d`, `objectValues`, `objectValues_d`, `setSiteManager`, `superValues`, `tpValues`, `values` Inherited from `OFS.ObjectManager.ObjectManager` (private): `_delOb`, `_getImportPaths`, `_getOb`, `_importObjectFromFile`, `_setOb`, `_subobject_permissions` Inherited from `OFS.CopySupport.CopyContainer`: `cb_dataItems`, `cb_dataValid`, `manage_CopyContainerAllItems`, `manage_CopyContainerFirstItem`, `manage_clone`, `manage_copyObjects`, `manage_cutObjects`, `manage_pasteObjects`, `manage_renameObject`, `manage_renameObjects`, `validClipData` Inherited from `OFS.CopySupport.CopyContainer` (private): `_get_id` Inherited from `App.Management.Navigation`: `manage_zmi_logout` Inherited from `PrimaryPathObjectManager.PrimaryPathManager`: `getPrimaryId`, `getPrimaryParent`, `getPrimaryPath`, `getPrimaryUrlPath`, `primaryAq` Inherited from `ZItem.ZItem`: `__repr__`, `getId`, `manage_editedDialog`, `this`, `titleOrId`, `title_and_id`, `title_or_id`, `tpURL` Inherited from `OFS.CopySupport.CopySource`: `cb_isCopyable`, `cb_userHasCopyOrMovePermission` Inherited from `OFS.CopySupport.CopySource` (private): `_canCopy`, `_postCopy`, `_setId` Inherited from `App.Management.Tabs`: `filtered_manage_options`, `tabs_path_default`, `tabs_path_info` Inherited from `webdav.Collection.Collection`: `DELETE`, `HEAD`, `PUT`, `dav__init`, `listDAVObjects` Inherited from `webdav.Resource.Resource`: `COPY`, `LOCK`, `MKCOL`, `MOVE`, `OPTIONS`, `PROPFIND`, `PROPPATCH`, `TRACE`, `UNLOCK`, `dav__simpleifhandler`, `dav__validate`, `manage_DAVget` Inherited from `webdav.Lockable.LockableItem`: `wl_clearLocks`, `wl_delLock`, `wl_getLock`, `wl_hasLock`, `wl_isLocked`, `wl_lockItems`, `wl_lockTokens`, `wl_lockValues`, `wl_lockmapping`, `wl_setLock` Inherited from `webdav.EtagSupport.EtagSupport`: `http__etag`, `http__parseMatchList`, `http__processMatchHeaders`, `http__refreshEtag` Inherited from `OFS.Traversable.Traversable`: `absolute_url`, `absolute_url_path`, `getPhysicalPath`, `restrictedTraverse`, `unrestrictedTraverse`, `virtual_url_path` Inherited from `App.Undo.UndoSupport`: `manage_undo_transactions`, `undoable_transactions` Inherited from `App.Undo.UndoSupport` (private): `_get_request_var_or_attr` Inherited from `ZenPropertyManager.ZenPropertyManager`: `deleteZenProperty`, `exportZProperties`, `getOverriddenObjects`, `getProperty`, `getPropertyType`, `getZ`, `getZenRootNode`, `hasProperty`, `isLocal`, `manage_editProperties`, `saveZenProperties`, `setZenProperty`, `zenPropIsPassword`, `zenPropertyIds`, `zenPropertyItems`, `zenPropertyMap`, `zenPropertyOptions`, `zenPropertyPath`, `zenPropertyString` Inherited from `ZenPropertyManager.ZenPropertyManager` (private): `_findParentWithProperty`, `_setPropValue`, `_setProperty`, `_updateProperty` Inherited from `OFS.PropertyManager.PropertyManager`: `manage_addProperty`, `manage_changeProperties`, `manage_changePropertyTypes`, `manage_delProperties`, `propdict`, `propertyDescription`, `propertyIds`, `propertyItems`, `propertyLabel`, `propertyMap`, `propertyValues`, `valid_property_id` Inherited from `OFS.PropertyManager.PropertyManager` (private): `_delPropValue`, `_delProperty`, `_propertyMap`, `_wrapperCheck` Inherited from `OFS.ZDOM.ElementWithAttributes`: `getAttribute`, `getAttributeNode`, `getAttributes` Inherited from `OFS.ZDOM.Element`: `getChildNodes`, `getElementsByTagName`, `getFirstChild`, `getLastChild`, `getNextSibling`, `getNodeName`, `getNodeType`, `getParentNode`, `getPreviousSibling`, `getTagName` Inherited from `OFS.ZDOM.Node`: `getNodeValue`, `getOwnerDocument`, `hasChildNodes`

Class Methods | [hide private]
lookupSchema(cls, relname) Lookup the schema definition for a relationship. | source code

Class Variables | [hide private]
| _relations = `()`
| meta_type = `'Relationship Manager'`
| security = `ClassSecurityInfo()`
| manage_options = `PrimaryPathObjectManager.manage_options+ ZenP`...``
| manage_main = `DTMLFile('dtml/RelationshipManagerMain', globals())`
| _operation = `-1`
Inherited from `OFS.ObjectManager.ObjectManager`: `has_order_support`, `isAnObjectManager`, `isPrincipiaFolderish`, `manage_addProduct`, `manage_importExportForm`, `manage_index_main`, `meta_types` Inherited from `OFS.ObjectManager.ObjectManager` (private): `_components`, `_objects` Inherited from `OFS.CopySupport.CopyContainer`: `manage_renameForm` Inherited from `App.Management.Navigation`: `manage`, `manage_copyright`, `manage_form_title`, `manage_menu`, `manage_page_footer`, `manage_page_header`, `manage_top_frame`, `manage_zmi_prefs`, `zope_quick_start` Inherited from `ZItem.ZItem`: `REQUEST`, `__allow_access_to_unprotected_subobjects__`, `__name__`, `__propsets__`, `getId__roles__`, `icon`, `id`, `isTopLevelPrincipiaApplicationObject`, `title` Inherited from `ZItem.ZItem` (private): `_manage_editedDialog` Inherited from `App.Management.Tabs`: `manage_tabs`, `manage_workspace__roles__` Inherited from `webdav.Collection.Collection`: `__dav_collection__` Inherited from `webdav.Resource.Resource`: `__dav_resource__`, `__http_methods__` Inherited from `OFS.Traversable.Traversable`: `getPhysicalRoot` Inherited from `App.Undo.UndoSupport`: `manage_UndoForm` Inherited from `ZenPropertyManager.ZenPropertyManager`: `__pychecker__`, `manage_propertiesForm` Inherited from `ZenPropertyManager.ZenPropertyManager` (private): `_onlystars` Inherited from `OFS.PropertyManager.PropertyManager`: `manage_propertyTypeForm`, `propertysheets` Inherited from `OFS.PropertyManager.PropertyManager` (private): `_properties`, `_reserved_names`

Method Details | [hide private]

### __init__(self, id, title=None, buildRelations=True) (Constructor) | source code
Overrides: object.__init__ (inherited documentation)

### removeRelation(self, name, obj=None, suppress_events=False) | source code
Remove an object from a relationship. If no object is passed all objects are removed.

### _setObject(self, id, object, roles=None, user=None, set_owner=1) | source code
Track __primary_parent__ when we are set into an object Overrides: OFS.ObjectManager.ObjectManager._setObject (inherited documentation)

### _getCopy(self, container) | source code
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) | source code
Manage copy/move/rename state for use in manage_beforeDelete. Overrides: OFS.CopySupport.CopySource._notifyOfCopyTo

### cb_isMoveable(self) | source code
Prevent move unless we are being called from our primary path. Overrides: OFS.CopySupport.CopySource.cb_isMoveable

### lookupSchema(cls, relname) Class Method | source code
Lookup the schema definition for a relationship. All base classes are checked until RelationshipManager is found.

### exportXml(self, ofile, ignorerels=[], root=False, exportPasswords=False) | source code
    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, exportPasswords=False) | source code
    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

### manage_workspace(self, REQUEST) | source code
return the workspace of the related object using its primary path Overrides: App.Management.Tabs.manage_workspace

Class Variable Details | [hide private]

  ### manage_options Value:
      PrimaryPathObjectManager.manage_options+ ZenPropertyManager.manage_opt
      ions