Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractModel

Abstract: this class should never be instantiated. Implementation of IModel.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _areUnitInterfacesLoaded

_areUnitInterfacesLoaded: boolean

Protected _connectionConfig

_connectionConfig: ISdkConfig

Protected _deltaQueue

_deltaQueue: DeltaQueue

Protected _unitTypes

_unitTypes: string[]

Protected _unitsByType

_unitsByType: IUnitsByTypeCache

Map unitType -> units[], containing all units of this model, per type, but not sorted in any particular order. Please extend the type whenever applicable, for convenience of the programmer.

Protected _unresolvedReferences

_unresolvedReferences: ByNameReference<any>[]

id

id: string

metaModelVersion

metaModelVersion: Version

metadata

metadata: IWorkingCopy

mxVersionForModel

mxVersionForModel: Version

Methods

Protected _assertConnectionClosed

  • _assertConnectionClosed(): void
  • If a model element changes its name, broken by-name references should be attempted to resolve.

    In the future this might be made smarter and less expensive, once that becomes an issue.

    Returns void

Protected _loadMetaData

  • _loadMetaData(workingCopyId: string, callback: function, errorCallback: IErrorCallback): void
  • Parameters

    • workingCopyId: string
    • callback: function
        • (processCallback: IVoidCallback): void
        • Parameters

          • processCallback: IVoidCallback

          Returns void

    • errorCallback: IErrorCallback

    Returns void

Protected _loadUnit

  • _loadUnit<T>(unit: IAbstractUnit, callback: ICallback<T>, errorCallback?: IErrorCallback): void
  • Type parameters

    Parameters

    • unit: IAbstractUnit
    • callback: ICallback<T>
    • Optional errorCallback: IErrorCallback

    Returns void

Protected _loadUnitInterfaces

  • _loadUnitInterfaces(workingCopyId: string, callback: function, errorCallback: IErrorCallback): void
  • Loads all unit interfaces and caches them. This function cannot be called twice.

    Parameters

    • workingCopyId: string
    • callback: function
        • (processCallback: IVoidCallback): void
        • Parameters

          • processCallback: IVoidCallback

          Returns void

    • errorCallback: IErrorCallback

    Returns void

Protected _processLoadedMetaData

Protected _processLoadedUnitInterfaces

Protected _resolveContainer

  • _resolveContainer(unit: IAbstractUnit, containerId: string): void
  • Parameters

    Returns void

Protected _unitInterfacesByType

  • _unitInterfacesByType<T>(typeName: string): T[]
  • Return the non-defensive set of unit interfaces of a certain type. Creates the collection lazily if needed.

    Type parameters

    Parameters

    • typeName: string

    Returns T[]

Protected _warnAboutUnsupportedType

  • _warnAboutUnsupportedType(propertyName: string, qname: string): void
  • Given an object type name and a qualified name, finds the corresponding element (or null if the reference is broken). Will always succeed for unbroken references, since all objects that are referred by name should be part of the public interface of the model.

    Example usage: modelStore.resolveName(domainmodels.Attribute.typeName, "Expenses.Expense.Price");

    Parameters

    • propertyName: string
    • qname: string

    Returns void

allUnits

closeConnection

  • closeConnection(callback: IVoidCallback, errorCallback?: IErrorCallback): void

deleteFile

  • deleteFile(filePath: string, callback: IVoidCallback, errorCallback: IErrorCallback): void
  • Parameters

    • filePath: string
    • callback: IVoidCallback
    • errorCallback: IErrorCallback

    Returns void

deleteWorkingCopy

  • deleteWorkingCopy(callback: IVoidCallback, errorCallback?: IErrorCallback): void
  • Deletes this working copy from the server, and the (SDK) client.

    Parameters

    • callback: IVoidCallback
    • Optional errorCallback: IErrorCallback

    Returns void

deploy

  • deploy(forceFullDeployment: boolean, callback: ICallback<IDeploymentResult>, errorCallback?: IErrorCallback): void

exportMpk

  • exportMpk(outFilePath: string, callback: IVoidCallback, errorCallback?: IErrorCallback): void
  • Parameters

    • outFilePath: string
    • callback: IVoidCallback
    • Optional errorCallback: IErrorCallback

    Returns void

findModuleByQualifiedName

  • findModuleByQualifiedName(qname: string): void

getDeploymentStatus

  • getDeploymentStatus(callback: ICallback<IDeploymentResult>, errorCallback?: IErrorCallback): void

getEditorData

  • getEditorData(callback: ICallback<IEditorData>, errorCallback: IErrorCallback): void

getFile

  • getFile(filePath: string, outFilePath: string, callback: IVoidCallback, errorCallback: IErrorCallback): void
  • Parameters

    • filePath: string
    • outFilePath: string
    • callback: IVoidCallback
    • errorCallback: IErrorCallback

    Returns void

getFilePaths

  • getFilePaths(callback: ICallback<string[]>, errorCallback: IErrorCallback): void
  • Parameters

    • callback: ICallback<string[]>
    • errorCallback: IErrorCallback

    Returns void

getFiles

  • getFiles(callback: ICallback<string[] | void>, errorCallback: IErrorCallback): any
  • getFiles(options: IGetFilesOptions, callback: ICallback<string[] | void>, errorCallback: IErrorCallback): any
  • Parameters

    • callback: ICallback<string[] | void>
    • errorCallback: IErrorCallback

    Returns any

  • Parameters

    • options: IGetFilesOptions
    • callback: ICallback<string[] | void>
    • errorCallback: IErrorCallback

    Returns any

loadUnitById

  • loadUnitById<T>(id: string, forceRefresh: boolean, callback: ICallback<T>, errorCallback?: IErrorCallback): void
  • Fetches a complete unit. The result might be returned from the cache.

    Type parameters

    Parameters

    • id: string
    • forceRefresh: boolean
    • callback: ICallback<T>
    • Optional errorCallback: IErrorCallback

    Returns void

putFile

  • putFile(inFilePath: string | Blob, filePath: string, callback: IVoidCallback, errorCallback: IErrorCallback): void
  • Parameters

    • inFilePath: string | Blob
    • filePath: string
    • callback: IVoidCallback
    • errorCallback: IErrorCallback

    Returns void

Static create

  • Instantiates a new Model that can communicate with the server for sending and receiving documents. Loading a Model will automatically fetches all unit interfaces for this working copy and invokes the (success) callback, or calls the errorHandler if this fails.

    Parameters

    Returns void

Static read

  • read<IT, CT>(client: IModelApiClient, workingCopyId: string, connectionConfig: ISdkConfig, instance: CT, callback: function, errorCallback: IErrorCallback): void
  • Instantiates a new working copy that can communicate with the server for sending and receiving documents. Reading a working copy will automatically fetch all unit interfaces for this working copy and invoke callback, or call the errorHandler if this fails.

    Type parameters

    Parameters

    • client: IModelApiClient
    • workingCopyId: string
    • connectionConfig: ISdkConfig
    • instance: CT
    • callback: function
        • (model: IT): void
        • Parameters

          • model: IT

          Returns void

    • errorCallback: IErrorCallback

    Returns void

Static Private readImpl

  • readImpl(instance: any, workingCopyId: any, callback: any): any
  • Parameters

    • instance: any
    • workingCopyId: any
    • callback: any

    Returns any

Generated using TypeDoc