esWebApi
es.Services.Web
In order to use the esWebApi service you have to configure within your AngularJS application the service through the esWebApiProvider. Web API.
Deletes the ES00DocumentInfo record as specified by the parameters and returns the current set of ES00Documents that are corelated to the specified Entity object.
ATTENTION
This method requires the ngFileUpload module of AngularJS. In order to use it you must make sure that the appropriate js libraries have been loaded. For example, in the main html file e.g. index.html of the AngularJS application you have to include the ng-file-upload/ng-file-upload-shim.min.js prior to loading the angular library and the ng-file-upload/ng-file-upload.min.js just after the Angular library has been loaded, as shown in the example below:

Also in your application Angular controller module or application module you should also require the ngFileUpload module as shown in the code below:
var smeControllers = angular.module('smeControllers', ['kendo.directives', 'underscore', 'es.Web.UI', 'ui.bootstrap', 'uiGmapgoogle-maps', 'ngFileUpload']);
And in the AngularJS application controller function you should inject the Upload service as shown below:
smeControllers.controller('examplesCtrl', ['$log', '$q', '$scope', 'Upload', 'esWebApi', 'esUIHelper', 'esGlobals', 'esCache', 'esGeoLocationSrv', 'uiGmapGoogleMapApi',
function($log, $q, $scope, Upload, esWebApi, esWebUIHelper, esGlobals, esCache, esGeoLocationSrv, GoogleMapApi) {
// your application code
// goes here
}
| Param | Type | Details |
|---|---|---|
| doc | object | The JSON object representation of the ES00Document to be added or updated (in case that it exists) |
| file | file | The file object holding the value of the element of type file |
| okfunc (optional) | function | a function that will be called when the upload is completed |
| errfunc (optional) | function | a function that will called should an error occurs while uploading the file |
| progressfunc (optional) | function | a function that will be called as many times as necessary to indicate the progress of the uploading of the file i.e. to inform the user about the percentage of the bytes that have been uploaded so far |
| Upload | An object of type Upload. For detailed documentation please visit ng-file-upload. |
$scope.uploadPic = function(myFile) {
var okf = function(retFile) {
$log.info("file uploaded ....");
};
var errf = function(response) {
if (response.status > 0)
$scope.errorMsg = response.status + ': ' + response.data;
else {
$scope.errorMsg = "Ooops something wnet wrong";
}
$log.error($scope.errorMsg);
};
var progressf = function(evt) {
myFile.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
};
var doc = {
"GID": "3536eaa3-6c67-4d15-a8d9-3519711969c9",
"Title": "Hello File",
"Description": $scope.username,
"Caption": "Tehcnical Guide for Hello File",
"OriginalFN": "xxx.pdf"
};
esWebApi.addES00Document(doc, myFile, okf, errf, progressf);
}
Deletes the ES00DocumentInfo record as specified by the parameters and returns the current set of ES00Documents that are corelated to the specified Entity object
| Param | Type | Details |
|---|---|---|
| es00Document | object | The JSON object representation of the ES00Documen to be deleted. The following attributes are mandatory:
|
$scope.deleteES00Document = function() {
esWebApi.deleteES00Document($scope.pEntityType, $scope.pEntityGID, $scope.pDocumentGID)
.then(function(ret) {
$scope.pES00DocResults = ret.data;
},
function(err) {
$scope.pES00DocResults = err;
});
}
Creates a URL that directly downalods the specified assetUrlPath. The download process is performed in chunks of 8KB buffer size, it is resumable and it also supports ranges.
| Param | Type | Details |
|---|---|---|
| assetUrlPath | string | The string path of the asset to be downloaded. |
| string | A complete URL for the asset to be downloaded. |
This function returns the arraybuffer for the document stored in ES00Document as BLOBDATA for a given by GID ES00Document record.
REQUIRES ESWebAPIServer >= 1.9.7 and Entersoft Application Server >= <IP_ADDRESS>
| Param | Type | Details |
|---|---|---|
| es00BlobGID | string | The GID of the ES00Blob to be downloaded. Should the ES00Blob does not exist or the contents of the blob is empty 404 is returned. |
| fExt (optional) | string | Optional, the file extension of the related ES00Blob i.e. ".xlsx" |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the arraybuffer of the contents of the ES00Blob identified by the parameters es00BlobGID |
Creates a URL that direct downalods the specified ES00Blob. The URL contains the query parameter for the GID of the ES00Blob to be downloaded as well as the web api token. The download process is performed in chunks of 8KB buffer size, it is resumable and it also supports ranges.
| Param | Type | Details |
|---|---|---|
| es00BlobGID | string | The GID of the ES00Blob to be downloaded. Should the ES00Blob does not exist or the contents of the blob is empty 404 is returned. |
| fExt (optional) | string | Optional, the file extension of the related ES00Blob i.e. ".xlsx" |
| string | A complete URL for the ES00Blob to be downloaded, ready to be used in an ng-href or similar html element. |
Creates a URL that direct downalods the specified ES00DocumentGID. The URL contains the query parameter for the GID of the ES00Document to be downloaded as well as the web api token. The download process is performed in chunks of 8KB buffer size, it is resumable and it also supports ranges.
| Param | Type | Details |
|---|---|---|
| es00documentGID | string | The GID of the ES00Document to be downloaded. Should the ES00Document does not exist or the contents of the blob or binded file are empty 404 is returned. |
| string | A complete URL for the ES00Document to be downloaded, ready to be used in an ng-href or similar html element. |
This function acts as a facade to the Elastic Search Engine that has been registered with Entersoft WEB API Server. This function allows for almost any kind of operation can be executed by the ElasticSearch engine as an http method (i.e. GET, PUT, DELETE, POST, etc.) searchIndex.
| Param | Type | Details |
|---|---|---|
| eUrl | string | the last segment of the URL (i.e. without the domain name) that contains the REST api part e.g. twitter/_settings,_mappings (the full CURL type request URL would be http://localhost:9200/twitter/_settings,_mappings). This call is an example from ElasticSearch documentation GetIndex that retrieves the settings and the mappings for the twitter index. |
| eMethod | string | The http method verb (i.e. "GET", "PUT", "DELETE", "POST", etc.). In the example above the verb should be "GET" the index or indices specified by the elasticSearchIndex parameter. |
| eBody | string | The http request payload as required by the ElasticSearch REST call we are executing. In the example above there is no payload so it would be emtpy or null. |
| httpPromise | The response that we get from Elastic Search service should we perform an AJAX call against the service |
This function executes an EBS service method defined and registered at the Entersoft Application Server. For such an example you may download the Microsoft VS2015 C# project and solution that has the implementation of such an example project. Download the zip file from esbotestapiservice.zip Once you download and extract the zip, please resolve the .NET Assembly References to the required dlls by pointing the Reference Path to the run-time directory where the Entersoft Application Server is installed and running. Compile the assembly and copy the built DLL in the run-time directory of the EAS.
| Param | Type | Details | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| serviceObj | object | a simple JSON object with the following properties:
| ||||||||||||||||||
| paramObject | objectstringnumberdate* | the object that will be passed as parameter to the method call. It should be compatible and consistent to what the service method expects in the .NET space. In case that .NET method expects a POCO class or struct as the type of the function's argument you can pass a javascript POCO class with respect to property names and types |
| httpPromise | Returns a promise that upon success the ret.data contains the result of the service |
.NET Assembly and class definitions
using Entersoft.Framework.Platform;
using Entersoft.Web.Api;
using Entersoft.Web.Api.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace esbotestapiservice.Generic
{
public class ESWebApiCustomService
{
public class Identity2Payload
{
public string TextValue { get; set; }
public int IntValue { get; set; }
public byte[] ByteArray { get; set; }
public int[] IntArray { get; set; }
}
public struct Identity2Struct
{
public string TextValue { get; set; }
public int IntValue { get; set; }
public byte[] ByteArray { get; set; }
public int[] IntArray { get; set; }
}
[EbsService]
public static byte[] SanRebel(ESSession session, string Message)
{
return Enumerable.Range(64, 90).Select(i => (byte)i).ToArray();
}
[EbsService]
public static Identity2Payload Identity2(ESSession session, Identity2Payload payload)
{
payload.TextValue += payload.TextValue;
payload.IntValue += payload.IntValue;
payload.ByteArray = Enumerable.Range(1, 10).Select(i => (byte)i).ToArray();
payload.IntArray = Enumerable.Range(1, 10).ToArray();
return payload;
}
[EbsService]
public static Identity2Struct Identity2Structure(ESSession session, Identity2Struct payload)
{
payload.TextValue += payload.TextValue;
payload.IntValue += payload.IntValue;
payload.ByteArray = Enumerable.Range(1, 10).Select(i => (byte)i).ToArray();
payload.IntArray = Enumerable.Range(1, 10).ToArray();
return payload;
}
[EbsService]
public static Identity2Payload ReturnNull(ESSession session, Identity2Payload payload)
{
return null;
}
[EbsService]
public static int SimpleInt(ESSession session, int x)
{
return x * x;
}
[EbsService]
public static string ReturnString(ESSession session, Identity2Payload payload)
{
return "{0}-{1}".SafeFormat(payload.IntValue, payload.TextValue);
}
[EbsService]
public static int ReturnInt(ESSession session, Identity2Payload payload)
{
return payload.IntValue * 2;
}
[EbsService]
public static byte[] ReturnByteArray(ESSession session, Identity2Payload payload)
{
return Enumerable.Range(0, payload.IntValue).Select(i => (byte)i).ToArray();
}
public static int InvalidService(ESSession session, Identity2Payload payload)
{
return payload.IntValue * 2;
}
}
}
Ajax calls sample
tester.register_ajax_call({
caption: 'execute an EBS service - returns null',
ajax_options: function () {
return {
// /api/rpc/EbsService/<assembly>/<namespace>/<namespace>/<namespace>/<class>/<method>,
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/ReturnNull',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 123
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.are_equal(null, results);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an EBS service - returns a complex object ',
ajax_options: function () {
return {
// /api/rpc/EbsService/<assembly>/<namespace>/<namespace>/<namespace>/<class>/<method>,
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/Identity2',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 123
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.existy(results);
assert.are_equal("hellohello", results.TextValue);
assert.are_equal("246", results.IntValue);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an EBS service - returns a struct' ,
ajax_options: function () {
return {
// /api/rpc/EbsService/<assembly>/<namespace>/<namespace>/<namespace>/<class>/<method>,
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/Identity2Structure',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 123
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.existy(results);
assert.are_equal("hellohello", results.TextValue);
assert.are_equal("246", results.IntValue);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an EBS service - returns a string',
ajax_options: function () {
return {
// /api/rpc/EbsService/<assembly>/<namespace>/<namespace>/<namespace>/<class>/<method>,
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/ReturnString',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 123
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.existy(results);
assert.are_equal("123-hello", results);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an EBS service - returns an integer',
ajax_options: function () {
return {
// /api/rpc/EbsService/<assembly>/<namespace>/<namespace>/<namespace>/<class>/<method>,
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/ReturnInt',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 123
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.existy(results);
assert.are_equal(246, results);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an EBS service - returns a byte array',
ajax_options: function () {
return {
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/ReturnByteArray',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 10
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (results) {
assert.existy(results);
assert.are_equal("AAECAwQFBgcICQ==", results);
var byteCharacters = atob(results);
//logger.ok(byteCharacters.to_s());
assert.are_equal(0, byteCharacters.charCodeAt(0));
//assert.are_equal(10, byteCharacters.length);
logger.ok();
}
});
tester.register_ajax_call({
caption: 'execute an invaldid EBS service',
ajax_options: function () {
return {
url: '/api/rpc/EbsService/ESWebApiServices/Entersoft/Web/Test/EbsServiceTest/InvalidService',
type: 'POST',
headers: {
Authorization: 'Bearer ' + tester.user.Model.WebApiToken
},
data: JSON.stringify({
TextValue: "hello",
IntValue: 10
}),
contentType: "application/json; charset=utf-8"
}
},
done: function (user) {
assert.fail('invaldid EBS service')
}, error: function (jqXHR, textStatus, errorThrown) {
assert.are_equal(403, jqXHR.status);
var data = jqXHR.responseJSON;
assert.are_equal("invalid-service", data.MessageID)
logger.ok();
return true;
}
});
javascript sample
$scope.serviceObj = {
netAssembly: "esbotestapiservice",
netNamespace: "esbotestapiservice/Generic",
netClass: "ESWebApiCustomService",
netIsBinaryResult: false,
netMethod: ""
}
$scope.execEbsService = function() {
esWebApi.ebsService($scope.serviceObj, $scope.netParam)
.then(function(ret) {
$scope.ebsret = ret.data;
}, function(err) {
$scope.ebsret = JSON.stringify(err);
});
}
html sample

34. esService

<input type="text" ng-model="serviceObj.netAssembly" placeholder=".NET Assembly name"/>
<input type="text" ng-model="serviceObj.netNamespace" placeholder=".NET Namespace"/>
<input type="text" ng-model="serviceObj.netClass" placeholder=".NET Class"/>
<input type="text" ng-model="serviceObj.netMethod" placeholder=".NET Method"/>
<input type="text" ng-model="netParam" placeholder="POCO Object in string format"/>
Binary Result:
<input type="checkbox" ng-model="serviceObj.netIsBinaryResult">

<button ng-click="execEbsService()">Execute EBS Service</button>

<textarea>{{ebsret}}</textarea>

This function inserts a new log entry in the ES00EventLog Entersoft Application Server subsystem
| Param | Type | Details | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| esLog | object | a simple JSON object with the following properties:
|
| promise | A promise that denotes either success or error. No data are expected to be retrieved from the promise success function |

29. eventLog

<input type="text" ng-model="eID" placeholder="Event ID"/>
<input type="text" ng-model="eDescription" placeholder="Event Description"/>
<input type="number" ng-model="eSeverity" placeholder="Event Severity"/>
<button ng-click="eventLog()">Log an Event</button>
<textarea>{{eRet}}</textarea>

$scope.eventLog = function() {
esWebApi.eventLog({
ID: $scope.eID,
Description: $scope.eDescription,
TypeID: $scope.eSeverity
})
.then(function(ret) {
$scope.eRet = ret.data;
},
function(err) {
$scope.eRet = err;
});
}
Function that returns the ES Param for a requested ParamID.
| Param | Type | Details |
|---|---|---|
| esParam | string | The ID of the ES CompanyParam. The ID should not contain the @ i.e. fetchCompanyParam("MyValidParamKey") |
| httpPromise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
// fetchCompanyParam
$scope.fetchCompanyParam = function() {
esWebApi.fetchCompanyParam($scope.pCompanyParam)
.then(function(x) {
$scope.pCompanyParamValue = x.data;
},
function(err)
{
$scope.pCompanyParamValue = JSON.stringify(err);
});
}
Function that returns the ES Params for the requested array of parameter id's
| Param | Type | Details |
|---|---|---|
| esParams | string[]string | can be
|
| httpPromise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchCompanyParams
$scope.fetchCompanyParams = function() {
if (!$scope.pCompanyParams) {
$scope.pCompanyParams = null;
}
esWebApi.fetchCompanyParams($scope.pCompanyParams)
.then(function(x) {
$scope.pCompanyParamsValue = x.data;
},
function(err) {
$scope.pCompanyParamsValue = JSON.stringify(err);
});
};
Retrieves information for the ES00Device identified by the parameter deviceCode.
| Param | Type | Details |
|---|---|---|
| deviceCode | string | The Code (Device code, which typically is the DeviceID as supplied by the mobile device application. This is NOT Device GID). |
| object | The datase in JSON representation for the given device. If the user that send this request is not an EBS administrator then data is returned only if the device identified by the deviceCode belongs to the user issueing this request. Otheriwise, the result will be empty. |
This function returns the contents of a file asset stored in the Entersoft Application Server (EAS) ESWebAssets or CSWebAssets sub-directories of the EAS.
REQUIRES ESWebAPIServer >= 1.7.9
| Param | Type | Details |
|---|---|---|
| assetUrlPath | string | the sub-path that points to the file the contents of which we need to retrieve. So, if at the EAS the file is stored in the $/CSWebAssets/esrfa/config/menuConfig.json you have to provide as assetUrlPath the value "esrfa/config/menuConfig.json". |
| options (optional) | object | JSON object representing the options that will be used to get the contents of the file. These options depend on what the caller wants to do with the results and on the document type e.g. image, MS Office document, PDF, etc. If left null or unspecified, then contents of the file will be returned as arraybuffer (requires AngularJS v1.2 or hogher) To get an image i.e. myphoto.png to be displayed by an ATTENTION For the image to be shown correctly by an HTML image element you should pre-pappend to the begining of the returned string the following string: "data:image/png;base64," i.e. img_data = "data:image/png;base64," + ret.data
To get a unicode or utf-8 text document contents as a string you need to call
As described above, if options is null or undefined, then the default options that will be used to execute the operation:
|
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the string or the array buffer with the contents of the file requested |
$scope.fetchEASWebAsset = function() {
esWebApi.fetchEASWebAsset($scope.pAsset, false)
.then(function(ret) {
$scope.pAssetResults = ret.data;
},
function(err) {
$scope.pAssetResults = err;
});
}
// call this function
// esWebApi.fetchEASWebAsset("xx/yy/abcd.txt", {Accept: 'text/plain'})
// will return the contents of the file.
// sample
This function returns the arraybuffer for the document stored in ES00Document as BLOBDATA for a given by GID ES00Document record.
REQUIRES ESWebAPIServer >= 1.7.9
| Param | Type | Details |
|---|---|---|
| es00DocumentGID | string | The GID of the ES00Document record the blobdata of which we are looking for. |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the arraybuffer of the contents of the file stored in blobdata in the ES00Document record specified by its GID key. |
This function returns the JSON object for the record of the ES00Document object that matches the es00DocumentCode parameter.
REQUIRES ESWebAPIServer >= 1.7.9
| Param | Type | Details |
|---|---|---|
| es00DocumentCode | string | The Code of the ES00Document record that we are looking for |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the JSON representation of the ES00Document record for the specific doc Code. The JSON object is of the form:
|
$scope.fetchES00DocumentByCode = function() {
esWebApi.fetchES00DocumentByCode($scope.pES00Doc)
.then(function(ret) {
$scope.pES00DocResults = ret.data;
},
function(err) {
$scope.pES00DocResults = err;
});
}
This function returns the JSON object for the record of the ES00Document object that matches the es00DocumentGID parameter.
REQUIRES ESWebAPIServer >= 1.7.9
| Param | Type | Details |
|---|---|---|
| es00DocumentGID | string | The GID of the ES00Document record that we are looking for |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the JSON representation of the ES00Document record for the specific GID. The JSON object is of the form:
|
$scope.fetchES00DocumentByGID = function() {
esWebApi.fetchES00DocumentByGID($scope.pES00Doc)
.then(function(ret) {
$scope.pES00DocResults = ret.data;
},
function(err) {
$scope.pES00DocResults = err;
});
}
This function returns an array of JSON objects for the records of type ES00Document that belong to entity with GID equal to entityGID.
REQUIRES ESWebAPIServer >= 1.7.9
| Param | Type | Details |
|---|---|---|
| entityGID | string | The GID of the entity for which we want to get all the registered ES00Documents |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the array of the JSON representation of the ES00Document records for the specific entity. The JSON object is of the form:
|
$scope.fetchES00DocumentsByEntityGID = function() {
esWebApi.fetchES00DocumentsByEntityGID($scope.pES00Doc)
.then(function(ret) {
$scope.pES00DocResults = ret.data;
},
function(err) {
$scope.pES00DocResults = err;
});
}
This function returns a scale object as it is defined in the Entersoft Application Server ESGOZScales
| Param | Type | Details |
|---|---|---|
| scaleCode | string | The string code of the ESGOScale object we want to retrieve |
| object | If success i.e. function(ret) { ...} the ret contains the JSON representation of the ESGOScaleObject |
var ret = {
"GID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"Code": "AgeScale",
"Description": "Age scale",
"InternationalID": "ES.AgeScale",
"Inactive": false,
"ESSystem": true,
"Ranges": [{
"GID": "d9a19f99-6f34-4a7d-aab8-288f77c6ee9d",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 1,
"Code": "18-24",
"Inactive": false,
"MinValue": 0,
"MaxValue": 24,
"ImageIndex": 0,
"ColorARGB": -103
}, {
"GID": "6eed297b-f7cb-4c06-9215-0276c424e39a",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 2,
"Code": "25-34",
"Inactive": false,
"MinValue": 24,
"MaxValue": 34,
"ImageIndex": 0,
"ColorARGB": -7876885
}, {
"GID": "cdf25cd5-1cf3-4f81-8b99-9a4f6907ecc8",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 3,
"Code": "35-44",
"Inactive": false,
"MinValue": 34,
"MaxValue": 44,
"ImageIndex": 0,
"ColorARGB": -1146130
}, {
"GID": "b63498c2-b104-4adb-b316-31c7b889b2f5",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 4,
"Code": "45-54",
"Inactive": false,
"MinValue": 44,
"MaxValue": 54,
"ImageIndex": 0,
"ColorARGB": -16776961
}, {
"GID": "e39f3163-e71a-43d6-9a04-bf09b2ba129d",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 5,
"Code": "55-64",
"Inactive": false,
"MinValue": 54,
"MaxValue": 64,
"ImageIndex": 0,
"ColorARGB": -16744448
}, {
"GID": "2a871edb-1732-4f2a-863e-7dc9cacd752c",
"fScaleGID": "78bd32f1-398d-4779-850c-7ae4f0bc2290",
"SeqNum": 6,
"Code": "65+",
"Inactive": false,
"MinValue": 64,
"MaxValue": 130,
"ImageIndex": 0,
"ColorARGB": -65536
}]
};
This function returns the Entersoft Entity ISUD dataset in JSON representation
| Param | Type | Details |
|---|---|---|
| entityclass | string | The Entersoft ODS object ID the ISUD record to be retrieved |
| entitygid | string | The gid in string format that represents the Primary Key of the record to be retrieved |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains JSON object of the ISUD dataset. |
$scope.fetchEntity = function() {
esWebApi.fetchEntity("esmmstockitem", "B485C0C2-D9A9-47A6-88A3-039A40CA0157")
.then(function(ret) {
$scope.pEntityDS = ret.data;
},
function(err) {
$scope.pEntityDS = err;
})
}
var x = {
"ESMMStockItem": [{
"GID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"Code": "ΘΡ.ΑΛ.425",
"Description": "ΛΟΥΚ.Τ.ΦΡΑΓΚΦ.18ΧΛ.400ΓΡ -20%",
"AlternativeDescription": "SAUSAGE FRANFURT 18ΧΛ.400ΓΡ -20%",
"InternationalCode": "ΘΡ.ΑΛ.425",
"AlternativeCode": "THR.AL.425",
"AssemblyType": 0,
"ItemClass": 1,
"ItemType": 0,
"fMainSupplierGID": "f6f24cba-6c22-49ef-b072-7165ad834592",
"fItemPricingCategoryCode": "ΕΜΠΟΡΕΥΜΑΤΑ",
"Price": 35,
"RetailPrice": 42,
"MarkupOnPrice": 11,
"MarkupOnRetailPrice": 14,
"PriceIncludedVAT": 0,
"RetailPriceIncludedVAT": 1,
"fMainMUGID": "ac431509-66a2-4fdb-9b75-ac1cd5b9c1e7",
"fVATCategoryCode": "1111",
"Discount": 4,
"MaxDiscount": 6,
"MinProfitMargin": 8,
"MinSalesOrderQty": 0,
"UsualPurchaseOrderQty": 0,
"fCommissionLevelCode": "M.FLAT",
"fItemFamilyCode": "ΤΡΟΦΙΜΑ",
"fItemGroupCode": "ΧΑΙΤΟΓΛΟΥ",
"fItemCategoryCode": "ΛΟΥΚΑΝΙΚΑ",
"StandardCost": 3.6,
"ValuationMethod": 0,
"fItemControlProfileGID": "134fe00c-3212-440a-8237-0abd89e5b02c",
"IncludedTaxReports": 0,
"SerialNumberMgmt": 0,
"LotMgmt": 0,
"ColorMgmt": 0,
"SizeMgmt": 0,
"StockDim1Mgmt": 0,
"StockDim2Mgmt": 0,
"fCatalogueItemGID": "c1f5f5b1-6a9e-4100-9186-49385878f18d",
"DateField1": "2006-11-16T00:00:00",
"NumericField1": 0,
"NumericField2": 0,
"NumericField3": 0,
"NumericField4": 0,
"NumericField5": 0,
"NumericField6": 0,
"NumericField7": 0,
"NumericField8": 0,
"NumericField9": 0,
"NumericField10": 0,
"Flag1": 0,
"Flag2": 0,
"Flag3": 0,
"Flag4": 0,
"Flag5": 0,
"Flag6": 0,
"Flag7": 0,
"Flag8": 0,
"Flag9": 0,
"Flag10": 0,
"Flag11": 0,
"Flag12": 0,
"fBusinessActivityCode": "ΤΡΟΦΙΜΑ",
"fGLSegCode": "Εμπορεύματα",
"Price1": 0,
"Price2": 0,
"Price3": 0,
"Price1IncludedVAT": false,
"Price2IncludedVAT": false,
"Price3IncludedVAT": false,
"fMUServiceCode": "ΤΕΜ",
"fMUMainCode": "ΤΕΜ",
"MainSupplier": "f9eef0bf-2995-45cc-85b6-473a03a25a0d",
"VATCalculationValue": 1,
"Web": 1,
"ValuationMethodAnalysis": 0,
"MainCode": 1,
"ValuationPerPeriod": 0,
"ServiceMUType": 0,
"Mobile": 0,
"SelectInMobileOrder": 1,
"PerCentOfTaxExclusion": 0,
"MarkupOnPrice1": 0,
"MarkupOnPrice2": 0,
"MarkupOnPrice3": 0,
"OpeningPerFiscalYear": 1,
"LotCharacteristicsMgmt": 0,
"CatalogueItemBehaviour": 0,
"NS_MainSupplierDescription_Col": "ZOLOTAS Α.Ε..",
"NS_MainMUDescription_Col": "Τεμάχια",
"NS_MainSupplierItemCode_Col": "ΘΡ.ΑΛ.425",
"NS_MainSupplierCurrency_Col": "EUR",
"fCurrencyRateGroupCode": "1",
"SetDate": "2015-11-23T00:00:00",
"CurrencyExchangePriceType": 2,
"CurrencyRate": 1,
"NS_MainSupplierPrice_Col": 0,
"ESDCREATED": "2006-11-16T13:51:19.86",
"ESDMODIFIED": "2013-09-30T11:42:29.65",
"ESUCREATED": "esmaster",
"ESUMODIFIED": "KAR",
"INACTIVE": 0,
"fCompanyCode": "ES"
}],
"ESMMCatalogueItemRelation": [],
"ESMMCatalogueItemRelationStockDimSetMap": [],
"ESMMItemStorageLocation": [],
"ESMMItemCodes": [{
"ItemGID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"Code": "ΘΡ.ΑΛ.425",
"fMUGID": "ac431509-66a2-4fdb-9b75-ac1cd5b9c1e7",
"Description": "ΛΟΥΚ.Τ.ΦΡΑΓΚΦ.18ΧΛ.400ΓΡ -20%",
"RequiresBCProcessing": 0,
"NumericField1": 0,
"NumericField2": 0,
"Flag1": false,
"Flag2": false,
"INACTIVE": 0,
"fCompanyCode": "ES"
}],
"ESMMItemMU": [{
"GID": "ac431509-66a2-4fdb-9b75-ac1cd5b9c1e7",
"fItemGID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"fMUCode": "ΤΕΜ",
"Relation": 1,
"EditRelation": 0,
"DefaultVar2": 1,
"DefaultVar3": 1,
"DefaultVar4": 0,
"RelationType": 0,
"ApplyOnUserSelection": 0,
"INACTIVE": 0,
"fCompanyCode": "ES"
}],
"ESMMSISupplier": [{
"GID": "f6f24cba-6c22-49ef-b072-7165ad834592",
"fItemGID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"fSupplierGID": "f9eef0bf-2995-45cc-85b6-473a03a25a0d",
"SupplierItemCode": "ΘΡ.ΑΛ.425",
"fCurrencyCode": "EUR",
"Price": 0,
"CurrencyPrice": 0,
"DeliveryDays": 2,
"Discount": 10,
"fMUCode": "ΤΕΜ",
"MinOrderQty": 0,
"OptionLevel": "1",
"OfferPrice": 0,
"RequiresBCProcessing": 0,
"PurchaseNetPrice": 0,
"CurrencyPurchaseNetPrice": 0,
"CrossCompanyID": "7jgU4Jjao1LMuhSJe6fjJg==",
"fCurrencyRateGroupCode": "1",
"SetDate": "2015-11-23T00:00:00",
"CurrencyExchangePriceType": 2,
"CurrencyRate": 1,
"fCompanyCode": "ES",
"SeqNum": 1
}],
"ESMMItemWH": [{
"GID": "9f88e587-185d-4e2a-8bd2-14eb4c169c9e",
"fItemGID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"fWareHouseGID": "86947579-6885-4e86-914e-46378db3794f",
"BottomLevel": 1,
"SecurityLevel": 0,
"ReorderLevel": 0,
"UpperLevel": 0,
"DebitQty": 100,
"CreditQty": 2,
"ReservedStock": 0,
"Remainder": 98,
"Available": 98,
"BottomLevelAltMU": 0,
"SecurityLevelAltMU": 0,
"ReorderLevelAltMU": 0,
"UpperLevelAltMU": 0,
"DebitQtyAltMU": 0,
"CreditQtyAltMU": 0,
"ReservedStockAltMU": 0,
"RemainderAltMU": 0,
"AvailableAltMU": 0,
"NumericField1": 0,
"NumericField2": 0,
"NumericField3": 0,
"NumericField4": 0,
"NumericField5": 0,
"AnalysisDebitQty": 0,
"AnalysisCreditQty": 0,
"AnalysisReservedStock": 0,
"AnalysisRemainder": 0,
"AnalysisAvailable": 0,
"AnalysisDebitQtyAltMU": 0,
"AnalysisCreditQtyAltMU": 0,
"AnalysisReservedStockAltMU": 0,
"AnalysisRemainderAltMU": 0,
"AnalysisAvailableAltMU": 0,
"fCompanyCode": "ES"
}],
"ESMMItemCostPrices": [],
"ESMMItemDimensionPrices": [],
"ESFIItemCategory": [],
"ESMMDimensionalAnalysis": [{
"GID": "098ec252-57c1-4d68-8f2d-65966c57c567",
"fItemGID": "b485c0c2-d9a9-47a6-88a3-039a40ca0157",
"fItemMUGID": "ac431509-66a2-4fdb-9b75-ac1cd5b9c1e7",
"Length": 0,
"Width": 0,
"Height": 0,
"SurfaceArea": 0,
"Volume": 0,
"NetWeight": 0,
"GrossWeight": 0
}],
"ESMMItemMURelation": [],
"ESWMItemContainerType": [],
"FK_ESFIItem_ESMMCommercialProfile": [],
"FK_ESFIItem_ESMMItemControlPolicy": [{
"GID": "134fe00c-3212-440a-8237-0abd89e5b02c",
"Code": "ΠΟΛ-ΔΙΑ-02",
"Description": "Απαγόρευση Αρνητικών & Ελεγχος Διαστάσεων",
"Display": "ΠΟΛ-ΔΙΑ-02 / Απαγόρευση Αρνητικών & Ελεγχος Διαστάσεων"
}],
"FK_ESFIItemCategory_ESTMTaskCategoryValue": [],
"FK_ESFIItem_ESTMContractTerm": [],
"FK_ESFIItem_TaxDifferencesAccount": [],
"FK_ESFIItem_ESMMZIntrastatCode": [],
"FK_ESMMStockItem_ES00PropertySet": [],
"ESTMPCatalogueItem": [],
"FK_ESMMCatalogueItemRelation_ESMMStockDimSetMap_Color": [],
"FK_ESMMCatalogueItemRelation_ESMMStockDimSetMap_Size": [],
"FK_ESMMCatalogueItemRelation_ESMMStockDimSetMap_StockDim1": [],
"FK_ESMMCatalogueItemRelation_ESMMStockDimSetMap_StockDim2": [],
"FK_ESMMCatalogueItemRelationStockDimSetMap_ESMMStockDimSetMap_Color": [],
"FK_ESMMCatalogueItemRelationStockDimSetMap_ESMMStockDimSetMap_Size": [],
"FK_ESMMCatalogueItemRelationStockDimSetMap_ESMMStockDimSetMap_StockDim1": [],
"FK_ESMMCatalogueItemRelationStockDimSetMap_ESMMStockDimSetMap_StockDim2": [],
"FK_ESMMStockItem_ESFIItem": [],
"FK_ESMMStockItem_ESBGAllocationProfile": [],
"FK_ESMMItemCodes_ESMMZColor": [],
"FK_ESMMItemCodes_ESMMZSize": [],
"FK_ESMMItemCodes_ESMMZStockDim1": [],
"FK_ESMMItemCodes_ESMMZStockDim2": [],
"FK_ESMMStockItem_ESFIItemAllocationProfile": [],
"FK_ESFIItem_ESFISpecialAccountGroup_DiscountGroup": [],
"FK_ESFIItem_ESFISpecialAccountGroup_TaxesGroup": [],
"FK_ESFIItem_ESFISpecialAccountGroup_ChargesGroup": [],
"FK_ESFIItem_ESFISpecialAccountGroup_DeductionGroup": [],
"FK_ESFIItem_ESFISpecialAccountGroup_BonusGroup": [],
"FK_ESFIItem_ESMMStockDimSet_Color": [],
"FK_ESFIItem_ESMMStockDimSet_Size": [],
"FK_ESFIItem_ESMMStockDimSet_1": [],
"FK_ESFIItem_ESMMStockDimSet_2": [],
"FK_ESMMSISupplier_ESFITradeAccount": [{
"GID": "f9eef0bf-2995-45cc-85b6-473a03a25a0d",
"Code": "ΠΡΟΜ00020",
"Type": 1,
"Name": "ZOLOTAS Α.Ε..",
"fTradeCurrencyCode": "EUR"
}],
"FK_ESWMItemContainerType_ESWMContainerType": [],
"FK_ESFIItem_ESWMItemControlPolicy": [],
"FK_ESMMLot_ESMMItemDimensionPrices": [],
"FK_ESMMZColor_ESMMItemDimensionPrices": [],
"FK_ESMMZSize_ESMMItemDimensionPrices": [],
"FK_ESMMZStockDim1_ESMMItemDimensionPrices": [],
"FK_ESMMZStockDim2_ESMMItemDimensionPrices": [],
"FK_ESFIItem_ESFIItemNetProfitCodes": [],
"FK_Supplier": [{
"GID": "f9eef0bf-2995-45cc-85b6-473a03a25a0d",
"Code": "ΠΡΟΜ00020",
"Name": "ZOLOTAS Α.Ε.."
}],
"FK_FamilyCode": [{
"Code": "ΤΡΟΦΙΜΑ",
"Description": "ΤΡΟΦΙΜΑ",
"Display": "ΤΡΟΦΙΜΑ / ΤΡΟΦΙΜΑ"
}],
"FK_CategoryCode": [{
"Code": "ΛΟΥΚΑΝΙΚΑ",
"fParentCode": "ΧΑΙΤΟΓΛΟΥ",
"Description": "ΛΟΥΚΑΝΙΚΑ",
"Display": "ΛΟΥΚΑΝΙΚΑ / ΛΟΥΚΑΝΙΚΑ"
}],
"FK_GroupCode": [{
"Code": "ΧΑΙΤΟΓΛΟΥ",
"fParentCode": "ΤΡΟΦΙΜΑ",
"Description": "ΧΑΙΤΟΓΛΟΥ",
"Display": "ΧΑΙΤΟΓΛΟΥ / ΧΑΙΤΟΓΛΟΥ"
}],
"FK_SubCategoryCode": [],
"FK_ESFIItem_ESGOZBusinessUnit": [],
"FK_ESFIItem_ESGOZBusinessActivity": [{
"Code": "ΤΡΟΦΙΜΑ",
"Description": "ΤΡΟΦΙΜΑ",
"Display": "ΤΡΟΦΙΜΑ / ΤΡΟΦΙΜΑ"
}],
"FK_ESMMItemUnit_ESMMZMeasurementUnit": [{
"Code": "ΤΕΜ",
"Description": "Τεμάχια",
"DefaultRelation": 1,
"Symbol": "ΤΕΜ"
}],
"FK_ESFIItem_ESGOPerson_Manufacturer": [],
"FK_ESMMStorageLocation_ESGOSites_WareHouse": [],
"FK_ESMMItemWH_ESGOSites": [{
"GID": "86947579-6885-4e86-914e-46378db3794f",
"Code": "ΑΘΗ",
"Description": "Κεντρικά Entersoft",
"Address1": "ΛΕΩΦΌΡΟΣ ΣΥΓΓΡΟΎ 362"
}],
"FK_ESMMItemCostPrices_ESGOFiscalYear": [],
"FK_ESMMItemCostPrices_ESGOFiscalPeriod": [],
"FK_ESFIItem_ESMMBOM_Base": [],
"FK_ESFIItem_ESMMCatalogueItem": [{
"GID": "c1f5f5b1-6a9e-4100-9186-49385878f18d",
"Code": "ΘΡ.ΑΛ.425",
"Description": "ΛΟΥΚ.Τ.ΦΡΑΓΚΦ.18ΧΛ.400ΓΡ -20%"
}],
"FK_ESFIItem_ESCOCostElementType": [],
"ES00Documents": [],
"ES00Properties": [],
"ES00PropertiesMultipleValues": []
};
This function returns the Entersoft Entity ISUD dataset in JSON representation
| Param | Type | Details |
|---|---|---|
| entityclass | string | The Entersoft ODS object ID the ISUD record to be retrieved |
| entityCode | string | The string code that represents the unique human understandable key of the record to be retrieved |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains JSON object of the ISUD dataset. |
```js $scope.fetchEntityByCode = function() { esWebApi.fetchEntityByCode("esmmstockitem", "ΕLΕ.Q.CΑΤΗ") .then(function(ret) { $scope.pEntityDS = ret.data; }, function(err) { $scope.pEntityDS = err; }) }
a function that fetches with just one round-trip for the browser to the Entersoft Application Server the contebts of one or more ES Zooms as sepcified by the input parameter
| Param | Type | Details |
|---|---|---|
| multizoomdefs | ESMultiZoomDef[] | An array of ESMultiZoomDef objects each one of which specifies the ES Zoom to be retrieved from the server. |
| promise | Returns a promise that once resolved the returned object will hold an array with the Zoom contents in one-to-one mapping with the input array |
$scope.multifetchStdZoom = function() {
var zoomOptions = new esGlobals.ESPQOptions(300, 5, false);
var zooms = _.map($scope.pZoomID.split(','), function(k) {
return new esGlobals.ESMultiZoomDef(k, zoomOptions, true);
});
esWebApi.fetchMultiStdZoom(zooms)
.then(function(ret) {
$scope.pZoomResults = ret;
}, function(err) {
$scope.pZoomResults = JSON.stringify(err);
});
}
Function that returns the ODSTable definition from the Entersoft Object Description System (ODS) repository.
| Param | Type | Details |
|---|---|---|
| tableID | string | The ODS Table ID i.e. "ESFFitem". If columnID parameter is undefined, null or empty string then additional forms of tableid-column id definition are available:
|
| columnID (optional) | string | The ODS Column/Field ID to retrieve i.e. "Description". If columnID is undefined or null or empty string then tableID should be one of the forms described above. |
| promise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchODSColumnInfo example
$scope.fetchOdsColumnInfo = function() {
esWebApi.fetchOdsColumnInfo($scope.odsID, $scope.odsColumnID)
.then(function(ret) {
$scope.pColumnInfo = ret.data;
}, function(err) {
$scope.pColumnInfo = err;
});
}
Function that returns the Detail ODS Relation definitions that exist in the ODS Repository for a given Master TableID on a given ColumnID of the Master TableID from the Entersoft Object Description System (ODS) repository.
| Param | Type | Details |
|---|---|---|
| tableID | string | The ODS Table ID i.e. "ESFFitem". |
| columnID | string | The ODS Column/Field ID to retrieve i.e. "GID". |
| promise | Returns a promise..
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchOdsDetailRelationsInfo example
$scope.fetchOdsDetailRelationsInfo = function() {
esWebApi.fetchOdsDetailRelationsInfo($scope.odsID, $scope.odsColumnID)
.then(function(ret) {
$scope.pRelationInfo = ret.data;
}, function(err) {
$scope.pRelationInfo = err;
});
}
Function that returns the Master Relations ODS Relation definitions that exist in the ODS Repository for a given Master TableID on a given foreign ColumnID of the Master TableID from the Entersoft Object Description System (ODS) repository.
| Param | Type | Details |
|---|---|---|
| tableID | string | The ODS Table ID i.e. "ESFFitem". |
| columnID | string | The ODS Column/Field ID to retrieve i.e. "fDim1Code". |
| promise | Returns a promise..
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchOdsMasterRelationsInfo example
$scope.fetchOdsMasterRelationsInfo = function() {
esWebApi.fetchOdsMasterRelationsInfo($scope.odsID, $scope.odsColumnID)
.then(function(ret) {
$scope.pRelationInfo = ret.data;
}, function(err) {
$scope.pRelationInfo = err;
});
}
Function that returns the ODS Releation definition from the Entersoft Object Description System (ODS) repository.
| Param | Type | Details |
|---|---|---|
| relationID | string | The ODS Relation ID or the ODS Relation GID in string (guid) to retrieve |
| promise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchOdsRelationInfo example
$scope.fetchOdsRelationInfo = function() {
esWebApi.fetchOdsRelationInfo($scope.odsID)
.then(function(ret) {
$scope.pRelationInfo = ret.data;
}, function(err) {
$scope.pRelationInfo = err;
});
}
Function that returns the ODSTable definition from the Entersoft Object Description System (ODS) repository.
| Param | Type | Details |
|---|---|---|
| tableID | string | The ODS Table ID or the ODS Table GID in string (guid) to retrieve |
| promise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
Error promise return value i.e. function(err) is of the following form:
|
//fetchODSTableInfo example
$scope.fetchOdsTableInfo = function() {
esWebApi.fetchOdsTableInfo($scope.odsID)
.then(function(ret) {
$scope.pTableInfo = ret.data;
}, function(err) {
$scope.pTableInfo = err;
});
}
This function delete the current logged in user logo from the Entersoft Application.
| Param | Type | Details |
|---|---|---|
| personGID | string | The GID of the ESGOPerson in string format, the logo of which we are looking for |
| httpPromise | Returns an httpPromise that once resolved, the ret.data contains the base64 string for the logo image of the specified person |

33. fetchPersonLogo

<input type="text" ng-model="PersonGID" placeholder="PersonGID"/>
<button ng-click="fetchPersonlogo()">Get Person Logo</button>

and the controller's part
$scope.fetchPersonlogo = function() {
esWebApi.fetchPersonLogo($scope.PersonGID)
.then(function(x) {
$scope.personPhoto = x.data;
});
}
This function returns the property set / survey identified by the psCode parameter that is optionally linked / attached to the campaignID specified by the campaignGID parameter
| Param | Type | Details |
|---|---|---|
| psCode | string | The Entersoft ODS object ID the ISUD record to be retrieved |
| campaignGID | string | The gid in string format that represents the gid of the campaign that is of type sruvey |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains JSON object of the ESPropertySet object. |
smeControllers.controller('surveyCtrl', ['$location', '$scope', '$log', 'esWebApi', 'esUIHelper', '_', 'esCache', 'esMessaging', 'esGlobals',
function($location, $scope, $log, esWebApiService, esWebUIHelper, _, cache, esMessaging, esGlobals) {
$scope.surveyDef = {};
$scope.startFrom = -1;
$scope.surveyCode = "usage_s1";
$scope.surveyAns = {};
$scope.loadSurvey = function() {
esWebApiService.fetchPropertySet($scope.surveyCode, "2E035E80-BFED-4B45-91D2-1CEB64C2BB7B")
.then(function(ret) {
$scope.surveyDef = ret.data;
$scope.startFrom = -1;
$scope.surveyCode = "usage_s1";
$scope.surveyAns = {};
},
function(err) {
$scope.surveyDef = {};
alert(err);
});
}
}
]);
and the result would be similar to the example below according to the following defintion in EBS:
and the JSON model for this definition would be as follows:
{
"GID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"Code": "usage_s1",
"Description": "Survey for RFA Usage",
"ESDCreated": "2015-12-07T15:46:05.193",
"ESUCreated": "ADMIN",
"ESDModified": "0001-01-01T00:00:00",
"Inactive": false,
"Type": 1,
"MobileSurvey": false,
"Lines": [{
"GID": "184b1993-db48-4c38-ac39-b31958b6cf0c",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 1,
"Category_Code": "Γενικές Ερωτήσεις",
"Category_OrderPriority": 0,
"ESDModified": "0001-01-01T00:00:00",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-17T18:34:12.373",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q001",
"Description": "Profit",
"PType": 1
}, {
"GID": "032d0b05-5fd5-46fa-a909-1cac51c5d766",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 2,
"Category_Code": "Ειδικά Στοιχεία",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-20T13:02:57.067",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.263",
"Mandatory": true,
"VisualizationStyle": 1,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q002",
"Description": "Age",
"AlternativeDescription": "you should answer with care",
"PArg": "AgeScale",
"PType": 4
}, {
"GID": "57526e4c-ccf7-4d2b-92f1-754d31590771",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 3,
"Category_Code": "Ειδικά Στοιχεία",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.353",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.32",
"Mandatory": true,
"VisualizationStyle": 2,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q003",
"Description": "Colors",
"PArg": "ColorsType",
"PType": 14
}, {
"GID": "f4af1a79-16ee-45fa-b7fd-31654fd6876a",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 4,
"Category_Code": "Εμπορικά Θέματα",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.353",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.34",
"Mandatory": true,
"VisualizationStyle": 4,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "ES.YesNoDontKnow",
"Description": "Σας αρέσει το EBS?",
"PArg": "ES.YesNoDontKnow",
"PType": 4
}, {
"GID": "753e2d67-28df-4054-877c-2706f8179711",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 5,
"Category_Code": "Εμπορικά Θέματα",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.353",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.34",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q005",
"Description": "Άλλα Στοιχεια",
"PType": 0
}, {
"GID": "1708e894-c3c7-446c-8af7-595c07233cb2",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 6,
"Category_Code": "Εμπορικά Θέματα",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.357",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.343",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q006",
"Description": "Τζίρος",
"PArg": "3",
"PType": 1
}, {
"GID": "9c79a9d6-6943-42e2-b4af-108e440f9ec9",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 7,
"Category_Code": "Εμπορικά Θέματα",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.357",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.343",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q007",
"Description": "Αριθμός Υπαλλήλων",
"PType": 2
}, {
"GID": "4c6a89e2-6d0e-48e0-9a34-c3603019c3d6",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 8,
"Category_Code": "Εμπορικά Θέματα",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.357",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.343",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q008",
"Description": "Ετος Ίδρυσης",
"PType": 3
}, {
"GID": "51ca7792-a339-452a-bf68-023029fc7bad",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 9,
"Category_Code": "Ερωτηματολόγιο",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.357",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.347",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q009",
"Description": "Εναρξη Ημέρας",
"PType": 12
}, {
"GID": "a408bc3c-75d8-49b7-a989-0c3cbbf686d3",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 10,
"Category_Code": "Ερωτηματολόγιο",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.357",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.347",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q010",
"Description": "Ραντεβού",
"PType": 11
}, {
"GID": "f1e8406c-418a-4aa1-b1fe-e57e4aca09b7",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 11,
"Category_Code": "Ερωτηματολόγιο",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-17T18:34:12.36",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-07T15:46:05.35",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q011",
"Description": "Κατανομή Εσόδων",
"PArg": "9",
"PType": 15
}, {
"GID": "ce67f1ec-0ffb-4046-b2d9-512cf16ed7bc",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 12,
"Category_Code": "Γενικές Ερωτήσεις",
"Category_OrderPriority": 0,
"ESDModified": "0001-01-01T00:00:00",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-17T19:36:02.473",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q012",
"Description": "Statisfaction",
"AlternativeDescription": "0=δυσαρεστημένος και με το 5=ευχαριστημένος",
"PArg": "5Scale",
"PType": 4
}, {
"GID": "a3064835-afe2-4da9-bc90-db17d3980e33",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 13,
"Category_Code": "Ειδικά Στοιχεία",
"Category_OrderPriority": 0,
"ESDModified": "2015-12-20T13:02:57.48",
"ESUModified": "ADMIN",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-18T10:51:01.857",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q013",
"Description": "Πώς αξιολογείτε την Υποστήριξη",
"AlternativeDescription": "0 = χαμηλά 4 = άριστα",
"PArg": "9",
"PType": 2
}, {
"GID": "00c75e94-a9e6-42a9-b5b0-e9b1f48cc0e9",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 14,
"Category_Code": "Γενικές Ερωτήσεις",
"Category_OrderPriority": 0,
"ESDModified": "0001-01-01T00:00:00",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-21T08:57:06.54",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q014",
"Description": "Χώρα Προέλευσης",
"PArg": "ESGOZCountry",
"PType": 4
}, {
"GID": "57aaa798-9d49-499f-8807-4ce9daef6260",
"fPropertySetGID": "254feeb8-b56e-4c57-bcd3-6c023b085cc6",
"SeqNum": 15,
"Category_Code": "Γενικές Ερωτήσεις",
"Category_OrderPriority": 0,
"ESDModified": "0001-01-01T00:00:00",
"ESUCreated": "ADMIN",
"ESDCreated": "2015-12-21T09:35:19.923",
"Mandatory": true,
"VisualizationStyle": 0,
"Inactive": false,
"PhotoRelated": false,
"NotApplicable": false,
"Code": "usage_s1 - Q015",
"Description": "Μερίδιο Αγοράς",
"PType": 15
}],
"Choices": [{
"ChoiceCode": "5Scale",
"Code": "0",
"Description": "Καθόλου Ικανοποιημένος",
"Value": "0",
"OrderPriority": 1
}, {
"ChoiceCode": "5Scale",
"Code": "1",
"Description": "-",
"Value": "1",
"OrderPriority": 2
}, {
"ChoiceCode": "5Scale",
"Code": "22",
"Description": "-",
"Value": "22",
"OrderPriority": 3
}, {
"ChoiceCode": "5Scale",
"Code": "33",
"Description": "-",
"Value": "33",
"OrderPriority": 4
}, {
"ChoiceCode": "5Scale",
"Code": "4",
"Description": "Εξαιρετικά Ικανοποιημένος",
"Value": "4",
"OrderPriority": 5
}, {
"ChoiceCode": "AgeScale",
"Code": "1",
"Description": "18-25",
"Value": "1",
"OrderPriority": 1
}, {
"ChoiceCode": "AgeScale",
"Code": "2",
"Description": "26-35",
"Value": "2",
"OrderPriority": 2
}, {
"ChoiceCode": "AgeScale",
"Code": "3",
"Description": ">36",
"Value": "3",
"OrderPriority": 3
}, {
"ChoiceCode": "ColorsType",
"Code": "1",
"Description": "Red",
"Value": "1",
"OrderPriority": 1
}, {
"ChoiceCode": "ColorsType",
"Code": "2",
"Description": "Green",
"Value": "2",
"OrderPriority": 2
}, {
"ChoiceCode": "ColorsType",
"Code": "3",
"Description": "Blue",
"Value": "3",
"OrderPriority": 3
}, {
"ChoiceCode": "ES.YesNoDontKnow",
"Code": "55",
"Description": "Όχι",
"Value": "55",
"AlternativeDescription": "No",
"OrderPriority": 1
}, {
"ChoiceCode": "ES.YesNoDontKnow",
"Code": "Yes",
"Description": "Ναι",
"Value": "1",
"AlternativeDescription": "Yes",
"OrderPriority": 2
}, {
"ChoiceCode": "ES.YesNoDontKnow",
"Code": "DontKnow",
"Description": "Δεν γνωρίζω/Δεν απαντώ",
"Value": "2",
"AlternativeDescription": "Don't know",
"OrderPriority": 3
}],
"Sections": [{
"Code": "Γενικές Ερωτήσεις",
"Description": "Γενικές Ερωτήσεις",
"Inactive": false,
"OrderPriority": 0
}, {
"Code": "Ειδικά Στοιχεία",
"Description": "Ειδικά Χαρακτηριστικά Είδους",
"Inactive": false,
"OrderPriority": 0
}, {
"Code": "Εμπορικά Θέματα",
"Description": "Εμπορικά Θέματα Είδους",
"Inactive": false,
"OrderPriority": 0
}, {
"Code": "Ερωτηματολόγιο",
"Description": "Ερωτηματολόγιο",
"Inactive": false,
"OrderPriority": 0
}]
}
fetchPublicQuery is one of the most important functions of the esWebApi Service as it is the most preferable and strongly recommended way to get data from the Entersoft Application Server through the Entersoft WEB API Sever.
Public Queries is a new Entersoft Data Retrieval component introduced since <IP_ADDRESS> version of EBS. Public Queries can be defined and managed through the Entersoft Scroller Designer much like the well-know and widely used across all Entersoft Applications ecosystem Entersoft Scroller. Although, Entersoft Public Queries are very similar in principle and definition to Entersoft Scrollers, they have a completely new implementation and a set of prerequisites in order to use and execute them against the Entersoft Application Server.
Public Queries have been designed and developed in order to enable for modern programming, customization and integration with 3rd party systems with respect to: WEB Programming i.e. Ajax calls, JQuery, plain Javascript, AngularJS, node.js, Python, etc. as well as mobile programming in native platforms such as: Microsoft Univeral Applications, Microsoft .NET Framework applications, Xamarin Forms, Xamarin Monotouch, Xamarin Monodroid, Objective C, Java, etc. and in general in any Mono (.NET open source platform for Linux and Mac OSx OSs), .NET or javascript based development frameworks.
The main features of Entersoft Public Queries (PQ) compared to Entersoft Scrollers are:
async PQs are executed asynchronously, by taking full advantage of the async capabilities of Microsoft .NET Framework 4.5.1, which is required to be installed and available at the Entersoft Application Server as well as at the Entersoft WEB API Server. This feaure allows for greater scalability i.e. greater number of concurrent calls to the Entersoft Application Server, better thread management and better use of server's CPU
server side paging PQ's fully support first class Microsoft SQL Server server side paging with FAST and cpu and memory OPTIMIZED Transact SQL transformations and Execution. PQs require that the underlying Microsoft SQL Server should be SQL Server 2008 R2 or higher with SQL Server 2014 being strongly recommended. PQ's Paging allows for variable Page number request of variable PageSize.
For example, suppose that we have a large table of ESGOPerson with millions of records and we have defined a Public Query with Parameters such as @Name, @eMail, @City, etc. ORDERED BY the ESGOPerson.FullName. Suppose we want to execute this PQ with no parameter values meaning ALL elgibile records and we want just the data of 6th Page with PageSize of 250 Records. Assuming that all prerequisites are met, the PQ will be executed by the Entersoft Application Server aynchronously, getting ONLY the 6th Page of 250 records pagesize. Also interesting, we want a second execution of this PQ for the 37th Page with a PageSize of 1000 Rows. No problem, since, Page and PageSize are variable and can take any value in every subsequent call. Should this scenario is executed with Entersoft Scroller instead of PQ, we would have a huge burden on the SQL Server to get all millions of records !!! as well as a HUGE XML Dataset in the Entersoft Application Server (possibly an out-of-memory exception) and a couple of memory operations to slice the data to get just the 6th page i.e. out of question !!!
IMPORTANT PQs also allow for ALL data to be returned, i.e. with No Paging at all, if this is what we want. Even in this bad scenario, PQ execution will be orders of magnitude BETTER performin in all aspects compared to Scoller execution: FASTER SQL Execution, LESS Memory required, ASYNC App Server Execution, MORE Efficient memory processing (JSON instead of XML). Of course, we have to be careful, so that we will not overload systems resources (SQL, Entersoft App Server, nework, traffic, bandwidth, Browser's memory etc.).
Count of Records PQs no matter whether Paging in taking place or not, allow for the Number of Records that meet the current sql statement (defined by the PQ along with the run-time params) to be returned along with the data. The number of records, if requested to be returned, it highly optimized executed by the SQL Server with just one round-trip to the server with no need to re-write or restructure the PQ's defintion. Any transformations are done at run-time atomatically by the Entersoft Query Processor along with the support of the new features of SQL Server, Transact SQL.
JSON format The default format to which PQ data and results are transformed to and returned to the caller. JSON for this kind of data i.e. records which outperforms in almost any aspect the DataSet - XML representation. Most important, PQ's execution is taking advantage of the latest .NET Framework and ADO.NET execution options with ASYNC READERS, ASYNC Streams and StringBuilders in order to construct the JSON result in the most optimal way. Newtonsoft JSON .NET library, now 1st class citizen of the .NET Framework, is the core component used for serialization and deserialization of objects in the Entersoft .NET Framework code ecosystem.
Precompiled SQL PQ Actual SQL Statement is precompiled and stored at design time, which speeds up the application server PQ execution time as the sql statement to be sent to the SQL Server is instantly available. This is in contrast to the Scroller's execution model that requires the SQL Statement to be constructed in every execution.
Public Query Prerequisites
Public Query Restrictions
| Param | Type | Details |
|---|---|---|
| pqGroupID | stringESPublicQueryDef | if string then Entersoft Public Query GroupID or a ESPublicQueryDef object that defines the rest of the parameters |
| pqFilterID | string | Entersoft Public Query FilterID |
| pqOptions | ESPQOptions | Entersoft Public Query execution options. See ESPQOptions.
|
| pqParams | object | Parameters that will be used for the execution of the Public Query at the Entersoft Application Server The typical structure of the pqParams object is:
pqParams is a typical JSON object of key: value properties, where key is the parameter name as defined in the Public Query (through Entersoft Scroller Designer) and value is an Entersoft Application server acceptable value for the given parameter, depending on the parameter type and properties as defined in the Public Query (through Entersoft Scroller Designer)
|
| httpVerb (optional) | string | Parameter to specify HTTP verb. Default is GET |
| httpPromise | Returns a promise.
ATTENTION If no records are returned by the Server ret.data.Rows will NOT BE null or undefined or not defined. It will be an empty array. ret.data.PageSize will be -1, ret.data.Page will be -1, If PAGING is taking place the following pseudo code diagram reflects the contents of ret.data response:
|
$scope.dofetchPublicQuery = function() {
var group = "ESGOPerson";
var filter = "PersonList";
$scope.pqResult = "";
var pqOptions = {
WithCount: false,
Page: 2,
PageSize: 5
};
var pqParams = {
Name: "a*"
};
esWebApi.fetchPublicQuery(group, filter, pqOptions, pqParams)
.then(function(ret) {
$scope.pqResult = ret.data;
$log.info(ret);
},
function(err) {
$scope.pqResult = ret;
$log.error(err);
});
}
Function that returns the results of the execution of an Entersoft Scroller (simple or hierarchical) in JSON format
| Param | Type | Details |
|---|---|---|
| groupID | string | Entersoft Scroller GroupID |
| filterID | string | Entersoft Scroller FilterID |
| params | object | pqParams Parameters that will be used for the execution of the Scroller at the Entersoft Application Server The typical structure of the params object is:
params is a typical JSON object of key: value properties, where key is the parameter name as defined in the Scroller (through Entersoft Scroller Designer) and value is an Entersoft Application server acceptable value for the given parameter, depending on the parameter type and properties as defined in the Scroller (through Entersoft Scroller Designer)
|
| httpPromise | Returns a promise.
|
// fetchScroller sample
$scope.fetchScroller = function() {
var scroller_params = {
Name: "a*"
};
esWebApi.fetchScroller($scope.pGroup, $scope.pFilter, scroller_params)
.then(function(ret) {
$scope.pScrollerResults = ret.data;
$log.info(ret);
},
function(err) {
$scope.pScrollerResults = ret;
$log.error(err);
});
}
The result for fetchScroller("ESGOPerson", "PersonList", scroller_Params) has the following format:
var scrollerResults = {
"ESGOPerson": [{
"GID": "d4b166f4-417d-46b8-8459-1d11d81f4aff",
"Code": "0000026",
"Name": "AGROSKY A.E.",
"Description1": "Εμπόριο Αγροτικών Προϊόντων",
"TaxRegistrationNumber": "094123469",
"Code5": "1",
"Address1": "ΑΝΔΡΕOY 212",
"fPostalCode": "30300",
"fCityCode": "ΝΑΥΠΑΚΤΟΣ",
"Area": "ΑΙΤΩΛΟΑΚΑΡΝΑΝΙΑΣ",
"Code7": "010",
"Description5": "ΔΥΤΙΚΗ ΣΤΕΡΕΑ / ΛΕΥΚΑΔΑ",
"Telephone1": "2310-804858",
"Code8": "ΣΥΝΕΡΓΑΤΗΣ",
"Description6": "ΣΥΝΕΡΓΑΤΗΣ",
"Code9": "ΥΠΗΡΕΣΙΕΣ",
"Description7": "ΥΠΗΡΕΣΙΕΣ",
"EMailAddress"<EMAIL_ADDRESS>},
// ...
{
"GID": "ee80474d-0f07-48df-b8e0-b47d58d9e9ba",
"Code": "0000003",
"Name": "AMY Α.Ε.",
"Description1": "Εμπόριο - Διανομή Ποτών & Αναψυκτικών",
"TaxRegistrationNumber": "094123478",
"Code5": "2",
"Address1": "ΧΟΛΑΡΓΟΥ 34",
"fPostalCode": "10437",
"fCityCode": "ΑΘΗΝΑ",
"Area": "ΟΜΟΝΟΙΑ",
"Code7": "001",
"Description5": "ΑΘΗΝΑ - ΠΡΟΑΣΤΙΑ",
"Telephone1": "23210-24680",
"Code8": "ΠΕΛΑΤΕΣ",
"Description6": "ΠΕΛΑΤΕΣ",
"Code9": "BIOMHXANIA",
"Description7": "BIOMHXANIA",
"EMailAddress"<EMAIL_ADDRESS>}]
};
Function that returns the WEB API Server capabilities in terms of http(s). This service does not require authorization prior to call
| httpPromise | If success i.e. function(ret) { ... } ret is a JSON object of the current WEB API Server capabilities. The return object has the following structure:
|
$scope.fetchServerCapabilities = function()
{
esWebApi.fetchServerCapabilities()
.then(function(ret) {
$scope.pSrvCapabilities = ret;
}, function(err) {
$scope.pSrvCapabilities = err;
});
}
Function that returns Entersoft Application Server session information
| httpPromise | Returns a promise.
Success promise return value i.e. response.data is of the following form:
|
//fetchSessionInfo example
$scope.fetchSessionInfo = function() {
esWebApi.fetchSessionInfo()
.then(function(ret) {
$scope.pSessionInfo = ret.data;
}, function(err) {
$scope.pSessionInfo = err;
});
}
Function that returns the data of the defined MasterTable for an Entersoft Scroller (simple or hierarchical) in JSON format. It is very similar to fetchScroller function with the MAIN difference that it only returns the data for the MASTER Table as defined by the creator at the Scroller Definition
| Param | Type | Details |
|---|---|---|
| groupID | string | Entersoft Scroller GroupID |
| filterID | string | Entersoft Scroller FilterID |
| params | object | pqParams Parameters that will be used for the execution of the Scroller at the Entersoft Application Server The typical structure of the params object is:
params is a typical JSON object of key: value properties, where key is the parameter name as defined in the Scroller (through Entersoft Scroller Designer) and value is an Entersoft Application server acceptable value for the given parameter, depending on the parameter type and properties as defined in the Scroller (through Entersoft Scroller Designer)
|
| httpPromise | Returns a promise.
|
// fetchSimpleScrollerRootTable sample
$scope.fetchSimpleScrollerRootTable = function() {
var scroller_params = {
Name: "a*"
};
esWebApi.fetchSimpleScrollerRootTable($scope.pGroup, $scope.pFilter, scroller_params)
.then(function(ret) {
$scope.pScrollerResults = ret.data;
$log.info(ret);
},
function(err) {
$scope.pScrollerResults = ret;
$log.error(err);
});
}
The result for fetchSimpleScrollerRootTable("ESGOPerson", "PersonList", scroller_Params) has the following format:
var simpleRootTable_scrollerResults = [{
"GID": "d4b166f4-417d-46b8-8459-1d11d81f4aff",
"Code": "0000026",
"Name": "AGROSKY A.E.",
"Description1": "Εμπόριο Αγροτικών Προϊόντων",
"TaxRegistrationNumber": "094123469",
"Code5": "1",
"Address1": "ΑΝΔΡΕOY 212",
"fPostalCode": "30300",
"fCityCode": "ΝΑΥΠΑΚΤΟΣ",
"Area": "ΑΙΤΩΛΟΑΚΑΡΝΑΝΙΑΣ",
"Code7": "010",
"Description5": "ΔΥΤΙΚΗ ΣΤΕΡΕΑ / ΛΕΥΚΑΔΑ",
"Telephone1": "2310-804858",
"Code8": "ΣΥΝΕΡΓΑΤΗΣ",
"Description6": "ΣΥΝΕΡΓΑΤΗΣ",
"Code9": "ΥΠΗΡΕΣΙΕΣ",
"Description7": "ΥΠΗΡΕΣΙΕΣ",
"EMailAddress"<EMAIL_ADDRESS>},
// ...
{
"GID": "ee80474d-0f07-48df-b8e0-b47d58d9e9ba",
"Code": "0000003",
"Name": "AMY Α.Ε.",
"Description1": "Εμπόριο - Διανομή Ποτών & Αναψυκτικών",
"TaxRegistrationNumber": "094123478",
"Code5": "2",
"Address1": "ΧΟΛΑΡΓΟΥ 34",
"fPostalCode": "10437",
"fCityCode": "ΑΘΗΝΑ",
"Area": "ΟΜΟΝΟΙΑ",
"Code7": "001",
"Description5": "ΑΘΗΝΑ - ΠΡΟΑΣΤΙΑ",
"Telephone1": "23210-24680",
"Code8": "ΠΕΛΑΤΕΣ",
"Description6": "ΠΕΛΑΤΕΣ",
"Code9": "BIOMHXANIA",
"Description7": "BIOMHXANIA",
"EMailAddress"<EMAIL_ADDRESS>}];
| Param | Type | Details |
|---|---|---|
| zoomID | string | Entersoft Public Query GroupID |
| pqOptions | ESPQOptions | Entersoft Public Query execution options with respect to Paging, PageSize and WithCount. See ESPQOptions
|
| useCache | boolean | if pqOptions is null or undefined meaning that we want all data for the zoom to be fetched from the server if useCache is true then on success the zoom records will be cached by the framework so that next call for the same zoom will get the results from the cache. |
| promise | Returns a promise.
|
$scope.fetchStdZoom = function()
{
var zoomOptions = {
WithCount: false,
Page: 2,
PageSize: 5
};
esWebApi.fetchStdZoom($scope.pZoomID, zoomOptions)
.then(function(ret) {
$scope.pZoomResults = ret.data;
}, function(err) {
$scope.pZoomResults = err;
});
}
This function inserts a new log entry in the ES00EventLog Entersoft Application Server subsystem
| Param | Type | Details |
|---|---|---|
| userID (optional) | stringguid | Either the code of the user (ESGOUser) or the GID of the ESGOUser the logo of which we are interested in. If empty, null or undefined, the logo of the current logged-in user will be requested |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the string base64 of the image that corresponds to the requested logo. If the ESGOUser exists BUT there is no logo stored for the given user an empty string will be returned. If the ESGOUser does not exist an error 404 will be returned. |

30. fetchUserLogo

<input type="text" ng-model="lUserID" placeholder="User ID or GID"/>
<button ng-click="fetchUserLogo()">Get the PHOTO</button>

$scope.fetchUserLogo = function() {
esWebApi.fetchUserLogo($scope.lUserID)
.then(function(ret) {
$scope.userPhoto = ret.data;
},
function(err) {
$scope.userPhoto = "";
});
}
Function that returns ESGOSites of the current ESCompany that the given user has access to authorization prior to call
| Param | Type | Details | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ebsuser | string | The Entersoft Business Suite UserID for whom we want to fetch the ESGOSites of the current ESCompany the user has access to. | ||||||||||||
| credentials (optional) | object | A JSON object with subscriptionId, subscriptionPassword and bridgeId properties defined. If empty the default configuration settings will be used
|
| httpPromise | If success i.e. function(ret) { ... } ret.data is an Array of JSON objects representing the ESGOSites user has access to whitin the context of the current ESCompany. The return object has the following structure:
|
$scope.fetchUserSites = function()
{
esWebApi.fetchUserSites($scope.pUser)
.then(function(ret) {
$scope.pUserSites = ret.data;
}, function(err) {
$scope.pUserSites = err;
});
}
// results based on EBS Demo fetchUserSites("esmaster") =>
// ret.data ===> [{"Key":"ΑΘΗ","Value":"Κεντρικά Entersoft"},{"Key":"ΘΕΣ","Value":"Υποκατάστημα Θεσσαλονίκης ES"}]
This function imports a ESFIDocument of all the supported classes i.e.(Trade, Cash, Adjustment and Stock) through the FIImportDoc service of the Entersoft Application Server.
| Param | Type | Details |
|---|---|---|
| xmldocstr | string | The XML representation of the financial document to be inserted/updates through the Entersoft Application Server FIImportDocument service. For more, see the relative Entersoft Knowledge Base article. |
| httpPromise | If success i.e. function(ret) { ...} the ret.data contains the string result of the FIImportDocument function. |
This function returns an array of JSON objects representing the Mime types that the ES WEB API server supports
| object[] | Array of json objects of the form {mime: string, extension: string, IsText: boolean} |
esWebApi.getMimeTypes()
.then(function(ret) {
$scope.pMimeTypes = JSON.stringify(ret);
},
function(err) {
$scope.pMimeTypes = JSON.stringify(err);
});
// The result will be like:
[{
"mime": "application/andrew-inset",
"extension": ["ez"],
"IsText": false
}, {
"mime": "application/applixware",
"extension": ["aw"],
"IsText": false
}, {
"mime": "application/atom+xml",
"extension": ["atom"],
"IsText": false
},
...
]
Function that returns the full URL to the Entersoft WEB API Server as it has been resolved according to the configuration of the esWebApiProvider at the provider's configuration function of the AngularJS application. For more information, please
| string | The URL to the Entersoft WEB API Server |
// getServerUrl
var sUrl = esWebApi.getServerUrl();
alert(sUrl);
// i.e. http://localhost/eswebapi/ (if allowUnsecureConnection configuration setting of the esWebApiProvider is true)
// i.e. https://localhost/eswebapi/ (if allowUnsecureConnection configuration setting of the esWebApiProvider is false)
Function that performs a web session logout. As a result of calling this function, all internal state related to the current web session, if any, is cleaned-up and no valid web session is available. The application/user must login again through openSession in order to be able to call any Entersoft WEB API autheticated method or service.
//logout sample
$scope.doLogout = function ()
{
esWebApi.logout();
alert("LOGGED OUT. You must relogin to run the samples");
};
multiPublicQuery is similar to the fetchPublicQuery with the difference that it supports for multiple public queries execution with just one round-trip to the Entersoft WEB API Server and to the Entersoft Application Server.
| Param | Type | Details | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pqDefs | ESPublicQueryDef[] | An array of one or more public query defintion objects that are to be executed to the server. The object has the following structure:
|
| MultPublicQueryResult[] | An array of equal size to the pqDefs of objects each one of which holds the results of the corresponding public query. The structure of the MultPublicQueryResult object is as follows:
|
var pqParams = [{
GroupID: "ESGOPerson",
FilterID: "CRM_Personlist",
Params: {
Name: "εντ*"
}
},
{
GroupID: "notdefined",
FilterID: "not exists",
Params: {
Name: "ao*",
Code: "noname"
}
}
];
esWebApi.MultiPublicQuery(pqParams)
.then(function(x) {
$scope.ret = x.data;
},
function(err) {
$scope.pCompanyParamValue = JSON.stringify(err);
});
}
This is the function that enables for login and connect through the Entersoft WEB API Server to the Entersoft Application Server. The vast majority of the esWebApi service methods REQUIRE for an authorization token in order to be executed. This Authorization token is obtained through a successfull call of the openSession function and it is implicitly stored and managed by the esWebApi for its complete lifecycle.
When credentials.StickySession evaluates to true this is a requirement to the Entersoft WEB API Server that it requires / mandates the Entersoft WEB API Server to route all the subsequent calls to the same server side session object i.e. stick to the initial session. That means that in case that more than one Entersoft Application Servers have been registered in the web api server config.json file as shown in the image below
the server that will be selected to full fill the stickySession request will be the same that will serve all the subsequent calls for this session, i.e. all calls will be serverd by the same ESSession of the same server. On the other hand, openSession instructs Entersoft WEB API Server to fully use load balancing and fault-tolerant logic by randomly selecting one of the available server to fullfil any susequent call on a per call basis.
| Param | Type | Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| credentials | object | Entersoft Business Suite login credentials in the form of a JSON object with the following form:
|
| httpPromise | Returns a promise.
A success response object has the following form:
In case of an error i.e. function(err) {...} the err contains the Entersoft's Application Server error message and the http error codes in case the error is network related. As in the case of success, should you use the typical Entersoft AngularJS development template for SPAs, the framework automatically handles the error response of openSession call and performs a clean-up in browsers local storage, cache, messaging, etc. so that no valid web session exists (as if the user never) logged-in or performed a logout operation An Entersoft application server releated response error e.g. User does not exist has the following form:
|
$scope.credentials = {
UserID: 'admin',
Password: 'entersoft',
BranchID: 'ΑΘΗ',
LangID: 'el-GR'
};
$scope.doLogin = function() {
esWebApiService.openSession($scope.credentials)
.then(function(rep) {
$log.info(rep);
$location.path("/pq");
},
function(err) {
$log.error(err);
});
}
Function that returns the full URL that acts as a POST proxy for downloading files, in cases where the client generated file cannot be savedAs by the local browser (i.e. Safari on iOS, etc).
| Param | Type | Details |
|---|---|---|
| proxyType (optional) | string | The proxyType instructs the WEB API Server what sort of processing should to the POST payload. if empty or "telerik" the POST payload for body should conform to Telerik's documentation for proxyUrl |
| string | Returns the full URL to the Entersoft Web API server that will execute the actual POST request. |
This function delete the current logged in user logo from the Entersoft Application.
| httpPromise | Returns an httpPromise that once resolved, it has a status code OK if everything went OK, or BadRequest if an error occurred. |

30. fetchUserLogo

<input type="text" ng-model="lUserID" placeholder="User ID or GID"/>
<button ng-click="fetchUserLogo()">Get the PHOTO</button>

<button ng-click="removeCurrentUserLogo()">Remove Current User Logo</button>

$scope.removeCurrentUserLogo = function() {
esWebApi.removeCurrentUserLogo();
}
This function uploads and stores in the EAS an image as the current logged-in User's Logo
ATTENTION
This method requires the ngFileUpload module of AngularJS. In order to use it you must make sure that the appropriate js libraries have been loaded. For example, in the main html file e.g. index.html of the AngularJS application you have to include the ng-file-upload/ng-file-upload-shim.min.js prior to loading the angular library and the ng-file-upload/ng-file-upload.min.js just after the Angular library has been loaded, as shown in the example below:

Also in your application Angular controller module or application module you should also require the ngFileUpload module as shown in the code below:
var smeControllers = angular.module('smeControllers', ['kendo.directives', 'underscore', 'es.Web.UI', 'ui.bootstrap', 'uiGmapgoogle-maps', 'ngFileUpload']);
And in the AngularJS application controller function you should inject the Upload service as shown below:
smeControllers.controller('examplesCtrl', ['$log', '$q', '$scope', 'Upload', 'esWebApi', 'esUIHelper', 'esGlobals', 'esCache', 'esGeoLocationSrv', 'uiGmapGoogleMapApi',
function($log, $q, $scope, Upload, esWebApi, esWebUIHelper, esGlobals, esCache, esGeoLocationSrv, GoogleMapApi) {
// your application code
// goes here
}
| Param | Type | Details |
|---|---|---|
| file | file | The file that should be of type image that will be uploaded and stored in the EAS |
| okfunc (optional) | function | a function that will be called when the upload is completed |
| errfunc (optional) | function | a function that will called should an error occurs while uploading the file |
| progressfunc (optional) | function | a function that will be called as many times as necessary to indicate the progress of the uploading of the file i.e. to inform the user about the percentage of the bytes that have been uploaded so far |
| Upload | An object of type Upload. For detailed documentation please visit ng-file-upload. |

31. uploadUserLogo

<input type="file" ngf-select ng-model="userLogoImage" name="file" accept="image/*" required>
<button ng-click="uploadUserLogo()">Upload Photo</button>

$scope.uploadUserLogo = function() {
var progressf = function(evt) {
$scope.userLogoImage.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
};
var errf = function(x) {
alert(x);
}
esWebApi.uploadUserLogo($scope.userLogoImage, undefined, errf, progressf);
}


Lawsuit claims man fired for HIV status
Lawyer says company's actions violate law
OVERLAND PARK, Kan. - - In a lawsuit, a man says a Kansas business fired him because he has HIV.
OVERLAND PARK, Kan. - - In a lawsuit, a man says a Kansas business fired him because he has HIV.


To link to or from a SubPage, you can normally use a regular WikiLink that does not contain the name of the parent directory of the SubPage. Ikiwiki descends the directory hierarchy looking for a page that matches your link.
For example, if FooBar/SubPage links to "OtherPage", ikiwiki will first prefer pointing the link to FooBar/SubPage/OtherPage if it exists, next to FooBar/OtherPage and finally to OtherPage in the root of the wiki.
Note that this means that if a link on FooBar/SomePage to "OtherPage" currently links to OtherPage, in the root of the wiki, and FooBar/OtherPage is created, the link will change to point to FooBar/OtherPage. On the other hand, a link from BazBar to "OtherPage" would be unchanged by this creation of a SubPage of FooBar.
You can also specify a link that contains a directory name, like "FooBar/OtherPage" to more exactly specify what page to link to. This is the only way to link to an unrelated SubPage.
You can use this to, for example, to link from BazBar to "FooBar/SubPage", or from BazBar/SubPage to "FooBar/SubPage".
You can also use "/" at the start of a link, to specify exactly which page to link to, when there are multiple pages with similar names and the link goes to the wrong page by default. For example, linking from "FooBar/SubPage" to "/OtherPage" will link to the "OtherPage" in the root of the wiki, even if there is a "FooBar/OtherPage".
Also, if the wiki is configured with a userdir, you can link to pages within the userdir without specifying a path to them. This is to allow for easy linking to a user's page in the userdir, to sign a comment. These links are checked for last of all.


A CIVIL ACTION (director/writer: Steven Zaillian; screenwriter: based on the book by Jonathan Harr; cinematographer: Conrad L. Hall; editor: Wayne Wahrman; cast: John Travolta (Jan Schlichtmann), Robert Duvall (Jerome Facher), Tony Shalhoub (Kevin Conway), William H. Macy (James Gordon), Zeljko Ivanek (Bill Crowley), Bruce Norris (William Cheeseman), Kathleen Quinlan (Anne Anderson), Peter Jacobson (Neil Jacobs), Mary Mara (Kathy Boyer), James Gandolfini (Al Love), Stephen Fry (Pinder ), Dan Hedaya (John Riley), Sydney Pollack (Al Eustis), John Lithgow (Judge Walter J. Skinner), 1998)
Reviewed by Dennis Schwartz
"A Civil Action" is about a real court case in the early 1980s involving toxic waste dumping in a small town north of Boston, that is based on Jonathan Harr's best-selling non-fiction book about the personal-injury lawyer Jan Schlichtmann (Travolta), whose small law firm brought a willful neglience lawsuit against two giant corporations, consumer goods conglomerate Beatrice and chemical giant W.R. Grace. It's an absorbing story but it was presented in such a mangled way, so a lot of the drama was sucked out of it and it instead became an obvious sob story about an injustice done.
Jan is first shown as a hotshot lawyer full of hubris after winning an ambulance-chaser case. He drives his Porsche to Woburn, Massachusetts, to check out a potential law suit representing some families whose children either died because of Leukemia or became seriously ill because of the toxins Trichloroethylene (TCE) in their drinking water, he turns the case down when his clients who are only after an apology, can't tell him who to sue that has the big bucks to pay. But that all changes when he gets a speeding ticket on his way back to Boston and observes from a bridge the site where the dumping from a tannery owned by Beatricefoods takes place and where W.R. Grace has a chemical plant.
This Steven Zaillian directed film has traces of the same intelligence he has shown in his previous work as director of Searching For Bobby Fischer and as a screenwriter for Schindler's List, but loses its fire-power with scenes of endless court hagglings and what seems like an interminable amount of time spent in giving prep classes on how the court system works.
 This sets-up a battle of David versus Goliath. The film stays on track with the claim that in today's court system, the odds are rigged against the little guy and that it takes big money to file a law suit against such giants. This is proven when Travolta's law firm is sucked into the case deeper than what they expected, paying huge expenses to do research to prove contamination, as they all go broke and have to mortgage their homes to keep the case going.
The supporting players all have limited roles compared to the two gunslingers, Travolta and Duvall, but perform admirably. William H. Macy is on the Travolta team and makes it plain he's along only for the money, with him being the one in the firm who handles financial matters. But, he cracks from the strain of going belly-up. The others in the firm, Tony Shalhoub and Zeljko Ivanek, follow their leader Travolta until they see he actually believes in his clients and they thereby desert him. Dan Hedaya is the tannery owner who lies on the stand and can't be shaken from his lie until the case is appealed by the EPA. John Lithgow is the judge who sides with his big business friends. James Gandolfini is the only witness who works at the site of W.R. Grace who is willing to take a chance and tell what he knows. Sydney Pollack is the snobbish head of W.R. Grace who won't talk business with Travolta when he invites him to the Harvard club, but only when he's back at his office and he can put his feet up on the table. Anne Anderson is the gentle Woburn local who is alarmed that her son died of Leukemia and initiated the lawsuit to protect others in the community, as her persistence finally won out.
For all its telling faults in its storytelling ability, the film had an aura of reality about it that the John Grisham movies never have. The entertainment value for the film comes from the simulated gun duel between the inexperienced Travolta taking on the skilled Duvall, who always seems to be one move ahead of him. That Travolta undergoes a change of character during the law suit and really believes what he's doing is right, is shown in the subtle changes of expression he has, no longer pretending to feel the pain of his clients but tunes into the pain he has. His ego gets a thorough examination and the superficial things he was once interested in fail to move him anymore. While Duvall is shown as the masterful Machiavellian tactician with absolutely no heart, whose m.o. is to shred his opponents as well as those who are under him. When one of his staff interupts his quiet office lunch of listening to the Red Sox game to do him a favor and give him an important document on the upcoming lawsuit, he spitefully rails into him for not going out to lunch.
What the film failed to do, is to bring a sense of urgency to their presentation. Though they were sympathetic to the families' plight and caught the essence of what Travolta was up against, which makes it better than most Hollywood films, it just couldn't drive the fastball thrown down the middle of the plate over the 'Green Monster' in Fenway Park for a home run. The story became less than compelling and more of an exercise about who was the better actor/lawyer Duvall or Travolta. The great social impact of the lawsuit never caught on during the film, when that should have been the driving force of the film, as it was when grippingly told in the book.
REVIEWED ON 6/11/2000 GRADE: B-
Dennis Schwartz: "Ozus' World Movie Reviews"
http://www.sover.net/~ozus
<EMAIL_ADDRESS>© ALL RIGHTS RESERVED DENNIS SCHWARTZ
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


true — return true value
true
The true utility exits with a successful exit status.
The true utility does not perform any option processing.
The true utility always exits with a status of 0.
The true utility conforms to the Single UNIX Specification, Version 3 (SUSv3).
false (1) .