August 31, 2008


Posted in GSoC tagged , at 5:21 pm by fadinlight

Following some requests in OSM’s talk-it list, I’ve just released a manual for Osmarender Frontend 0.2 version (sorry folks, only English for the moment, hope to translate it soon!). The manual (24 pages long) is available in ODT or PDF format and released under CC-by-SA license. Hope you’ll find it useful!

August 26, 2008

Trac component open

Posted in GSoC tagged , at 11:59 pm by fadinlight

After a question in the talk-de list (thanks to Martin for the announcement… and for having replied in German for me 🙂 ), and after fixing the reported bug (even if it’s not a completely clean solution atm), replying to AndreR in the wiki, I’ve thought about opening a component in Openstreetmap’s trac.

Thanks to TomH, now everyone can submit a bug report or an enhancement suggestion for Osmarender Frontend in OSM’s trac! (you need to use your OSM account to submit a new ticket).

August 21, 2008

New 0.2 (SoC) release, JUICE is born – aka the longest title and the longest post in history

Posted in GSoC tagged , , , , , , , , at 2:56 am by fadinlight

Relevant links:

“Dojoizing” OsmaFrontend

Following what I’ve said before, also this last week (while doing a MAJOR blog posts updating) has been full of interest for code developing, even if not so full of new features. What I’ve been doing is “Dojoizing” OsmaFrontend, to take the most advantage from Dojo toolkit and to have a cleaner code design (separating HTML code from Javascript, using Dojo’s xhrGet). Here the last days timeline:

August 11: TagTrunk

While “Dojoizing” Osmafrontend, I’ve started to separate the trunk code from the tags (thanks to TomH and spaetz that helped me in the #osm channel, also helping me not to do tens and tons of commits 🙂 !)

August 12: Widgets and blog

A long day of studying to learn how to write Dojo widgets, and to write some of the past posts for the blog

August 13: Tags, Blog, Rule tree

Finally I’ve separated the tags from the trunk, while updating the blog with the new posts. A little interesting new Osmarender Frontend feature developed: a raw tree view of the rules. This is what is going to be, after the major refactoring I want to do for CMYK library.

August 14-15: Django template in Dojo (Dojox DTL)

I’ve started to learn how to use DTL in Dojo, but even after spending the whole day on various tries, I didn’t manage to have it do what I wanted to do to separate some HTML from the code. For example, I couldn’t manage to do a {% for key,value in store %}. Really don’t know why, because with other tags everything worked smoothly.

August 16: Widgets and i18n

After doing all the refactoring to separate HTML content from Javascript, I started to refactor all the code that concerned the CSS editing part of Osmarender Frontend. Then, I’ve started to learn how to do i18n with Dojo, while learning that Dojo’s i18n have some issues with Firefox 3.

August 17: Externalising CSS editor and publish/subscribe

This day I’ve finally externalised all CSS editor code from osmarender_frontend.js file, with some tricks to keep it really separate. As Osmarender Frontend takes the styles and handles them (add, modify, delete) only with the help of CMYK library, and as I wanted to keep the CSS editing widget and CMYK library really separate, I didn’t want to pass the CMYK instance to the CSS editor, nor I wanted to let Osmarender Frontend handle the CSS section of the rule file. This is where dojo publish/subscribe came to help! In this way, the CSS editor will publish a topic, which Osmarender Frontend have to subscribe to pass the parameters to CMYK library. That’s cool!

August 18: JUICE

I’ve spent the last GSoC days to do some minor changes to the code, and to definitely keep the CSS editor widget separate from the rest of the code, with its own i18n. This is how JUICE (Javascript User Interface CSS Editor) project was born!

Three projects in one!

At the end of my GSoC adventure, and at the beginning of a new adventure, I’m very happy to say that three projects have started at the same time:

  • CMYK library: When the refactoring will come to an end, the library will be completely independent from Osmarender Frontend, thus allowing every Javascript-speaking code to handle Osmarender’s rule file smoothly.
  • Osmarender Frontend: A Dojo-powered GUI interface for WYSIWYG handling of Osmarender’s great power.
  • JUICE dojox based widget: Without even knowing or wanting, the CSS editor has now its own life, so, sooner or later (at the end, when it will have more features and handling power), it will be a separate project, perhaps with some integration with Trevor McCauley’s great CSS parser… Who knows… Fantasy is the limit…!

August 10, 2008

Refactoring and UML models

Posted in GSoC tagged , , , at 11:46 pm by fadinlight

(This post has been published after the original date)

Now that all is ready, I know that probably the time is not enough for GSoC deadline to complete all that I would like to complete (even if I’ll try to do my best), that would be:

  • Externalise data model from cmyk.js
  • Create and package a better data model for rules handling (with some GUI hacking I could let it work in few time after creating it)
  • Refactor Osmarender Frontend (the GUI section) code
  • Externalise and dynamic loading some GUI resources (like the various panels)
  • Refactor some controls (mainly those that edit CSS properties) as Dojo widgets
  • If time permits, start using Dojo templating system for some GUI resources
  • Create all packages ready for release

The hardest thing to do would be to write and get to work the refined data model for rules handling. This is because, after a quick refresh of my Osmarender rules knowledge, I’ve produced the rough sort-of-UML model shown above (thank to argouml), which represents needed classes, inheritances, attributes and types. That explains clearly how difficult will be a proper refactoring, at least to get it to work for GSoC deadline without too much loose ends. Obviously I don’t want to risk to break something now. 🙂

So, what I’m doing now? I’m using a mixed “top-down/bottom-up” stategy. I’ve already refactored some data models used by cmyk.js (1st point) and I’m just starting to externalise and dynamic loading GUI resources for Osmarender Frontend (4th point). This is going to be a step by step process, refactoring the code and re-testing the GUI any time, for every bit, to see if some regression bug appears. It would be quite slow, but, IMO, too much needed to have a maintainable and more flexible code for future improvements.

In the meantime, I’ll begin to prepare Osmarender Frontend’s directory in SVN for release.

August 9, 2008

Unit testing, unit testing…

Posted in GSoC tagged , at 1:31 pm by fadinlight

(This post has been published after the original date)

As said before, I was going to use JSUnit for unit testing while refactoring CMYK library’s code. After failing many times, I’ve found that latest Firefox 3 security policies seems to break JSUnit, so I needed to download it from the JSUnit code trunk and create “security.fileuri.origin_policy=3” key in about:config.

Now it finally works smoothly, and, after some learning, I’ve started to produce some unit tests for the first refactored library modules.

A very interesting thing I’ve found is that, before this version, JSUnit Firefox’s version seemed to support a client-side functionality to browse through local files to open a test suite. This functionality no longer works for Firefox 3. I need to find if really there is no hope to get a Firefox 3 browse feature.

August 6, 2008

Refactoring, refactoring… Documenting, documenting…

Posted in GSoC tagged , , at 4:12 pm by fadinlight

(This post has been published after the original date)

During the last week, I’ve managed to learn and beginning to use Dojo packaging features. So I’ve started splitting my cmyk.js file into model and controller chunks, exporting all functions that refers to models into different Dojo class files. After some little issues with relative paths, and after learning how variable and function scope works in Dojo classes, now it works!

I was starting to get worried, because JSDoc Toolkit seemed not to work in my PC at all, founding no suitable solution in the Net. Even switching from open-jdk to sun-jdk didn’t help. But, even in an unlucky period like this, sometimes a little bit of luck comes out… yesterday JSDoc Toolkit version 2.0.2 has been released… and all begun to work very very smoothly!

I’ve had some issues to let JSDoc Toolkit document properly Dojo classes, but, in the end, I’ve managed to let it work, even if it documents some functions as statics even if they’re not, and even if I needed to create some .js mock files just to document the various namespaces of the packages. Probably there could be a way to do all better, but I think I’ve to defer this research. 🙂

August 5, 2008

Mapping Elice

Posted in OSM Contributions tagged , at 3:29 pm by fadinlight

(This post has been published after the original date)

As said in my last post, Simone Cortesi came here in Montesilvano for two days. Simone thought to try to map a very little town, to see and test how much time is needed to map a whole town. After a quick look on the slippy map, we decided to map a little town nearby, which is called Elice.

An example of synchronous photo 🙂 (right photo by Simone Cortesi)

We went there in the afternoon by his car, and, after a coffee and a little tour around Elice, we found that this town couldn’t be mapped by car! So we parked the car and started to discover every Elice’s street by feet 🙂

Maps maps maps maps (right photo by Simone Cortesi)

We both took GPS traces and photos, while Simone took note of every street on a paper. We found to map the whole town in few more than 1 hour, with much fun, also seeing the faces of the wondering inhabitants 🙂

Elice street sign

Twilight maps… (photo by Simone Cortesi)