Todo Manager
by Ben Adida
Purpose
The Todo Manager is meant to allow collaboration of task-list creation
and completion. It is initially closely modeled on the PalmPilot ToDo
app, with added collaboration.
The Todo Manager also includes plugability for other modules to
display their information as todos. This allows as single
organizational module to display tasks to the end-user.
The Todo Plugin Architecture
A few important things about the plug-in architecture.
- There is a runtime association between the
todo module and other modules. Nothing in the database represents this
association.
- One plug-in can declare multiple categories for a given user, each
of which will correspond to one to-do list for that user.
- It is the plug-in's role to register with the todo manager and to
provide a call-back API to display todos.
The registration proc will be as follows:
proc todo_plugin_register {plugin_name plugin_procs}
where plugin_procs is an ns_set containing the callback API. The
todo plugin registration expects the following callbacks:
- GET_PERSONAL_CATEGORIES: a procedure that takes a db connection
and a user id and returns the categories that that user can see that
are personal to him.
- GET_OTHER_CATEGORIES: a procedure that takes a db connection and
a user_id and returns the categories that that user can see that
belong other to users.
- ITEM_CHANGE_ALLOWED_P: 1 or 0 depending on whether the user
can change the item from the todo interface or not.
- ITEM_CHANGE: the name of a procedure that takes the following
arguments:
- a db conn.
- user_id: the user.
- todo_id: the id of the item. This id only has a meaning to
the plug-in, it is not the id of a real to-do item.
- new_date: the new date in standard SQL format.
- new_priority: the new priority
- new_item_details: the new item details
This procedure may be blank if the date is not allowed to change.
- MARK_COMPLETED_ALLOWED_P: 1 or 0 depending on whether the user
can mark an item as completed from the todo interface or not.
- MARK_COMPLETED: the name of a procedure that takes the following
arguments:
- a db conn
- user_id: the user performing the operation
- todo_id: the id of the item.
- completion_date: when the item was completed. This argument
is not mandatory.
- ONE_ITEM_URL: the url for a single todo. This will be given the
todo_id as argument.
- ITEM_LIST_SQL: a procedure that takes the following arguments:
- a db conn
- user_id: the user for whom we're querying.
- category: the category of the todos.
- date_prettifier: a PL/SQL proc that prettifies the due date
according to the to-do way of doing things.
- n_days_to_show_completed_items: the number of days that
complete items should show up for after they've been completed.
- completion_status: "open" "closed" or "both" depending on
what we want to show.
the SQL that produces the list of todos. This must
return the following named columns:
- todo_id: the id number. This means something only to the
plugin itself, not to the todo list. It is an identifier that
will be used to throw the user back into the plugged-in module.
- due_date: in the classic todo format of yesterday, today,
etc... the todo PL/SQL can be used for this.
- one_line: a one-liner description of the todo item.
- priority: the priority of the todo item.
- completed_p: whether or not this item has been completed