Blog

Category Filtering: 'ColdFusion'

Remove Filter


CFquestions.com A great place for CF Certications

Posted by Luis Majano
Apr 04, 2007 00:00:00 UTC
I am just posting about this great website that Charlie Griefer just put up. Its called cf questions.com and its a great resource for those of you trying to get your ColdFusion certifications. He has done a great job on creating a very dynamic site for studying and a great way to contribute with questions of your own. So give the site a visit and support it, I am.

Coldspring usage question, please help?

Posted by Luis Majano
Mar 15, 2007 00:00:00 UTC
I have a question concerning setting up a service via coldspring. Let's say I have object A already instantiated in the application scope and I want it to be injected into every service ColdSpring creates for me. However, I don't want object A to be created by ColdSpring.

I want to be able to define in my service definition that for example my UserService will receive this instantiated object as a dependency. How do I define this? Is this possible? Am I totally deranged for trying to do this? Any thoughts? Do you understand my dilema?

I know I can inject it later by hand coding it, but I don't want to do that, I want Coldspring to do this for me. Is this possible?

cfdirectory recurse emulation alternative: the Java Way (For BlueDragon, etc)

Posted by Luis Majano
Mar 14, 2007 00:00:00 UTC
As you know, ColdBox is now fully supported for BlueDragon and Railo. However, to port it was a bit tedious when it came to the auto-registration engine for handlers, since I need to traverse the handlers directory recursively and create an array of handlers. This is so easy in Adobe ColdFusion, but BlueDragon and Railo, does not support it (BD 6, railo 1). Here is the Adobe ColdFusion code:

That is awesome!! So easy!! Well, to do it the Java Way, takes some patience and well, some insight into recursion. The following example is using the CF/JAVA hybrid notation, but the end result is the same as above. And with some speed tests, the code actually compares, not that much of a slow down. So :)

Here is my call to the recursion, the entry point:

What I do is call my recurseListing method with the handlerArray I want the results in, the handlersPath into the initial directory and the working directory. Why do I send in the HandlerPath again? Well, I do it, to actually clean the path to show me the invocation paths, mumbo jumbo!! Give me the code!! Here it is:

Remember that this code is not to get the query like cfdirectory, it could, but you will have to do that, I am just showing how I solved my problem. This is a great exercise also.

//Init the oDirectory object with the initial working directory (Java File Object)

var oDirectory = CreateObject("java","java.io.File").init(arguments.Directory);

//Get an array listing of the objects in the directory

var Files = oDirectory.list();

//My Index.

var i = 1;

//My temp File Object

var tempfile = "";

//My clean handler string.

var cleanHandler = "";

//Loop Through listing if any files found.

for ( i=1; i lte arrayLen(Files); i=i+1 ){

//get first File reference as a File Object

tempFile = CreateObject("java","java.io.File").init(oDirectory,Files[i]);

//Directory Check for recursion, if directory, then recurse.

if ( tempFile.isDirectory() ){

//recurse, directory found, send in the new directory path.

arguments.fileArray = recurseListing(arguments.fileArray,tempFile.getPath(), arguments.HandlersPath);

}

else{

//File found

//Filter only cfc's, I could have used a Filter Java object, but was lazy.

if ( listlast(tempFile.getName(),".") neq "cfc" )

continue;

//Clean entry by using Handler Path (For my specific purposes)

cleanHandler = replacenocase(tempFile.getAbsolutePath(),arguments.handlersPath,"","all");

//Clean OS separators accordingly

if ( getSetting("OSFileSeparator",1) eq "/")

cleanHandler = removeChars(replacenocase(cleanHandler,"/",".","all"),1,1);

else

cleanHandler = removeChars(replacenocase(cleanHandler,"\",".","all"),1,1);

//Clean Extension right off baby

cleanHandler = getPlugin("fileUtilities").ripExtension(cleanhandler);

//Add data to array, a cleaned Handler, thank you GOD, bless you.

ArrayAppend(arguments.fileArray,cleanHandler);

}

}

//else return the empty array or filled array.

return arguments.fileArray;

There you go, you can follow the comments to tell you what I did. This is an awesome exercise and shows you how ColdFusion is really powerful by leveraging its Java backbone. When things like this just work, it just amazes me of how ColdFusion has evolved and how EASY it is to overcome problems by leveraging Java. Viva Java Mis Amigos!! Viva!! Viva!!

Hope you enjoy this little java/cf/recursion tutorial. This example shows potential of how you can build your own recursion methods.

Why does ColdBox exist? Why another framework?

Posted by Luis Majano
Nov 19, 2006 00:00:00 UTC
I recently found some great comments about a user commenting on ColdBox, why it exists, why create it, etc. I found it enlightening because, not many people have used this yet, it is fairly new to the open source community and it is my job to write more about the nature of ColdBox and using a coldfusion framework. So to introduce the article I have to note that ColdBox is another tool for web application development. Just like mach-ii and model-glue. Some people want competition and which one is the best. I do not believe in that. I believe in cooperation and finding the best solution to a problem, no matter what. I even wish that all the framework authors can join and create a solution. (Anybody listening?? A standard??) So please understand, that object oriented approaches and enterprise level application architectures will be complex and you should study upon them. Here is my article:

The institution of Developer Friday!! (Managers Better Listen)

Posted by Luis Majano
Sep 29, 2006 00:00:00 UTC
Are your developers demotivated? Burned out? Too much work? Too much of the same thing over and over again. Well, welcome to Developer Friday!!!

This is the day we came up with my superior of a way to stimulate diversity, learning and fun for the developers, at least once a week. Our developers can work on personal projects or just learning projects every friday. As long as there are not any pending deadlines, production issues or overwhelming issues.

This has been phenomenal. We have developers learning Flex, creating new web 2.0 apps, showing off their personal projects, and basically promoting learning and a little bit of FUN!!

So managers, listen if you dare!! I did!! and it has paid off. We have been getting the best ideas every friday now. New techniques, getting to play around with new frameworks, specially ColdBox (had to throw the marketing here) which is AWESOME, coldspring, etc.

To tell you the truth, if it were not for this day, I will have not begun to play around with coldspring, which I am a total newbie and need to start learning it so I can extend it for ColdBox.

This is my testimony and it has really improved the learning environment. So developers out there, bother your managers and bother them again, so you can have one day of the week to learn and inspire.

I got Advanced Certification!! Hooray!!

Posted by Luis Majano
Jun 18, 2006 00:00:00 UTC

Just a note that i took my ColdFusion 7 Certification friday at 4:00 PM.  Well, got an 88%!!  The studying payed off. My only material for studying was Ben Forta's Macromedia ColdFusion MX7 Certified Developer Study Guide which is a great study aid.  However, the best tool is actually using ColdFusion in you daily work.

 I can now upgrade my certification, Hooray!!

How to create an Eclipse Plugin Extension Location

Posted by Luis Majano
May 10, 2006 00:00:00 UTC

For any eclipse newbie, you will find out that all the plugins you download or update will be placed by you or the update manager in the eclipse install folder under the plugins directory. However, when updating comes around or removing or any kind of update, it is a hassle to manage it.  That is why you can create multiple plugin extension directories in order to facillitate plugin management.  I have attached a simple zip file with the correct format of an extension directory.

It basically contains the following structure:

+MyPlugins (Dir)
|--+eclipse (Dir)
    |--features (Dir)
    |--plugins (Dir)
    |--.eclipseextension

The .eclipseextension is a text file that contains the following:

 id=org.eclipse.platform
name=Eclipse Platform
version=3.1.0

You now have a succesfull extension directory.  You now can go to eclipse to add it.

1) Open Eclipse

2) Click on Help ==> Manage Configuration


3) Click on Add An Extension Location:

4)  Choose your directory

 

5) Restart your workbench

6) You are set and dandy!! Ready to roll!!

 

Hope this works for you. I have also a testing eclipse extension folder, so I can drop and test new plugins without affecting my workbench.

Eclipse RDS Support!!!

Posted by Luis Majano
Mar 21, 2006 00:00:00 UTC
I know everybody is posting about this, but I need to do it too. Adobe labs just posted the Eclipse RDS support and this is absolutely great. The migration to eclipse is finally over.

Here is the link to it:

http://labs.macromedia.com/wiki/index.php/ColdFusion/Flex_Connectivity:Eclipse_RDS_Support

Here is their description:

Remote Development Services (RDS) lets you access files and data sources registered in the ColdFusion Administrator on a ColdFusion server. You must enable RDS during the installation process. With Eclipse RDS Support, you can use CFEclipse as your IDE and access ColdFusion files remotely.

Eclipse RDS Support is supported on all ColdFusion server platforms.

I will be installing it soon, so I will let you know how it goes.

UPDATE

The link to RDS is confusing. You need to go here

Link

You need to go to the Flex Builder 2.0 Beta 2 downloads and download the

following:

Download ColdFusion Extensions to Flex Builder 2.0 (ZIP, 1.8 MB)

You then extract it and move it to your eclipse plugins directory.

Cfcompile for MAC OS X?? Well, it works now.

Posted by Luis Majano
Mar 01, 2006 00:00:00 UTC
I have been recently using the cfcompile utility, but under windows and linux. And since I am a Mac convert now, I have been doing all my development on MAC. However, I found out that the installer does not even place the cfcompile.sh utility in the bin directory of the CFMX installation.

Basically, cfcompile is not supported on MAC OS X (Am I right here???). So I decided to fool around a bit to see if I could figure out why. Well, basically, I created a new case in the cfcompile.sh script for the Mac OS "Darwin" and made sure that it would point to the correct places to compile the source into java bytecode.

I am attaching the full cfcompile.sh script for you to try out. Here is a sample of the case for the -deploy argument:

Darwin)

OS=Darwin

/bin/sh -c "${Setting: _JAVACMD not found} -cp $CLASSES -Dcoldfusion.classPath=$CFUSION_HOME/lib/updates,$CFUSION_HOME/lib -Dcoldfusion.libPath=$CFUSION_HOME/lib coldfusion.tools.CommandLineInvoker Compiler -deploy -webinf $WEBINF -webroot $webroot -cfroot $CFUSION_HOME -srcdir $srcdir -deploydir $deploydir"

;;

I removed the su, since in Mac OS, the cfmx engine runs under the install user. So there was no need to su to that specific user.

I in no way support this tinkering, do at your own risk. I may be doing it wrong or badly, however, it has worked for me.

I am attaching the cfcompile.sh for you to download.

Hope you enjoy it.

Flash Player 8 Mac OS Gateway bug using Flash Remoting and CFMX 7

Posted by Luis Majano
Feb 16, 2006 00:00:00 UTC
This is a recorded bug that is solved by the CFMX7 cumulative hot fix 2. However, the bug is still active only on MAC OS X standalone flash player or projector.

Thanks to Dave Stanten at Adobe, for sending me the technote and resolving this issue: Tech Note

ColdFusion MX 7 Gateway Connection URL

If you are using Flash Remoting to access ColdFusion code, you may run into an issue where ColdFusion constructs an invalid URL when appending a jsessionid. If this occurs, the web server that is accessing your code could throw errors. The solution is to simply add a question mark (?) to the end of the gateway URL. Change /flashservices/gateway to /flashservices/gateway?. This ensures that the URL is created correctly.

I only had this problem with flash player 8 and 7 for the MAC, but standalone only. If I used the flash player plugin within a browser I was ok or if I used any form of the flash player on Windows.

Also, the tricky part is that the Coldfusion logs report the following, which is due to the malformed URL's:

[Flash Remoting MX]->Request received was not Flash-based (not of the binary AMF protocol)

So lookout for this tricky bug if you come upon it. A single character can make a difference. :)

Happy Remoting!!!

Site Updates

Archives

Entries Search