FSN#39982 Flexfiles eenvoudiger verplaatsen via *_DATA

svn path=/Website/branches/v2016.3/; revision=33267
This commit is contained in:
Jos Groot Lipman
2017-03-27 13:10:42 +00:00
parent 8d469ab32e
commit cfe6c2e880

View File

@@ -24,20 +24,15 @@ settings =
cache : { perfmon_threshold: { v: 2000 }, // is al nodig om de settings uit de database te kunnen halen
// Onderstaande settings hebben een default die custpath afhankelijk is.
// In de database kunnen ze nog wel overruled worden
image_path_virtual: { v: custpath },
flexfilespath: { v: Server.MapPath(custpath + "/flexfiles") },
bdradrfiles_path: { v: Server.MapPath(custpath + "/bdradrfiles") },
fg_dwf_path: { v: Server.MapPath(custpath + "/dwf/") + "/" },
fg_dwf_path_concept: { v: Server.MapPath(custpath + "/dwf/") + "/concept/" },
fg_vlucht_path: { v: Server.MapPath(custpath + "/dwf/") + "/vlucht/" },
fg_symbols_path: { v: Server.MapPath(custpath + "/dwf/") + "/symbols/" },
fg_dwf_path_prj: { v: Server.MapPath(custpath + "/dwf/") + "/prj/" },
fg_dwf_path: { v: Server.MapPath(custpath) },
// Merk op dat onderstaande paden (ook) via http benaderd worden. Daarom in
// eerste instantie nog geen Server.MapPath
// Sommige staan nog onder /flexfiles/ voor backwards compatibiliteit hoewel
// logischer is om ze ooit allemaal onder een /photos/ te plaatsen
image_path_virtual: { v: custpath },
menu_image_path: { v: custpath + "/flexfiles/menu/" },
prs_image_path: { v: custpath + "/flexfiles/prs/" },
res_image_path: { v: custpath + "/photos/" },
@@ -92,13 +87,34 @@ settings =
v = this.cache[n].v;
t = typeof v;
}
// Normaal gesproken zijn dit absolute paden maar we staan ook relatieve
// paden ten opzichte van de root toe
if (n == "flexfilespath" || n == "fg_dwf_path")
{
if (v.substr(0,1) == '*') // *_DATA wordt /branch20163_DATA of FPlace5i_DATA
{
v = Server.MapPath(rooturl) + v.substr(1) + "/" + customerId;
var fso = Server.CreateObject("Scripting.FileSystemObject");
v = fso.GetAbsolutePathName(v); // Technisch niet nodig maar toch '..' wegwerken
__Log("Path {0} is set to {1}".format(n, v));
}
}
Application("SET_T_" + n) = t; // Is voor alle klanten gelijk
Application("SET_" + customerId + "_" + n) = v;
//Response.Write(oRs("fac_setting_name").Value + ": " + typeof v);
oRs.MoveNext();
}
oRs.Close();
// De diverse dwf-paden zijn altijd onder het 'hoofdpad'
var fg_dwf_path = Application("SET_" + customerId + "_fg_dwf_path");
Application("SET_" + customerId + "_fg_dwf_path") = fg_dwf_path + "/dwf/";
Application("SET_" + customerId + "_fg_dwf_path_concept") = fg_dwf_path + "/dwf/concept/";
Application("SET_" + customerId + "_fg_vlucht_path") = fg_dwf_path + "/dwf/vlucht/";
Application("SET_" + customerId + "_fg_symbols_path") = fg_dwf_path + "/dwf/symbols/";
Application("SET_" + customerId + "_fg_dwf_path_prj") = fg_dwf_path + "/dwf/prj/";
// Eigenlijk moet DBLANG ook gewoon een setting worden. Simuleer dat hier
oRs = Oracle.Execute("SELECT fac_version_lang FROM fac_version");
Application("SET_T_DB_LANG") = "string"; // Is voor alle klanten gelijk