Google Summer of Code – 2009 Balance

Now that GSOC has ended, I thought I would share with you my thoughts on this experience.

This started by being a terrifying experience (not in the bad meaning of the word). It was the first time I developed something real for a real team. It was my first time working in a open-source project and the first time working with such diverse technologies like JSP, Spring, jQuery, DWR and even Javascript.

I was stunned by the community. The people at OpenMRS is very patient and supportive, at first I was relunctant to ask some questions I thought were stupid, but everyone helped me without complaining. If the project went as far as it did is because of everyone at OpenMRS who went to the IRC channel and read/answered the mailing lists. I give my thanks to everyone, especially to my mentors, Darius Jazayeri and Daniel Futerman, for their infinite patience.  If you are reading this balance, chances are that I also have to give you my thanks, for your feedback and support.

About the project. Although the milestones for the project were accomplished and, overall, the goals were met, I feel that the module is still very incomplete. I’ve created a page for development tracking of the module. I’ve already added a lot of points to improve, and you are encoraged to add your own: HTML Form Entry Designer – Development Tracking

I’ve also added installation instructions and a small tutorial for its use on the project wiki page.

One of the goals of GSOC was to promote open-source development among students, and for me it succeeded. I’ll try to keep developing the HTML Form Entry Designer module as often as I can and possibly fix some bugs in OpenMRS or take other projects. I would also like to have a try with different open source communities.

So was it worth it? Definitely, yes. If I my exam period hadn’t overlapped with GSOC it would be like heaven. Because it did overlap, GSOC was more like an earthly thing, with good and bad times. Thankfully the good times totally eclipsed the bad ones, so I’m recommending this program to everyone (and if you are applying next year, consider OpenMRS!).

I’ll try to use this blog to keep in track with my ventures in the world of open-source, so stay tuned (for those of you subscribed to openmrs feeds, don’t worry, you’ll only receive entries tagged with “openmrs”). For now I’m going to take a little vacancy, until September (away from the computer, so I’ll probably won’t be able to answer emails, although I’ll try to check it a day or two).

Thank you all!

GSOC Weekly Blog Entry (2009-08-17)

Today was the “firm pencils down” date for GSOC and I “released” a “beta” version of the HTML Form Entry Designer. You can try it here: http://lab10.openmrs.org:8080/openmrs/module/htmlformentrydesigner/designerHome.form

User: admin
Pass: test

If you “follow” the video in the previous entry you should have no problem understanding how to use it.

This is a beta version, so a few bugs are to be expected. Also, tinymce can be quite weird sometimes :(

This is what I did this week:

  • Added Coded and Datetime concepts (all observations treated by htmlformentry are now functional!)
  • The Encounter Provider now shows a list of the roles in the database
  • Tinymce uses the release version instead of the development version (as well as the visualxml plugin), meaning the speed should be quite improved.

It sounds too little (especially compared with last week), but I had to learn how to use controllers to connect to the database, as well as dwelve into some of the openmrs code, so I’ve spent some time doing it. I’m glad I did it because my understanding was quite lacking in that department.

Now that GSOC is over (the code period at least), I mean to continue with the development of htmlformentrydesigner. For the few days I’ll try to write documentation for the module (how to use it, identify bugs, features to implement, limitations, etc), so that other users can use it and other developers can help with it. After next week I’m taking a vacancy from the computer (until the end of August), and I should restart development with it (well, September and October are very demanding months for me, but I’ll try to help whenever I have free time.

Also, next week I’ll write a balance of GSOC (it’s definitely positive!)

GSOC Weekly Blog Entry (2009-08-10)

With only a week left for the suggested end of the coding period of GSOC, I’ve tried to give my best efforts to improve the editor. This past week was so productive (maybe I really needed a break), that the htmlformentrydesigner moved from 0.5-dev to 0.7-dev (and I’m very picky on incrementing version numbers).

Here’s the full changelog:

  • Widgets are now rendered properly thanks to the atomic plugin and trailing plugin.
  • Fixed the bug that wouldn’t allow to render observation widgets in the designer view
  • Added more buttons to the editor
  • Used the same CSS as the one used by OpenMRS (although it’s not exactly the same as the one used by htmlformentry, I still need to see to it)
  • Added encounter widgets, to offer Encounter Date, Location and Provider controls
  • Added correct handling of the submit tag
  • The editor automatically adds <htmlform></htmlform> envolving the content
  • Added buttons in the tinymce toolbar for adding observations, encounter widgets and the submit button
  • The dialogs for adding observations and encounters are inline (ajax)
  • Removed &nbsp; entities because htmlformentry doesn’t support it

Here’s a video of the capabilities of 0.7-dev:

You may have noticed by the video that this is almost a full version of the htmlformentrydesigner. That’s what I’m expecting to have next week, here’s my plan for it:

  • Add Coded and Datetime widgets for observations
  • Improve integration with htmlformentry module
  • Add templates for easing form creation
  • Improve code (for speed and readability)
  • Fix possible bugs and try to improve usability

GSOC Weekly Blog Entry (2009-08-02)

This entry is sooner than usual because I’m taking the next 3 days off to go camping with my friends. This week I had to move to my summer house, so I hadn’t as much time as last week to work. I’ve also found some bugs while installing the trunk version of OpenMRS on my laptop, which took me a few hours to resolve.

Here’s what I’ve done this week:

- Fixed a bug with OpenMRS, that would throw an exception if the DWRConceptService.getConcept method was called with a non-existant concept ID

- Given up on using the noneditable plugins to keep rendered widgets from being editable (I still need to figure out a way to render them properly)

- Added the rendering of Text and Boolean widgets

For next week my goals are:

- Render widgets properly with other HTML (this should take most of my time)

- Choose the buttons to use in TinyMCE

- Fix the bug that doesn’t allow tinymce to render a concept directly in the Designer View if it is added from that view

- Use the same CSS in the editor as the one originally used in OpenMRS

I hope I get back with renewed energy to embrace this last few weeks of GSOC!

GSOC Weekly Blog Entry (2009-07-27)

I’ll make this one short because it’s past 1.30 AM and I still want to practice at my piano…

This week was quite productive. Here’s what was done:

- The visualxml plugin successfully converts between non-standard html code (<obs…/>) to standard html code (<span…></span>)
- The framework for registering the visual code of each widget is ready (its foundations at least) and its showcased with the numeric widget

I also learned a lot about javascript regular expressions.

However, there are still plenty of bugs to correct (which I’ll try to identify in my wiki page soon). For the next week, solving those bugs and adding the renderers for other widgets should be my priority. I’m still behind on the schedule, but I think I can get back on track (my estimate is around 8-10 of August).

And here’s the video of the current version of the designer. At the end there was a bug (because the editor tried to figure the type of a conceptid that didn’t exist), but I think the designer is finally shaping itself (you should go to the youtube page to see it better).

GSOC Weekly Blog Entry (2009-07-20)

I managed to configure tinyMCE in my module, although it was not as smooth process as I would like. Actually, the problem wasn’t in tinymce, but in my module’s build.xml file. If you are using the helloworld module as the starting point for creating your module, please use the basicmodule instead, since the helloworld module isn’t updated since revision 4002. I’ve opened a ticket regarding this issue and I’m planning to update the helloworld module after I’m finished with my own problems ;)

Configuring tinymce was quite easy. I quickly given up the idea of creating a new theme, since the advanced theme offers all the customization I need. For now there are just 3 buttons on tinymce (Bold, Italic, Underline), just to keep it, but all the functionality of a full-fledged wysiwyg editor can be added by just changing a few parameters.

Most of this week was passed trying to figure out how can I solve the conversion from code view to design view. I need to transform this:

<obs conceptID=”1234″ labelText=”Weeks old: “/>

Into this:

<div class=”numeric”><div class=”label”>Weeks old:</div><input type=”textfield”/></div>

And vice-versa. Fortunately, tinymce has a good event manager and good DOM utilities that will make this possible (at least I hope so!).

Actually, I tried to create a plugin that showed something like: “Here be widgets!” each time a concept was entered in the code view (via the Add Concept button, for example). I didn’t succeed yet, but the amount of research I had into the tinymce code will surely help me with next week. Also, I’ve realized how really “pro” javascript works, and I think I can improve my “widget factory” a lot.

So, for the next week, I think I should have a code view <-> design view translator plugin ready (which I called visualxml) and I should have figured a way for widgets to register themselves with this plugin.

PS: A weekly blog entry wouldn’t really be one without a screenshot :)

tinymce_begin

GSOC Weekly Blog Entry (2009-07-14)

College exams are finally over! This means the project will occupy most of my time from now on. I’ll do my best to keep things on schedule before the end of the month!

So, about last week. I’ve added a way to add concepts from the database into the textarea. The foundations of the Add Concept dialog are now relatively complete. Here’s a small video demonstration from the state of the Html Form Entry Designer. You can see it in “HD” for better quality (and better size if you follow the link to youtube):

I also had to choose (once and for all) the wysiwyg editor to use. The main contenders were TinyMCE and FCKEditor, and I’ve chosen TinyMCE. They are great tools to work with, so this choice wasn’t  an easy one.

I’ve chosen TinyMCE because it’s smaller, more simple and faster. I also loved its interface (although there are several themes for both editors. FCKEditor was very close, it was less buggy (or at least so they say) and had a solid feel to it. If you (the reader) don’t know what one to choose, then take my advice, choose one and stick with it. They are both good…

So, for the next week, I’ll integrate TinyMCE to the project (install, costumize, etc.) and I will add a button for the Add Concept dialog. If it’s easy to use tinymce popups, I’ll try to convert the dialog to those popups (which are floating divs). If it’s not, I’ll look for other alternatives, probably inside OpenMRS (I recall seeing an OpenMRS Popup tag). I’ll also plan the way to change non-visual code (obs tags) to visual (html) tags. I’ve been thinking about this for a long time, and I think the solution is to use the TinyMCE events to dinamically change between visual and non-visual code. This would be accomplished if each widget implements a “code” parser.

GSOC Weekly Blog Entry (2009-07-05)

This week was more productive than the others (mostly because I had my last exam on Wednesday).

Here’s what I’ve done this week:

  • Added AJAX functionality to the Add Concept dialog, via jQuery.
  • Added a flexible way for programmers to add new widgets to the HTML Form Entry Designer module. Basically, the developers just need to specify an HTML template for the form in the Add Concept dialog and create a Javascript class with handleSubmit (called when the user presses the submit button) and generateHTML (which should return the string to put in the textarea) methods. If you want to know the full process of creating a add concept dialog for a (new) widget, you can see some examples.
  • Added the Numeric, Text and Boolean widgets dialogs

Mid-term evaluations should start next week, so here’s a balance of the period. The goal for the mid-term evaluation was to have  the Add Concept dialogs generating proper HTML (milestones 1-3). Milestone #2 (retrieving concepts and its datatype from the database) isn’t ready yet (haven’t started it yet!), but I’ll try to finish that before next week. To compensate for that, I’ve worked into milestone #5 (a framework for developers to add widgets), so I could say that the goal was almost reached.

I’m a bit behind on schedule, mostly due to my wrong estimates of available time during my school exams period. Now that the first period of exams is gone (I’m just counting on going to one other exam in the second period), I’ll have more time to get it back on schedule.

For the next week I’ll try to complete milestone #2 (retrieve concepts from the database) and I’ll begin “playing” with tinymce and fckeditor to decide on what editor to use. I’ll post the advantages and disadvantages I find on each one in the next weekly blog entry.

Some screenshots of the new widgets’ dialogs:

GSOC Weekly Blog Entry (2009-06-27)

I finally fixed the problems with my module. Turns out there was a bug with the ExtensionPoint tag (it was already fixed).

So, now that I had the module up and ready for coding, the deliverables for this week were to create the Add Concept dialog for some of the widgets, by following my previous mockups. After having some trouble with Javascript (mainly because there are no “compiler errors” and the hard debugging, even with the Firebug tool), I finally have some (roughly) working thing to show.

Here’s a (working) Add Concept Dialog:

Add Concept Dialog

And here’s what happens to the big textarea if you click on Submit:

Result from Add Concept

This is all Javascript magic. I’m still trying to figure out the perfect way of adding the widget dialogs so it’s easy for other developers to implement them (for new widgets). If you want you can check my progress on the module repository.

PS: I’m at a very early stage of development, so don’t be stressed about the “nasty popup dialog”. The goal this week is to have a simple code generator for the HTML Form Entry module. Both TinyMCE and FCKEditors support a lot more fancier “popups” (without really opening a new window), which will be used later.

PPS: Just one more exam to go (July 1)! Well, actually I’ll still have one more exam period (in which I can repeat the previous exams to get a better grade), but, for now, I’m only expecting to repeat one exam…

GSOC Weekly Blog Entry (2009-06-18)

Phew, I survived this final weeks of the semester. I’ll still have exams (until July 1, or later if I need to repeat some of them), but I’ll have more free time (for GSOC and for myself :) ).

About the HTML Form Entry Designer project, I had two deliverables to complete this week:

1 – Create a mockup of the Add Concept dialog of each widget

2 – Create the core components of the htmlformentrydesigner module (config.xml, activator and a portlet extension to the htmlformentry module)

I had (am having) some problems with setting up an extension point with the htmlformentry module. See this thread on the dev-list.

I’ve commited my module to the module repository, so if you want to help I’ll appreciate it.