Admin Modules keeping the routes consistent

While adding a module I have been trying to get the routes to be consistent with the Admin, I have the routes working sort of. But when I do any actions like saving I get errors, or it is accessible outside of the admin.

So my question is if I want to keep the secured login for the module, and I wish to call my handlers what is the best way to achieve

/cbadmin/mymodule/handler/action

I have almost tried everything.

Hi Andrew,

We added a buildModuleLink() to the cb helper for this. The route for admin module calls is:

/cbadmin/module/:moduleName/:modulehandler/:moduleAction?

You also get all the name value pairs by convention as well.

Your module entry point is also registered as a ColdBox module so you can also execute it as a ColdBox module

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

And how to you call this?

Also setNextEvent(‘handler/action’); will no longer work for these modules either, is there some other magic needed here?

Well you kept this a secret but it still refuses to work

prc.CBHelper.buildModuleLink(‘myModule’, ‘settings.savesetting’)

produces

http://192.168.2.10:81/cbadmin/myModule/settings/savesetting

Good point. I will make a cb.setNextModuleEvent()

That way it is consistent.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

And what about buildModuleLink() doesn’t work.

But that looks ok, as it creates a cbadmin module link, why is it wrong?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

Because it doesn’t work.

prc.CBHelper.buildModuleLink(‘myModule’, ‘settings.savesettings’)

Throws an error in the url.

Luis,

The cbhelper.buildModuleLink() does not produce the same link as the menuService.buildModuleLink().

menuService.buildModuleLink(‘helloContentBox’,‘home’)

Produces : http://myblog.local/cbadmin/module/helloContentBox/home

cbhelper.buildModuleLink(‘helloContentBox’,‘home’)

Produces : http://myblog.local/cbadmin/helloContentBox/home

If they are supposed to produce the same link then the cbhelper method is missing the “module” slug.

Michael

Got it thanks does a ticket exist for this if not can you guys create it please.

Yes

Luis,

Since they are supposed to be the same, I went ahead and fixed and submitted a pull request.

Michael

Is there any news on this yet?

And you mention cb.setNextModuleEvent() is that callable from a handler?