Coldbox Relax Missing Information

I’ve just started using the Coldbox Relax module, and I seem to be missing something (other than logging to MSSQL doesn’t seem to work).

There is a fair amount of information concerning how to configure Relax, including defining the DSL, etc., however, those instructions including route information to the actual RESTful handlers. Alas, however, I am not finding any information on how define my handler CFCs so that they leverage the DSL defined in the Relax.cfc.

For example, the document at http://wiki.coldbox.org/wiki/Projects:Relax.cfm#How_to_start.3F shows the DSL for the /api/users event which maps to rest.user, however, there doesn’t seem to be any documentation describing how to code the handler itself. Or am I missing something (probably)?

Kevin S. Anderson | President

Superlative Solutions, Inc.

HI Kevin,

How to code your RESTful handlers is something up to the developer.
However, I am now going to start working on the documetnation for 3.0
as now I believe we are finalized. I will be creating some new guides
on how to create RESTful applications and levarage the URL mappings
and Relax.

Thanks for the reply, Luis. I do have some REST handlers working, using the routes.cfm conventions. The power of Relax, to me, is the documentation and test harness built in, and if I could leverage the DSL for the services, that would be SOOOOOO sweet!

Hang in there, 'mano! You do great work and your dedication to the framework is noticed and appreciated by all.

Kevin

Thanks Kevin! Yes, Relax was built with two focuses when I started it. 1) I did not want to write the documentation by hand (believe it or not), 2) I wanted a way to test and re-test.

However, since now the power behind it has been seen, there are tons of ideas floating of what it can become. So I do welcome direction for Relax as a product to help us developers produce RESTful services faster, leaner and meaner!

Collaboration is encouraged folks!

Ok, stuff is fixed and added some nice check for updates feature so
you can update the relax module online.

http://blog.coldbox.org/post.cfm/coldbox-relax-v1-2-released

Hi, Luis:

Two things...

1. I noted earlier that you stated that MSSQL has been fixed in logbox, but I'm not seeing anything referencing that at GitHub. Wondering what I should download to get this update as the new RelaxURL still has the datatype mismatch problem.

2. Potentially a stooped question, but I have Relax working, however, not sure how to handler the .format. Following is a snippet from the routes.cfm file:

  addRoute(pattern="api/address/:action", handler="soa.address");

The :action would be like getCountries, getUsStates, etc., however, when appending the .xml or .json, etc., I get an action not found.

I can work around this, somewhat, by being more specific in my pattern, but I would like it to be more flexible. My REST service was original written so that "format" was a parameter, which if not provided, would default to "xml". This was working nicely, but Relax seems to prefer the action.format form.

Thanks and considering taking the weekend off! (of course, after answering my questions! :wink: )

Kevin

Look below

Hi, Luis:

Two things…

  1. I noted earlier that you stated that MSSQL has been fixed in logbox, but I’m not seeing anything referencing that at GitHub. Wondering what I should download to get this update as the new RelaxURL still has the datatype mismatch problem.
  1. Potentially a stooped question, but I have Relax working, however, not sure how to handler the .format. Following is a snippet from the routes.cfm file:

addRoute(pattern=“api/address/:action”, handler=“soa.address”);

The :action would be like getCountries, getUsStates, etc., however, when appending the .xml or .json, etc., I get an action not found.

You need to have the latest coldbox for this, with extension detection enabled. Once enabled it will take the extension and place it in the request collection as a variable called “format”.

setExtensionDetection(true);

Then you can even set the valid extension formats.

Hi (again), Luis:

On the MSSQL_DAO, I did confirm that line 54 has the change (returntype=”any”). Different error message now, as shown below:

Application Execution Exception

Error Type: Autowire.AutowireException : [N/A]

Error Messages: Error autowiring modules.relax.handlers.Logs. Error constructing model: relax.logBox.logService Error constructing model: relax.logbox.MSSQL_DAOElement RELAX.RELAXLOGS is undefined in a CFML structure referenced as part of an expression.coldfusion.runtime.UndefinedElementException…

Not a big deal at the moment, just wanted you the be aware.

But a nice feature to have in Relax would be if there are global parameters that should be included with the request, or for a specific service, it would be nice if the test (RelaxURL) automatically created the fields, and then you could just populate them. Just thinking about improvements, you know?

Blessings!

Kevin

Can you send the full stacktrace for this and maybe any solutions you find?

Ahh global parameters is good. We already have global headers so this is easy to add. Can you make an issue ticket for this as an enhancement?

Yes, I do have that in mind, where if you select a resource to test, it will build it up with the headers and parameters automatically so you can fill them out. Only the required onces though.

Can you create a ticket for that also please.

Very happy to add tickets! Lots o fun!

Oops. Don’t know how to do that (this has been my day for the “don’t know how to do __________”!)

I went to the CodeTracker that that requires a user account. Point me in the right direction, oh wise one, and I’ll do it ASAP.

Kevin

Very happy to add tickets! Lots o fun!

Oops. Don’t know how to do that (this has been my day for the “don’t know how to do __________”!)

I went to the CodeTracker that that requires a user account. Point me in the right direction, oh wise one, and I’ll do it ASAP.

Kevin