October 8, 2007 at 9:06 pm
· Filed under SoC2007, chesspastebin, eclipse, google, jsPGNViewer, meme, web
Disclaimer: I’m affiliated with the product and this might be taken as a commercial but nevertheless things will start to change.
Before moving to Java (mostly JEE) I did couple of years PHP development. The thousand levels of abstraction, tons of third party libraries and most importantly the ever taking change-check cycle were something difficult to accept. I was so used to getting feedback automatically and could not even imagine that one day I will even have to re-traverse some application just to store some state.
For the past months I have been working on team battling the change->compile->redeploy cycle. Today there is a release. It is called JavaRebel and the product brings the cycle down to change->compile->check. Classes loaded by the container can be changed and JavaRebel inbetween will load these changes (adding/removing/changing fields, methods etc.).
When I was working on my Google Summer Of Code project I had to buy extra RAM just to be able to run couple of instances of Eclipse. I was not willing to buy a new CPU to make the restarting these instances of Eclipse faster. JavaRebel does not have Eclipse support but it is in the roadmap.
There is a screencast up that will demo some features of it. Java development will change.
Permalink
October 2, 2007 at 9:52 am
· Filed under SoC2007, chesspastebin, google, jsPGNViewer, meme
Permalink
August 27, 2007 at 9:51 pm
· Filed under SoC2007, eclipse, google
Finally I’ve found a PHP and JS library which work and are useful to show off how to use them through the Scripting Bridge (my GSoC project). This post is about the core part of my work.
A week before the deadline we separated all Eclipse stuff from the Scripting Bridge to provide something more general which we call core now. The core lets you incorporate scripts into your Java code and treat them as regular Java objects.
The libraries I found are:
The samples use these libraries to package a small JavaScript and show the output. Basically I have a Java-PHP mapping interface:
@ScriptableClass (fileName="etc/phpPacker.php,
etc/myWrapper.php",
extension="php")
public interface PhpPacker {
@ScriptableMethod(functionName="packJs",output="true")
public String packJs(String jsContents);
}
This defines which PHP files to use and which function to invoke. Then I use this interface as:
PhpPacker phpPacker = (PhpPacker)
ScriptableFactory.newInstance(PhpPacker.class);
result = phpPacker.packJs(toPack);
This actually invokes the bundled PHP function packJs($str). The same example is also for JavaScript using the other library.
I made a separate page for the core & samples which include
Next post will be about the UI or Eclipse part of the deliverables. I hope I’ll find some sexy PHP & JS scripts.
Permalink
August 20, 2007 at 9:13 pm
· Filed under SoC2007, eclipse, google
Its pencils down for the Google Summer Of Code. I’ve tagged my source in the repo and made another release. The update URL is the same. More info during the following days.
Permalink
July 12, 2007 at 8:46 am
· Filed under SoC2007, eclipse, google
After six weeks I have a release to show, this is something I can really call alpha quality
. Keep on reading to get the details. Firstly how to get the plugin
- You must have Java 6 installed for the scripting support (I need to verify it works with < Eclipse 3.3)
- Update site url http://tom.jabber.ee/phpengine/update-site/
- SVN url http://eclipse-incub.svn.sourceforge.net/viewvc/eclipse-incub/plugins_in_php/
- Module org.eclipse.soc2007.phpscriptengine
- Module update-site
- The info is more up-to-date on my wikipage.
What can you do with the plugin?
Firstly map PHP functions to Java methods. The approach is to create an interface.
public interface HelloWorld extends Scriptable {
@ScriptableAnnotation(
fileName="helloWorld.php",
output="true")
String getHelloWorld(String rtrn);
}
Implement the interface with method stubs that return the argument (I’m invoking the methods with return values as arguments). Get a proxy for the object implementing the interface
HelloWorld helloWorld = (HelloWorld)ScriptUtil.registerProxy(
objectImplementingTheInterface,
HelloWorld.class,
classLoaderThatFindsThePath);
And using the interface as you would. Right now you have to read the source code for more comments. I’ve actually documented it to some extent. To get a quick and dirty example see the “Mapping PHP Functions to Java Methods” (step-by-step tutorial) wiki page.
Secondly using some simple PHP developing aids. See the “Facilities Provided by the Plugin” again on the wiki.
The plugin comes with the Quercus ScriptEngine jar inside the plugin. It is compiled from trunk and has the support for MySql (you still have to download the MySql JDBC connector yourself). I’ve proposed a solution/patch to the issue I was ranting about in the last post. No GD support yet but I’ll get around to that soon.
Hopefully next releases will come quicker. I’ve automated the building of the update-site. So it is easy to even produce pseudo releases
.
Where to now? Oh boy, there is so much more work to do:). Here is a list of ideas/problems that I will be dealing with to produce an actual integration plugin:
- Provide a cleaner API for users.
- Implement invoking PHP functions/methods/multiple arguments etc.
- As PHP is somewhat different (also thanks to Quercus) than other scripting languages also provide support for JavaScript
- Development aids (when writing interfaces autocomplete for PHP functions/methods/objects etc.)
- Work on Quercus source code to solve issues that are bugging me (GD, logging exception when certain J2EE classes missing, etc.)
- Sample plugin mostly in PHP
- See if and how much I duplicate with PDT Project
- Bugfixes, bugfixes & bugfixes
Any feedback is appreciated. Go download the plugin, update your J2SE instance and go wild
Permalink
July 1, 2007 at 9:58 pm
· Filed under SoC2007, eclipse, google
How to search for files in the workspace using the API? See the dev.eclipse.org viewcvs for package org.eclipse.search.tests. Quick link to the file. You can search for files defining text patterns for file content matching and name patterns for file name matching
How to add a pop-up menu entry to a context-menu? IBM developerWorks has an article “Build extensions for Eclipse one snippet at a time“. I liked that I just supply the interface and then the entry is only added to that context menu (IFile for files and IProject for projects etc.).
How to do something when the menu entry is clicked? Like getting the reference to the IProject it was under. See Mylyn source code.
How to add a project nature to a project? General info at Eclipse Resources article “Project Builders and Natures” and then an example with code.
My googling daily average is 117 searches for the past week.
When I have a problem to solve (search for files in the Workspace) then I first try to get as far I can with what I know. At one point there will be some kind of an API question. What class to use to do that? Thanks to the self-descriptive naming scheme one can find an interface or two and check the implementations. If that does not do it then head off to dev.eclipse.org and see the tests for the usage. You can always try to remember if you have seen this functionality before and download the source of that plugin!
This week’s plan is:
- First Release
- Configure update site
- CVS import
- Usable PHP sample
My mentor is on a vacation so I guess I’ll be bugging the others
Permalink
May 2, 2007 at 5:28 pm
· Filed under google, meme
I’m writing my bachelors thesis about packaging web software. One format i analyzed as prior work was Google Gadgets. As I’m still in the army and the situation here in Estonia is as it is I have lots of kinda free time with a really laggy WiFi internet connection.
Yesterday I thought I’ll give Google Gadgets a try from the developers point of view and started coding a small gadget. Google has great resources for this:
The problems I did ran into was testing my module @ personalised homepage. The problem is that the module gets cached and you have to change the URL the retest it. So the development cycle looks like this:
- develop the webpage
- prepare the xml file
- copy webpage to xml CDATA
- test (rename and test again)
Maybe there is a solution to this but I just don’t know about it. Anyways here is the gadget (original idea from duke’s page) I developed:
Permalink