-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlerEditDB.cfm
47 lines (34 loc) · 1.41 KB
/
handlerEditDB.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<cfsetting showdebugoutput="FALSE" />
<cfparam name="form.ideVersion" default="1.0" type="any" />
<cfif structKeyExists(form, "ideeventinfo")>
<cfset builderHelper = new cfc.utils.builderHelper(form.ideEventInfo) />
<cfset application.BuilderHelper = builderHelper />
<cfelse>
<cfset BuilderHelper = application.builderHelper />
</cfif>
<cfset handlerPath = getDirectoryFromPath(cgi.script_name) & "editDB/editDatasource.cfm" />
<cfset handlerURL = "http://" & cgi.server_name & ":" & cgi.server_port & handlerPath />
<cfscript>
utils = New cfc.utils.utils();
cgiUtils = New cfc.utils.cgiUtils(cgi);
baseURL = cgiUtils.getBaseURL();
projectPath = BuilderHelper.getProjectPath();
resourcePath = BuilderHelper.getResourcePath();
configPath = utils.findConfig(projectPath,resourcePath);
schemaPath = utils.findConfig(projectPath,resourcePath, "schema");
</cfscript>
<cfif not FileExists(configPath)>
<cfscript>
messagesPath = getDirectoryFromPath(cgi.script_name) & "/messages.cfm";
messagesOptions = "?type=notanapplication";
messagesURL = baseURL & messagesPath & messagesOptions;
</cfscript>
<cf_ideWrapper messageURL="#messagesURL#" />
<cfabort>
</cfif>
<cfscript>
configXML = xmlParse(FileRead(configPath));
configXML.config.OverwriteDataModel.XMLText = TRUE;
FileWrite(configPath, configXML);
</cfscript>
<cf_ideWrapper messageURL="#handlerURL#" ideVersion="#builderHelper.getCFBuilderVersion()#" />