Development/OnlineGlom

From Glom
< Development
Revision as of 02:08, 23 December 2011 by Murrayc (Talk | contribs)

Jump to: navigation, search

Online Glom

Overview

OnlineGlom is an experimental UI for libglom which is in the initial stages of development.

We are currently working on view-only functionality, hoping to add editing later. These screenshots show the current unfinished state:

Screenshot-online-glom-list.png Screenshot-online-glom-details.png

Source Code

The source code for gwt-glom (the GWT UI) is here: http://gitorious.org/online-glom .

It uses java-libglom (Java bindings to libglom), found here: http://git.gnome.org/browse/java-libglom

Demos

You can try the latest demo code here, with the examples provided with Glom:

http://onlineglom.openismus.com/OnlineGlom/

Contact

You may discuss OnlineGlom on the regular Glom mailing list. See the Contact page.

File a new OnlineGlom bug, or see the list of open OnlineGlom bugs.

Building and Running

These instructions will help you get OnlineGlom built and running locally on your computer.

Dependencies

For Ubuntu Oneiric, all the necessary dependencies are packaged int the Openismus PPA. You just need to install these packages:

  • libjava-libglom-java (this is a package of java-libglom.)
  • maven2 (this provides the mvn build tool.)

You must then make the packages java-libglom available to maven's mvn command, like so:

mvn install:install-file -Dfile=/usr/share/maven-repo/org/glom/libglom/java-libglom/1.19.2/java-libglom-1.19.2.jar -DpomFile=/usr/share/maven-repo/org/glom/libglom/java-libglom/1.19.2/java-libglom-1.19.2.pom

(We are trying to avoid this last step by adding java-libglom to the central maven repository.)


For now, if you are using a different distro, or if you need to work with the latest code, you can build java-libglom from source.

Building gwt-glom

Now it's time to build the actual OnlineGlom which is in the gwt-glom git repository.

If you are using jhbuild, remember to enter the jhbuild environment if you are not still in it, like so:

jhbuild shell

Getting gwt-glom

Now you can run this command to clone the gwt-glom module:

git clone git://gitorious.org/online-glom/gwt-glom.git

And change into the directory that you just cloned:

cd gwt-glom

Configuring gwt-glom

Before you can use OnlineGlom, you'll need to create the configuration file, to specify the directory where you keep your .glom files. Even if you just have one glom file, you'll still need to set the directory where it is located. There is a sample configuration file that you can use as a starting point.

You can edit the configuration file with any text editor but we're going to use gedit here for simplicity. Run this command to open the configuration file:

cp src/main/resources/onlineglom.properties.sample src/main/resources/onlineglom.properties 
gedit src/main/resources/onlineglom.properties

To configure the directory where you have your glom files, change '/home/someuser/glomfiles' in the following configuration line:

glom.document.directory = /home/someuser/glomfiles

If you don't want to be prompted for the username and password of the underlying PostgreSQL database, you can set these two lines with the appropriate credentials:

glom.document.username = someuser

glom.document.password = ChangeMe

You can also set the password and username separately for each glom document by following the instructions in comments of the onlineglom.properties file.

Running gwt-glom

Once you have things configured, run this command to compile and run OnlineGlom in your jhbuild environment:

mvn gwt:run

An application will start which lets you launch OnlineGlom in your browser. Click on the Launch Default Browser button when you're ready to start playing and you should see OnlineGlom pop up in a new tab of your browser. If you don't already have the GWT Firefox plugin, you'll be prompted to download and install it. It's normal for the browser to become unresponsive while OnlineGlom is getting setup so don't worry too much if this happens.

You may instead deploy OnlineGlom to a real server.

Using Eclipse

To hack on the gwt-glom module with Eclipse, you should first follow the instructions above to build everything. The project files for Eclipse 3.7 have been committed to the gwt-glom repository. You should use Eclipse 3.7 to avoid the time consuming project configuration required to setup things for a different version of Eclipse.

When you have everything working, you can import gwt-glom as an existing project into your Eclipse environment. If you used jhbuild to build gwt-glom and java-libglom then you will need to run Eclipse in your jhbuild environment so the java-libglom native library will be picked up by the Eclipse launchers. This command should work:

jhbuild run path/to/eclipse/eclipse

If you need to change anything in the java-libglom module, you will need to ensure that the new native library is installed and you will need to update the jar file in your local maven repository. Your work flow would go something like this:

  • Edit the Swig interface file or files to wrap a new class.
  • Run this command to build and install java-libglom:
jhbuild buildone java-libglom