Revise Methods in ISPClientApplicationUI Interface - Integration - Update 46 - Help - Hexagon

SmartPlant Integration .NET Help

Language
English
Product
Integration
Search by Category
Help
SmartPlant Foundation / SDx Version
10
Smart P&ID Version
9 (2019)
Smart Engineering Manager Version
10 (2019)

GetDocumentContainersForRevise As Long

This method is called first when the Revise command is called by the authoring tool, most often from its menu. In this method, schema component containers are created and returned to the calling application.

This method indicates the start of the Revise transaction by creating a document data container (oDocs). The calling application fills the data container with selected document objects.

If a selected document is already revised by the publishing tool, the tool must ensure that its SmartPlant Adapter’s implementation, ISPAdapter2.GetRevision returns the correct values because SmartPlant Client calls GetRevision to obtain data to populate the document metadata container created internally at the same time as the document data container.

Arguments

Name

Data type

Input/output

Description

oDocs

IContainer

Output

Pointer to schema component container object. This container is empty and used by the application to create document objects.

Return Value

  • 0 if method is successful.

  • A negative number if method fails (check the LastErrorMessage property for error message).

ShowReviseDialog As Long

This method is called after GetDocumentContainersForRevise method. Calling this method completes the Revise transaction started in the GetDocumentContainersForRevise method. Before calling this method, the application fills the oDocs container as described in the previous section.

If one or more of the documents in the set being revised lacks an applicable revision scheme, a dialog will appear listing the documents that cannot be revised. The software will not attempt to revise those documents, but will log the issue in the log file.

The ShowReviseDialog method displays a user interface with documents passed in the oDocs container.

The user interface is subject to change. The left pane displays selected documents in a tree view, grouped by document type or custom folders. The right pane contains groups of fields for the revision values:

The revision scheme list is retrieved from SmartPlant Foundation, and revisions are based on the number sequences provided by the revision schemes. The revisions provided by most revision schemes have two parts, major and minor. The revisions for document can be major or a combination of major and minor.

The current revision in tool values are retrieved from the tool’s implementation of ISPAdapter2.GetRevision.

Revise in Tool refers to selection of allowed revision values.

Tool Processing

For each document selected for revising, a DocumentRevision object is added in the internal metadata container with IDocumentRevision.MajorRev_ForRevise and IDocumentRevision.MinorRev_ForRevise set to user-selected values for document revision. A RevisedDocument relationship between the document object and the DocumentRevision object is added in the metadata container.

The document container with the document object and the metadata container with the DocumentRevision and RevisedDocument relationship are passed to the tool’s SmartPlant Adapter’s ReviseDocuments method on ISPAdapter2 interface. In the SmartPlant Adapter’s ReviseDocuments method, the tool gets the major and minor revision numbers and saves them into its database.

SPF Processing (Reserving Revisions)

For new documents, master document objects are created in the SmartPlant Foundation database. Revision objects are created for the number of revisions to reserve in the user interface with a status of RESERVED.

The status of reserved revisions changes from RESERVED to WORKING when a document is published.

Arguments

Name

Data type

Input/output

Description

oDocs

SchemaCompInterfaces.IContainer

Input

Pointer to schema component container object with documents that need to be revised.

Return Value

  • 0 if the method is successful.

  • 1 if the Revise dialog box is canceled.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

ReleaseReviseDocumentListContainers As Long

This method is called in conjunction with GetDocumentContainersForRevise. The purpose of this method is to cancel the revise transaction started in the GetDocumentContainersForRevise method called previously. The authoring tool should call this method if an error occurs after GetDocumentContainersForRevise is called, if the authoring tool allows users to cancel the operation after GetDocumentContainersForRevise is called, or if the authoring tool’s logic forces a cancel.

This method releases all pointers to Container Compositions and Containers created in the GetDocumentContainersForRevise method and terminates the revise transaction.

Arguments

None.

Return Value

  • 0 if the method is successful.

  • A negative number if the method fails (check the LastErrorMessage property for error message).

Comments

The design tool must release all local pointers to containers.