References the mutex constructor.
References the node worker constructor.
References the shared worker constructor.
References the system worker constructor.
References the console of the application.
References the directory of the application.
References the datastore of the application.
Reference the HTTP server of the application.
References the model object of the application
References the HTTP session storage of the application.
Creates a progress indicator.
Number of elements to count
Name of execution session for progress indicator
true
if the progress indicator can be stopped, false
otherwise
Not used, always pass an empty string ("")
Unique name of object on the server
Starts the backup of the closed datastore defined by model and data.
Ends the current thread.
close();
Compacts the datastore's data file designated by model and data, and generates the compactedData data file.
Exit pending wait()
in the current thread. Does not impact pending wait()
in other threads.
exitWait();
Creates a valid UUID string.
generateUUID();
// 9AE457F4B557BD7895AD4712345ABCDE
Returns a string with the generated UUID
Returns an Array that lists the 20 most recent backup manifests recorded in the specified backup registry.
Returns an Object containing the default backup settings for the solution.
Returns information about the journal of the datastore whose data file you passed in dataFile.
Returns information about the journal of the datastore whose data file you passed in dataFile.
Returns an Array that lists the 20 most recent backup manifests recorded in the backup registry default folder of the application.
Gets the named progress indicator object.
Get or create a storage. This storage is shared between all your application.
// First call creates the storage
var myStorage = getStorage( 'mySuperHeroes' );
myStorage.squadOne = ['Batman', 'Spiderman', 'Superman'];
// Second call retrieves the storage even in another JS contexts.
var myStorage = getStorage( 'mySuperHeroes' );
// myStorage.squadOne returns ['Batman', 'Spiderman', 'Superman']
// The storage object can be manipulate as a JS object.
myStorage = { a:1,b:2,c:[1,2,3],d:{a:1} };
myStorage.a++;
myStorage.d.a++;
Allows you to partially or fully integrate a journal file into a datastore.
Loads an image from its path.
var myPict = loadImage( 'C:/images/tulips.jpg' );
var newPict = new ds.Pict();
newPict.name = 'Flower';
newPict.photo = myPict;
newPict.save();
Image path to load (POSIX path). Supports PNG and JPG files.
Returns the image through Image object.
Loads an image from a File object.
var myFile = new File( 'C:/images/tulips.jpg' );
var myPict = loadImage(myFile);
var newPict = new ds.Pict();
newPict.name = 'Flower';
newPict.photo = myPict;
newPict.save();
File object that reference an image. Supports PNG and JPG files.
Returns the image through Image object.
Loads the content of a text file from its path.
var myText = loadText( 'PROJECT/bootstrap.js' );
console.log(myText);
File path to load (POSIX path).
(default: 7) Defines the charset to use to read the file. See charset values for more details.
Returns a string with the full text file content.
Loads the content of a text file from a File object.
var myFile = new File( 'PROJECT/bootstrap.js' );
var myText = loadText( myFile );
console.log( myText );
File object that reference a text file.
(default: 7) Defines the charset to use to read the file. See charset values for more details.
Returns a string with the full text file content.
Remove a given storage.
removeStorage( 'myCustomStorage' );
Repairs the datastore's data file defined by model and data, and generates the repairedData data file.
Requires an SSJS module (CommonJS compliant).
This module must be defined in PROJECT/modules/
.
// Get the module defined in PROJECT/modules/mail
var mail = require('mail');
// Get the module defined in PROJECT/modules/customers/platinium
var platiniumCustomers = require('/customers/platinium');
Describes the module id and path
Returns the exported API of the given module
Requires a NodeJS module.
This module must be defined in PROJECT/node_modules
.
// Get the Node module defined in PROJECT/node_modules/http
var http = requireNode('http');
Describes the module id and path
Returns the exported API of the given module
Resets the current journal of the datastore whose data file you passed in dataFile.
Resets the current journal of the datastore whose data file you passed in dataFile.
Allows you to restore a data folder previously archived.
Allows you to restore a data folder previously archived.
Saves the text into a file.
saveText( 'Hello World ! Here is my text saved.', 'C:/texts/chapter-1.txt' );
Text string to save.
File path where to update (POSIX path).
(default: 7) Defines the charset of the text string. See charset values for more details.
Saves the text into a file.
var myFile = new File( 'C:/texts/chapter-1.txt' );
saveText( 'Hello World ! Here is my text saved.', myFile );
Text string to save.
File path where to update (POSIX path).
(default: 7) Defines the charset of the text string. See charset values for more details.
Defines a log listener. It calls the log()
function of moduleId
JS module.
@param moduleId Describes the module id and path from /modules/
directory
Verifies the internal structure of the objects contained in the datastore designated by model and data.
Allows a thread to handle events and to continue to exist after the complete code executes.
// Wait for 100ms
wait(100);
// Wait for the end of time
wait();
Milliseconds to wait for. If none, it's an infinite wait. Can be squeeze with an exitWait()
.
References the buffer constructor.