Namespace: API

API

General API methods.

Methods


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

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

Parameters:
Name Type Argument Description
vtlFile 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);
  }
}, getElement(GUID));

ajaxAppVTL("test.vm", {
   dataType: 'text',
   data: {
          fr_param1: Browser.getValue(getElement("GUID_FROM_FIELD"))
   },
   success: function(data){
      Browser.setValue(getElement("GUID_STATIC_TEXTFIELD"), data);
   }
}, getElement("GUID_FROM_ANY_FIELD"));

<static> ajaxVTL(vtlFile [, settingsAjax] [, appContext])

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

appContext Object <optional>

The upFuncPart or any HTMLElement of the application page.

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(ctrl)

Creates an JavaScript Date from a html control.

Parameters:
Name Type Description
ctrl Object

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

Returns:

date

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

<static> getNumberObject(ctrl)

Creates an JavaScript Number from a html control.

Parameters:
Name Type Description
ctrl Object

Reference to a html input control of types "integer", "double" or "currency".

Returns:

number

Type
Number
Example
getNumberObject(getElement("5F7S5E7F9EA9ED1A829DB98DBF5459F59961FA3B"));

<static> inking(control, op, comp, color, colored)

Colors rows and cells in a viewtablecontrol depending on a number value.

Parameters:
Name Type Description
control String

Name of control, whose value should be checked (name from expert page of the column).

op String

Operator

comp String

Value to compare with.

color String

Value of color (hexadecimal or name)

colored String

Possible values: "row" = whole row (tr), "cell" = whole cell (td), "span" = text of cell (span).

Example
inking("viewcontrolD54BA2DD", ">", 10, "#008000", "row");

<static> inkingDate(control, op [, type], color, colored)

Colors date or datetime values in a viewtablecontrol depending on today.

Parameters:
Name Type Argument Default Description
control String

Id of control, whose value should be checked, without prefix "ID_".

op String

Operator

type String <optional>
""

Compare either against today as "date" or today as "datetime".

color String

Value of color (hexadecimal or name)

colored String

Possible values: "row" = whole row (tr), "cell" = whole cell (td), "span" = text of cell (span).

See:
  • inking

<static> inkingString(control, op, comp, color, colored)

Colors strings in a viewtablecontrol depending on a number value.

Parameters:
Name Type Description
control String

Name of control, whose value should be checked (name from expert page of the column).

op String

Operator

comp String

Value to compare with.

color String

Value of color (hexadecimal or name)

colored String

Possible values: "row" = whole row (tr), "cell" = whole cell (td), "span" = text of cell (span).

See:
  • inking

<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 :(");
    });