conventions and inheritance

Hi guys,

I have a General handler which extends a BaseHandler. The BaseHandler has the sessionService and ORMService injected. I also have a preHandler function within BaseHandler to place sessionService into the RC in order to reference the sessionService within all of my layouts and handlers that inherit BaseHandler

After someone logs in they are redirected to the account section of the site. Mysite.com/account/ Rather than have an Account Handler I have a folder in the handlers folder called Account (to house and secure all account handlers) and within the Account folder are handlers for Profile, Billing, etc. Since Coldbox is using conventions to automatically show the account/index view I am getting an error saying that rc.sessionService is not available when i'm at Mysite.com/account.

I'm wondering if anyone has a recos on how to get around this when using conventions. There is essentially NO Account handler that inherits BaseHandler since coldbox conventions are taking over at this point. The error does go away when I drill down to account/profile since there is a Profile handler.

Thoughts?

Thanks.

Nolan

Well, i’m not sure if this is the correct approach but I was able to get around it by modifying my routes like so:

addRoute(pattern=“account/:handler/:action?”); //where this would be something like /account/billing/whatever
addRoute(pattern=“account/”, handler=“account.Account”, action=“index” ); // and this would explicitly tell CB to hit the Account handler which would then inherit BaseHandler which has reference to the sessionService

Appreciate any feedback on this

Thanks.

Nolan

You might be better to use modules in this type of scenario.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Nolan Dubeau
Sent: Thursday, 7 July 2011 4:40 AM
To: ColdBox Platform
Subject: [coldbox:10684] conventions and inheritance

Hi guys,

I have a General handler which extends a BaseHandler. The BaseHandler has
the sessionService and ORMService injected. I also have a preHandler
function within BaseHandler to place sessionService into the RC in order

to

reference the sessionService within all of my layouts and handlers that
inherit BaseHandler

After someone logs in they are redirected to the account section of the

site.

Mysite.com/account/ Rather than have an Account Handler I have a folder

in

the handlers folder called Account (to house and secure all account
handlers) and within the Account folder are handlers for Profile, Billing,

etc.

Since Coldbox is using conventions to automatically show the account/index
view I am getting an error saying that rc.sessionService is not available

when