I had to re-install ColdFusion 9 on my MacOS today and having installed CF approx. a million times before, I thought it would only take few minutes.
Here is what I did :-
1) Went to /Applications/ -> Moved existing “ColdFusion 9″ folder to Trash.
2) Ran the CF Installer and everything went well. But finally, the installer got stuck at “Installing WebServer Connectors” – I waited a few minutes but then gave up.
3) Repeat Steps 1 and 2.
4) I then decided to try the installation with the in-built webserver. That worked, but I could not load any pages at all in browser. Basically, Apache was not working.
5) I opened Terminal. Ran the command “sudo apachectl start” – It says “Already running”. At this point, I was wondering whats wrong.
6) Ran the command “sudo apachectl restart” and it appeared as if it got restarted. No changes.
7) Did some Search and ran this command. “sudo apachectl configtest” to make sure the Apache config was fine. Turns out it was throwing this error.
httpd: Syntax error on line 241 of /private/etc/apache2/httpd.conf: /private/etc/apache2/httpd.conf:241: <Files> was not closed.
I think this surely must have been done by the CF Installer. I opened the httpd.conf file and sure enough, it was broken.
<Files "rsrc">
Order allow,deny
Deny from all
Satisfy All
<DirectoryMatch ".*\.\.namedfork">
Order allow,deny
Deny from all
Satisfy All
</DirectoryMatch>
Once I fixed this by closing the </Files> tag, Apache and CF both started working again.
Anyone else seen this before? I have seen this first time and its hard to believe that CF Installer actually messes up the Apache Config file.
This post of mine is coming after a long time, I know. The reason for this has been lack of time, being very busy with other things etc. I will try to be more frequent here hereafer.
Anyways, in a recent project, I had the requirement to show Twitter statuses on the homepage of the website I was working on. The first thing I did was, went straight to RiaForge and searched for any Twitter related CFC’s. I did find a couple of them and they all looked pretty good. However, since I only wanted to get the stautses and not the other fancy stuff like direct messages etc, I thought there must be an easier way of doing it.
That’s when I thought if the statuses are available as RSS feeds, I am done. CFFEED can do everything for me.
<cfset feedurl = "http://twitter.com/statuses/user_timeline/15172848.rss" />
<cffeed source="#feedurl#" properties="statusmeta" query="statuses" />
Thats it. The code above gives me a feed of my status updates in a ColdFusion query, which I can now use to display as I want. There are too many columns in the query with lots of useful information. I ended up using just the “rsslink” and “title” columns as those were the only 2 I wanted for my requirement.
Its nice to know that Twitter publishes these rss feeds and even nicer that I can use this in one line of code.
If you are using ColdFusion XPath functions to search/parse XML strings, you will probably have come across this one at some point. Not all, but most of the XML files have namespaces in them e.g. xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”. If you use Xpath on a string that contains namespaces, chances are that you will get back the namespaces as well and sometimes you dont want these at all. You just want to deal with the real data. More »
This post is just a little tip that I think can take a lot of time in trying to solve.
I was building a variable , using cfsavecontent, to process later on and there was absolutely nothing wrong with the code according to me, as below :- More »
I had a cftextarea with richtext enabled and I had another dropdown which was supposed to change the value of the cftextarea when selected. So, I was doing it the old way as I would have imagined. More »
I have just released an update to coldfusiondocs.com . As the title says, I have added Railo support to the documentation, so now you get a new tab for Railo tags and functions and just like before, you can search and view the documentation.
I think it makes sense to add this as part of the documentaiton. As always, any feedback is more than welcome.
In response to reader’s comments from my previous post, I have updated the code for this little thingy.
Here are the updates in this version.
1) Added the ability to change pagesize dynamically (I did a separate post on this one earlier)
2) Made the grid rows double clickable. On double click, a window opens up with the selected row which can then be updated.
3) Removed the inline editing as didnt want the confusion of inline editing and double clickable rows.
4) The same “Add Artist” is used for add/update.
5) Changed the CFC to accomodate the update functionality.
6) Fixed a couple bugs and general code optimization and added some more comments in the code.
Any questions, please ask. More »
I know this has come up with a few times before but its something I want to blog more for myself so I could easily refer to it when required.
By default, cfpop does not support ssl and if you are trying to access your gmail account via cfpop, you wouldnt be able to do so straight away because gmail requires you to access its mail server using ssl. There are a couple solutions around (which can be searched via Google) but the best I found was that you can force socketFactory’s class to use ssl (which is not the default behaviour).
Just add the following few lines of code before your cfpop tag call and that should do it! And dont forget to enable POP access in your gmail account first.
<cfset javaSystem = createObject("java", "java.lang.System") />
<cfset jProps = javaSystem.getProperties() />
<cfset jProps.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory") />
<cfset jProps.setproperty("mail.pop3.port",995) />
<cfset jProps.setProperty("mail.pop3.socketFactory.port", 995) />
Here is an example of how to change the pageSize of an AJAX CFFGRID dynamically.
Purpose :-
Let the end user select how many rows of data he/she wants to see in the Grid. (ie technically speaking, change the pageSize on the fly).
Approach :-
1) Add a ComboBoxwith the number of Rows to be selected, for the user to be able to select. use the Ext JS functions to achieve that.
2) Take the value selected from ComboBox and reload the grid data.
3) Reload the paging Toolbar as well because, apparently, the grid data and paging toolbar work independently, reloading the grid does not reload the paging toolbar. So you have to do that manually.
4) Reconfigure the Grid. More »
After looking at Dan Vega’s series of posts on CFGRID usage, I decided to put together an example of CFGRID with a full CRUD functionality. ColdFusion 8 has introduced the new HTML format CFGRID which uses AJAX behind the scenes. I quite like the features it offers and I think with EXT framework behind the scenes, there are some nice things that can be done with it. Dan has already covered a lot of these areas and is doing a great job I think in writing these posts up. More »