Namespace: API

API

General API methods.

Methods


<static> ajaxAppVTL(vmName [, settingsAjax] [, appContext])

Sends a request to the provided application resource .vm-file underneath internal/application/resource/APPGUID/.

Parameters:
Name Type Argument Description
vmName String

Path to the application .vm-file - .vmi are not reachable.

settingsAjax Object <optional>

AJAX settings e.g. {dataType: 'json'}, http://api.jquery.com/jQuery.ajax/, additional intrexx properties: urlParameters

appContext Object <optional>

The upFuncPart or any HTMLElement of the application page.

Returns:
Type
Promise
Example
ajaxAppVTL("test.vm", {
   dataType: "json",
   success: function(dataJSON){
      //e.g. dataJSON response is:
      //{"myobject":{"property1":"propertyValue1"}}
      alert(dataJSON.myobject.property1);
  }
});

<static> ajaxVTL(vtlFile [, settingsAjax])

Sends a request to the provided .vm-file.

Parameters:
Name Type Argument Description
vtlFile String

Path to the .vm-file - .vmi are not reachable.

settingsAjax Object <optional>

AJAX settings e.g. {dataType: 'json'}, http://api.jquery.com/jQuery.ajax/, additional intrexx properties: urlParameters

Returns:
Type
Promise
Example
ajaxVTL("internal/system/vm/custom/test.vm", {
    dataType: "json",
    urlParameters: {
        "rq_Name1": "value1",
        "rq_Name2": "value2"
    },
    success: function(dataJSON){
        //e.g. dataJSON response is:
        //{"myobject":{"property1":"propertyValue1"}}
        alert(dataJSON.myobject.property1);
    }
});

<static> getDateObject(oHtml)

Creates an JavaScript date object from a html control.

Parameters:
Name Type Description
oHtml Object

Reference to a html input control of types "date", "time" or "date & time".

Returns:
Type
Date
Example
getDateObject(getElement("A84E5E7F9EA9ED1A829DB98DBF5459F59961FA3B"));

<static> triggerUserWorkflowEvent(eventGuid [, urlParameters] [, ajaxParameters])

Triggers an User Workflow Event, which is always a POST-Request.

Parameters:
Name Type Argument Description
eventGuid String

The parameter "eventGuid" of the generic event handler.

urlParameters Object <optional>

An object containing name value pairs, which will be part of the Query-String.

ajaxParameters Object <optional>

An object containing synchronous mode.

Returns:
Type
Promise
Example
// Example 1
// Trigger event with guid <EVENTGUID>. Define a generic event handler with the class "de.uplanet.lucy.server.workflow.eventhandler.UserWorkflowEventHandler" before.
triggerUserWorkflowEvent("<EVENTGUID>", {"param1":"value1","param2":"value2"}, {"async": true});

// Example 2
$.when(triggerUserWorkflowEvent("<EVENTGUID>", {"param1":"value1", "param2":"value2"}, {"async": true}))
    .done(function() {
       alert("done");
    })
    .fail(function() {
       alert("failed :(");
    });