FSN#37027 scaffolding via API2 niet meer ondersteunen
svn path=/Website/trunk/; revision=29892
This commit is contained in:
@@ -21,22 +21,14 @@
|
||||
</rule>
|
||||
<!-- /api2/buildings/1234.xml?... /default.asp?api2=buildings&format=xml&id=1234&... -->
|
||||
<rule name="api2SingleRecord" stopProcessing="true">
|
||||
<match url="^api2/([a-z0-9_]+)/(\d+)\.(xml|json|html|api|scf|doc)/?" />
|
||||
<match url="^api2/([a-z0-9_]+)/(\d+)\.(xml|json|html|api|doc)/?" />
|
||||
<action type="Rewrite" url="default.asp?api2={R:1}&format={R:3}&id={R:2}" appendQueryString="true" />
|
||||
</rule>
|
||||
<rule name="scfSingleRecord" stopProcessing="true">
|
||||
<match url="^api2/([a-z0-9_]+)/(\d+)/?" />
|
||||
<action type="Rewrite" url="default.asp?api2={R:1}&format=scf&id={R:2}" appendQueryString="true" />
|
||||
</rule>
|
||||
<!-- /api2/buildings.xml?... /default.asp?api2=buildings&format=xml&... -->
|
||||
<rule name="api2List" stopProcessing="true">
|
||||
<match url="^api2/([a-z0-9_]+)\.(xml|json|html|api|scf|doc)/?" />
|
||||
<match url="^api2/([a-z0-9_]+)\.(xml|json|html|api|doc)/?" />
|
||||
<action type="Rewrite" url="default.asp?api2={R:1}&format={R:2}" appendQueryString="true" />
|
||||
</rule>
|
||||
<rule name="scfList" stopProcessing="true">
|
||||
<match url="^api2/([a-z0-9_]+)/?" />
|
||||
<action type="Rewrite" url="default.asp?api2={R:1}&format=scf" appendQueryString="true" />
|
||||
</rule>
|
||||
<!-- 2015.1 experimenteel: -->
|
||||
<rule name="unsupportedMelding" stopProcessing="true">
|
||||
<match url="^melding/(\d+)" />
|
||||
|
||||
@@ -30,38 +30,7 @@ if (Request.QueryString("API2").Count>0)
|
||||
{
|
||||
var fname = String(Request.QueryString("API2")(1));
|
||||
var format = String(Request.QueryString("format")).toLowerCase();
|
||||
if (format == "scf") // zelf api_bestand maken
|
||||
{
|
||||
if (Application("otap_environment") != "O")
|
||||
SCF_ONLY_ON_OTAP_O;
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
var modelname = "appl/api2/model_" + fname + ".inc"
|
||||
if (!fso.FileExists(Server.MapPath(modelname)))
|
||||
{
|
||||
Response.Write("Model '" + modelname + "' niet gevonden.");
|
||||
Response.End;
|
||||
}
|
||||
|
||||
var scf_folder = Server.MapPath(rooturl + "/temp/scf");
|
||||
if (!fso.FolderExists(scf_folder))
|
||||
fso.CreateFolder(scf_folder);
|
||||
var outfname = scf_folder + "/api_" + fname + ".asp";
|
||||
if (!fso.FileExists(outfname))
|
||||
{
|
||||
var s = "<" + "%@language = 'javascript' %" + ">"
|
||||
+ "\n<!-- #include file='../../appl/scf/scaffolding.inc' -->"
|
||||
+ "\n<!-- #include file='../../" + modelname + "' -->"
|
||||
+ "\n<" + "%"
|
||||
+ "\n if (Application('otap_environment') != 'O')"
|
||||
+ "\n SCF_ONLY_ON_OTAP_O;"
|
||||
+ "\n scaffolding(model_" + fname + ", {});"
|
||||
+ "\n%" + ">";
|
||||
var outFile = fso.OpenTextFile(outfname, 2, true);
|
||||
outFile.Write(s.replace(/\n/g, "\x0D\x0A"));
|
||||
outFile.Close();
|
||||
}
|
||||
Server.Transfer("temp/scf/api_" + fname + ".asp");
|
||||
}
|
||||
if (!fname.match(/[^a-zA-Z0-9\_]/)) // Safe: alleen letters, cijfer en _ in filenaam
|
||||
{
|
||||
var fso = Server.CreateObject("Scripting.FileSystemObject");
|
||||
|
||||
@@ -978,7 +978,7 @@ function abort_with_warning(warning, code)
|
||||
var xml_antwoord = api2_rest.json2xml([data.error], { records_name: "errors", record_name: "error"}, true);
|
||||
Response.Write(xml_antwoord.xml);
|
||||
}
|
||||
else if (format == "scf" || format == "html")
|
||||
else if (format == "html")
|
||||
{
|
||||
Response.ContentType = "text/html";
|
||||
var str_antwoord = "<!DOCTYPE html><html><head></head><body><pre>"
|
||||
|
||||
Reference in New Issue
Block a user