0

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.]
  • 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>
When you go out to his site check out his Flash Paper cheat sheets for all the API pieces.  He put those together using the CFC documenting tool that I blogged about the other day.
tags:
ColdFusion
news said:
 
      Hey man, thanks for article, but I still have recurrent problems with explore your site in Internet Explorer 4.0. please fix this problem. it's not very convinient to browse your site if there are no design :(       
 
posted 1237 days ago
Add Comment Reply to: this comment OR this thread
 
 
If you are using a browser that is 10 years old (released 1997), then this site is the least of your problems. Good luck with that.
 
posted 1236 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Various Links

HikeTheCanyon.org - Rim-to-Rim hike of the Grand Canyon.
Dave Shuck on Twitter - Follow me on Twitter.
Scriptalizer - Minify your Javascript and CSS