ColdFusion Builder 3 - does code insight work?

43 views
Skip to first unread message

Michael Kear

unread,
May 1, 2014, 12:08:58 AM5/1/14
to coldspri...@googlegroups.com

I have been convinced to try to use ColdFusion Builder 3, since Adobe have chosen to remove all ColdFusion benefits from Dreamweaver.   I don’t really have time for learning a new IDE but I guess I’m forced to now. 

 

One of the main benefits trumpeted by Adobe is the code insight,  where when you type the name of a cfc,  and instantiate it,  it’ll give  a drop down list of the methods within the CFC.   And when you select one of the methods, it’ll give you a drop down of the required arguments for that method.

 

It’s not working for me, in any CFC instantiated using ColdSpring.    I don’t know whether that’s because I haven’t set it up properly or I’m doing something wrong,   or whether it simply doesn’t work with Coldspring.

 

Has anyone managed to get code insight to work on a cfc instantiated with Coldspring?

 

 

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month

 

 

Jared Rypka-Hauer

unread,
May 1, 2014, 10:51:54 AM5/1/14
to coldspri...@googlegroups.com
It will not work as, I think, you are expecting it to work. When using ColdSpring-derived objects you cannot rely on CB3’s built-in insight. In order for such insight to work, CB3 has to know where the CFC file is physically located on the disk, so it will work when you do something like:

MyObj = new com.foo.mystuff.ThatObject;
MyObj.{boom}…

CB3 goes and looks at the root of the project up the tree from / to /com to /com/foo and eventually finds ThatObject.cfc, reads it, parses and gives you insight as you continue to type.

So… when you call

MyObj = BeanFactory.getBean(“ThatObj”)

ColdSpring knows the path to the original CFC file via the config file it was given at init()… however CB3 only knows you’ve made a method call and gotten a result. It has no reference to the original CFC filie at all… in fact CB3 -itself- will never know what sort of variable is being created. Until runtime when CF executes the code, MyObj is just a variable name in a scope which may or may not eventually have success at being populated with a value.

HOWEVER!! If you right-click the project and go to CFC Mappings, you should see a place where you can give the name of an instance and pair that with a CFC to use for insight. I’ll grant you that it requires that you name your variables appropriately and set up a mapping for each var in your ColdSpring config file, but if you do set those mappings up and use a convention where the CS id and var names are the same...

<bean id=“MyObj”... /> (CS config file)
…and...
MyObj = bf.getBean(“MyObj”);
MyObj.{wait for it…}

…and you have told CB3 that any var named MyObj should be mapped to com.foo.mystuff.ThatObject, you will get insight.

Also, if you create one mapping and go look at settings.xml (created by CB3) in the root of your project you’ll see how those mappings are stored in XML. You’re not just a couple short steps away from using a decent text editor or CF itself to programmatically transform your CS config file into mappings in settings.xml.

And since your CS bean IDs have to be unique (well, OK not that simple but they should be) and you use the ID as the var name you can pretty well ensure that you’re going to get a consistent result.

HTH…

LATERZ!

J


On Apr 30, 2014, at 11:08 PM, Michael Kear <mk...@afpwebworks.com> wrote:

I have been convinced to try to use ColdFusion Builder 3, since Adobe have chosen to remove all ColdFusion benefits from Dreamweaver.   I don’t really have time for learning a new IDE but I guess I’m forced to now. 
 
One of the main benefits trumpeted by Adobe is the code insight,  where when you type the name of a cfc,  and instantiate it,  it’ll give  a drop down list of the methods within the CFC.   And when you select one of the methods, it’ll give you a drop down of the required arguments for that method.
 
It’s not working for me, in any CFC instantiated using ColdSpring.    I don’t know whether that’s because I haven’t set it up properly or I’m doing something wrong,   or whether it simply doesn’t work with Coldspring.
 
Has anyone managed to get code insight to work on a cfc instantiated with Coldspring?
...

Michael Kear

unread,
May 1, 2014, 6:39:22 PM5/1/14
to coldspri...@googlegroups.com

Thanks Jared   I’m grateful for your help.     This move to CFB3 has proved to be a whole lot of heartburn for me!!

 

Anyway,  I found out that after doing the CfC maps as you suggest,  this works: 

 

                UsersDAO = application.BeanFactory.getBean("UsersDAO");

                UsersList    = UsersDAO.GetAllUsers();

 

But chaining methods together doesn’t,   as you said in your post.    So this doesn’t show code insight:

 

                UsersList =  application.beanfactory.getbean(“UsersDAO”).getAllUsers();

 

Obviously it doesn’t matter to ColdFusion itself because either will work, but for code insight I have to learn a slightly different way of coding – just an additional line or two here and there as I instantiate a cfc on one line and call methods from it on another,  and it’s all cool.

 

Thanks for your help.

 

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month

 

 

 

From: coldspri...@googlegroups.com [mailto:coldspri...@googlegroups.com] On Behalf Of Jared Rypka-Hauer
Sent: Friday, 2 May 2014 12:52 AM
To: coldspri...@googlegroups.com
Subject: Re: [coldspring-users] ColdFusion Builder 3 - does code insight work?

 

It will not work as, I think, you are expecting it to work. When using ColdSpring-derived objects you cannot rely on CB3’s built-in insight. In order for such insight to work, CB3 has to know where the CFC file is physically located on the disk, so it will work when you do something like:

 

MyObj = new com.foo.mystuff.ThatObject;

MyObj.{boom}…

 

[snip]

 

Jared Rypka-Hauer

unread,
Jul 9, 2015, 5:30:43 PM7/9/15
to coldspri...@googlegroups.com, mk...@afpwebworks.com
Mike,

I ATTACHED AN IMAGE FOR YOU TO REFER TO... should be very helpful as you read my note...

So...

You have to edit the project and add a CFC mapping, simply associating the real OS path to part of the path of your CFCs... for example:

If you have ColdSpring at C:\inetpub\frameworks\CS12 and use "coldspring.beans.DefaultXmlBeanFactory" in your createObject() calls, you would use the CFC Folder mapping to associate C:\inetpub\frameworks\CS12 with coldspring. Then when you type:

new coldspring.

you'll be presented with all the CFCs in that folder directory tree.

Also if you always access your beans via application.beanfactory, you'll want to use CFC VARIABLE mappings to associate application.beanfactory to coldspring.beans.DefaultXmlBeanFactory...

Then when you type

application.beanfactory.

You'll be given function insight and autocomplete for the DefaultXmlBeanFactory.cfc.

It's -really- slick... but it does have a couple issues. If there are any errors in your code it prevents the insight from popping up. And you need to let Builder parse your entire directory tree before it provides the insight you are looking for.

And once in a while you'll need to pop into project properties and click the rebuild button to make it rebuild your CFC library.

And sadly this is all per-project. UGH.

Anyway... there ya have it. It ain't perfect but it's slick enough to be worth the effort.

J
CFCMappings.png

Jared Rypka-Hauer

unread,
Jul 9, 2015, 5:31:43 PM7/9/15
to coldspri...@googlegroups.com, mk...@afpwebworks.com
LMAO - OMG I just answered this question twice. HAH!

Oh well... *shrug* now you should be twice as convinced to use the feature. :)


On Wednesday, April 30, 2014 at 9:08:58 PM UTC-7, Mike Kear wrote:

Jared Rypka-Hauer

unread,
Jul 9, 2015, 5:33:30 PM7/9/15
to coldspri...@googlegroups.com, mk...@afpwebworks.com
Please note that if you have method chains that you regularly use you can add those as variable mappings and they will work just fine. :)

Just sayin... add application.beanfactory.getbean(“UsersDAO”). as a variable mapping to the UsersDAO cfc... boom, there's your insight. :)

Nathan Strutz

unread,
Jul 13, 2015, 10:05:05 AM7/13/15
to coldspri...@googlegroups.com
Jared, this is awesome. I can't believe I haven't been using this feature. Thanks for writing it up!

Nathan Strutz
--
You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldspring-use...@googlegroups.com.
To post to this group, send email to coldspri...@googlegroups.com.
Visit this group at http://groups.google.com/group/coldspring-users.
For more options, visit https://groups.google.com/d/optout.

Jared Rypka-Hauer

unread,
Jul 13, 2015, 5:19:25 PM7/13/15
to coldspri...@googlegroups.com
@Nathan,

COOL! I'm glad I inadvertently replied to Mike again then. LOL

I should start a blog or somethign. hehe
--
Jared Rypka-Hauer
dev.Objective() - Developing Apps, Developing Skills, Developing Community
May 12-15, 2015, Radisson Blu Mall of America
Bloomington, MN
Reply all
Reply to author
Forward
0 new messages