Ramblings

March 31, 2008

Getting Cairngen to work with Eclipse and Tiger

Filed under: cairngen, cairngorm, eclipse, tip, tool — michaelangela @ 11:06 pm

Thanks to Darren who added some notes on it, there may be hope yet! (I copy things things here to my blog in case the original sources disappear as many others have done… :-()

And Darren, yes it did help very much!

Eric Feminella: Solutions Architect, Rich Internet Applications » Blog Archive » Cairngen 2.1

For anyone interested, I’ve worked out how to get Cairngen running
on Tiger. It probably works for Leopard too. It wasn’t easy as there’s
no (official) JRE 1.6 available but now I’ve got there, it’s reasonably
straightforward. You just have to add BSF, Rhino and Commons-Logging
jars to your Ant classpath. Like so:

1. Download and copy bsf.jar and js.jar to your Ant lib directory. Get them here:

http://jakarta.apache.org/site/downloads/downloads_bsf.cgi
http://www.mozilla.org/rhino/download.html

2. In Eclipse->Preferences->Ant->Runtime->Classpath, add
the 2 jars above (Add External JARs button), as well as
org.apache.commons.logging._*.jar (which should already be in your
Eclipse plugins directory). I’ve added them to Ant Home Entries which
works for me.

That’s really all there is to it. Then, as Eric says, you have to
run the appropriate targets in your Ant build file if you want to
create delegates, events, vo’s, etc. I couldn’t find an explanation as
to the best way to do this so I just added the targets to line 63 of
build.xml so it’s now:

depends=”log, create-model-locator, create-front-controller,
create-service-locator, create-multiple-sequences-include-delegates,
create-multiple-value-objects” />

I hope this helps.

Starting Eclipse with an alternate VM

Filed under: cairngen, cairngorm, eclipse, java, tool — michaelangela @ 10:29 pm

So I was trying out the Soylatte Java VM to get it to work with Eclipse so I could use Cairngen on a 10.4 Mac. I got an error after working with some Eclipse configurations so that Eclipse started with errors and didn’t allow much work. However starting from the command line (/Applications/eclipse/eclipse) got me back. I can also set the VM I want to use with the -vm argument. (Side note, I can use Scribefire’s “Custom HTML” option to insert <code> tags where needed it seems!)

Java Runtime Environment (JRE) – How to change the default JRE when there are several version of JRE in Sys

I recently installed Oracle 9i client on my new box
and now Eclipse will not start. I get an error

You can set the path to your VM in the eclipse start command:
eclipse.exe -vm <path-to-your-javaw.exe>

e.g.
eclipse.exe -vm c:\program files\java\jdk1.5.09_09\bin\javaw.exe

Another way is to locate the VM with your path environment. Set the variable JAVA_HOME to the root path of your VM installation. Update your path settings and remove all occurences of java. At the end add the following: %JAVA_HOME%\bin
Now delete javaw.exe and java.exe from your windows\system32 directory. They’re not needed, because they are in your path.

So all java programs are in the path. To change the VM you only need to change the JAVA_HOME variable.

Java 6 Port for Mac OS X 10.4 and 10.5 (Intel)

Filed under: cairngen, dev, java, tool — michaelangela @ 9:20 pm

What ho! Hey I just complained about no Java 6 for the Mac and then this pops up! Now will it work for what I am trying to do with Cairngen?!

SoyLatte – Port of BSD Java

SoyLatte is a functional, X11-based port of the FreeBSD Java 1.6 patchset to Mac OS X Intel machines. SoyLatte is initially focused on supporting Java 6 development; however, the long-term view far more captivating: open development of Java 7 for Mac OS X, with a release available in concert with the official Sun release, supported on all recent versions of Mac OS X.

The name “SoyLatte” was chosen to clearly differentiate from Sun’s trademarks (Red Hat already claimed IcedTea, and I drank a lot of double soy lattes while working on this. (I think it’s funny)

The work is being done as a part of the FreeBSD Java project, with changes being pushed upstream to the FreeBSD code base as the port progresses. Coordination with OpenJDK is also progressing. SoyLatte is a staging ground for the Mac OS X port — it is not intended to be a fork. For more information on licensing, and the project’s relationship with FreeBSD and OpenJDK, please see the licensing section below.

Cairngen, Eclipse and “Unable to load a script engine manager”

Filed under: cairngen, cairngorm, dev, java, tool — michaelangela @ 9:16 pm

I need to add a bunch of functionality and I really want to automate the file creation so I just started trying out Cairngen. I got this “unable to load a script engine manager” error. Fortunately I had just checked my Java VM version (default Mac OS 1.5) and according to this post I need at least JRE 6. Let’s see now… hrmm… Java on a Mac is a little trickier than I thought… distressing

Eric Feminella: Solutions Architect, Rich Internet Applications » Blog Archive » Cairngen 2.1

  1. Leif Wells UNITED STATES Says:

    November 19th, 2007 at 10:46 am

    Eric, I am trying to use Cairngen 2.1 in FB 3 beta 2 (stand-alone) and getting an error:

    BUILD FAILED

    C:\…\build.xml:373: Unable to load a script engine manager (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager)

    Have you seen this before? Is there a software update I need to install? If so, which one?

    Thanks,

    Leif

  2. eric UNITED STATES Says:

    November 19th, 2007 at 11:59 am

    Hey Lief,

    You need to upgrade to JRE 6. First download and install at: http://www.java.com/en/download/manual.jsp

    Once you have upgraded the Java Runtime, restart Eclipse and from
    the toolbar select Windows > Preferences > Java (expand) >
    Installed JREs > Add > Browse (browse to Java Installation and
    select latest JRE). Click OK.

    Restart Eclipse and you should be good to go. Let me know if you have any problems.

    – Eric

Quicksilver tip: Copying a folder path to the clipboard

Filed under: quicksilver, tip, tool — michaelangela @ 8:44 pm

I’m sure this is out there somewhere, but for me it’ll be right here. 🙂 Plus it’s a multi step process which I didn’t actually expect. It’s not complicated but it’s longer than I thought. Maybe there is an easier way?

I wanted to copy the path of a source folder into Eclipse for Cairngen. I navigated to the folder in Quicksilver but wasn’t sure how to get the path. You have to:

  1. Cmd+G to the selected folder
  2. Tab to command pane
  3. Some combination of letters of “get file path” to get the file path (Quicksilver jumps back to the 1st pane with your path there now)
  4. Tab to command pane
  5. Copy to Clipboard

It seems longer than it actually is. And it’s a whole heck of a lot shorter than anything else I know of… so no complaints here!

Cairngen moving to Google Code

Filed under: cairngorm, dev, education, flex, tool — michaelangela @ 8:23 pm

I use Cairngorm. It’s main strength is making sure you put code where it should go. It goes by the MVC mantra which, in and of itself, is really good. The problem? To add one new capability, you sometimes have to add… I forget how many new class files:

“Hmm… need a button here to do X… ok… we need XEvent, XCommand, XController, XDelegate… *creating files* *doh typo!* *editing files* *doh!* *a few more ‘doh!’s* OK. Good.”

Cairngen aims to replace that problem (and a few others) by allowing you to generate the files in one go. I haven’t tried it yet but maybe now is the time?

Eric Feminella: Solutions Architect, Rich Internet Applications » Blog Archive » Cairngen Project moved to Google Code!

In order to provide a solid foundation to help facilitate a
collaborative Open Source initiative for the Cairngen Project I have
decided to move the project to Google Code.

Moving Cairngen to Google Code
allows for a number of significant development benefits for the
Cairngorm Community. This includes regular development updates, access
to all releases, availability of all source code revisions, better
documentation, defect lists, feature requests and much more.

Speed reading…

Filed under: education — michaelangela @ 8:15 pm

I really need to learn how to speed read. There is just TOO MUCH to read! Er… too much I want to read.

Flex Builder on Linux?!

Filed under: adobe, flex, linux — michaelangela @ 7:10 pm

This stuff just doesn’t stop! Woohoo! This is good though… I wonder if the license will be cross platform so current users can move to Linux…

Ted On Flex: Hello AIR/Flex Builder on Linux

This morning we launched the Alpha release of AIR for Linux and an updated Flex Builder for development on Linux. It is great to see Adobe providing both runtime and development support on Linux for Web applications using Flash Player and Desktop applications using AIR.

PyAMF flying high

Filed under: django, education, flex, pyamf, python, web2py — michaelangela @ 7:08 pm

More python/Flex goodness in the works in the future perhaps? 🙂 I really like Python… learning all the time with my web2py friends. I’d love to be able to combine this with Flex. Looks like it’s getting easier and easier. Now to combine this with Orbited

Ted On Flex: The AMF Revolution

The growth of AMF since the release of Blaze DS and the AMF spec
has been nothing short of amazing. I continue to see lots of great new
server software projects leveraging AMF data formats. This morning I
was reading the FlexCoders mailing list and an announcement of a new AMF library “PyAMF – AMF for Python” appeared leveraging Python targeting Twisted (I love twisted), Django, Pylons, TurboGears and CherryPy. Seeing a single project add this much functionality into Python web development is really great for the Flash/Flex developer community.

Python
PyAMF Project
PyAMF Examples

Create a PDF via Share’s API

Filed under: adobe, business development, pdf, tool — michaelangela @ 7:03 pm

And so now, you can also create PDFs via their API? I’ll have to look into that later…

Collaborative Methods

SHARE was updated late last week – see here.
In addition to some really cool new features (e.g. full screen embedded
document), you can now convert an uploaded document into a PDF!
Naturally with every new feature we add, we expose that functionality
via our APIs.

Free online document collaboration?

Filed under: adobe, pdf, tool — michaelangela @ 7:01 pm

Adobe Labs – SHARE

With Share you can:

  • Convert 5 documents to Adobe PDF.
  • Send documents without email attachments.
  • Access your documents from anywhere.
  • View all the documents you have shared or received in one place.
  • Post a link to your document on a wiki or blog.
  • Embed a Flash® preview of your document on any website.
  • Limit access to a document to a list of recipients.

Yahoo maps released an AS3 version!

Filed under: as3, component, dev, flash, flex, map — michaelangela @ 6:52 pm

There once was an app that wanted a map, but alas there was no map for the app. The app was content to use AS2, but it was too slow, too slow it was. Then there was a hack, of modest maps. It was not quite released for use but it was there nonetheless so used it was. It was hacked until it and AS3 and Flex were friends and friends they were for a long time. Now comes Yahoo Maps AS3 so dearly wanted so long ago.

OK, ok enough of that. I couldn’t keep it up myself any longer (bad influence of Monty Python on me… the “Silly Police” should be here momentarily).

Yahoo announced Yahoo Maps AS3 which would have been great a long time ago… maybe for a future rev of an app I would like to do. 🙂

Yahoo! Developer Network – Flash Developer Center – Yahoo! Maps AS3 Component

The new Yahoo! Maps API is now entirely built in ActionScript 3.0. The Maps API now gives you an incredibly powerful map engine and the ability to create custom components, overlays and markers while consuming different webservices provided by Yahoo!, or your own. The YahooMap component is distributed as a SWC, to get started you need to include it into your build path using Flex Builder.

The Maps API contains a core set of widgets, markers, overlays and web services to enable you to interact with the map in every way.

Cairngorm and views responding to server side events

Filed under: cairngorm, education, flex — michaelangela @ 6:26 pm

I’ll have to dig up the links for this as a reference. But I started an app in Flex. I wanted a good framework to work with to help me organize the code, get some “best practices”, etc. I chose the then standard Cairngorm currently hosted at Adobe. Everything was happening client side so all was good. That was because with Flex, you can use data binding. That means your user interface elements can simply be “bound” to a certain bit of data. When the data updates, the UI element updates, automatically. That’s cool.

However I started to add server side processing. UI controls mapped directly to data, even data processed on the server side, is still updated automatically. However, what if I want to notify the user that data on the server has finished? How do I notify different UI elements about such things as “your data is saved”, “your data is NOT saved”, etc.?

Linking that sort of data becomes hard to do, and also hard to maintain. I seemed to be at a loss of what to do. This is where the reference links would come in. There was actually quite a bit of discussion about this and, in the end, what I needed, or at least what I concluded, was actually not recommended for Cairngorm.

In Cairngorm, you have models and you have views. (You also have controllers to complete the MVC pattern.) When your model changes (meaning your data changed), your views which are bound to the model update. This doesn’t leave room for UI notifications, etc. The pattern I found that I was after is called ViewHelpers or ViewLocator. Basically it’s a way to wire your views to listen for events for updates, specifically for user notifications.

There was even a good post about why you should just add responders to a Cairngorm event so that the view can be notified directly as a callback on that event. That’s good… except it makes the assumption that the only view interested in that event is the one that triggered the event. That’s not always the case.

I hit this because I wanted to do drag and drop from one Flex UI component to another. When the user drops the object, an event is fired to save data to the server. The originator of the event though was the not the view I wanted to update. I eventually did find ViewLocator/ViewHelper patterns to use, which helped tremendously, even though others disagree with the implementation.

Interestingly enough, a newer Flex framework called PureMVC doesn’t have these issues. The idea of any view being able to be notified by any event is assumed. If I have time, I will try to learn that system as it seems to be closer to the way I think… or perhaps how I want to think. 🙂

The following link has a good discussion about Cairngorm in general… just here for my own reference.

Flex and Flash Developer – Jesse Warden dot Kizz-ohm » Blog Archive » Cairngorm vs. Joe Berkovitz’s MVCS

Quicksilver – get the item selected in Finder

Filed under: cool, education, quicksilver, tool — michaelangela @ 5:31 pm

I hadn’t used this shortcut much so I kept forgetting it. This page has many such reminders. 🙂 The shortcut is cmd+G

QuickSilver Keyboard Shortcuts

Grab file – puts current selection from Finder/Path Finder as active item in QS

Blog at WordPress.com.