cf.Objective() 2013: Top 10 Railo Features Presentation

Before I forget, I thought I would point you to the code that I used to do my Top 10 Railo features presentation. 

The presentation was actually written using the features and hence there are no slides as such, since it's a living presentation/document that I might add more features of bug fixes to. Hence it's also under version control over in GitHub! 

Go check out the code yourself: https://github.com/cybersonic/railo-top10-features and let me know what you think. 

 

No Comments

Give Me 5... Please?

 

On April 6th, I shall be running the Tough 5 in Greenwich Park. This will be a challenge for me, an ex smoker and overweight developer with a penchant for drinking Jack Daniels, as the run is not just nice and level, it is up and down the undulating hills of the park! Should be fun! 

Of course, this is the bit where you expect me to put up a link to my justgiving page or some other charity, but I don't want to do that.

I know a great diversity of people and I am sure you all know a worthy cause, so here is the deal: Just give five of something to the group/charity/community/product of your choice. That's it.  Be it $5, £5, 5 minutes, or 5 hours, it doesn't matter. Just make sure you do it before Saturday April 6th.

Oh, and why not let me know what you did, either privately or by commenting below! 

 

3 Comments

Passing events back to your view in Eclipse

This is going to be a bit of a technical post, and it's to do with views in Eclipse. I tried to find this all over the place but in the end it was bits and pieces from different posts that actually gave me the answer, which is kinda odd.

So, here’s the problem. You are writing a plugin for Eclipse. You have a view, say a TreeViewer in there that is going to be populated with some content. You do the following:

All is great, we have a content provider which basically allows you to find children and parents in your Tree, and the LabelProvider which displays the right image and label for each item.

The content provider is notified when you change anything in the tree, but how about the other way?

So say I have a background process that updates MyDataStore? How do you then tell the tree to refresh?

This is something that has been bugging me for a long while and today I come up with a quick solution, which I hope works.

First off, we want to somehow subscribe to any changes that MyDataStore might recieve. To do that you can make MyDataStore Observable.

Now whenever MyDataStore is changed (for example, when someone calls the updateMeSomehow() method) you should also add the following calls within the method:

Now in your View, you can add a new observer, that will now have the update() methop triggered whenever something changes in myDataStore!

Now that’s not the end of it. If you were to call (as you would presume) myTreeViewer.refresh() you will get a org.eclipse.swt.SWTException: Invalid thread access error. That is because the TreeView is running in a UI thread, and the thread that updated your DataStore is probably in a different thread (usually). So what you need to do is go back to the Display thread and do the update asynchronously.

I know there are few people out there doing this, but hopefully this will help you, since I couldn’t find this answer that easily (in completeness).

References:

No Comments

Running Railo from any directory

Today on the Railo mailing list someone asked if there was a way to start railo from any directory and use that directory as the web root. A fair enough question and it got me intrigued.

So after a bit of research I come up with the following, of course this works for OS X, change the relevant bits to suit your OS (hey, send me how to do it and I shall update the post)

First off, I downloaded Railo Express (3.3.4.003) and saved it to:

/Applications/railo_runner

Then I copied the ./start and renamed it to ./railo_runner

I added the path to ~/.bash_profile by adding:

export RAILO_RUNNER=/Applications/railo_runner/
export PATH=$PATH:$RAILO_RUNNER

so now, to change the railo_runner script. Mine looks like this:

#!/bin/bash
CURRPATH=$(pwd)
cd $(dirname $0)
java -DSTOP.PORT=8887 -DSTOP.KEY=railo -jar -Xms256M  -Xmx512M lib/start.jar -Drespath=$CURRPATH

The only thing I added was the current path and added it as a System property with the -D flag, as you can see by the -Drespath=$CURRPATH. All is good so far, now to tell Jetty to do something with it!

In the /Applications/railo_runner/contexts/railo.xml I changed the system property that is used for the resourceRoot:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"><Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
<!--
  <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webroot/</Set>
-->

   <Set name="resourceBase"><SystemProperty name="respath" default="./webroot/"/></Set>
  <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</Configure>

Now I can do the following:
Earth:~ markdrew$ cd ~/Sites/
Earth:Sites markdrew$ mkdir demo_site1
Earth:Sites markdrew$ cd demo_site1
Earth:demo_site1 markdrew$ railo_runner

And voila! It creates the WEB-INF and you are good to go by http://localhost:8888!

7 Comments

The Evolution of the Railo Company

Today I shared some important news about the Railo company and how we are setting up the future. 

You can read the post over in the Railo blog: http://blog.getrailo.com/post.cfm/railo-at-cf-objective-the-evolution-of-railo

In essence we have set it up so we can say to all CFML developers:

CFML is HERE TO STAY
We are MARKETING it
We are SUPPORTING it
We are DEVELOPING it
For the next 10 years and foreseeable future

Viva la Railo-vucion!

No Comments