Help with a request context validator

Ok I can see that a custom Request Context Decorator is a one of thing. I am in the need to create a few, one for each module that I create.

So is it possible to do this, and have multiple? And on a side note how would I register this from a Module?

For example I know on the module onLoad() I could easily change the setting requestContextDecorator to that of the CFC. But how would I set this up for a Module is it something like modules.forums.interceptor.request or would it be forums@interceptor.request?

So the question is it possible to get a ticket in to have multiple RCD’s?

Regards,

Andrew Scott

http://www.andyscott.id.au/

Technically, you can wrap the request context in any way you see fit as long as it follows the decorator pattern. However, since you want it for your module ONLY, then I would do this with a preProcess interceptor that only executes when my MODULE executes.

Something like this in pseudo code:

// add eventPattern annotation so only fires when myModule: is detected in event string.
function preProcess(event, interceptData) eventPattern="^myModule/:"{

// create my own context decorator
var myContext = createObject(“component”,“myContent”).init( event );
// replace it
controller.getRequestService().setContext( myContext );
}

Thanks Luis, but I need to ask how this would work if I wanted to do something like this for all my Modules? I don’t think I see a problem, but I just want to concur with you that this will not have any undesired race conditional problems.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Thanks Luis, but I need to ask how this would work if I wanted to do something like this for all my Modules? I don’t think I see a problem, but I just want to concur with you that this will not have any undesired race conditional problems.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Cheers I have it working, but I wasn’t sure if another module run at the same time would stuff up the setting of the RC in your example.

Now I tried using the : in the eventPattern but it never worked, would that be because my routes don’t use the :?

Regards,

Andrew Scott

http://www.andyscott.id.au/