session based i18N view cache

OK so I rushed home to try this out using a test interceptor with the
above code. When I run my page now i get this error:

Interceptor: test not found in any state:
ORMPostNew,afterPluginCreation,ORMPostLoad,afterHandlerCreation,afterAspectsLoad.

If I replace "onRequestCapture" with something like "preProcess" it
works fine. I also tried "requestCapture" instead of
"onRequestCapture.

I grabbed 3.0.0_M6.2 from SVN to make sure it wasn't a version
problem, but same same.

here's my interceptor class:

<cfcomponent name="TestInterceptor"
       hint="This is a simple test interceptor"
       output="false">

<!------------------------------------------- CONSTRUCTOR
------------------------------------------->

  <cffunction name="Configure" access="public" returntype="void"
hint="This is the configuration method for your interceptors"
output="false" >
    <!--- Nothing --->

  </cffunction>

<!------------------------------------------- INTERCEPTION POINTS
------------------------------------------->

  <!--- Pre execution process --->
  <cffunction name="onRequestCapture" access="public" returntype="void"
hint="Executes before any event execution occurs" output="true" >
    <!--- *************************************************************
--->
    <cfargument name="event" required="true" type="any" hint="The event
object.">
    <cfargument name="interceptData" required="true" type="struct"
hint="interceptData of intercepted info.">
    <!--- *************************************************************
--->
    <cfscript>
      var rc = Event.getCollection();

      $dump("I am in requestCapture",true);

    </cfscript>
  </cffunction>

</cfcomponent>

From github not svn

ok got it from Git :slight_smile:

I have the interceptor running now, but it doesn't appear to do what I
need in terms of making the cache unique to locale. It would appear
that the cache key is set before this thing fires. I have only two
interceptors set up to test (autowire and this one, in that order)

my onRequestCapture method sets fc.foo = createUUID();

...now I would expect that this would create a new cache item every
request, am I right?

when I run my cached event though (event=myHandler.myCachedEvent) I
can refresh it a number of times but only one cached item is created.

When I *manually* (via URL) add something to RC scope
(event=myHandler.myCachedEvent&foo=xxx) then I get a new cache entry
as expected.

Am I doing something wrong or does the cache engine hash the rc scope
before onRequestCapture?

Here's the debug trace in case that helps -- the onRequestCapture
interceptor is firing correctly

interception [onRequestCapture]
{EVENT={Security.listUser}
userLocale={_en_AU_8EFBF6B9602070995344F01DC59D2093_13900_96287697}}

interception [afterHandlerCreation]
{EVENT={Security.listUser}
userLocale={_en_AU_8EFBF6B9602070995344F01DC59D2093_13900_96287697}}
{cbox_eventCacheableEntry={cbox_event-
Security.listUser--22DD58E407D50A2844FA8C48FC497664}}

nvoking runEvent [General.onRequestStart]

Quick bump -- am I doing something wrong or does the onRequestCapture
interception point occur *after* the rc scope is hashed for use as a
cache key?

it is before the event caching occurs

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

ok, then it doesn't appear to work properly from a caching
perspective. Adding things to the RC collection at onRequestCapture
doesn't result in new cached entries per event.

As I mentioned above, I tried adding foo=CreateUUID() to the rc scope
to see if it would generate a new cache entry each request, but it
doesn't.

Yes, thanks, good catch, I just realized this is a bug. I will be submitting a patch tonight.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

This is now on github and I will be releasing a patch soon.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Awesome. Thanks Luis