Skip to main content
Version: v2023.18.0

Document builder

Interacting with the documentBuilder

  • Object: getARenderJS().getDocumentBuilder()

    FunctionDescription
    close()Closes the document builder
    open()Open the document builder
    reset()Resets the document builder content

Register to the documentBuilder save event

  • Object: getARenderJS().getDocumentBuilder()

    FunctionDescriptionArguments
    registerNotifyAlterDocumentContentEvent(callback)Trigger a callback function when a built document is savedcallback: the callback function to call
    registerSubmitAlterDocumentContentEvent(callback)Trigger a callback function when a document creation is submittedcallback: the callback function to call
    getSubmittedAlterDocumentContentDescription(obj)Retrieve content description of altered documentobj: the source SubmitAlterDocumentContentEvent object
    getDocumentMetadata(desc,index)Extract the DocumentMetadata object from the source AlterContentDescription
    getResultDocumentId(obj)Fetch resulting DocumentIdobj: the event that was sent when the altercontent operation has been done
  • Object: getARenderJS().getDocumentMetadata()

    FunctionDescriptionArguments
    addDocumentMetadata(metadata, key, value)Add a metadata to a documentMetadata object
function arenderjs_init(arenderjs_) {
arenderjs_.getDocumentBuilder()
.registerSubmitAlterDocumentContentEvent(function (obj) {
armt_onSubmitAlterDocumentContentEvent(arenderjs_, obj);
});
arenderjs_.getDocumentBuilder()
.registerNotifyAlterDocumentContentEvent(function (obj) {
armt_onNotifyAlterDocumentContentEvent(arenderjs_, obj);
});
}

function armt_onSubmitAlterDocumentContentEvent(arenderjs_, obj) {
var desc = arenderjs_.getDocumentBuilder()
.getSubmittedAlterDocumentContentDescription(obj);
var meta = arenderjs_.getDocumentBuilder()
.getDocumentMetadata(desc, 0);
arenderjs_.getDocumentMetadata().addDocumentMetadata(meta, "name", "value");
}

function armt_onNotifyAlterDocumentContentEvent(arenderjs_, obj) {
console.log("Notify: " + obj);
var docId = arenderjs_.getDocumentBuilder().getResultDocumentId(obj);
console.log("Notify: " + docId);
console.log("Notify: docId = " + docId);
}

Send documentBuilder save event

  • Object: getARenderJS().getDocumentBuilder()

    FunctionDescriptionArguments
    saveCustomDocument()Trigger the custom save process with default values
    saveCustomDocument(download, delete, freeze, behavior)Trigger the custom save process with specific optionsdownload: Activates the local download builder button.
    delete: Delete the documents from the document builder view.
    freeze: Disable the documents from the document builder view.
    behavior: Sets the document builder save behavior:
    UPDATE_NO_DOCUMENT,
    CREATE_NEW_FIRST_DOCUMENT,
    UPDATE_FIRST_DOCUMENT,
    UPDATE_ALL_DOCUMENT

Example

scripts/example.js
function arenderjs_init(arenderjs_)
{
arenderjs_.getDocumentBuilder().saveCustomDocument(false,true,false,"UPDATE_NO_DOCUMENT");
}