CDM
OCCT package CDM: CDM_Application, CDM_CanCloseStatus, CDM_Document, CDM_MetaData, and 2 more bound classes.
CDM_Application
Static methods(2)
- get_type_name(): string
Instance methods(7)
- BeginOfUpdate(aDocument: CDM_Document): void
this method is called before the update of a document. By default, writes in
MessageDriver().Parameters (1)aDocument
- EndOfUpdate(aDocument: CDM_Document, theStatus: boolean, ErrorString: TCollection_ExtendedString): void
this method is called after the update of a document. By default, writes in
MessageDriver().Parameters (3)aDocumenttheStatusErrorString
- Write(aString: string): void
writes the string in the application MessagerDriver.
Parameters (1)aString
Returns the application name.
Returns the application version.
Returns MetaData LookUpTable.
CDM_CanCloseStatus
Properties(5)
CDM_Document
An applicative document is an instance of a class inheriting CDM_Document. These documents have the following properties:
- they can have references to other documents.
- the modifications of a document are propagated to the referencing documents.
- a document can be stored in different formats, with or without a persistent model.
- the drivers for storing and retrieving documents are plugged in when necessary.
- a document has a modification counter. This counter is incremented when the document is modified. When a document is stored, the current counter value is memorized as the last storage version of the document. A document is considered to be modified when the counter value is different from the storage version. Once the document is saved the storage version and the counter value are identical. The document is now not considered to be modified.
- a reference is a link between two documents. A reference has two components: the "From Document" and the "To Document". When a reference is created, an identifier of the reference is generated. This identifier is unique in the scope of the From Document and is conserved during storage and retrieval. This means that the referenced document will be always accessible through this identifier.
- a reference memorizes the counter value of the To Document when the reference is created. The From Document is considered to be up to date relative to the To Document when the reference counter value is equal to the To Document counter value.
- retrieval of a document having references does not imply the retrieving of the referenced documents.
Static methods(2)
- get_type_name(): string
Instance methods(69)
- Update(ErrorString: TCollection_ExtendedString): boolean
This method Update will be called to signal the end of the modified references list. The document should be recomputed and UpdateFromDocuments should be called. Update should returns True in case of success, false otherwise. In case of Failure, additional information can be given in ErrorString.
Parameters (1)ErrorString—Mutated in place; read the updated value from this argument after the call.
- Update(): void
the following method should be used instead:
Update(me:mutable; ErrorString: out ExtendedString fromTCollection) returns Boolean fromStandard The
StorageFormat is the key which is used to determine in the application resources the storage driver plugin, the file extension and other data used to store the document.- Extensions(Extensions: NCollection_Sequence_TCollection_ExtendedString): void
by default empties the extensions.
Parameters (1)Extensions—Mutated in place; read the updated value from this argument after the call.
- GetAlternativeDocument(aFormat: TCollection_ExtendedString): { returnValue: boolean; anAlternativeDocument: CDM_Document; [Symbol.dispose](): void }
This method can be redefined to extract another document in a different format. For example, to extract a Shape from an applicative document.
Parameters (1)aFormat
ReturnsA result object with fields:
returnValue: the C++ return valueanAlternativeDocument: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- CreateReference(anOtherDocument: CDM_Document): number
Creates a reference from this document to {anOtherDocument}. Returns a reference identifier. This reference identifier is unique in the document and will not be used for the next references, even after the storing of the document. If there is already a reference between the two documents, the reference is not created, but its reference identifier is returned.
Parameters (1)anOtherDocument
- CreateReference(aMetaData: CDM_MetaData, aReferenceIdentifier: number, anApplication: CDM_Application, aToDocumentVersion: number, UseStorageConfiguration: boolean): voidParameters (5)
aMetaDataaReferenceIdentifieranApplicationaToDocumentVersionUseStorageConfiguration
- CreateReference(aMetaData: CDM_MetaData, anApplication: CDM_Application, aDocumentVersion: number, UseStorageConfiguration: boolean): numberParameters (4)
aMetaDataanApplicationaDocumentVersionUseStorageConfiguration
- RemoveReference(aReferenceIdentifier: number): void
Removes the reference between the From Document and the To Document identified by a reference identifier.
Parameters (1)aReferenceIdentifier
- RemoveAllReferences(): void
Removes all references having this document for From Document.
- Document(aReferenceIdentifier: number): CDM_Document
Returns the To Document of the reference identified by aReferenceIdentifier. If the ToDocument is stored and has not yet been retrieved, this method will retrieve it.
Parameters (1)aReferenceIdentifier
- IsInSession(aReferenceIdentifier: number): boolean
returns True if the To Document of the reference identified by aReferenceIdentifier is in session, False if it corresponds to a not yet retrieved document.
Parameters (1)aReferenceIdentifier
- IsStored(aReferenceIdentifier: number): boolean
returns True if the To Document of the reference identified by aReferenceIdentifier has already been stored, False otherwise.
Parameters (1)aReferenceIdentifier
- IsStored(): boolean
- Name(aReferenceIdentifier: number): TCollection_ExtendedString
returns the name of the metadata of the To Document of the reference identified by aReferenceIdentifier.
Parameters (1)aReferenceIdentifier
- ToReferencesNumber(): number
returns the number of references having this document as From Document.
- FromReferencesNumber(): number
returns the number of references having this document as To Document.
- ShallowReferences(aDocument: CDM_Document): boolean
returns True is this document references aDocument;
Parameters (1)aDocument
- DeepReferences(aDocument: CDM_Document): boolean
returns True is this document references aDocument;
Parameters (1)aDocument
- CopyReference(aFromDocument: CDM_Document, aReferenceIdentifier: number): number
Copies a reference to this document. This method avoid retrieval of referenced document. The arguments are the original document and a valid reference identifier Returns the local identifier.
Parameters (2)aFromDocumentaReferenceIdentifier
- IsReadOnly(): boolean
indicates that this document cannot be modified.
- IsReadOnly(aReferenceIdentifier: number): boolean
indicates that the referenced document cannot be modified,
Parameters (1)aReferenceIdentifier
- SetIsReadOnly(): void
- UnsetIsReadOnly(): void
- Modify(): void
Indicates that this document has been modified. This method increments the modification counter.
- Modifications(): number
returns the current modification counter.
- UnModify(): void
- IsUpToDate(aReferenceIdentifier: number): boolean
returns true if the modification counter found in the given reference is equal to the actual modification counter of the To Document. This method is able to deal with a reference to a not retrieved document.
Parameters (1)aReferenceIdentifier
- SetIsUpToDate(aReferenceIdentifier: number): void
Resets the modification counter in the given reference to the actual modification counter of its To Document. This method should be called after the application has updated this document.
Parameters (1)aReferenceIdentifier
- SetComment(aComment: TCollection_ExtendedString): void
associates a comment with this document.
Parameters (1)aComment
- AddComment(aComment: TCollection_ExtendedString): void
appends a comment into comments of this document.
Parameters (1)aComment
- SetComments(aComments: NCollection_Sequence_TCollection_ExtendedString): void
associates a comments with this document.
Parameters (1)aComments
- Comments(aComments: NCollection_Sequence_TCollection_ExtendedString): void
returns the associated comments through <aComments>. Returns empty sequence if no comments are associated.
Parameters (1)aComments—Mutated in place; read the updated value from this argument after the call.
- Comment(): string
Returns the first of associated comments. By default the comment is an empty string.
- StorageVersion(): number
returns the value of the modification counter at the time of storage. By default returns 0.
- SetMetaData(aMetaData: CDM_MetaData): void
associates database information to a document which has been stored. The name of the document is now the name which has beenused to store the data.
Parameters (1)aMetaData
- UnsetIsStored(): void
- SetRequestedFolder(aFolder: TCollection_ExtendedString): void
defines the folder in which the object should be stored.
Parameters (1)aFolder
- HasRequestedFolder(): boolean
- SetRequestedName(aName: TCollection_ExtendedString): void
defines the name under which the object should be stored.
Parameters (1)aName
Determines under which the document is going to be store. By default the name of the document will be used. If the document has no name its presentation will be used.
- SetRequestedPreviousVersion(aPreviousVersion: TCollection_ExtendedString): voidParameters (1)
aPreviousVersion
- UnsetRequestedPreviousVersion(): void
- HasRequestedPreviousVersion(): boolean
- SetRequestedComment(aComment: TCollection_ExtendedString): void
defines the Comment with which the object should be stored.
Parameters (1)aComment
- LoadResources(): void
read (or rereads) the following resource.
- FindFileExtension(): boolean
gets the Desktop.Domain.Application.
FileFormat.FileExtension resource.- FindDescription(): boolean
gets the
FileFormat.Description resource.- IsModified(): boolean
returns true if the version is greater than the storage version
- IsOpened(): boolean
- IsOpened(aReferenceIdentifier: number): boolean
returns true if the document corresponding to the given reference has been retrieved and opened. Otherwise returns false. This method does not retrieve the referenced document
Parameters (1)aReferenceIdentifier
- Open(anApplication: CDM_Application): voidParameters (1)
anApplication
- Close(): void
- CanCloseReference(aDocument: CDM_Document, aReferenceIdentifier: number): boolean
A referenced document may indicate through this virtual method that it does not allow the closing of aDocument which it references through the reference aReferenceIdentifier. By default returns true.
Parameters (2)aDocumentaReferenceIdentifier
- CloseReference(aDocument: CDM_Document, aReferenceIdentifier: number): void
A referenced document may update its internal data structure when {aDocument} which it references through the reference {aReferenceIdentifier} is being closed. By default this method does nothing.
Parameters (2)aDocumentaReferenceIdentifier
- ReferenceCounter(): number
- Reference(aReferenceIdentifier: number): CDM_ReferenceParameters (1)
aReferenceIdentifier
- SetModifications(Modifications: number): voidParameters (1)
Modifications
- SetReferenceCounter(aReferenceCounter: number): voidParameters (1)
aReferenceCounter
CDM_MetaData
Static methods(4)
- LookUp(theLookUpTable: NCollection_DataMap_TCollection_ExtendedString_handle_CDM_MetaData, aFolder: TCollection_ExtendedString, aName: TCollection_ExtendedString, aPath: TCollection_ExtendedString, aFileName: TCollection_ExtendedString, ReadOnly: boolean): CDM_MetaDataParameters (6)
theLookUpTableaFolderaNameaPathaFileNameReadOnly
- LookUp(theLookUpTable: NCollection_DataMap_TCollection_ExtendedString_handle_CDM_MetaData, aFolder: TCollection_ExtendedString, aName: TCollection_ExtendedString, aPath: TCollection_ExtendedString, aVersion: TCollection_ExtendedString, aFileName: TCollection_ExtendedString, ReadOnly: boolean): CDM_MetaDataParameters (7)
theLookUpTableaFolderaNameaPathaVersionaFileNameReadOnly
- get_type_name(): string
Instance methods(13)
- IsRetrieved(): boolean
returns the folder in which the meta-data has to be created or has to be found.
returns the name under which the meta-data has to be created or has to be found.
returns the version under which the meta-data has to be found. Warning: raises NoSuchObject from
Standardif no Version has been defined- HasVersion(): boolean
indicates that the version has to be taken into account when searching the corresponding meta-data.
- UnsetDocument(): void
- IsReadOnly(): boolean
- SetIsReadOnly(): void
- UnsetIsReadOnly(): void
CDM_Reference
Static methods(2)
- get_type_name(): string
Instance methods(6)
- ReferenceIdentifier(): number
- DocumentVersion(): number
- IsReadOnly(): boolean
CDM_ReferenceIterator
Constructors(1)
- constructor(aDocument: CDM_Document): CDM_ReferenceIteratorParameters (1)
aDocument
Instance methods(5)
- More(): boolean
- Next(): void
- ReferenceIdentifier(): number
- DocumentVersion(): number
returns the Document Version in the reference.