IDocumentContext

class IDocumentContext

Bases: ImpactCOMWrapperBase

Description:

Provides a context for the IDocuments collection operations and IDocumentSearch object.

Remarks:

When performing operations on an IDocuments collection this context interface can be used to control how that interface behaves. When using the IDocumentSearch object this context interface can be used to control which items are searched and how the resultant IDocuments collection is initialised. The context is useful for providing additional settings to the IDocuments collection during its lifetime. For example it can be used to initialise an IDocuments collection for paging operations, or change those documents included in the collection based on IDocument.status, or to change the sort order of items within the collection. After each use (by creating an IDocuments object) the IDocumentContext is reset to its default values (see below or each property for the default value). The IDocuments object then uses those values it was initialised with so further changes to the IDocumentContext properties do not normally effect any existing IDocuments objects. The exception to this is using paging operations with IDocuments, in this case you can assign a new sort order (using add_sort_column) or status (using include_status) and then set the IDocuments.page_number property to refresh the documents collections. Default IDocumentContext values. documents_page_size = . initial_page_number = 1. load_documents = false. max_documents_count = 0. search_all_versions = false. Status = dsNormal. sort_columns = dkcSeriesID, dkcModifiedDateTime.

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

property documents_page_size

Gets documents_page_size.

Description:

Sets the initial page size when initialising an IDocuments collection that supports paging.

Remarks:

The default value is

Returns:

The value of documents_page_size.

Return type:

documents_page_size (int)

property documents_to_process

Gets documents_to_process.

Description:

Determines which documents get processed for some IDocument methods and properties.

Remarks:

Some methods and properties of the IDocument interface support performing the operation on mulitple documents within the same document series. For example to delete all documents in a series you can set documents_to_process to dtpAllVersions before calling the IDocument.delete method. This property currently applies to the Delete, Undelete, Purge, Obliterate methods and the can_delete, can_undelete, can_purge and can_obliterate properties of the IDocument interface. Introduced in Impact 10.0.0.68

Returns:

The value of documents_to_process.

Return type:

documents_to_process (ipDocumentsToProcess)

property initial_page_number

Gets initial_page_number.

Description:

Sets the initial page number when initialising an IDocuments collection that supports paging.

Remarks:

The default value is 1.

Returns:

The value of initial_page_number.

Return type:

initial_page_number (int)

property load_documents

Gets load_documents.

Description:

Determines whether all document properties are loaded when the IDocuments collection is initialised.

Remarks:

When loading an IDocuments collection this property determines if all document properties should also be loaded. If you intending to access each IDocument in the collection then setting this value to true The default value is false.

Returns:

The value of load_documents.

Return type:

load_documents (bool)

property max_documents_count

Gets max_documents_count.

Description:

Sets the maximum number of documents to match when searching using an IDocumentSearch object.

Remarks:

Set this value to zero to match all available documents, or a value to limit the number of documents matched. The default value is zero.

Returns:

The value of max_documents_count.

Return type:

max_documents_count (int)

property search_all_versions

Gets search_all_versions.

Description:

Determines if an IDocumentSearch searches all document versions.

Remarks:

To determine if the underlying document provider supports searching all document versions you should check the IDocumentSettings.supports_searching_all_versions property. The default value is false.

Returns:

The value of search_all_versions.

Return type:

search_all_versions (bool)

add_sort_column(column, ascending, lookup_column)
Description:

Add a sort column when using the IDocuments collection or IDocumentSearch object.

Remarks:

Multiple sort columns are supported by adding each sort column in the order required. Using add_sort_column replaces the default sort order, or call clear_sort_columns explicitly.

Parameters:
  • column (IDocumentColumn) – The document column to apply sorting to.

  • ascending (bool) – Specifies that sorting should be ascending or descending.

  • lookup_column (str) – If the document column is a lookup column (e.g. dkcCreatedBy, dkcModifiedBy, dkcCheckedOutBy) then you can specify a lookup column to apply during sorting instead. Typically for a user lookup column this would be ‘U_LOG_NAME’ or ‘U_NAME’.

clear_sort_columns()
Description:

Clears all sort columns when using the IDocuments collection or IDocumentSearch object.

Remarks:

Clears the sort columns to the default columns dkcSeriesID, dkcModifiedDateTime.

exclude_status(status)
Description:

Add an ipDocumentStatus to be excluded from the IDocuments collection or IDocumentSearch.

Parameters:

status (ipDocumentStatus) – The status to exclude.

include_status(status)
Description:

Add an ipDocumentStatus to be included in the IDocuments collection or IDocumentSearch.

Remarks:

As soon as you alter the statuses using include_status or exclude_status the default value (dsNormal) is ignored. So if you do want to include dsNormal in your results you must explicitly include it.

Parameters:

status (ipDocumentStatus) – The status to include.

reset_status()
Description:

Resets the status values when using the IDocuments collection or IDocumentSearch object.

Remarks:

Resets the status values to the default value of dsNormal.

Examples