[coldbox 3.1] getMetaData

34 views
Skip to first unread message

Nolan Dubeau

unread,
May 26, 2012, 12:48:13 PM5/26/12
to col...@googlegroups.com
Hey guys,

I'm looking to building a module that reads the meta data of a handlers function to produce some documentation.  I was wondering if anyone can point me in the direction of somewhere this might be used within the coldbox framework in order to get some ideas.

Thanks!

Nolan

nolandubeau

unread,
May 26, 2012, 1:06:16 PM5/26/12
to col...@googlegroups.com
I found this article by Dan Vega which provided some useful information:


Here is the function and annotations:

/**
* @httpMethod GET
* @description I am the component description
* @hint I do something
*

*/

function index(event){

var rc = event.getCollection();
local.foo = getMetaData(this);
writedump(local.foo);abort;

}

Now instead of each annotation displaying as it's own struct element, only the first one is picked up.  Here is what the dump produces:
HTTPMETHODGET * @description I am the component description * @hint I do something *
NAMEindex
PARAMETERS
array
1
struct
NAMEevent
REQUIREDfalse


Any ideas why only the first one is picked up?

Thanks guys.  I know this isn't fully related to ColdBox, but it will come in handy in the module i'm going to build/share.

Cheers,

Nolan

nolandubeau

unread,
May 26, 2012, 5:02:45 PM5/26/12
to col...@googlegroups.com
Anyone have any ideas on this one?

Thanks!

N


On Saturday, 26 May 2012 12:48:13 UTC-4, nolandubeau wrote:

Luis Majano

unread,
May 26, 2012, 6:17:04 PM5/26/12
to col...@googlegroups.com
Yes it is a cf bug. Do arg.hint on each

Luis Majano
CEO
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Nolan Dubeau

unread,
May 26, 2012, 8:36:48 PM5/26/12
to col...@googlegroups.com
can you provide me with an example?  I don't understand.

Nolan Dubeau

unread,
May 29, 2012, 10:38:56 AM5/29/12
to col...@googlegroups.com
Hey Luis,

I haven't been able to get this to work. Would you be able to provide me an example or is there someplace in the framework that uses this fix?

Thanks again.

Nolan

Luis Majano

unread,
May 29, 2012, 2:02:21 PM5/29/12
to col...@googlegroups.com
Here you go, this worked for me

Luis F. Majano
CEO
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Test.cfc

Nolan Dubeau

unread,
May 29, 2012, 7:41:21 PM5/29/12
to col...@googlegroups.com
That's really weird.  It still doesn't work for me.

I still get...

FUNCTIONS
array
1
struct
HTTPMETHODGET * @description I am the component description * @hint I do something
NAMEindex
PARAMETERS
array [empty]


What version of CF are you running?  and What OS?

Can anyone else get this to work on ACF 9.0.1 on OSX?

Thanks.

Nolan

Luis Majano

unread,
May 29, 2012, 8:21:14 PM5/29/12
to col...@googlegroups.com
That is what I got

Nolan Dubeau

unread,
May 29, 2012, 8:39:10 PM5/29/12
to col...@googlegroups.com, col...@googlegroups.com
How do you get each of the annotations to be its own struct element?

Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1

Luis Majano

unread,
May 29, 2012, 8:49:17 PM5/29/12
to col...@googlegroups.com
With the code I sent you.

Are you sure, you don't have empty whitespaces

Nolan Dubeau

unread,
May 29, 2012, 8:58:17 PM5/29/12
to col...@googlegroups.com
yep, no whitespace.  i copied and pasted your code exactly.

do you get struct elements for httpMethod, description, and hint?  or do you just get  httpMethod?

thx.

Luis Majano

unread,
May 29, 2012, 10:00:53 PM5/29/12
to col...@googlegroups.com

Nolan Dubeau

unread,
May 29, 2012, 10:15:04 PM5/29/12
to col...@googlegroups.com
wtf?  what version of CF are you using?  

this doesn't make any sense.

doh!

Nolan Dubeau

unread,
May 29, 2012, 10:15:51 PM5/29/12
to col...@googlegroups.com
also,  i'm now testing this on 3.5, instead of 3.1. 

Luis Majano

unread,
May 30, 2012, 12:53:47 AM5/30/12
to col...@googlegroups.com

Brad Wood

unread,
May 30, 2012, 10:39:08 AM5/30/12
to col...@googlegroups.com
Back to your original question, have you looked at http://colddoc.riaforge.org/ to see how it works?

Thanks!

~Brad

Nolan Dubeau

unread,
May 30, 2012, 1:45:31 PM5/30/12
to col...@googlegroups.com
Thanks Brad!  I haven't looked at ColdDoc yet.  


Nolan Dubeau

Sent from my Commodore-64
Load *.*,8,1
--
Reply all
Reply to author
Forward
0 new messages