OS X 10.10 Yosemite upgrades the default Apache install from 2.2 in Mavericks to 2.4. In general, this is a good thing, but if you were using mod_perl, perhaps for mod_cfml with Railo for example, then mod_perl will no longer work.
Recently, there have been several commits so mod_perl will now support Apache 2.4. Since there are no binary releases yet, we will have to compile it ourselves.
I have managed to do this with help from this StackOverflow post.
First you need the latest source from the Apache SVN repositories. They mirror it on git, but its missing some dependencies, so I found it easier to use SVN.
svn checkout https://svn.apache.org/repos/asf/perl/modperl/trunk/ mod_perl-2.0
Then switch into the new directory:
cd mod_perl-2.0
Next, we need to be sure we have XCode 6.1 installed and the command line tools installed as well:
xcode-select --install
Once, we have that, we need to tell the compiler where to find a few dependencies. You can find the reasoning behind this in the StackOverflow post mentioned above, but in general you run:
1 2 3 |
|
This will create a couple simlinks and tell the compiler where some Apache headers are located.
Almost done. Next, we compile it. We need to set a compiler option to tell it to build using the gnu89 standard, instead of clang’s default C99. (Thanks to this blog post for that little nugget!)
perl Makefile.PL MP_CCOPTS=-std=gnu89 ; make ; sudo make install
This will install mod_perl.so to /usr/libexec/mod_perl.so
Lastly, we need to tell Apache to load the newly compiled module and restart apache. Add this line to your /etc/apache2/httpd.conf
file:
LoadModule perl_module libexec/apache2/mod_perl.so
Then restart apache:
1 2 |
|
If all is well, you should have a working mod_perl module inside Apache 2.4.
]]>So:
LoadModule jrun_module /Applications/JRun4/lib/wsconfig/1/mod_jrun22.so
becomes
LoadModule jrun_module /Applications/JRun4/lib/wsconfig/1/mod_jrun24.so
You may find you need to update other Apache configuration settings. You can find additional information on upgrading from Apache 2.2 to 2.4 in the Apache HTTP Server Documentation.
]]>/Applications/ColdFusion10/cfusion/bin/jvm.config
/Applications/ColdFusion10/cfusion/bin/coldfusion
/Applications/ColdFusion10/cfusion/runtime/bin/wsconfig_jvm.config
In each of these, there was a setting to set the Java home path. It was set to the old location for Java 6. I updated these to point to Java 7. For me this was:
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
This was after installing the latest Updater 45 JDK from Oracle’s website.
Once I made these changes ColdFusion started fine.
The next issue is with the Connector. Adobe created a customized version of mod_jk to go along with their customized version of Tomcat. Because of this, recompiling mod_jk is not going to work. We’ll have to wait for an updated version from Adobe. (EDIT: See Mike’s comment below for a solution!) Until then you can either use the built in web server or install MAMP PRO which ships with Apache 2.2.22 (same as Mountain Lion) and then configure using the web server connector.
I followed the recommendations in this blog post: http://www.brilang.com/2012/06/installing-coldfusion-10-under-mamp-pro-2-on-os-x-lion/1137 to configure MAMP PRO.
]]>The plugin uses a similar syntax to FarCry’s built in skin:loadCSS tag so it should be instantly familiar. Be sure to read the installation instructions to avoid a couple of potential “gotchas”.
Check it out on Github, and let me know if its useful for you, or if you would like to see any additional features.
]]>/org/camden/blog/render/gist.cfc
. You can then use
to include the gist in your entry. If you want to constrain the height you can use CSS like:
Here is an example of what the output looks like, using the Gist I created to hold the code for the renderer. Feel free to grab it for your own BlogCFC install.
I have created a slider formtool for a client and thought it could be useful to others in the community. You can find the source for it here: https://gist.github.com/1230366
To use, simply download the CFC, and place it in your project’s /farcry/projects/projectname/packages/formtools
directory. Once there, you specify the metadata in your custom types as you would use any other formtool.
The formtool is an extension of the numeric formtool found in core, so you can use any of the features found from that formtool in the slider (ftPrefix
, ftSuffix
, etc).
The slider formtool adds 4 new metadata options. ftMin
, ftMax
, ftStep
, and ftOrientation
. Min and Max are the lowest and highest values allowed for the field. ftStep
is the increment factor the slider will use. If you specify one, each slide of the slider will move the value by 1, if you specify 0.5, it will increment it by 0.5 (1, 1.5, 2, etc). ftOrientation
can be either “horizontal” or “vertical” and it will orient the slider either horizontally or vertically.
Your users can either type a value into the text box or use the slider to select a value.
This uses the jQuery UI Slider widget so you can use it with FarCry 6+ since core ships with jQuery UI built in.
If you find it useful, missing a feature, broken, etc please let me know. Consider it released under a “do whatever you want with it” license.
]]>As some other clients have also expressed a desire to display YouTube videos on their sites, I decided to build the functionality as a FarCry plugin. This would allow me to move this feature set to any FarCry site.
At its foundation, the plugin works via two custom types and a scheduled task. The scheduled task runs and uses the YouTube API to grab the playlists and videos on the specified account (configurable via a FarCry config). If it finds those objects already in FarCry, it updates them with the latest data from YouTube, if its new, it adds it to the FarCry database. Any items found in FarCry that aren’t returned by the API are deleted. The plugin gives you the ability to reorder the videos on a playlist via the FarCry webtop. All data is managed on the YouTube side. I may consider adding the ability to completely manage the videos and playlists on the webtop, but that will greatly increase the complexity of the plugin, and I don’t see a great benefit to doing so. To me, it makes more sense to go straight to the source to upload new videos, manage your videos, etc rather than try to stuff all that functionality into a FarCry form. No need to reinvent the wheel, in my opinion.
The plugin also includes two rules. One lists videos based on selected playlists or videos, the other displays an embedded video.
To interact with the YouTube API, I made use of Raymond Camden’s awesome YouTube CFC.
I am happy to say that I have also posted this code on Github for the entire community to use. Give it a try! If you have any ideas for improvement please open a ticket, or better yet, fork the project and send me a pull request.
]]>I always had a love for gadgets and machines, which naturally led to a love for computers. I wrote my first program, Tic Tac Toe, in Basic on my family’s IBM PC Jr when I was in 7th grade or so.
When I went off to college, I decided early on that Computer Science would be my major. At this point, I had already been building websites for a few years while in high school. First, I would toy around with HTML on sites like Geocities and Angelfire, creating webpages for myself and family members. I used all the sweet tags like <blink />
and <marquee />
, they were awesome! :)
Around 1998 or so, a volunteer at my church gave me an opportunity to assist him with maintaining the church’s website. It was mostly static HTML, with some bits of, GASP, PHP mixed in. This was my first taste of server side web development. That said, most of what I helped out with, was the weekly posting of newsletters and schedules to their respective pages. Rather than simply manually convert the text from the newsletters and schedules into HTML each week, which would take a while given all the formatting that needed to be done, we had a Perl script that would parse the text and add the required HTML formatting such as lists, paragraphs, headings, etc. It was a really neat script, and my first look at regular expressions. I developed a healthy respect for the power of Perl and its string manipulation libraries.
I continued to work on the church’s website, eventually on my own as the current “webmaster” moved on to some other projects. I continued learning, mostly PHP, and applied those self taught skills to the site, expanding it in small ways. This continued until about 2002 when I was mid-way through college.
At that point, I was well along with my college studies, having taken courses in basic programming, c/c++, visual basic, database development, networking, etc; the standard CS curriculum. I spent two summers interning at ING in Hartford, CT, first in the DBA group, and next in the project and process management group. I created a PHP application that allowed the DBAs to view current status information for all of the production databases, and another application to manage the metadata for those databases for the project managers to use. This gave me some great experience and real world use.
When I returned to school, I then took a course called “Web Development II”, a follow up to a basic introductory course on HTML and the structure of web pages. This course was to introduce server side, and dynamic web development. I didn’t think much of it at the time, figuring I would be a C++ or Java programmer, or maybe a DBA when I graduated. I loved web development, but never really considered it would be my career. I didn’t think I would be that lucky.
So by now you are probably wondering, but how the heck did you start using ColdFusion??! You’re right! All this rambling and I haven’t even reached that yet! Fear not, here it comes :)
When we started “Web Development II”, my professor gave us an option. We could scrap the “scheduled”, boring lesson plans for the course which would give us a slight introduction to dynamic web development, but not give us any in depth experience, or we could explore the technology that he used, ColdFusion, and build our own full applications in the short time the course would run.
My first reaction to this was, OH NO! I had heard of ColdFusion, but only the bad things. You know the ones. “Its Dead!” “Its Old!” “It doesn’t scale!” “Its not a real programming language!” I was leaning toward sticking with the course’s scheduled curriculum, but I didn’t want to rock the boat. I figured that I had been doing this already for a while, and I didn’t need in depth anyways, I just wanted the credits. :)
The class decided to try ColdFusion, and get the most out of the course they could. I am glad that decision was made! From the start, I fell in love with ColdFusion. It made all the hardest things so easy! In PHP I would have to manually connect to the database, setting up that connection with each page, then pass the SQL in as a string, run 2 or 3 methods just to execute the query and return each row as iterated. I thought this was OK. Then CF introduced me to the magical <cfquery />
tag! I thought to myself, “I have been doing it this way all this time, when THIS is available!??”
My professor could tell right away that I was into it. Since I had been doing web development for a while, I would pick up the easier things faster, and had more time on my hands in class. Toward the end of the class, for our final project, we would break up into teams and build a functional application from scratch. It would be a basic CRUD app to manage a database.
Now, I had never been a great fan of “teams” in school. Mostly because I would end up doing all of the work. It always seemed to me, that no one took the work seriously, and I would have to make up the slack. I didn’t want to do the team project, fearing that would again happen, and someone else would get to slide by while I did the heavy lifting.
My professor sensed this, and came to me after class and told me that he had a different final project in mind for me. He wanted me to work on a project of his, that he was working on for a client. This was great! A real world project! This would be a great learning experience. So we talked about what I would build, how it would work, etc and I set to work building it. Once it was complete, he reviewed it, and we had some back and forth tweaking some things. It was a really great experience for me to have, and really prepared me for my future endeavors.
After this experience, I decided I wanted to do web development professionally. I got a job in the Academic Services Center at my school, building their intranet website, including an application that allowed students to look up a professor’s schedule, and find out where they would be at a given time. This was a classic ASP application. Trust me, I wished for the sweet relief of ColdFusion each day I worked there! It was a great experience though.
As graduation approached, I started looking for web development jobs. I didn’t specifically look for ColdFusion, after all, I needed a job and wasn’t going to be picky! I interviewed at a few different places, even got an offer for a web development job. I wasn’t exactly thrilled with the work I would be doing though, so I kept looking.
Eventually I stumbled upon a web development position, close to my parents home (central CT), and, would you believe it, they used ColdFusion! I was excited. It sounded great, it was exactly what I wanted to do. It was an association management firm that provided services for a variety of clients so I wouldn’t be stuck working on the same things over and over again.
I interviewed and got the job and right after graduation I started working full time. Eventually I worked my way up the ladder to Senior Web Developer, and I was the lead developer and system architect for all our web projects in a team of three. I learned more and more about ColdFusion, and development in general, over the years there, and it really prepared me for where I am today.
Today, I have my own development company, n42 Designs, and I work full time for a consulting firm here in CT, that provides IT services, primarily for clients in the healthcare industry.
]]>To install, copy the files to /farcry/plugins/spcPoll
and add spcPoll
to your this.plugins
setting in your FarCry constructor. Deploy the content types in the COAPI manager and restart the application. You can now create a question, assign answers to it, and deploy that question using the “Poll: Display Poll” rule.
You can grab the code on Binpress or Github.
Let me know what you think!
]]>I set up Railo running on the Resin server using Apache as a front end with mod_caucho. In my httpd.conf
file I had the following lines:
This causes Resin to handle all requests from apache. The resin configuration files tell resin which URLs to handle. I also had an SVN server set up so I had a configuration file in /etc/httpd/conf.d/
to set up subversion. All my SVN repositories are under the location /svn
. Reading SVN repositories worked fine, but I kept getting “path not found” errors when committing new files. After debugging this for quite a while using Fiddler, and other means, I finally realized that Resin was actually handling the PUT http request and, finding no file, returned a 404.
So to fix this, and simply have Apache handle any request to /svn/
I modifed my httpd.conf
file as follows:
then restarted Apache. Now apache handles any requests to /svn/*
and Resin handles all other requests. Hopefully this helps future Googlers in need.
You can see here that I am just hard coding the query in, you would replace this with your cfquery call to your database or a call to your service layer, etc. Once you have your query results, you want to use the queryConvertForGrid
function to format the result to a value that CFGrid can work with.
You then need a cfgrid! The trick here is how to get the grid to refresh as the user types a value in the filter box. ColdFusion Ajax UI tools have bind expressions that let us bind one control to another, and to react to events.
You can see my bind expression in the cf grid. It will call the getData method of my data.cfc and pass in the value from the “filter” input box whenever the key is released. ColdFusion provides other events you can react to as well, check the docs for details.
So now if you run index.cfm you will see a simple form with a text input and a grid. the grid will load when the page is run (bindonload="true"
) and as you type in the text box, the results are filtered.
EDIT: removed the example link as I have moved this blog to Railo
]]>The modifications allow you to return a struct where the key is the name of the field in your object, and the value is true/false indicating if it passed validation.
This is useful if you prefer more control when showing informative messages to the user.
The zip file is at RIAForge.
]]>For example I have the following tables set up
And the following transfer configuration:
So when you call getRelationArray()
on a Table1 object. You will receive the error. To correct this I took the following steps:
Create a for table 1 with the ntext column casted to varchar:
1
|
|
Save this as vwTable1
.
Change your transfer config to point to the view instead of table one so
becomes
Now, you wont be able to run it yet because the view is not updatable since you used the casted field. To overcome this we are going to use an INSTEAD OF
trigger.
You need to create 2 triggers. One will be called whenever UPDATE
is called on the vwTable1
and the other will be called when INSERT INTO
is called on vwTable1
You can create the triggers as follows, obviously change it to suit your table’s needs:
Once you have created these triggers you should be able to use Transfer as you normally would. Using the casted column in the view will allow you to call the getRelationArray()
. The SQL that Transfer creates will no longer be invalid.
You may run into a couple of other items though. First, your ntext field is now
limited to 8000 characters since you are casting it to varchar. You may
be able to increase this, but I haven’t tried. Your mileage may vary,
but be sure before the value is passed to transfer that it is validated
as less than 8000 characters (perhaps in your decorator). Next, if you
have any non-null, defaulted columns in your base table (a created date
perhaps) you HAVE to provide a value when you call insert into vwTable1
.
Since Transfer is creating this SQL you have to ensure that Transfer
includes that column. This means that you cannot use the
ignore-insert="true"
option in the transfer configuration. SQL Server
will still respect your default value, as long as you provide that
column in the sql statement pointed at the view.
You can find more information about INSTEAD OF INSERT and INSTEAD OF UPDATE triggers on the MSDN site.
I have only used this in a simple application with two base tables and one relationship table, so if your setup is more complex it may not work out for you.
]]>Webservices.java
and also a [cfcname].java
file. CF couldn’t create
both so it threw an error. The solution was to rename my CFC. The
stubs can be found in C:\ColdFusion8\stubs\
on Windows, and if I
remember correctly /Applications/ColdFusion8/stubs/
on Mac OS X.
]]>