From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-soc+bounces-303-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1KSbfV-000346-8S
	for garchives@archives.gentoo.org; Mon, 11 Aug 2008 17:58:57 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5BFC6E067D;
	Mon, 11 Aug 2008 17:58:56 +0000 (UTC)
Received: from yx-out-1718.google.com (yx-out-1718.google.com [74.125.44.157])
	by pigeon.gentoo.org (Postfix) with ESMTP id 31DDFE067D
	for <gentoo-soc@lists.gentoo.org>; Mon, 11 Aug 2008 17:58:56 +0000 (UTC)
Received: by yx-out-1718.google.com with SMTP id 4so751207yxp.46
        for <gentoo-soc@lists.gentoo.org>; Mon, 11 Aug 2008 10:58:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:mime-version:content-type:content-transfer-encoding
         :content-disposition;
        bh=z4D6SEZHK1wIKw1h6XPqKxWEGyKx3dQ5rryPx0dBnHE=;
        b=D7/jHbKifgeuHYyduRwfBsy7ecQ5njY7kowhox8RJxi6GrqrpBJfMCPv67rCq2y+v2
         SNBT9fpcAcP0BkJm6po5T0QXe8WzaCJw2S2li9OYXVRkW7nFjYj1ZW5wYMGh/c9aWu5e
         A5PttF774b6AdpW5Shz0UPRLjI+HZymwjBKuc=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:mime-version:content-type
         :content-transfer-encoding:content-disposition;
        b=xvDBWX2zcANUiLkhCxrT5vInnHYrrQA9xNFDCM1y0wmPXfeMR9loxrPfn6nLPRtiSd
         CutMS4RG0U70T3njCm/ov9HAh1kb13U5BQuHqrRM5IQYK5Dxr9zqLx2au273owJhMCvo
         uJict+/dY9LIzRUXR3KYSuiokpduak0NxvN58=
Received: by 10.114.178.13 with SMTP id a13mr3748238waf.158.1218477534767;
        Mon, 11 Aug 2008 10:58:54 -0700 (PDT)
Received: by 10.115.109.7 with HTTP; Mon, 11 Aug 2008 10:58:54 -0700 (PDT)
Message-ID: <b59c1640808111058q1758dec2o3bdebf21ffc30046@mail.gmail.com>
Date: Mon, 11 Aug 2008 23:28:54 +0530
From: "Nandeep Mali" <n9986.mali@gmail.com>
To: gentoo-soc@lists.gentoo.org
Subject: [gentoo-soc] Progress Report - Setting Beacon Afloat
Precedence: bulk
List-Post: <mailto:gentoo-soc@lists.gentoo.org>
List-Help: <mailto:gentoo-soc+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-soc+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-soc+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-soc.gentoo.org>
X-BeenThere: gentoo-soc@lists.gentoo.org
Reply-to: gentoo-soc@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Archives-Salt: 20895fd0-9034-4cfb-a608-6080d0f4be05
X-Archives-Hash: e8dc3e2ac6ba07599533aa3ac244f3a6

Hi folks,

It's 11th, the suggested "pencil down" date for Google Summer of Code
2008. It's been fun. And it'll continue to be. No pencil down
unofficially. :)

Here's a long due report on Beacon.

My post mid-term deliverable was the collaborative editor. The initial
week was spent learning, cleaning and sprucing certain sections of
code and realizing how much more I need to learn. I spent quite a time
looking around, reading other codes and going through articles on many
topics in Web Apps. I wanted a know how on how to make a great web
app, issues with scalability (after a twitter/blog update by Anant ;)
[1]), good asynchronous JavaScript programming patterns etc. [2].
There are not many open source collaborative RTEs out there [3]. I
started my coding on it and changed my practices. So the post mid-term
code turned out to be different and more manageable and re-factoring
other code will not be difficult. I had tried to avoid the use of
libraries so I could understand more [4].

The collaborative editor has pretty much the same layout as the 'solo'
editor. The document, but, is not fully editable at once. I am using
inline editors (like in the original beacon), which allow user to edit
a part of the document by clicking on it. The click makes the text
editable (much like the Dojo inline editor, which sadly did not have
the support for an RTE and since I have a framework for one, I forged
it myself). This helps me in applying section locking so as to prevent
changes by different editors from colliding.

There is a tiny chat widget on the page and a user list which can help
editors stay in sync with each other within the editor itself.

As the document is being edited the sections get locked/unlocked
giving the user a complete view of what's happening. Epic events like
adding a chapter/section are handled differently by locking the whole
document. This part is still being worked upon.

Another major learning step was good (shudder) Ajaxing. Reading a lot
many articles by JS gurus I tried to find the best way to handle the
large amount of asynchronous requests made in the collaborative
editor. There are some periodical poll functions like getting the
connected users list, chats, server syncs and data comms. I had to
find the some ways to remove the HTTP open/close overheads but sadly
browsers don't support some hacks so well so went ahead with simple
polling. An interesting read at [5].

So what's remaining now?

- The completion of server-client communication in the collaborative editor.
- Perform the much needed testing and bug fixing.
- Completing the stand-alone editor's missing features like support
for certain GuideXML elements and output of well formatted XML.

Staying in tune to the project 'title' I plan to set afloat a beta
after the first two tasks.

Thanks to bonsaikitten, there's a demo of the current code base at
[6]. The 'solo' editor is pretty useable and you can play with the
chat feature in the collab editor. To let another user join your
session just copy the URL in the browser and paste it to the other
person. Or you could just open two tabs in the browser and chat with
yourself. :P

My future plan is to basically just continue work with Beacon and make
it as extensible and feature rich as possible while keeping it very
easy to install and run anywhere. I also plan to port it to Python
later (for a possible integration with the Google App Engine, thanks
to quantumsummers for that idea :) ).

It has been a great learning experience! More updates later.

Kind Regards
Nandeep


[1] http://www.kix.in/blog/2008/07/weeks-8-9-load-balancing-oauth/
[2] One of the good articles on JS patterns:
http://www.klauskomenda.com/code/javascript-programming-patterns/
[3] Wikipedia: http://en.wikipedia.org/wiki/Collaborative_real-time_editor
[4] A nice article by JS guru Stuart Langridge on use of libraries:
http://www.kryogenix.org/days/2006/12/24/the-fog-of-libraries/
[5] A bit on HTTP connections: http://en.wikipedia.org/wiki/Comet_(programming)
[6] http://dev.gentooexperimental.org/~n9986/beacon/trunk/editor/
(currently supported only in Firefox)