mydigitalstructure

How and where a webapp stores the organisation's information (data & files) is critical.

In this guide we cover saving and retrieving data & files from storage and protecting the organisations stored information.

Remember if you have any questions please email as at learn@mydigitalstructure.cloud

Saving data

The mydigitalstructure Javascript framework includes a .save() function to help with saving organisation data.

The most common options for .save() are;

Option Description Example
object The type of object you are updating. mydigitalstructure has many organsational objects included. contact_person
data The data fields you are updating ie mobile number {id: 1234, mobile: '0400 123 456'}
callback The function to be called once the update has been completed by mydigitalstructure.cloud myApp.refreshContact
Using the example options above we can update the contact_person by calling the .save() function;
mydigitalstructure.cloud.save(
{
  object: 'contact_person',
  fields:
  {
      id: 1234,
      mobile: '0400 123 456'
  },
  callback: myApp.refreshContact
})

Retrieving data

The mydigitalstructure Javascript framework includes a .retrieve() function to help with retrieving data.

The most common .retrieve() options are;

Option Description Example
object The type of object you are updating. mydigitalstructure has many organsational objects included. contact_person
fields Which fields do you want returned. [{name: 'mobile'}, {name: 'firstname'}]
filters Array to filters
[{name: 'mobile', comparison: 'EQUAL_TO', value1: 'Jane'}]
Filter comparisons
sorts Array of data sorting [{name: 'mobile', direction: 'asc'}]
callback The function to be called once the retrieve has been completed by mydigitalstructure.cloud myApp.showSurname
Using the example options above we can retrieve data from the contact_person object by calling the .retrieve() function;
mydigitalstructure.cloud.retrieve(
{
  object: 'contact_person',
  fields: [{name: 'firstname'}, {name: 'surname'}],
  filters: [{name: 'firstname', comparison: 'EQUAL_TO', value: 'Jane'}],
  sorts: [{name: 'firstname', direction: 'asc'}],
  callback: myApp.showSurname
});

Try it


Saving (Uploading) files

A lot of of an organisation's information is also contained in files.

The mydigitalstructure Javascript framework includes a .upload() function to make it easier to upload files into mydigitalstructure.cloud storage.

It .upload() function will upload the file selected in a special HTML input element.

  • <input type="file" name="file0" id="myapp-attach-file0">

The options for .upload() are;

Option Description Example
object The type of object you are updating. mydigitalstructure has many organsational objects included. contact_person
objectContext The id of the object you are attaching the file to. contact_person id
context The context within the app ie used to find the input box. myapp
callback The function to be called once complete myApp.uploadComplete

Retrieving (Downloading) files

To retrieve a file that has been saved (uploaded) into storage you first need to retrieve the information about the file using .retrieve() with the object set as core_file and the field download included. You can then use this data to set the HTML a element href property.

  • mydigitalstructure.cloud.retrieve(
    {
      object: 'core_file',
      fields: [{name: 'filename'}, {name: 'download'}],
      filters:
      [
        {name: 'object', comparison: 'EQUAL_TO', value1: '32'},
        {name: 'objectcontext', comparison: 'EQUAL_TO', value1: '123456'}
      ],
      sorts: [{name: 'filename', direction: 'asc'}],
      callback: 'app-files-show'
    })
  • <a href="/download/789">test.txt</a>

Then when a user then clicks on the a element (ie text.txt), if they have access to it, the file will be downloaded.


Protecting the organisational data in storage

Organisational data is valuable and also organisations have obligations to keep it private.

mydigitalstructure.cloud includes a number of special objects that can be used to control access to data and files.

Object Description
User Roles Preset roles that contain access to the other objects in the organisation - ie viewing invoices.
Users Control who has access and how they have to authenticate themselves.
Logon Used by a user to authenticate themselves and return their authorisation - ie what mydigitalstructure objects that have access to.

More about access control...


Key factors when considering organisation information storage;

Factors Description mydigitalstructure
Availability Where is located? How long has it existed? Based on AWS and 19+ years of service. mydigitalstructure is independantly audited to ISO27001.
Protection Authentication, Authorisation & Accounting (Access Auditing) Full authentication including 2nd factor and full role based authorisation with all user actions being accounted (audited).
Existing structures Existing objects Full enterprise model