diff --git a/APPL/API2/api2_rest.inc b/APPL/API2/api2_rest.inc index 508ce3ed5a..cc974efe92 100644 --- a/APPL/API2/api2_rest.inc +++ b/APPL/API2/api2_rest.inc @@ -331,7 +331,8 @@ api2_rest = { style.resolveExternals = false; if (Request.QueryString("debug").Count == 0) { - style.load(Server.MapPath(rooturl + "/appl/api2/reference.xsl")); // De stylesheet laden. API's redeneren vanuit de root + var xslname = model.xslname || "reference.xsl"; + style.load(Server.MapPath(rooturl + "/appl/api2/" + xslname)); // De stylesheet laden. API's redeneren vanuit de root var str_antwoord = xml_antwoord.transformNode(style); // terugstoppen in antwoord } else diff --git a/APPL/API2/api_doc.asp b/APPL/API2/api_doc.asp new file mode 100644 index 0000000000..288e4bb7c6 --- /dev/null +++ b/APPL/API2/api_doc.asp @@ -0,0 +1,25 @@ +<%@ language = "JavaScript" %> +<% /* + $Revision$ + $Id$ + + File: default.asp + + Description: + Parameters: + Context: Documentatie van de api's + + Notes: Via /api2/doc.doc +*/ + DOCTYPE_Disable = true; + ANONYMOUS_Allowed = 1; // Eigenlijk niet waar. We regelen echter alles zelf + THIS_FILE = "appl/api/api_doc.asp"; + +%> + + + + +<% + api2_rest.process(model_doc); +%> \ No newline at end of file diff --git a/APPL/API2/model_doc.inc b/APPL/API2/model_doc.inc new file mode 100644 index 0000000000..227c9c7ec2 --- /dev/null +++ b/APPL/API2/model_doc.inc @@ -0,0 +1,35 @@ +<% /* + $Revision$ + $Id$ + + File: model_doc.inc + + Description: Doc model. + Parameters: + Context: + + Notes: +*/ + +%> + +<% +function model_doc() +{ + this.table = "apis"; + this.primary = "id"; + this.records_name = "apis"; + this.record_name = "api"; + + var apis = model_apis.REST_GET({}); + this.fields = {}; + for (var i = 0; i < apis.length; i++) + { + this.fields[ apis[i].id ] = { label: apis[i].id }; + } + + this.REST_GET = generic_REST_GET(this, {}); + + this.xslname = "model_doc.xsl"; +} +%> \ No newline at end of file diff --git a/APPL/API2/reference.xsl b/APPL/API2/reference.xsl index a0262be58b..be53850240 100644 --- a/APPL/API2/reference.xsl +++ b/APPL/API2/reference.xsl @@ -12,15 +12,39 @@