Namespace: Document

Appearition.Mop.Document

Use the functions under this module to create, change and remove Mop Documents on the Appearition platform

Methods

Appearition.Mop.Document.CreateMopDocument (request, requestOptions)Appearition.Mop.Document.MopDocItemViewModel static

Will create a new record in the database to hold the Mop document information. Once this returns successfully, you can invoke the UploadMopDocument method to push the new file up to the server. You will need to pick up the new MopDocumentId from the return object and pass it to the UploadMopDocument. Will return an Appearition.Mop.Document.MopDocItemViewModel object

Name Type Description
request Appearition.Mop.Document.MopDocItemViewModel

Contains the details of the Mop document

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.Mop.Document.MopDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Mop.Document.DeleteMopDocument (request, requestOptions) static

Will delete an existing Mop document. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Mop.Document.MopDocItemViewModel

Contains the details of the Mop

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Mop.Document.MopDocuments (requestOptions)Appearition.Mop.Document.MopDocViewModel static

This method will return all MOP documents. It will return a collection of Appearition.Mop.Document.MopDocViewModel

Name Type Description
requestOptions Appearition.RequestOptions

configure callbacks

Returns:
Type Description
Appearition.Mop.Document.MopDocViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Mop.Document.UpdateMopDocument (request, requestOptions)Appearition.Mop.Document.MopDocItemViewModel static

Will setup a new version of the Mop document. Once this returns successfully, you can invoke the UploadMopDocument method to push the new file up to the server. You will need to pick up the new MopDocumentId from the return object and pass it to the UploadMopDocument. Will return an Appearition.Mop.Document.MopDocItemViewModel object

Name Type Description
request Appearition.Mop.Document.MopDocItemViewModel

Contains the details of the Mop

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.Mop.Document.MopDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Mop.Document.UploadMopDocument (mopDocumentId, fileName, fileContent, requestOptions) static

Once the CreateMopDocument or UpdateMopDocument methods succeed, invoke this method to upload the file to the server. This will not return anything unless a failure occurs.

Name Type Description
mopDocumentId number

The unique identifier of the Mop Document which returned by the CreateMopDocument or UpdateMopDocument methods

fileName number

The name of the file being uploaded

fileContent string

The file contents that need to be submitted to the server

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Type Definitions

Appearition.Mop.Document.MopDocItemViewModel

This data structure holds the details of a specific Mop document

Properties:
Name Type Description
MopDocumentId number

The unique identifier of the Mop Document. This is a system generated value

ShelterType Appearition.Site.ShelterTypeEnum

The numerical value of the Appearition.Site.ShelterTypeEnum. This is a mandatory property

ShelterTypeName string

The name of the ShelterType

MainsHybridGenset Appearition.Site.MainsHybridGensetEnum

The numerical value of the Appearition.Site.MainsHybridGensetEnum.

MainsHybridGensetName string

The name of the MainsHybridGenset

DocumentTitle string

The title of the document. This will differ to FileName

Description string

The description of the document

FileName string

The description of the document

DocumentVersion number

The version of the document. You upload a new file to an existing MopDocument and the version number will increment

ModifiedUtcDateDisplay string

The date/time the document was changed. (Format "d/MM/yy HH:mm"). Note, whilst the field name suggest UTC, the server will attempt to convert it to your local timezone if its known. If not the UTC date is simply returned

Appearition.Mop.Document.MopDocViewModel

This data structure holds a collection of all MOP documents and a list of ShelterTypes and a list of MainsHybridGenset.

Properties:
Name Type Description
Docs Array.<Appearition.Mop.Document.MopDocItemViewModel>

The collection of documents linked to the Mop

Doc Appearition.Mop.Document.MopDocItemViewModel

Is an empty data structure that can be used to setup a new doc for saving to the server

ShelterTypeList Array.<Appearition.SelectListItem>

ShelterType is a property of a site. A MOP document can be linked to a Shelter Type

MainsHybridGensetList Array.<Appearition.SelectListItem>

MainsHybridGenset is a property of a site. A MOP document can be linked to a MainsHybridGenset