IDocumentRelationships

class IDocumentRelationships

Bases: ImpactCOMWrapperBase, Iterable

Summary:

A collection of IDocumentRelationship objects.

Remarks:

Introduced in Impact 9.0.0.83.

Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance

property count

Gets Count.

Summary:

The number of items in this collection.

Returns:

The value of Count.

Return type:

count (int)

add(relationship, external_type, object_id, version)
Summary:

Adds a new document relationship.

Remarks:

When Relationship is drExternal an external_type must be specified. It is recommended to use a format such as [domain]:[type] for the external_type to identify external objects to avoid clashes with other applications. For example ‘webcnx:task’. The allowed object_id values depend on the Relationship type. For most internal Impact objects the object_id is the primary key of the associated object. It is always more efficient to use the primary keys, but most also support mapping string values to the appropriate primary key values. drDocument Integer: An IDocument.key (check IDocumentSettings.supports_document_key) String: An IDocument.id or IDocument.series_id. drProject, drTemplate, drSymbol Integer: An IDatabaseItem.key String: An IDatabaseItem.guid or IDatabaseItem.code drLayer Integer: An IDatabaseLayer.key String: An IDatabaseLayer.guid drUser Integer: An IUser.key String: An IUser.login_id drCustomer Integer: An ICustomer.key String: An ICustomer.code drContact Integer: An IContact.key drSite Integer: An ISite.key String: An ISite.full_name drExternal Integer or String value as appropriate When Relationship is drExternal it is the responsibility of the external application to choose a suitable format for reading/writing external object_id values.

Parameters:
  • relationship (ipDocumentRelationship) – The type of relationship to add.

  • external_type (str) – A unique external type identifier when the Relationship is drExternal.

  • object_id (any) – An identifier that uniquely identifies the referenced object. See Remarks below for valid object_id types.

  • version (str) – An optional version for the object_id. Typically used when the Relationship is drExternal.

Examples:

has_relationship(relationship, external_type, object_id, latest_version_only)
Summary:

Determines if the collection contains a specific relationship.

Parameters:
  • relationship (ipDocumentRelationship) – The relationship type to match.

  • external_type (str) – The external type when Relationship is drExternal to match.

  • object_id (any) – The object_id to match. See the Add method for details on valid object_id values.

  • latest_version_only (bool) – When the IDocumentRelationships collection is from an IDocument.relationships or IDocument.series_relationships property then only match relationships to the latest version of a document series.

Examples:

has_relationship2(relationship, latest_version_only)
Summary:

Determines if the collection contains a specific relationship.

Parameters:
  • relationship (IDocumentsRelationship) – The relationship to match.

  • latest_version_only (bool) – When the IDocumentRelationships collection is from an IDocument.relationships or IDocument.series_relationships property then only match relationships to the latest version of a document series.

Examples:

isNone()

Checks if the COM object is None. This is useful for determining if the wrapper has been initialized with a valid COM object.

item(index)
Summary:

Gets an IDocumentRelationship object with the specified index.

Parameters:

index (any) – Specifies the index of the IDocumentRelationship object to get.

refresh()
Summary:

Refresh the collection of IDocumentRelationships directly from the document provider.

Examples