Changeset 1755
- Timestamp:
- 09/01/08 14:21:56 (4 months ago)
- Files:
-
- coldbox/trunk/system/controller.cfc (modified) (3 diffs)
- coldbox/trunk/testharness/config/routes.cfm (modified) (2 diffs)
- coldbox/trunk/testharness/handlers/default.cfc (modified) (2 diffs)
- coldbox/trunk/testharness/handlers/ehGeneral.cfc (modified) (14 diffs)
- coldbox/trunk/testharness/layouts/Layout.Main.cfm (modified) (1 diff)
- coldbox/trunk/testharness/views/dspFlash.cfm (added)
- coldbox/trunk/testharness/views/navigation.cfm (modified) (1 diff)
- coldbox/trunk/testharness/views/vwHello.cfm (modified) (2 diffs)
- coldbox/trunk/testharness/views/vwQuote.cfm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
coldbox/trunk/system/controller.cfc
r1754 r1755 279 279 280 280 <!--- Set Next Event ---> 281 <cffunction name="setNextEvent" access="Public" returntype="void" hint="I Set the next event to run and relocate the browser to that event. " output="false">281 <cffunction name="setNextEvent" access="Public" returntype="void" hint="I Set the next event to run and relocate the browser to that event. If you are in SES mode, this method will use routing instead" output="false"> 282 282 <!--- ************************************************************* ---> 283 283 <cfargument name="event" hint="The name of the event to run." type="string" required="No" default="#getSetting("DefaultEvent")#" > 284 284 <cfargument name="queryString" hint="The query string to append, if needed." type="string" required="No" default="" > 285 <cfargument name="addToken" hint="W ether to add the tokens or not. Default is false" type="boolean" required="false" default="false" >285 <cfargument name="addToken" hint="Whether to add the tokens or not. Default is false" type="boolean" required="false" default="false" > 286 286 <cfargument name="persist" hint="What request collection keys to persist in the relocation" required="false" type="string" default=""> 287 <cfargument name="varStruct" required="false" type="struct" hint="A structure key-value pairs to persist.">287 <cfargument name="varStruct" hint="A structure key-value pairs to persist." required="false" type="struct" default="#structNew()#" > 288 288 <!--- ************************************************************* ---> 289 289 <cfset var EventName = getSetting("EventName")> 290 290 <cfset var frontController = listlast(cgi.script_name,"/")> 291 <cfset var oRequestContext = getRequestService().getContext()> 292 <cfset var routeString = 0> 291 293 292 294 <!--- Cleanup Event ---> … … 295 297 </cfif> 296 298 297 <!--- Persistance Logic ---> 298 <cfset persistVariables(argumentCollection=arguments)> 299 300 <!--- Push Timers ---> 301 <cfset pushTimers()> 302 303 <!--- Check if query String needs appending ---> 304 <cfif len(trim(arguments.queryString)) eq 0> 305 <cflocation url="#frontController#?#EventName#=#arguments.event#" addtoken="#arguments.addToken#"> 299 <!--- Are we in SES Mode? ---> 300 <cfif oRequestContext.isSES()> 301 <!--- setup the route ---> 302 <cfset routeString = replace(arguments.event,".","/","all")> 303 <cfif len(trim(arguments.queryString))> 304 <cfset routeString = routeString & "/" & replace(arguments.queryString,"&","/","all")> 305 <cfset routeString = replace(routeString,"=","/","all")> 306 </cfif> 307 <!--- Relocate with routing ---> 308 <cfset setNextRoute(route=routeString, 309 persist=arguments.persist,varStruct=arguments.varStruct, 310 addToken=arguments.addToken)> 311 306 312 <cfelse> 307 <cflocation url="#frontController#?#EventName#=#arguments.event#&#arguments.queryString#" addtoken="#arguments.addToken#"> 313 <!--- Persistance Logic ---> 314 <cfset persistVariables(argumentCollection=arguments)> 315 <!--- Push Timers ---> 316 <cfset pushTimers()> 317 <!--- Check if query String needs appending ---> 318 <cfif len(trim(arguments.queryString)) eq 0> 319 <cflocation url="#frontController#?#EventName#=#arguments.event#" addtoken="#arguments.addToken#"> 320 <cfelse> 321 <cflocation url="#frontController#?#EventName#=#arguments.event#&#arguments.queryString#" addtoken="#arguments.addToken#"> 322 </cfif> 308 323 </cfif> 309 324 </cffunction> … … 314 329 <cfargument name="route" hint="The route to relocate to, do not prepend the baseURL or /." type="string" required="yes" > 315 330 <cfargument name="persist" hint="What request collection keys to persist in the relocation" required="false" type="string" default=""> 316 <cfargument name="varStruct" required="false" type="struct" hint="A structure key-value pairs to persist.">331 <cfargument name="varStruct" hint="A structure key-value pairs to persist." required="false" type="struct"> 317 332 <cfargument name="addToken" hint="Wether to add the tokens or not. Default is false" type="boolean" required="false" default="false" > 318 333 <!--- ************************************************************* ---> coldbox/trunk/testharness/config/routes.cfm
r1612 r1755 59 59 Else, htmlBaseURL and sesBaseURL should be the same. 60 60 ---> 61 <cfset setBaseURL("http://# getSetting('MyBaseURL')#/coldbox/testharness/index.cfm")>61 <cfset setBaseURL("http://#cgi.http_host#/#getSetting('AppMapping')#/index.cfm")> 62 62 63 63 … … 111 111 112 112 <!--- STANDARD COLDBOX COURSES, DO NOT MODIFY UNLESS YOU DON'T LIKE THEM ---> 113 <cfset addCourse(":handler/:action /:id-numeric?")>113 <cfset addCourse(":handler/:action?/:id-numeric?")> 114 114 <!--- <cfset addCourse(":handler/:action?/:id?")> ---> 115 115 coldbox/trunk/testharness/handlers/default.cfc
r1751 r1755 48 48 49 49 <!--- RSS ---> 50 <!--- rss --->51 50 <cffunction name="rss" access="public" returntype="void" output="false" hint=""> 52 51 <cfargument name="Event" type="coldbox.system.beans.requestContext" required="yes"> … … 69 68 </cffunction> 70 69 70 <!--- testRoute ---> 71 <cffunction name="testRoute" access="public" returntype="void" output="false" hint=""> 72 <cfargument name="Event" type="coldbox.system.beans.requestContext" required="yes"> 73 <cfset var rc = event.getCollection()> 74 75 <cfset getPlugin("messagebox").setMessage("warning","I am relocating from <strong>default.testRoute</strong>")> 76 77 <cfset setNextEvent('default.index',"page=2&issues=1")> 78 </cffunction> 79 71 80 <!------------------------------------------- PRIVATE -------------------------------------------> 72 81 coldbox/trunk/testharness/handlers/ehGeneral.cfc
r1605 r1755 15 15 <cfcomponent name="ehGeneral" extends="baseHandler" output="false" autowire="true"> 16 16 17 <!--- Autowire Properties ---> 18 <cfproperty name="myMailSettings" type="ioc" scope="instance"> 19 20 21 <!--- ************************************************************* ---> 17 <!--- Autowire Properties ---> 18 <cfproperty name="myMailSettings" type="ioc" scope="instance"> 22 19 23 20 <cffunction name="init" access="public" returntype="any" output="false"> … … 28 25 </cffunction> 29 26 30 <!--- ************************************************************* --->31 32 <cffunction name="onRequestStart" access="public" output="false" returntype="void">33 <cfargument name="Event" type="coldbox.system.beans.requestContext">34 </cffunction>35 36 <!--- ************************************************************* --->37 38 27 <cffunction name="onApplicationStart" access="public" output="false" returntype="void"> 39 28 <cfargument name="Event" type="coldbox.system.beans.requestContext"> … … 52 41 </cffunction> 53 42 54 <!--- ************************************************************* --->55 56 <cffunction name="onRequestEnd" access="public" output="false" returntype="void">57 <cfargument name="Event" type="coldbox.system.beans.requestContext">58 </cffunction>59 60 <!--- ************************************************************* --->61 43 62 44 <cffunction name="onSessionStart" access="public" output="false" returntype="void"> … … 68 50 </cffunction> 69 51 70 <!--- ************************************************************* --->71 72 52 <cffunction name="onSessionEnd" access="public" output="false" returntype="void"> 73 53 <cfargument name="Event" type="coldbox.system.beans.requestContext"> … … 78 58 </cffunction> 79 59 80 <!--- ************************************************************* --->81 82 60 <cffunction name="preHandler" access="public" output="false" returntype="void"> 83 61 <cfargument name="Event" type="coldbox.system.beans.requestContext"> … … 95 73 </cfscript> 96 74 </cffunction> 97 98 <!--- ************************************************************* --->99 75 100 76 <cffunction name="dspHello" access="public" returntype="void" output="false"> … … 109 85 110 86 <cfset getPlugin("timer").start("New Instance Creation")> 87 111 88 <!--- Get a new instance plugin ---> 112 89 <cfset event.setValue("mylogger", getPlugin("logger",false,true) )> … … 116 93 <!--- Create a tracer message ---> 117 94 <cfset logger.tracer("Starting dspHello. Using default name")> 118 119 95 <cfset logger.tracer("arguments: #arguments.toString()#")> 120 96 … … 137 113 138 114 <!--- Java Loader ---> 139 140 115 <cfif getColdboxOCM().lookup("isColdfusionMX7") and getColdboxOCM().get("isColdfusionMX7") eq true> 141 116 <cfset Event.setvalue("HelloWorldObj", getPlugin("JavaLoader").create("HelloWorld").init())> … … 148 123 <cfset Event.setValue("MyQuote", renderView("vwQuote"))> 149 124 150 <!--- Cache for 5 minutes. --->151 <cfset cacheParams.timeout = 5>152 153 125 <!--- Run Private Event ---> 154 126 <cfset runEvent(event="ehGeneral.myPrivateEvent",private=1)> … … 157 129 <cfset Event.setView(name="vwHello",cache=true,cacheTimeout=5)> 158 130 </cffunction> 159 160 <!--- ************************************************************* --->161 131 162 132 <cffunction name="doChangeLocale" access="public" returntype="void" output="false"> … … 167 137 </cffunction> 168 138 169 <!--- ************************************************************* --->170 171 139 <cffunction name="testflash" access="public" output="false" returntype="void"> 172 140 <cfargument name="Event" type="coldbox.system.beans.requestContext"> … … 175 143 rc.lname = "majano"; 176 144 rc.fname = "luis"; 177 setNextEvent(event='ehGeneral.dspHello',persist='lname,fname'); 145 setNextEvent(event='ehGeneral.dspFlash',persist='lname,fname'); 146 </cfscript> 147 </cffunction> 148 149 <cffunction name="dspFlash" access="public" output="false" returntype="void"> 150 <cfargument name="Event" type="coldbox.system.beans.requestContext"> 151 <cfscript> 152 var rc = event.getCollection(); 153 154 event.setView("dspFlash"); 178 155 </cfscript> 179 156 </cffunction> … … 259 236 <cfset event.setView('vwLoginForm')> 260 237 </cffunction> 238 261 239 <!------------------------------------------- PRIVATE METHDOS -------------------------------------------> 262 240 coldbox/trunk/testharness/layouts/Layout.Main.cfm
r1425 r1755 48 48 <td width="77" height="30" align="center" bgcolor="#eeeeee" valign="top"> 49 49 <cfoutput> 50 #renderView("navigation" ,true,1)#50 #renderView("navigation")# 51 51 </cfoutput> 52 52 </td> coldbox/trunk/testharness/views/navigation.cfm
r1751 r1755 1 1 <cfoutput> 2 <p><a href=" index.cfm">#getresource("homebutton")#</a></p>3 <p><a href=" index.cfm?#getController().getSetting("eventName")#=log.ehTest.dspApi">Call Package Event</a></p>4 <p><a href=" index.cfm?fwreinit=1">RELOAD</a></p>5 <p><a href=" index.cfm?#getController().getSetting("eventName")#=testing">Error</a></p>6 <p><a href=" index.cfm?#getController().getSetting("eventName")#=ehGeneral.doColdboxFactoryTests">ColdBox Factory Tests</a></p>7 <p><a href=" index.cfm?#getController().getSetting("eventName")#=ehGeneral.testflash">Test Flash Persist</a></p>8 <p><a href=" index.cfm?#getController().getSetting("eventName")#=ehGeneral.purgeEvents">Purge All Events</a></p>2 <p><a href="#getSetting("sesbaseURL")#">#getresource("homebutton")#</a></p> 3 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=log.ehTest.dspApi">Call Package Event</a></p> 4 <p><a href="#getSetting("sesbaseURL")#?fwreinit=1">RELOAD</a></p> 5 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=testing">Error</a></p> 6 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.doColdboxFactoryTests">ColdBox Factory Tests</a></p> 7 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.testflash">Test Flash Persist</a></p> 8 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.purgeEvents">Purge All Events</a></p> 9 9 <hr> 10 <p><a href=" index.cfm?#getController().getSetting("eventName")#=ehGeneral.dspFolderTester1">Test Folder Layout 1</a></p>11 <p><a href=" index.cfm?#getController().getSetting("eventName")#=ehGeneral.dspFolderTester2">Test Folder Layout 2</a></p>10 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.dspFolderTester1">Test Folder Layout 1</a></p> 11 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.dspFolderTester2">Test Folder Layout 2</a></p> 12 12 <hr> 13 <p><a href="index.cfm?#getController().getSetting("eventName")#=ehTest.dspExternal">External Handler</a></p> 14 <p><a href="index.cfm?#getController().getSetting("eventName")#=ehGeneral.externalview">External View</a></p> 15 <p><a href="index.cfm?#getController().getSetting("eventName")#=ehSecure.dspUser">Security Int Test</a></p> 16 <p><a href="index.cfm?#getController().getSetting("eventName")#=default.implicit">Implicit Views</a></p> 17 <p><a href="index.cfm?#getController().getSetting("eventName")#=default.rss">RSS Reader</a></p> 13 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehTest.dspExternal">External Handler</a></p> 14 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.externalview">External View</a></p> 15 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehSecure.dspUser">Security Int Test</a></p> 16 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=default.implicit">Implicit Views</a></p> 17 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=default.rss">RSS Reader</a></p> 18 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=default.testroute">Test SetNextEvent Route</a></p> 19 <p><a href="#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=default">Default Handler</a></p> 18 20 </cfoutput> coldbox/trunk/testharness/views/vwHello.cfm
r1695 r1755 33 33 34 34 <hr> 35 <strong>Flash Persistance Test: </strong> <br /> 36 Fname = #event.getValue("fname","")#<br /> 37 Lname = #event.getValue("lname","")#<br /> 38 39 <hr> 40 <input type="button" name="logentries" value="Call custom Plugin & Flash Tracer" onClick="window.location = 'index.cfm?#getController().getSetting("eventName")#=ehGeneral.docustomplugin'"> 35 <input type="button" name="logentries" value="Call custom Plugin & Flash Tracer" onClick="window.location = '#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.docustomplugin'"> 41 36 <cfif Event.getValue("usecustomplugin",false)> 42 37 <cfdump var="#getMyPlugin("myclientstorage").getvar("MyCustomVariable")#" label="Custom Variable"> … … 56 51 57 52 <hr> 58 <input type="button" name="logentries" value="Log Entries" onClick="window.location = ' index.cfm?#getController().getSetting("eventName")#=ehGeneral.doLog'">59 <input type="button" name="logentries" value="Clear Log" onClick="window.location = ' index.cfm?#getController().getSetting("eventName")#=ehGeneral.doClearLog'">53 <input type="button" name="logentries" value="Log Entries" onClick="window.location = '#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.doLog'"> 54 <input type="button" name="logentries" value="Clear Log" onClick="window.location = '#getSetting("sesbaseURL")#?#getController().getSetting("eventName")#=ehGeneral.doClearLog'"> 60 55 File Size: #NumberFormat(getPlugin("Utilities").FileSize(getSetting("ColdboxLogsLocation")))# bytes 61 56 coldbox/trunk/testharness/views/vwQuote.cfm
r1509 r1755 1 1 <h2>Vistanme Despacio que tengo Prisa</h2> 2 2 <cfoutput>#getPlugin("messagebox").renderit()#</cfoutput> 3 3 <p><Cfoutput>#event.getValue("test","Nothing")#</Cfoutput></p>
