FSN#39312 Verder ontsluiten van modellen via de API
svn path=/Website/trunk/; revision=33021
This commit is contained in:
@@ -1369,7 +1369,7 @@ function generic_REST_GET(model, gparams)
|
|||||||
sql += " ORDER BY " + orderbys.join(", "); // TODO: Altijd goed met includes?
|
sql += " ORDER BY " + orderbys.join(", "); // TODO: Altijd goed met includes?
|
||||||
|
|
||||||
// Probeer ook nog de 1e include te sorteren. Fraaier met subframes in scaffolding
|
// Probeer ook nog de 1e include te sorteren. Fraaier met subframes in scaffolding
|
||||||
if (params.include && params.include.length && model.includes)
|
if (params.include && params.include.length && model.includes && params.include[0] in model.includes)
|
||||||
{
|
{
|
||||||
var inc0 = model.includes[params.include[0]].model;
|
var inc0 = model.includes[params.include[0]].model;
|
||||||
if (inc0.fields["sequence"])
|
if (inc0.fields["sequence"])
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ var api2_mapper = {
|
|||||||
|
|
||||||
function api2_dispatch(api2_name)
|
function api2_dispatch(api2_name)
|
||||||
{
|
{
|
||||||
|
api2_name = api2_name.toLowerCase();
|
||||||
if (api2_name in api2_mapper)
|
if (api2_name in api2_mapper)
|
||||||
return api2_mapper[api2_name];
|
return api2_mapper[api2_name];
|
||||||
|
|
||||||
@@ -120,6 +121,4 @@ function api2_dispatch(api2_name)
|
|||||||
return fullname;
|
return fullname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FAC_LCL('lcl_rap_expression', 'SQL expressie', 'SQL expression', 'SQL-Ausdruck', 'Expressie SQL')
|
|
||||||
%>
|
%>
|
||||||
@@ -209,6 +209,8 @@ api2_rest = {
|
|||||||
{
|
{
|
||||||
// TODO: Onderstaande in een of ander standaardformaat opleveren?
|
// TODO: Onderstaande in een of ander standaardformaat opleveren?
|
||||||
var result = { id: model.records_name,
|
var result = { id: model.records_name,
|
||||||
|
"name": model.record_title,
|
||||||
|
"names": model.records_title,
|
||||||
methods: [],
|
methods: [],
|
||||||
includes: [],
|
includes: [],
|
||||||
fields: []
|
fields: []
|
||||||
@@ -230,7 +232,9 @@ api2_rest = {
|
|||||||
result.fields.push({ id: fld,
|
result.fields.push({ id: fld,
|
||||||
filter: model.fields[fld].filter,
|
filter: model.fields[fld].filter,
|
||||||
type: model.fields[fld].typ,
|
type: model.fields[fld].typ,
|
||||||
label: model.fields[fld].label
|
label: model.fields[fld].label,
|
||||||
|
required: model.fields[fld].required,
|
||||||
|
valuelist: model.fields[fld].LOV && api2.splitLOV(model.fields[fld].LOV)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,7 +430,7 @@ api2_rest = {
|
|||||||
case "html":
|
case "html":
|
||||||
Response.ContentType = "text/html";
|
Response.ContentType = "text/html";
|
||||||
var antwoord = JSON.stringify(resultdata, null, 2);
|
var antwoord = JSON.stringify(resultdata, null, 2);
|
||||||
var str_antwoord = "<!DOCTYPE html><html><head></head><body><pre>"
|
var str_antwoord = "<!DOCTYPE html><html><head><title>{0}</title></head><body><pre>".format(single?model.record_name:model.records_name)
|
||||||
+ Server.HTMLEncode(antwoord)
|
+ Server.HTMLEncode(antwoord)
|
||||||
+ "</pre></body></html>";
|
+ "</pre></body></html>";
|
||||||
break;
|
break;
|
||||||
@@ -771,6 +775,8 @@ var simple_json2xml = (function (undefined) {
|
|||||||
if (obj.hasOwnProperty(i)) {
|
if (obj.hasOwnProperty(i)) {
|
||||||
var value = obj[i],
|
var value = obj[i],
|
||||||
type = typeof value;
|
type = typeof value;
|
||||||
|
if (value === obj) // bij merged_model zouden we hier oneindige recursie krijgen
|
||||||
|
continue;
|
||||||
if (value instanceof Array && type == 'object') {
|
if (value instanceof Array && type == 'object') {
|
||||||
for (var sub in value) {
|
for (var sub in value) {
|
||||||
xml += simple_json2xml(value[sub]);
|
xml += simple_json2xml(value[sub]);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
File: model_alg_srtgebouw.inc
|
File: model_alg_srtgebouw.inc
|
||||||
|
|
||||||
Description: Vanuit CodeCharge gegenereerd model voor alg_srtgebouw
|
Description: Model voor alg_srtgebouw
|
||||||
|
|
||||||
Context:
|
Context:
|
||||||
|
|
||||||
@@ -14,10 +14,8 @@
|
|||||||
<%
|
<%
|
||||||
function model_alg_srtgebouw()
|
function model_alg_srtgebouw()
|
||||||
{
|
{
|
||||||
var tab_key = getQParamInt("alg_srtgebouw_key", -1);
|
this.records_name = "buildingfunctions";
|
||||||
|
this.record_name = "buildingfunction";
|
||||||
this.records_name = "alg_buildingfunctions";
|
|
||||||
this.record_name = "alg_buildingfunction";
|
|
||||||
this.table = "alg_srtgebouw";
|
this.table = "alg_srtgebouw";
|
||||||
this.primary = "alg_srtgebouw_key";
|
this.primary = "alg_srtgebouw_key";
|
||||||
this.soft_delete = "alg_srtgebouw_verwijder";
|
this.soft_delete = "alg_srtgebouw_verwijder";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
File: model_alg_srtterreinsector.inc
|
File: model_alg_srtterreinsector.inc
|
||||||
|
|
||||||
Description: Vanuit CodeCharge gegenereerd model voor alg_srtterreinsector
|
Description: Model voor alg_srtterreinsector
|
||||||
|
|
||||||
Context:
|
Context:
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
<%
|
<%
|
||||||
function model_alg_srtterreinsector()
|
function model_alg_srtterreinsector()
|
||||||
{
|
{
|
||||||
this.records_name = "alg_terrainfunctions";
|
this.records_name = "terrainfunctions";
|
||||||
this.record_name = "alg_terrainfunction";
|
this.record_name = "terrainfunction";
|
||||||
this.table = "alg_srtterreinsector";
|
this.table = "alg_srtterreinsector";
|
||||||
this.primary = "alg_srtterreinsector_key";
|
this.primary = "alg_srtterreinsector_key";
|
||||||
this.soft_delete = "alg_srtterreinsector_verwijder";
|
this.soft_delete = "alg_srtterreinsector_verwijder";
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ model_apis =
|
|||||||
primary: "id",
|
primary: "id",
|
||||||
records_name: "apis",
|
records_name: "apis",
|
||||||
record_name: "api",
|
record_name: "api",
|
||||||
fields : { "id" : { xxdbs: "fac_usrrap_key", typ: "varchar", label: "Api", filter: "exact" },
|
fields : { "id" : { typ: "varchar", label: "Api", filter: "exact" },
|
||||||
"name" : { xxdbs: "fac_usrrap_key", typ: "varchar", label: "Api", filter: "exact" }
|
"module" : { typ: "varchar", label: "Module", filter: "exact" },
|
||||||
|
"name" : { typ: "varchar", label: "Api", filter: "exact" }
|
||||||
},
|
},
|
||||||
|
|
||||||
REST_GET: function _GET(params)
|
REST_GET: function _GET(params)
|
||||||
@@ -32,8 +33,9 @@ model_apis =
|
|||||||
var api2_names = [];
|
var api2_names = [];
|
||||||
for (var dispatch in api2_mapper)
|
for (var dispatch in api2_mapper)
|
||||||
{
|
{
|
||||||
|
var module = api2_mapper[dispatch].substr(9, 3).toUpperCase();
|
||||||
// TODO: kijken of er een L() bestaat voor de api2_mapper filenaam
|
// TODO: kijken of er een L() bestaat voor de api2_mapper filenaam
|
||||||
api2_names.push({ id: dispatch, name: "X-" + dispatch });
|
api2_names.push({ id: dispatch, name: dispatch, modulecode: module, module: L("lcl_module_" + module) });
|
||||||
}
|
}
|
||||||
|
|
||||||
var fullpath = Server.MapPath("./appl/api2");
|
var fullpath = Server.MapPath("./appl/api2");
|
||||||
@@ -57,15 +59,6 @@ model_apis =
|
|||||||
|
|
||||||
return api2_names;
|
return api2_names;
|
||||||
},
|
},
|
||||||
PUT: function (params) /* update api */
|
|
||||||
{
|
|
||||||
},
|
|
||||||
POST: function (params) /* new api */
|
|
||||||
{
|
|
||||||
},
|
|
||||||
DELETE: function (params) /* delete api */
|
|
||||||
{
|
|
||||||
},
|
|
||||||
|
|
||||||
search: { autosearch: true },
|
search: { autosearch: true },
|
||||||
list: { default_url: "api2/{0}.scf" }
|
list: { default_url: "api2/{0}.scf" }
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function model_doc()
|
|||||||
this.fields = {};
|
this.fields = {};
|
||||||
for (var i = 0; i < apis.length; i++)
|
for (var i = 0; i < apis.length; i++)
|
||||||
{
|
{
|
||||||
this.fields[ apis[i].id ] = { label: apis[i].name };
|
this.fields[ apis[i].id ] = { label: apis[i].name, module: apis[i].module };
|
||||||
}
|
}
|
||||||
|
|
||||||
this.REST_GET = generic_REST_GET(this, {});
|
this.REST_GET = generic_REST_GET(this, {});
|
||||||
|
|||||||
@@ -7,13 +7,16 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="../appl/api2/reference.css?"/>
|
<link rel="stylesheet" type="text/css" href="../appl/api2/reference.css?"/>
|
||||||
|
<title>FACILITOR® API reference</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>FACILITOR® API reference</h1>
|
<h1>FACILITOR® API reference</h1>
|
||||||
<xsl:element name="ul">
|
<xsl:element name="ul">
|
||||||
<xsl:for-each select="/api/fields/*">
|
<xsl:for-each select="/api/fields/*">
|
||||||
|
<xsl:sort select="@module" />
|
||||||
<xsl:element name="li">
|
<xsl:element name="li">
|
||||||
<xsl:element name="a">
|
<xsl:value-of select="module"/>
|
||||||
|
 <xsl:element name="a">
|
||||||
<xsl:attribute name="href">../api2/<xsl:value-of select="local-name()"/>.doc</xsl:attribute>
|
<xsl:attribute name="href">../api2/<xsl:value-of select="local-name()"/>.doc</xsl:attribute>
|
||||||
<xsl:value-of select="local-name()"/>
|
<xsl:value-of select="local-name()"/>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function model_fac_profiel()
|
|||||||
|
|
||||||
|
|
||||||
this.includes = {
|
this.includes = {
|
||||||
"profile_values": {
|
"profilevalues": {
|
||||||
"model": new model_fac_profielwaarde(),
|
"model": new model_fac_profielwaarde(),
|
||||||
"joinfield": "profile",
|
"joinfield": "profile",
|
||||||
"enable_update": true,
|
"enable_update": true,
|
||||||
|
|||||||
@@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
function model_fac_srtnotificatie(cust)
|
function model_fac_srtnotificatie(cust)
|
||||||
{
|
{
|
||||||
|
this.records_name = "notificationtypes";
|
||||||
|
this.record_name = "notificationtype";
|
||||||
this.table = "fac_srtnotificatie";
|
this.table = "fac_srtnotificatie";
|
||||||
this.primary = "fac_srtnotificatie_key";
|
this.primary = "fac_srtnotificatie_key";
|
||||||
this.records_name = "fac_srtnotificaties";
|
|
||||||
this.record_name = "fac_srtnotificatie";
|
|
||||||
this.autfunction = "WEB_PRSSYS";
|
this.autfunction = "WEB_PRSSYS";
|
||||||
this.record_title = L("fac_srtnotificatie");
|
this.record_title = L("fac_srtnotificatie");
|
||||||
this.records_title = L("fac_srtnotificatie_m");
|
this.records_title = L("fac_srtnotificatie_m");
|
||||||
@@ -26,7 +26,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
this.fields = {
|
this.fields = {
|
||||||
"id": {
|
"id": {
|
||||||
"dbs": "fac_srtnotificatie_key",
|
"dbs": "fac_srtnotificatie_key",
|
||||||
"label": "Key",
|
"label": L("lcl_key"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
"required": true,
|
"required": true,
|
||||||
"seq": "fac_s_fac_srtnotificatie_key",
|
"seq": "fac_s_fac_srtnotificatie_key",
|
||||||
@@ -54,7 +54,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
"LOV": fill_srtnotificatie_LOV(),
|
"LOV": fill_srtnotificatie_LOV(),
|
||||||
"emptyoption": null
|
"emptyoption": null
|
||||||
},
|
},
|
||||||
"notification_url": {
|
"notificationurl": {
|
||||||
"dbs": "fac_srtnotificatie_url",
|
"dbs": "fac_srtnotificatie_url",
|
||||||
"label": L("fac_srtnotificatie_url"),
|
"label": L("fac_srtnotificatie_url"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
@@ -66,7 +66,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
"readonly": true
|
"readonly": true
|
||||||
},
|
},
|
||||||
"notification_mode": {
|
"notificationmode": {
|
||||||
"dbs": "fac_srtnotificatie_mode",
|
"dbs": "fac_srtnotificatie_mode",
|
||||||
"label": "",
|
"label": "",
|
||||||
"typ": "number",
|
"typ": "number",
|
||||||
@@ -121,40 +121,43 @@ function model_fac_srtnotificatie(cust)
|
|||||||
"dbs": "fac_srtnotificatie_usermode",
|
"dbs": "fac_srtnotificatie_usermode",
|
||||||
"label": L("fac_srtnotificatie_usermode"),
|
"label": L("fac_srtnotificatie_usermode"),
|
||||||
"typ": "check0",
|
"typ": "check0",
|
||||||
"listfunction": fnshowusermode
|
"listfunction": fnshowusermode,
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"mail_building": {
|
"mailbuilding": {
|
||||||
"dbs": "fac_srtnotificatie_gebouw",
|
"dbs": "fac_srtnotificatie_gebouw",
|
||||||
"label": L("fac_srtnotificatie_gebouw"),
|
"label": L("fac_srtnotificatie_gebouw"),
|
||||||
"typ": "check0",
|
"typ": "check0",
|
||||||
"listfunction": fnshowmailbuilding
|
"listfunction": fnshowmailbuilding,
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"delay": {
|
"delay": {
|
||||||
"dbs": "fac_srtnotificatie_delay",
|
"dbs": "fac_srtnotificatie_delay",
|
||||||
"label": L("fac_srtnotificatie_delay"),
|
"label": L("fac_srtnotificatie_delay"),
|
||||||
"typ": "number",
|
"typ": "number",
|
||||||
"required": true,
|
"required": true,
|
||||||
"defaultvalue": "0"
|
"defaultvalue": "0",
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"mode_status": {
|
"modestatus": {
|
||||||
"dbs": "notimode.status",
|
"dbs": "notimode.status",
|
||||||
"label": L("fac_srtnotificatie_status"),
|
"label": L("fac_srtnotificatie_status"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
"hidden_fld": true
|
"hidden_fld": true
|
||||||
},
|
},
|
||||||
"mode_email": {
|
"modeemail": {
|
||||||
"dbs": "notimode.email",
|
"dbs": "notimode.email",
|
||||||
"label": L("fac_srtnotificatie_mail"),
|
"label": L("fac_srtnotificatie_mail"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
"hidden_fld": true
|
"hidden_fld": true
|
||||||
},
|
},
|
||||||
"mode_sms": {
|
"modesms": {
|
||||||
"dbs": "notimode.sms",
|
"dbs": "notimode.sms",
|
||||||
"label": L("fac_srtnotificatie_sms"),
|
"label": L("fac_srtnotificatie_sms"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
"hidden_fld": true
|
"hidden_fld": true
|
||||||
},
|
},
|
||||||
"mode_alert": {
|
"modealert": {
|
||||||
"dbs": "notimode.portal",
|
"dbs": "notimode.portal",
|
||||||
"label": L("fac_srtnotificatie_alert"),
|
"label": L("fac_srtnotificatie_alert"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
@@ -163,7 +166,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!S("puo_smsaccount"))
|
if (!S("puo_smsaccount"))
|
||||||
this.fields.notification_mode.bits[0].radios.splice(2, 1);
|
this.fields.notificationmode.bits[0].radios.splice(2, 1);
|
||||||
|
|
||||||
var ext_sql = "(SELECT fac_srtnotificatie_key"
|
var ext_sql = "(SELECT fac_srtnotificatie_key"
|
||||||
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 1), 1,"+ safe.qL("lcl_on") +", '') status"
|
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 1), 1,"+ safe.qL("lcl_on") +", '') status"
|
||||||
@@ -179,6 +182,24 @@ function model_fac_srtnotificatie(cust)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function fill_srtnotificatie_LOV()
|
||||||
|
{
|
||||||
|
var xmlnodeLOV = "";
|
||||||
|
var sql = "SELECT distinct fac_srtnotificatie_xmlnode"
|
||||||
|
+ " , NVL(fac_srtnotificatie_xmlnode,'<empty>') xmlnode_lov"
|
||||||
|
+ " FROM fac_srtnotificatie"
|
||||||
|
+ " ORDER BY 1 NULLS FIRST";
|
||||||
|
var oRs = Oracle.Execute(sql);
|
||||||
|
while (!oRs.eof)
|
||||||
|
{
|
||||||
|
var xmlnode = oRs("fac_srtnotificatie_xmlnode").Value;
|
||||||
|
xmlnodeLOV += (xmlnodeLOV?";":"") + xmlnode + ";" + oRs("xmlnode_lov").Value;
|
||||||
|
oRs.moveNext();
|
||||||
|
}
|
||||||
|
oRs.Close();
|
||||||
|
return xmlnodeLOV;
|
||||||
|
}
|
||||||
|
|
||||||
function xxx_srtkenmerk_sql()
|
function xxx_srtkenmerk_sql()
|
||||||
{
|
{
|
||||||
var sql = "(select sk.mld_srtkenmerk_key srtkenmerk_key"
|
var sql = "(select sk.mld_srtkenmerk_key srtkenmerk_key"
|
||||||
@@ -201,7 +222,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
this.fields.xmlnode.readonly = false;
|
this.fields.xmlnode.readonly = false;
|
||||||
this.fields.xmlnode.required = true;
|
this.fields.xmlnode.required = true;
|
||||||
this.fields.description.required = true;
|
this.fields.description.required = true;
|
||||||
this.fields.notification_url.readonly = false;
|
this.fields.notificationurl.readonly = false;
|
||||||
this.fields.group.readonly = false;
|
this.fields.group.readonly = false;
|
||||||
|
|
||||||
get_param.GET.wheres.push("UPPER(SUBSTR(fac_srtnotificatie_code, 1, 4)) = 'CUST' ");
|
get_param.GET.wheres.push("UPPER(SUBSTR(fac_srtnotificatie_code, 1, 4)) = 'CUST' ");
|
||||||
@@ -218,7 +239,7 @@ function model_fac_srtnotificatie(cust)
|
|||||||
// Voorlopig mag alleen voor meldingen en opdrachten het vinkje 'E-mail sturen naar gebouw'
|
// Voorlopig mag alleen voor meldingen en opdrachten het vinkje 'E-mail sturen naar gebouw'
|
||||||
// gezet worden
|
// gezet worden
|
||||||
if (iscust == 1 || !inArray(obj.name.substring(0,3), ["MLD", "ORD"]))
|
if (iscust == 1 || !inArray(obj.name.substring(0,3), ["MLD", "ORD"]))
|
||||||
fld.mail_building.readonly = true;
|
fld.mailbuilding.readonly = true;
|
||||||
|
|
||||||
if (inArray(obj.name, ["MLDAFM", "MLDAFR", "MLDUPD"]))
|
if (inArray(obj.name, ["MLDAFM", "MLDAFR", "MLDUPD"]))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
function model_res_ruimte()
|
function model_res_ruimte()
|
||||||
{
|
{
|
||||||
|
this.records_name = "bookingrooms";
|
||||||
|
this.record_name = "bookingroom";
|
||||||
this.table = "res_ruimte";
|
this.table = "res_ruimte";
|
||||||
this.primary = "res_ruimte_key";
|
this.primary = "res_ruimte_key";
|
||||||
this.records_name = "res_ruimtes";
|
|
||||||
this.record_name = "res_ruimte";
|
|
||||||
this.soft_delete = "res_ruimte_verwijder";
|
this.soft_delete = "res_ruimte_verwijder";
|
||||||
this.soft_expire = "res_ruimte_vervaldatum";
|
this.soft_expire = "res_ruimte_vervaldatum";
|
||||||
this.autfunction = "WEB_RESMSU";
|
this.autfunction = "WEB_RESMSU";
|
||||||
@@ -31,7 +31,7 @@ function model_res_ruimte()
|
|||||||
this.fields = {
|
this.fields = {
|
||||||
"id": {
|
"id": {
|
||||||
"dbs": "res_ruimte_key",
|
"dbs": "res_ruimte_key",
|
||||||
"label": "Key",
|
"label": L("lcl_key"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
"required": true,
|
"required": true,
|
||||||
"filter": "exact",
|
"filter": "exact",
|
||||||
@@ -58,12 +58,12 @@ function model_res_ruimte()
|
|||||||
"label": L("res_ruimte_volgnummer"),
|
"label": L("res_ruimte_volgnummer"),
|
||||||
"typ": "number"
|
"typ": "number"
|
||||||
},
|
},
|
||||||
"res_ruimte_info_url": {
|
"infourl": {
|
||||||
"dbs": "res_ruimte_info_url",
|
"dbs": "res_ruimte_info_url",
|
||||||
"label": L("res_ruimte_info_url"),
|
"label": L("res_ruimte_info_url"),
|
||||||
"typ": "varchar"
|
"typ": "varchar"
|
||||||
},
|
},
|
||||||
"locatiekey": {
|
"locatiekey": { // liever location maar zo komt het uit de plaatsselector
|
||||||
"dbs": "res_v_alg_ruimte_gegevens.alg_locatie_key",
|
"dbs": "res_v_alg_ruimte_gegevens.alg_locatie_key",
|
||||||
"label": L("lcl_location"),
|
"label": L("lcl_location"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
@@ -76,7 +76,7 @@ function model_res_ruimte()
|
|||||||
},
|
},
|
||||||
"foreignfiltercode": null // Ook facilitor irrelevant
|
"foreignfiltercode": null // Ook facilitor irrelevant
|
||||||
},
|
},
|
||||||
"catalog": {
|
"bookingdiscipline": {
|
||||||
"dbs": "res_discipline_key",
|
"dbs": "res_discipline_key",
|
||||||
"label": L("res_discipline_key"),
|
"label": L("res_discipline_key"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
@@ -94,121 +94,127 @@ function model_res_ruimte()
|
|||||||
"label": L("res_ruimte_begintijd"),
|
"label": L("res_ruimte_begintijd"),
|
||||||
"typ": "float",
|
"typ": "float",
|
||||||
"LOV": api2.getTimetable(),
|
"LOV": api2.getTimetable(),
|
||||||
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t1"),false))
|
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t1"),false)),
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"close": {
|
"close": {
|
||||||
"dbs": "res_ruimte_eindtijd",
|
"dbs": "res_ruimte_eindtijd",
|
||||||
"label": L("res_ruimte_eindtijd"),
|
"label": L("res_ruimte_eindtijd"),
|
||||||
"typ": "float",
|
"typ": "float",
|
||||||
"LOV": api2.getTimetable(),
|
"LOV": api2.getTimetable(),
|
||||||
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t2"),false))
|
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t2"),false)),
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"blockstart": {
|
"blockstart": {
|
||||||
"dbs": "res_ruimte_begintijdblok",
|
"dbs": "res_ruimte_begintijdblok",
|
||||||
"label": L("res_ruimte_begintijdblok"),
|
"label": L("res_ruimte_begintijdblok"),
|
||||||
"typ": "float",
|
"typ": "float",
|
||||||
"LOV": api2.getTimetable()
|
"LOV": api2.getTimetable(),
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"blockend": {
|
"blockend": {
|
||||||
"dbs": "res_ruimte_eindtijdblok",
|
"dbs": "res_ruimte_eindtijdblok",
|
||||||
"label": L("res_ruimte_eindtijdblok"),
|
"label": L("res_ruimte_eindtijdblok"),
|
||||||
"typ": "float",
|
"typ": "float",
|
||||||
"LOV": api2.getTimetable()
|
"LOV": api2.getTimetable(),
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"min_res_time": {
|
"minduration": {
|
||||||
"dbs": "res_ruimte_min_duur",
|
"dbs": "res_ruimte_min_duur",
|
||||||
"label": L("res_ruimte_min_duur"),
|
"label": L("res_ruimte_min_duur"),
|
||||||
"typ": "float"
|
"typ": "float",
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs_vast": {
|
"fixedprice": {
|
||||||
"dbs": "res_ruimte_prijs_vast",
|
"dbs": "res_ruimte_prijs_vast",
|
||||||
"label": L("res_ruimte_prijs_vast"),
|
"label": L("res_ruimte_prijs_vast"),
|
||||||
"typ": "check"
|
"typ": "check",
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"_interne_prijzen": {
|
"_intpricelabel": {
|
||||||
"dbs": "",
|
"dbs": "",
|
||||||
"label": "",
|
"label": "",
|
||||||
"typ": "label",
|
"typ": "label",
|
||||||
"labelvalue": L("res_ruimte_intprijs_label")
|
"labelvalue": L("res_ruimte_intprijs_label")
|
||||||
},
|
},
|
||||||
"res_ruimte_intprijs": {
|
"intpricehour": {
|
||||||
"dbs": "res_ruimte_intprijs",
|
"dbs": "res_ruimte_intprijs",
|
||||||
"label": L("res_ruimte_intprijs"),
|
"label": L("res_ruimte_intprijs"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_intprijs_ochtend": {
|
"intpricemorning": {
|
||||||
"dbs": "res_ruimte_intprijs_ochtend",
|
"dbs": "res_ruimte_intprijs_ochtend",
|
||||||
"label": L("res_ruimte_intprijs_ochtend"),
|
"label": L("res_ruimte_intprijs_ochtend"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_intprijs_middag": {
|
"intpriceafternoon": {
|
||||||
"dbs": "res_ruimte_intprijs_middag",
|
"dbs": "res_ruimte_intprijs_middag",
|
||||||
"label": L("res_ruimte_intprijs_middag"),
|
"label": L("res_ruimte_intprijs_middag"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_intprijs_avond": {
|
"intpriceevening": {
|
||||||
"dbs": "res_ruimte_intprijs_avond",
|
"dbs": "res_ruimte_intprijs_avond",
|
||||||
"label": L("res_ruimte_intprijs_avond"),
|
"label": L("res_ruimte_intprijs_avond"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_intprijs_dag": {
|
"intpriceday": {
|
||||||
"dbs": "res_ruimte_intprijs_dag",
|
"dbs": "res_ruimte_intprijs_dag",
|
||||||
"label": L("res_ruimte_intprijs_dag"),
|
"label": L("res_ruimte_intprijs_dag"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"_externe_prijzen": {
|
"_extpricelabel": {
|
||||||
"dbs": "",
|
"dbs": "",
|
||||||
"label": "",
|
"label": "",
|
||||||
"typ": "label",
|
"typ": "label",
|
||||||
"labelvalue": L("res_ruimte_extprijs_label")
|
"labelvalue": L("res_ruimte_extprijs_label")
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs": {
|
"extpricehour": {
|
||||||
"dbs": "res_ruimte_prijs",
|
"dbs": "res_ruimte_prijs",
|
||||||
"label": L("res_ruimte_prijs"),
|
"label": L("res_ruimte_prijs"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs_ochtend": {
|
"extpricemorning": {
|
||||||
"dbs": "res_ruimte_prijs_ochtend",
|
"dbs": "res_ruimte_prijs_ochtend",
|
||||||
"label": L("res_ruimte_prijs_ochtend"),
|
"label": L("res_ruimte_prijs_ochtend"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs_middag": {
|
"extpriceafternoon": {
|
||||||
"dbs": "res_ruimte_prijs_middag",
|
"dbs": "res_ruimte_prijs_middag",
|
||||||
"label": L("res_ruimte_prijs_middag"),
|
"label": L("res_ruimte_prijs_middag"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs_avond": {
|
"extpriceevening": {
|
||||||
"dbs": "res_ruimte_prijs_avond",
|
"dbs": "res_ruimte_prijs_avond",
|
||||||
"label": L("res_ruimte_prijs_avond"),
|
"label": L("res_ruimte_prijs_avond"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_prijs_dag": {
|
"extpriceday": {
|
||||||
"dbs": "res_ruimte_prijs_dag",
|
"dbs": "res_ruimte_prijs_dag",
|
||||||
"label": L("res_ruimte_prijs_dag"),
|
"label": L("res_ruimte_prijs_dag"),
|
||||||
"iscurrency": true,
|
"iscurrency": true,
|
||||||
"typ": "float"
|
"typ": "float"
|
||||||
},
|
},
|
||||||
"res_ruimte_image": {
|
"image": {
|
||||||
"dbs": "res_ruimte_image",
|
"dbs": "res_ruimte_image",
|
||||||
"label": L("res_ruimte_image"),
|
"label": L("res_ruimte_image"),
|
||||||
"typ": "varchar",
|
"typ": "varchar",
|
||||||
"flexmodule": "RESPH"
|
"flexmodule": "RESPH"
|
||||||
},
|
},
|
||||||
"res_ruimte_groep": {
|
"waitingarea": {
|
||||||
"dbs": "res_ruimte_groep",
|
"dbs": "res_ruimte_groep",
|
||||||
"label": L("res_ruimte_groep"),
|
"label": L("res_ruimte_groep"),
|
||||||
"typ": "varchar"
|
"typ": "varchar"
|
||||||
},
|
},
|
||||||
"action": {
|
"visitoraction": {
|
||||||
"dbs": "bez_actie_key",
|
"dbs": "bez_actie_key",
|
||||||
"label": L("bez_actie_key"),
|
"label": L("bez_actie_key"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
@@ -221,7 +227,7 @@ function model_res_ruimte()
|
|||||||
"filter": "exact",
|
"filter": "exact",
|
||||||
"LOVinit": ""
|
"LOVinit": ""
|
||||||
},
|
},
|
||||||
"res_status_fo_key": {
|
"defaultstatus": {
|
||||||
"dbs": "res_status_fo_key",
|
"dbs": "res_status_fo_key",
|
||||||
"label": L("res_status_fo_key"),
|
"label": L("res_status_fo_key"),
|
||||||
"typ": "key",
|
"typ": "key",
|
||||||
@@ -233,12 +239,13 @@ function model_res_ruimte()
|
|||||||
"label": L("res_ruimte_friendlyname"),
|
"label": L("res_ruimte_friendlyname"),
|
||||||
"typ": "varchar"
|
"typ": "varchar"
|
||||||
},
|
},
|
||||||
"res_ruimte_vervaldatum": {
|
"expirationdate": {
|
||||||
"dbs": "res_ruimte_vervaldatum",
|
"dbs": "res_ruimte_vervaldatum",
|
||||||
"label": L("res_ruimte_vervaldatum"),
|
"label": L("res_ruimte_vervaldatum"),
|
||||||
"typ": "date"
|
"typ": "date",
|
||||||
|
"multiedit": true
|
||||||
},
|
},
|
||||||
"res_ruimte_extern_id": {
|
"externalid": {
|
||||||
"dbs": "res_ruimte_extern_id",
|
"dbs": "res_ruimte_extern_id",
|
||||||
"label": L("res_ruimte_extern_id"),
|
"label": L("res_ruimte_extern_id"),
|
||||||
"typ": "varchar"
|
"typ": "varchar"
|
||||||
@@ -251,14 +258,14 @@ function model_res_ruimte()
|
|||||||
this.fields.res_ruimte_extern_id.readonly = true;
|
this.fields.res_ruimte_extern_id.readonly = true;
|
||||||
|
|
||||||
this.includes = {
|
this.includes = {
|
||||||
"rooms": {
|
"physicalrooms": {
|
||||||
"model": new model_res_alg_ruimte(),
|
"model": new model_res_alg_ruimte(),
|
||||||
"joinfield": "res_ruimte_key"
|
"joinfield": "bookingroom"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"bookingconfigurations": {
|
||||||
"model": new model_res_ruimte_opstelling(),
|
"model": new model_res_ruimte_opstelling(),
|
||||||
"joinfield": "res_ruimte_key",
|
"joinfield": "bookingroom",
|
||||||
"multiadd": "res_opstelling_key"
|
"multiadd": "bookingconfiguration"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="../appl/api2/reference.css?"/>
|
<link rel="stylesheet" type="text/css" href="../appl/api2/reference.css?"/>
|
||||||
|
<title>API <xsl:value-of select="/api/records_name"/></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>FACILITOR® API reference: <xsl:value-of select="/api/records_name"/></h1>
|
<h1>FACILITOR® API reference: <xsl:value-of select="/api/records_name"/></h1>
|
||||||
|
<xsl:if test="/api/records_title!=''">
|
||||||
|
<h1><xsl:value-of select="/api/records_title"/></h1>
|
||||||
|
</xsl:if>
|
||||||
Record name: <xsl:value-of select="/api/record_name"/><br />
|
Record name: <xsl:value-of select="/api/record_name"/><br />
|
||||||
Records name: <xsl:value-of select="/api/records_name"/><br />
|
Records name: <xsl:value-of select="/api/records_name"/><br />
|
||||||
<h2>Parameters:</h2>
|
<h2>Parameters:</h2>
|
||||||
@@ -36,6 +40,15 @@
|
|||||||
GET /api2/<xsl:value-of select="/api/records_name"/>.json
|
GET /api2/<xsl:value-of select="/api/records_name"/>.json
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</div>
|
</div>
|
||||||
|
<xsl:for-each select="/api/includes/*">
|
||||||
|
<div class="sample">
|
||||||
|
<xsl:element name="a">
|
||||||
|
<xsl:attribute name="href">../api2/<xsl:value-of select="/api/records_name"/>.html?include=<xsl:value-of select="local-name()"/>&limit=3</xsl:attribute>
|
||||||
|
<xsl:attribute name="target">_new</xsl:attribute>
|
||||||
|
GET /api2/<xsl:value-of select="/api/records_name"/>.json?include=<xsl:value-of select="local-name()"/>
|
||||||
|
</xsl:element>
|
||||||
|
</div>
|
||||||
|
</xsl:for-each>
|
||||||
<div class="sample">
|
<div class="sample">
|
||||||
<xsl:element name="a">
|
<xsl:element name="a">
|
||||||
<xsl:attribute name="href">../api2/<xsl:value-of select="/api/records_name"/>.xml?limit=3</xsl:attribute>
|
<xsl:attribute name="href">../api2/<xsl:value-of select="/api/records_name"/>.xml?limit=3</xsl:attribute>
|
||||||
@@ -46,7 +59,9 @@
|
|||||||
<h2>Fields list:</h2>
|
<h2>Fields list:</h2>
|
||||||
<xsl:for-each select="/api/fields/*">
|
<xsl:for-each select="/api/fields/*">
|
||||||
<h3><xsl:value-of select="local-name()"/></h3>
|
<h3><xsl:value-of select="local-name()"/></h3>
|
||||||
Name: <xsl:value-of select="local-name()"/><br />
|
<xsl:if test="label!=''">
|
||||||
|
Label: "<xsl:value-of select="label"/>"<br />
|
||||||
|
</xsl:if>
|
||||||
<xsl:if test="filter!=''">
|
<xsl:if test="filter!=''">
|
||||||
Filter: <xsl:value-of select="filter"/><br />
|
Filter: <xsl:value-of select="filter"/><br />
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ scaffolding(this_model,
|
|||||||
"description",
|
"description",
|
||||||
"locatiekey",
|
"locatiekey",
|
||||||
"bookingdiscipline",
|
"bookingdiscipline",
|
||||||
"bookingconfigurations.roomconfiguration"
|
"bookingconfigurations.bookingroom"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
@@ -29,8 +29,8 @@ scaffolding(this_model,
|
|||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
"bookingdiscipline",
|
"bookingdiscipline",
|
||||||
"bookingconfigurations.roomconfiguration",
|
"bookingconfigurations.bookingroom",
|
||||||
"rooms.ruimtekey"
|
"physicalrooms.ruimtekey"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
|
|||||||
@@ -927,11 +927,18 @@ Perslid.prototype.checkAutorisation_readit = function _checkAutorisation_readit(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Request.QueryString("api2").Count > 0)
|
if (Request.QueryString("api2").Count > 0)
|
||||||
|
{
|
||||||
|
if (Request.QueryString("format") == 'doc')
|
||||||
|
{
|
||||||
|
shared.simpel_page(L("lcl_no_auth") + " ({0})".format(String(autfunction)));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Response.Status = '403 Forbidden';
|
Response.Status = '403 Forbidden';
|
||||||
// Response.Write(L("lcl_no_auth")); ?
|
// Response.Write(L("lcl_no_auth")); ?
|
||||||
Response.End();
|
Response.End();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
shared.simpel_page(L("lcl_no_auth"));
|
shared.simpel_page(L("lcl_no_auth"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user