Showing posts with label coldfusion. Show all posts
Showing posts with label coldfusion. Show all posts

Illudium generator gotcha!

I know I haven't been writing for a while, however this is something really interesting that happened to us here at work and I figure it may help someone else out there. We are using the well known Illudium PU-36 Code Generator from Brian Rinaldi. I use it for a project that connects to MSSQL and had no trouble generating the code, I even created my own template based on the "Prototype" provided with the generator. It creates nice clean code that we can start working on right away. The problem we had was that we were getting "duplicate parameters" and "duplicate Properties" once we started using any Oracle database. I started digging the code and learned a lot in the process, one thing I noticed is that on the adminAPIFacade.driverOrClassToType() method Brian checks for the datasource's Driver and Class values and if it finds "oracle" then uses "oracle.cfc" to get metadata from the database. If it finds "mssql" then it uses "mssql.cfc" to get the metadata from SQL Server. If nothing is matched then it tries to use the new CF8 for metadata extraction, the component used for that is scorpio.cfc. Well everything looked good there, logic look solid and things were working OK. The problem was on our side. I checked our datasources and every Oracle DSN is using "Other" as the driver. This turns out to be a JDBC connection where the Driver Class is "macromedia.jdbc.MacromediaDriver" and the driver Name is "MacromediaDriver" nowhere in these values you will find the word "Oracle". That's why the adminAPIFacade.driverOrClassToType() method was returning "Scorpio" all the time. Now I don't know why the CF8 tags are returning duplicate information on the metadata but I knew that I needed to find a way to tell the method to start using Oracle.cfc instead of scorpio.cfc. I found the answer on the datasource.url value. Right now it reads JDBC URL : jdbc:macromedia:oracle://[serverName]:1521;ServiceName=[ServiceName];AlternateServers=([ServerName2]:1521);LoadBalancing=true So I added that to the method and now all generated code is coming the way is supposed to be. Final method looks like this. <cffunction name="driverOrClassToType" access="private" output="false" returntype="string"> <cfargument name="datasource" required="true" type="struct" /> <cfif ((arguments.datasource.driver eq "MSSQLServer") or (arguments.datasource.class contains "MSSQLServer") or (arguments.datasource.url contains "MSSQLServer"))> <cfreturn "mssql" /> <cfelseif ((arguments.datasource.driver contains "mySQL") or (arguments.datasource.class contains "mySQL"))> <cfreturn "mysql" /> <cfelseif ((arguments.datasource.driver contains "Oracle") or (arguments.datasource.class contains "Oracle") or (arguments.datasource.url contains "oracle"))> <cfreturn "oracle" /> <!--- if you are running cf8 we can try to leverage db metadata tags ---> <cfelseif listFirst(server.coldfusion.ProductVersion) gte 8 and arguments.datasource.driver neq "MSAccess"><!--- only access with unicode seems to work with dbinfo ---> <cfreturn "scorpio" /> <cfelse> <!--- not a supported type ---> <cfreturn "" /> </cfif> </cffunction> çB^]\..

NoDans Series on ModelGlue Reloaded Part 5

This was also a short entry. The main purpose here is to change the free form text for the Contact Types to a Select box. We do this by creating a MAP with ENTRIES in Coldspring.xml and then calling a method getContactTypes() on the ContactService bean. Once we have the collection of values we set the variable "ContactTypes" for later use un the final view (frmContact.cfm). Direct Link to MindMap of Part 5 (opens full Size)

Giant steps on ModelGlue

It seems to me that I was over my head when I started looking at the Model-Glue Series from Ray Camden. I started looking for more information on the web and I found two great resources, Dan Wilson and Doug Boude. These two guys have great information on Model Glue. Right now I'm making giant steps on Model Glue thanks to the following Great video posting here, it explains a lot about the ModelGlue Framework and how things connect between Model, Views and Controllers. I recommend people trying to learn ModelGlue check the video. This series is just amazing, I had done the two initial parts and I liked them because they are easy to understand and the reading is simple but packed with a lot of information. I started following Posting #3 of the series and I was blown away by the reference to Rooibos Generator. Are you kidding me? I spent so much time doing the getters and setters before that now that I found this nifty app I don't know if I'll ever do it again. Great stuff, really great stuff. Once I get a good understanding of the whole thing and I'm done with the tutorials I'll have to create a small app from scratch and post here all the steps. çB^]\..

Coldfusion on Ubuntu 7.10

Update It seems I spoke too soon, and I Was too tired to think straight. I was able to follow the steps and have Coldfusion installed, however I can't setup Apache to listen to CFM requests. I've been trying to run the ./cf-connector.sh script and so far nothing happens, screen doesn't change and every time I try to open a .cfm page the server asks me if I want to download it.

wow, I've not been this excited about computers in a long time. 3:20AM and I'm still unable to go to sleep, even though I have to wake up early tomorrow (actually today, in a couple hours). Coldfusion was a little more tricky than the other ones. Most of the steps came from Installing ColdFusion 8 on Ubuntu Feisty Fawn. But the trick with the correct paths to all the files came from Installing ColdFusion 7 on Ubuntu Feisty Fawn
Add web server Configuration Apache
  1. What directory contains your Apache configuration file: /etc/apache2
  2. Where is the Apache program binary file?: /usr/sbin/apache2
  3. Where is the control file that you use to start and stop the Apache web server?: /etc/init.d/apache2
çB^]\..

Model Glue and the MasterJedi Series

For the last two days I've been following the Model Glue Series from Ray Camden as a way to get my feet wet. I like Ray's work overall and I think that if I had followed the series from the beginning it would've been much easier to follow. Sadly I'm stuck and trying to figure out somethings on part 7, it doesn't help that I'm using Model-Glue 2.0 Unity and the series is written for an earlier version without any ColdSpring. I decided that at some point I'll start a website explaining basic concepts related to Model-Glue and Coldfusion in general in a graphical way. I like to code as much as the next guy but to me a graphic or a diagram can save a lot of grief and also helps me understand the big picture of things instead of trying to create the whole thing bottom-up. ShowMeCF.com , graphicalCF.com? çB^]\..

That was a long snooze

Haven't entered anything for months, not that I didn't have anything to write about, just lack of time and too many things going on actually, one of them called Summer. It was a great summer, the kids enjoyed and so did we. Back to business. I've contacted people in Bolivia to start ( finish actually) a couple projects to get my Bachelors degree. I decided to finish things from college now that we've settled down, don't plan on having more kids and have a stable job. The projects are related to things I work with on a daily basis. One of them is an online game similar to Yahtzee created exclusively for my website www.LLAJTA.com. This will require PHP, MySQL and a good understanding of the Joomla framework. I've used the admin options of Joomla for over a year but never really got into messing with the code. This is my chance. The second project is a hybrid CRM system/Project Management System for construction companies in Bolivia. This will require Coldfusion 8.0 and MySQL. I'm excited about this one since I'll be playing with the new features Coldfusion offers and at the same time I'll get my feet wet in the Model-Glue waters. For those who don't know, Model-Glue is a development framework for Coldfusion apps. Lots of things happening. I guess I'll be posting more often now that I have projects outside work.