Namespace: Manage

Appearition.GeneralDocument.Manage

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

Methods

Appearition.GeneralDocument.Manage.CreateGeneralDocument (request, requestOptions)Appearition.GeneralDocument.Manage.GeneralDocItemViewModel static

Will create a new record in the database to hold the General document information. Once this returns successfully, you can invoke the UploadGeneralDocument method to push the new file up to the server. You will need to pick up the new GeneralDocumentId from the return object and pass it to the UploadGeneralDocument. Will return an Appearition.GeneralDocument.Manage.GeneralDocItemViewModel object

Name Type Description
request Appearition.GeneralDocument.Manage.GeneralDocItemViewModel

Contains the details of the General document

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.GeneralDocument.Manage.GeneralDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.GeneralDocument.Manage.DeleteGeneralDocument (request, requestOptions) static

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

Name Type Description
request Appearition.GeneralDocument.Manage.GeneralDocItemViewModel

Contains the details of the General

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.GeneralDocument.Manage.GeneralDocuments (requestOptions)Appearition.GeneralDocument.Manage.GeneralDocViewModel static

This method will return all General documents. It will return a collection of Appearition.GeneralDocument.Manage.GeneralDocViewModel

Name Type Description
requestOptions Appearition.RequestOptions

configure callbacks

Returns:
Type Description
Appearition.GeneralDocument.Manage.GeneralDocViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.GeneralDocument.Manage.UpdateGeneralDocument (request, requestOptions)Appearition.GeneralDocument.Manage.GeneralDocItemViewModel static

Will setup a new version of the General document. Once this returns successfully, you can invoke the UploadGeneralDocument method to push the new file up to the server. You will need to pick up the new GeneralDocumentId from the return object and pass it to the UploadGeneralDocument. Will return an Appearition.GeneralDocument.Manage.GeneralDocItemViewModel object

Name Type Description
request Appearition.GeneralDocument.Manage.GeneralDocItemViewModel

Contains the details of the General

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.GeneralDocument.Manage.GeneralDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.GeneralDocument.Manage.UploadGeneralDocument (generalDocumentId, fileName, fileContent, requestOptions) static

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

Name Type Description
generalDocumentId number

The unique identifier of the General Document which returned by the CreateGeneralDocument or UpdateGeneralDocument 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.GeneralDocument.Manage.GeneralDocItemViewModel

This data structure holds the details of a specific General document

Properties:
Name Type Description
GeneralDocumentId number

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

FormId number

Uniquely identifies the form to associate to this general document

FormName string

The name of the associated form

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 GeneralDocument 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.GeneralDocument.Manage.GeneralDocViewModel

This data structure holds a collection of all General documents and a list of project forms. A general document can be non specific or relate to a particular form.

Properties:
Name Type Description
Docs Array.<Appearition.GeneralDocument.Manage.GeneralDocItemViewModel>

The collection of documents linked to the General

Doc Appearition.GeneralDocument.Manage.GeneralDocItemViewModel

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

ProjectFormList Array.<Appearition.SelectListItem>

A collection of forms that can be used to associate a general document to.