ColdFusion admin API CFEclipse snippets
ColdFusion
Aaron Lynch has posted some code examples for accessing the ColdFusion Admin Api. It is often a minor pain to have to go into the admin and turn on/off debugging on your development machine to test certain things. Additionally in our environment, in order to restart the ColdFusion Server service I have to remote into the server, open up services, and restart. Being able to open the CFEclipse Scribble Pad, and having quick and dirty access to these things has saved me time already this morning!
So here are a couple of snippets:
[note: in the examples, the password is set to "coldfusion". Alter that as you need to.]
So here are a couple of snippets:
[note: in the examples, the password is set to "coldfusion". Alter that as you need to.]
- Restart the ColdFusion Server by typing restart[ctrl][shift][period] and saving/running. Here is the snippet:
<cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("coldfusion");
// Instantiate the serverInstance object.
myServer = createObject("component","cfide.adminapi.serverInstance");
myServer.restartInstance("cfusion");
</cfscript>
- Turn On/Off debugging by typing debug[ctrl][shift][period]. You are then prompted for enable:true/false. Then save/run. Here is the snippet for that one:
<cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("coldfusion");
myDebugging = createObject("component","cfide.adminapi.debugging");
myDebugging.setDebugProperty("enableDebug",$${enabled:true|false});
myDebugging.setDebugProperty("enableRobustExceptions",$${enabled:true|false});
myDebugging.setDebugProperty("showGeneralInfo",$${enabled:true|false});
myDebugging.setDebugProperty("templateModel",$${enabled:true|false});
myDebugging.setDebugProperty("showDatabaseInfo",$${enabled:true|false});
myDebugging.setDebugProperty("showExceptionInfo",$${enabled:true|false});
myDebugging.setDebugProperty("showTrace",$${enabled:true|false});
myDebugging.setDebugProperty("showTimer",$${enabled:true|false});
myDebugging.setDebugProperty("showExecutionTime",$${enabled:true|false});
myDebugging.setDebugProperty("templateExecutionTime",$${enabled:true|false});
myDebugging.setDebugProperty("showVariables",$${enabled:true|false});
myDebugging.setDebugProperty("showFormVariables",$${enabled:true|false});
myDebugging.setDebugProperty("showCGIVariables",$${enabled:true|false});
myDebugging.setDebugProperty("showURLVariables",$${enabled:true|false});
</cfscript>





Loading....