Methods (ISPAdapter) - HxGN SDx - Update 36 - Customization & Programming - Hexagon

HxGN SPClient Programming Guide

Language
English
Product
HxGN SDx
Search by Category
Customization & Programming

DocumentExistsInTool

Description

This method checks whether the specified document exists in the tool database or not. This method is used during a re-publish of a document. It is possible that the document was deleted in the tool since the last publish. When you select a document in the ISPCLCommonUI for re-publish, ISPCLServiceManager will make a simple check for document existence by calling this method.

Name

Data type

Input/output

Description

oDocumentIObj

IObject

Input

IObject interface on the document object.

True - If the document exists in the tool

False - If the document does not exist in the tool

Return Value

Boolean

Comments

If the method fails, the tool will raise an appropriate exception.

FindDocsToPublish

Description

This method returns the documents that need to be published. Some design tools keep the required information (last published date, last modified date) in their database to determine if a document needs to be published. Design tools implement this method to compare the last published date and the last modified date, and to add the document to the container passed if the last modified date is later than the last published date. If any documents have been created have not been published, they must be added to the second container passed to this method.

This method is called for only those tools that support this functionality. That determination is made by calling the SupportsFeature method with the FindToPublish argument as described in SupportsFeature later in this section.

For Integration with SDx, the default hierarchy is DocumentClass > DocumentType1 > DocumentType2. To display documents in a custom hierarchy, add objects and relationships to the oDocsToPublishIContainer and the oNewDocsToPublishIContainer:

Arguments

Name

Data type

Input/output

Description

oDocsToPublishIContainer

IContainer

Input

IContainer pointer to documents container. Documents to be published should be added to this container.

oNewDocsToPublishIContainer

IContainer

Input

IContainer pointer to documents container. New documents (not published previously) should be added to this container.

Return Value

None

Comments

If the method fails, the tool will raise an appropriate exception.

GetCompSchemaUID As String

Description

Purpose of this schema UID is for ISPCLServiceManager to load the Component Schema in memory for the tool adapter to use during publish. In Integration with SDx, this method should return "Common".

Arguments

Name

Data Type

Input/Output

Description

sDocTypeUID

String (maximum 128 characters)

Input

UID of document type for which the Component Schema UID is requested.

Return Value

Component Schema UID as string.

Comments

If the method fails, the tool will raise an appropriate exception.

GetDocClassDefUID As String

Description

This method returns corresponding SmartPlant schema class definition UID of document for a given document type. This method is used during publish. ISPCLServiceManager will create a document object for the adapter to populate with data objects. Before it can create document object, ISPCLServiceManager needs to know the class definition for the document object. ISPCLServiceManager will call this method to get the class definition UID.

Tools will implement this method to return the class definition UID of document object given a document type.

Arguments

Name

Data type

Input/output

Description

sDocTypeUID

String (maximum 128 characters)

Input

UID of document type for which the document class definition UID is requested.

Return Value

UID of class definition of document as string.

Comments

If the method fails, the tool will raise an appropriate exception.

GetMapSchemaFile As String

Description

Returns the mapping schema file name, including the full path. This method will be called for tools that support mapping schema. The returned map schema will be loaded by ISPCLServiceManager for tools to use in subsequent publish calls.

Arguments

Name

Data type

Input/output

Description

sDocTypeUID

String (maximum 128 characters)

Input

UID of document type for which the Map schema file is requested.

If this parameter is empty and the tool adapter has multiple map schema files for its different supported document types, GetMapSchemaFile should raise an exception. If this parameter is empty and the tool adapter has one map schema files for all its supported document types, GetMapSchemaFile should not raise an exception.

Return Value

Full path to mapping schema file as string.

Comments

If the method fails, the tool will raise an appropriate exception.

GetObjectStatusInTool As ObjectStatusInTool

Description

This method checks the status of an object in the design tool. This call is made to the design tool when an object is found missing in the published data but was published or claimed previously. Such an object is either deleted, moved, or unclaimed. The return value should be one of the first three of the following enumerations:

Enum ObjectStatusInTool As Integer

Deleted = 1,

Moved = 2,

Unclaimed = 3,

UIDUpdated = 4

End Enum

If the return value is Deleted, a tombstone will be generated. If the return value is Moved, the object will be added to a moved object collection. If the return value is Unclaimed, an unclaim instruction is generated and the object will be added to the unclaimed object collection in SDx.

The UIDUpdated status was added to object starting with version 3.7. Tools that can return UIDUpdated status for an object should implement ISPAdapter3 interface. The ISPAdapter3 interface also has the GetObjectStatusInTool method. For details, see ISPAdapter3 Interface Class.

Arguments

Name

Data type

Input/output

Description

sObjUID

String (maximum 128 characters)

Input

UID of the object.

sClassUID

String (maximum 128 characters)

Input

UID of the class definition of the object.

Return Value

ObjectStatusInTool.

Comments

If the method fails, the tool will raise an appropriate exception.

GetPublishableDocTypes As ISPDocTypes

Description

This method should return document types that a tool can publish as ISPDocTypes collection object. Tools will implement this method to obtain the list of publishable document types by the tool, add them to ISPDocTypes collection object, and return the collection object.

Arguments

None

Return Value

Publishable document types as ISPDocTypes. If the method fails, the return value is Nothing.

Comments

If the method fails, the tool will raise an appropriate exception.

GetRelationshipStatusInTool as ObjectStatusInTool

Description

This method checks the status of a relationship object in the design tool. This call is made to the design tool when a relationship object is found to be missing from the published data but was previously published or claimed. Such a relationship object is either deleted, moved, or unclaimed. The return value should be one of the first three of the following enumerations.

Enum ObjectStatusInTool As Integer

Deleted = 1,

Moved = 2,

Unclaimed = 3,

UIDUpdated = 4

End Enum

If the return value is Deleted, a tombstone will be generated. If the return value is Moved, the relationship object will be added to a moved object collection. If the return value is Unclaimed, an UnclaimedInstruction is generated, and the relationship object will be added to an unclaimed object collection in SDx.

The new UIDUpdated status was added to objects starting with version 3.7. Tools that return UIDUpdated status for an object should implement ISPAdapter3 interface also has the GetObjectStatusInTool method. For details see ISPAdapter3 Interface Class.

Arguments

Name

Data type

Input/output

Description

sRelUID

String (maximum 128 characters)

Input

UID of the relationship object.

sRelDef

String (maximum 128 characters)

Input

UID of the class definition of the relationship object.

sUID1

String (maximum 128 characters)

Input

UID of the end1 object

sUID2

String (maximum 128 characters)

Input

UID of the end2 object

Return Value

ObjectStatusInTool.

Comments

If the method fails, the tool will raise an appropriate exception.

PublishDocument

Description

When a user selects one or more documents to publish, ISPCLServicesManager will call the PublishDocument method for each document. ISPCLServicesManager will get the IObject, IDocument, IissueRecordComposition, and IDocVersionComposition interfaces and will populate the properties on the IObject and IDocument interfaces before calling this method.

The implementation of this method will do the following

  1. Collect all data associated with the specified document.

  2. Use the schema component to create objects and relationships.

  3. Add created objects and relationships to the document data container (passed as an input argument).

  4. Check the value of bViewFileRequired. If it is TRUE, add the graphic file interfaces to the document metadata container (passed as an input argument). A File object should be created for each view file and reference file for the publishing document. The adapter needs to create the necessary view file interfaces and relationships in the metadata container and set the FilePath property.

Arguments

Name

Data type

Input/output

Description

oDocumentIObj

IObject

Input

IObject interface on the document object.

oDocContIContainer

IContainer

Input

Document container.

oDocMetadataIContainer

IContainer

Input

Document metadata container.

bViewFileRequired

Boolean

Input

Indicates whether view files and the reference files need to be added to the metadata container. TRUE will be passed for normal publish operation. FALSE will be passed in cases where view files and reference files are not required. The case for FALSE would be when only the XML is required.

Arguments (Overloaded)

Name

Data type

Input/output

Description

oDocumentIObj

IObject

Input

IObject interface on the document object.

oDocContIContainer

IContainer

Input

Document container.

oDocMetadataIContainer

IContainer

Input

Document metadata container.

bViewFileRequired

Boolean

Input

Indicates whether view files and the reference files need to be added to the metadata container. TRUE will be passed for normal publish operation. FALSE will be passed in cases where view files and reference files are not required. The case for FALSE would be when only the XML is required.

oMapSchContIContainer

IContainer

Input

Map schema container. This argument will be passed for only the tools that support mapping schema.

Return Value

None.

Comments

If the method fails, the tool will raise an appropriate exception.

SupportsFeature

Description

ISPCLCommonUI calls this method when it needs to check with a tool if a feature is supported or not. There are two arguments in this method. The first argument for this method is of type ToolFeatures. ToolFeatures is an enumeration defined in SmartPlantInterfaces.dll as defined below.

Public Enum ToolFeatures As Integer

ToolRevisions = 1,

Mapping = 2,

FindToPublish = 3,

BatchPublish = 4,

BatchRetrieve = 5,

RetrieveViewFile = 6,

NoConfigurationManagement = 7,

NoCorrelationInTool = 8,

SPFRevisions = 9,

ToolBatchPublish = 10,

MultiToolPlantsToOneSPFPlant = 11,

NoMinorRevisions = 12

End Enum

  • The ToolRevisions entry is used to check if the tool supports revisions. Tools employing integration with SDx should return FALSE because integration for SDx currently does not support tool revision.

  • The Mapping entry is used to check if the tool uses the mapping schema in publish operations. When the SupportsFeature method is called with this entry, the tool adapter should return TRUE if the tool supports mapping schema.

  • The FindToPublish entry is used to check if the tool supports Documents to Publish functionality. A tool can support this functionality by keeping a record of what documents have been published by saving the last publish date and when the documents have been modified last.

  • If a tool supports this functionality, then when user clicks, ISPCLServiceManager will call the FindDocsToPublish method on the tool adapter to get a list of documents to publish. If the tool does not support the functionality, ISPCLServiceManager will execute its logic to get the list.

  • BatchPublish does not apply to Integration with SDx; tools should return FALSE for it in SupportsFeature.

  • BatchRetrieve does not apply to Integration with SDx; tools should return FALSE for it in SupportsFeature.

  • The RetrieveViewFile entry does not apply to Integration with SDx; tools should return FALSE for it in SupportsFeature.

  • The NoConfigurationManagement entry is used to determine if the tool supports plant configuration similar to SDx plant configuration. If the tool does not support plant configuration, then the ISPCLCommonUI will allow registration to a plant depending on where the tool documents will be published. Currently all tools support plant configuration and hence return FALSE for this entry.

  • The NoCorrelationInTool entry is used to determine if the object correlation needs to be done in SDx or not. Tools employing integration for SDx should return FALSE because integration for SDx does not provide for retrieval.

  • The SPFRevisions entry is used to check whether the tool supports the Revise command and uses the SDx revisioning scheme. A tool that depends on SDx for revisioning must implement the ISPAdapter2 interface and will have to call the revise methods described later. Integration for SDx currently only supports SDx revisioning and therefore should return TRUE for this entry in SupportsFeature.

  • The ToolBatchPublish entry is added for SP3D drawings publish. This entry is used to check whether a tool can support batch publish where the ISPCLCommonUI would return the document selections made in the Publish dialog back to the tool adapter for later publish using ISPCLCommonUIApplicationNoUI interface. The Publish dialog will show an option for tool batch publish. When this option is selected, the ISPCLCommonUI will send the user selections to the tool adapter using ISPAdapter4 interface instead of continuing with normal publish process. The tool will save the user selections for later publish using ISPClientApplicationNoUI interface. A tool that supports batch publish will have to implement ISPAdapter4 interface.

  • The MultiToolPlantsToOneSPFPlant entry is used to check if the tool supports integrating two or more tool plants with one SDx plant. The tool adapter will set this entry to TRUE so that the ISPCLCommonUIApplicationUI’s dialog will allow registering more than one tool plant with one SDx plant. Tools should make this entry TRUE only when it is capable of publishing and retrieving documents from multiple tool plants to a single SDx plant.

  • The NoMinorRevisions entry is used to determine if the tool supports minor revisions. If the answer is TRUE, then the tool does not support minor revisions.

Example Code in Tool Implementation

Public Function SupportsFeature(

ByVal eToolFeature As ToolFeatures,

ByVal sDocTypeUID As String) As Boolean

Implements ISPAdapter.SupportsFeature

Select Case eToolFeature

Case ToolFeatures.BatchPublish

Return FALSE

Case ToolFeatures.BatchRetrieve

Return False

End Select

End Function

Arguments

Name

Data type

Input/output

Description

eToolFeature

ToolFeatures

Input

Feature for which the support is checked.

Arguments (Overloaded)

Name

Data type

Input/output

Description

eToolFeature

ToolFeatures

Input

Feature for which the support is checked.

sDocTypeUID

String

Input

UID of Document type. Used only when this method is called with a value of RetrieveViewFile in the Feature argument. Does not apply to Integration with SDx.

Return Value

TRUE - If the tool supports the feature.

FALSE - If the tool does not support the feature.

Terminate

Description

This method has been added as per the P&ID team’s request. P&ID will implement this method to release all the resources it obtained during the lifetime of this object. Other tools can take advantage of this method if they have similar requirement. Otherwise, tools will implement this method to do nothing, meaning to add the method with no code.

ISPCLServiceManager will call this method before setting the adapter object to Nothing.

Arguments

None.

Return Value

None.