Files
Facilitor/APPL/API2/model_apis.inc
Jos Groot Lipman 896c7f7ab0 API 2.0 in wording: geautomatiseerd testen ondersteunen
svn path=/Website/trunk/; revision=21937
2014-06-18 12:48:46 +00:00

62 lines
1.8 KiB
PHP

<% /*
$Revision$
$Id$
File: model_apis.inc
Description: Api model. Dit bestand heeft niets met interfacing te maken
maar werkt uitsluitend op JSON-data
Parameters:
Context:
Notes:
*/
%>
<%
model_apis =
{
table: null,
primary: null,
records_name: "apis",
record_name: "api",
fields: [],
REST_GET: function _GET(params)
{
var autfunction = "WEB_PRSSYS"; // is dit niet erg streng?
params.authparams = user.checkAutorisation(autfunction, null, null, true); // pessimistisch
var api2_names = [];
var fullpath = Server.MapPath("./appl/api2");
var objFso = new ActiveXObject("Scripting.FileSystemObject");
var objFiles = objFso.GetFolder(fullpath);
var allFiles = new Enumerator(objFiles.files);
for (; !allFiles.atEnd(); allFiles.moveNext())
{
var attFile = allFiles.item();
var ext = objFso.GetExtensionName(attFile);
if ((attFile.name.indexOf("api_") == 0) && (ext == "asp"))
{
var name = attFile.name.substring(4, attFile.name.indexOf(".asp"))
api2_names.push({ id: name });
}
// Graag zou ik er ook info instoppen over het model zelf.
// Dan moet ik echter alle model_xxxx.inc bestanden includen wat ik niet wil.
// Daarom moet je zelf maar /api2/xxxx.api aanroepen voor de details
}
return api2_names;
},
PUT: function (params) /* update api */
{
},
POST: function (params) /* new api */
{
},
DELETE: function (params) /* delete api */
{
}
}
%>