This is my diploma thesis. Enjoy. Forgive the bugs, this is just a prototype.
Read more about the thesis in my blog.
You can try out the outliner here. The whole fun only starts though when you also "install" it on your local CouchDB instance, and open that and the program on the server in two different browser windows. Then you can see how updates on the server (or on other peoples CouchDB instances) are automatically replicated to your computer.
To see this, make sure you have the right server URL set in /_attachments/app/config/config.js.
Create a new outline and start to write.
- Enter: create and jump to a new line
- Up/down: jump one line up/down
- Tab: Indent a line
- Shift+Tab: Unindent a line
When solving a write conflict:
- Tab or Shift+Tab: Jump between versions
You can also delete outlines and change their titles.
- Install CouchDB.
- Install Couchapp
- Get Firefox >= 3.5. That's the only browser all features are guaranteed to work with. Use other browsers at own risk.
- Start CouchDB as instructed. If you installed from source, you can amend the Rakefile with your CouchDB location and use the raketask "rake couch:start_host"
- Git clone this repository. Rename .couchapprc_example to .couchapprc.
- Do 'couchapp push' in the doingnotes project folder to deploy/"install" doingnotes into your local CouchDB.
- Visit http://localhost:5984/doingnotes/_design/doingnotes/index.html
Running the tests
- $ cd features
- $ cucumber/*.feature
Open the file _attachments/app/spec/index.html and uncomment the specs you want to run.
Replication notifications from remote
- Install, start and deploy CouchDB, Couchapp and doingnotes as instructed above.
- The application is running here already. Set the server URL constant in /_attachments/app/config/config.js to http://lena.couchone.com:5984/doingnotes to replicate with this application. Make sure to do a 'couchapp push' afterwards.
- Visit http://localhost:5984/doingnotes/_design/doingnotes/index.html and open an outline.
- Open the same outline on the server in another browser window, change something in there, and see the instant changes on your local instance.
Replication notifications on your local machine
- You need to set up two CouchDB instances on your machine first.
- Make sure the server URL constant is set to http://localhost:5985 in /_attachments/app/config/config.js
- Start the second couch instance (on port 5985) in another Browser window.
- Open the same outline with both browser windows and type in the window where it says "you won't see any changes here".
- See a notification in the client window (port 5984)
You need to open the same outline on two couch instances in two windows. Then:
- stop the first couch instance,
- write something in the second window,
- stop the second couch instance,
- start the first couch instance,
- write something in the same line in the first window,
- start the second couch instance.
Then you have a write conflict. For creating an append conflict, add a new line to the same line instead of writing in it. You can also create both conflicts for the same line, or multiple (different) conflicts in one outline, or conflicts between more than two instances. But don't expect the outliner to handle all these cases gracefully!
As a shortcut for this lengthy procedure, there are a couple of rake tasks to help you bring your DB into certain states:
- rake:writeconflict or rake:twowriteconflicts or rake:nicewriteconflict
Written 2009/10 by Lena Herrmann, lena[at]zeromail.org or http://github.com/lenalena. Released under the MIT license.