variables.ADFversion = "1.6.2"; // use a dot delimited version number // ADF Build Revision Number variables.buildRev = "1220-hf2"; // ADF Codename variables.buildName = "Spy Hunter"; // CS product version, get the decimal value variables.csVersion = Val(ListLast(request.cp.productversion, " ")); // Check if the ADF variable does not exist in server scope if ( NOT StructKeyExists(server, "ADF") ) { server.ADF = StructNew(); server.ADF.environment = StructNew(); // Stores the App and Site configuration data } server.ADF.beanConfig = StructNew(); // Stores the server bean configuration server.ADF.objectFactory = StructNew(); // Stores the server object factory server.ADF.dependencyStruct = StructNew(); // Stores the bean dependency list server.ADF.library = StructNew(); // Stores library components server.ADF.proxyWhiteList = StructNew(); // Stores Ajax Proxy White List server.ADF.dir = expandPath('/ADF'); server.ADF.buildErrors = ArrayNew(1); // Place to store errors that occur while building the ADF server.ADF.version = getADFversion(); // Get the ADF version server.ADF.csVersion = getCSVersion(); // Get the ADF version server.ADF.buildRev = variables.buildRev; server.ADF.buildName = variables.buildName; // Build object factory server.ADF.beanConfig = createObject("component","ADF.core.lightwire.BeanConfig").init(); server.ADF.objectFactory = createObject("component","ADF.core.lightwire.LightWireExtendedBase").init(server.ADF.beanConfig); // Load the Ajax white list proxy server.ADF.proxyWhiteList = createObject("component","ADF.core.Config").getConfigViaXML(expandPath("/ADF/lib/ajax/proxyWhiteList.xml")); var status = false; if ( StructKeyExists(application,"ADF") AND StructKeyExists(application.ADF,"siteDevMode") AND IsBoolean(application.ADF.siteDevMode) AND application.ADF.siteDevMode ) status = true; return status; var rtnMsg = "ADF Reset Error: You must be logged in to perform this operation."; var ADFReset = false; var returnStruct = StructNew(); var siteName = ""; var logFileName = ""; var ADFversion = "v" & getADFversion(); var forceReset = false; var dump = ""; var devModeStatus = false; // Check if the ADF space exists in the SERVER and APPLICATION if ( NOT StructKeyExists(server, "ADF") OR NOT StructKeyExists(application, "ADF") ) forceReset = true; // 2010-06-23 jrybacek Determine if user is logged in. // 2010-06-23 jrybacek Determine how much of the ADF is being requested to be reset switch (uCase(arguments.type)) { case "ALL": // 2010-06-23 jrybacek Reload ADF server createObject("component", "ADF.core.Core").init(); // 2010-06-23 jrybacek Reload ADF site createObject("component", "#request.site.name#._cs_apps.ADF").init(); rtnMsg = "ADF #ADFversion# has been reset successfully!"; ADFReset = true; break; case "SERVER": // 2010-06-23 jrybacek Reload ADF server createObject("component", "ADF.core.Core").init(); rtnMsg = "ADF #ADFversion# server has been reset successfully!"; ADFReset = true; break; case "SITE": // 2010-06-23 jrybacek Reload ADF site createObject("component", "#request.site.name#._cs_apps.ADF").init(); rtnMsg = "ADF #ADFversion# site '#request.site.name#' has been reset successfully!"; ADFReset = true; break; default: rtnMsg = "Invalid argument '#arguments.type#' passed to method reset."; break; } if ( ADFReset ) { //Reset the cache. application.ADF.cache = StructNew(); // Get the Dev Mode Status to display with reset message devModeStatus = getSiteDevModeStatus(); // Append the dev or production mode text to the rtnMsg string if ( devModeStatus ) rtnMsg = rtnMsg & " [Development Mode]"; else rtnMsg = rtnMsg & " [Production Mode]"; }

server.ADF Does not exist.

// // 2011-06-29 - MT - Set a response header indicating if the ADF was reset or not // getPageContext().getResponse().setHeader( "X-CS_ADF_Reset" , "#ADFReset#" ); returnStruct.success = ADFReset; returnStruct.message = " " & DateFormat(now(),"yyyy-mm-dd") & " " & TimeFormat(now(),"hh:mm:ss") & " - " & rtnMsg; returnStruct.forceResetStatus = forceReset; returnStruct.devModeStatus = devModeStatus; return returnStruct;