Mobile web projects/Collections Backend

This is a draft space for Collections, spring zero backend spike results

Non-MVP Collections schema draft
Collections table:
 * collection_id ( auto increment )
 * user_id ( index )
 * label
 * description
 * private flag ( default false )
 * timestamp ( time created )

Collection_pages table
 * item id ( auto increment )
 * collection id ( index )
 * page id
 * order ( default 0 )
 * timestamp ( time added )

action=editlist
Create, edit, or delete a list. If list ID is given, treat this as an edit request. If only label is given, treat as a creation request. All other parameters are optional. If given, they set/modify list information. If missing, no changes are done to them. To delete an existing list, use the deletelist=1 parameter.

This action also allows pages to be added or removed from the list. Just like action=watch, it supports titles, pagids, revids, and generator queries.

Parameters

 * : List ID of the existing list you want to edit.
 * : Title of the list you want to create (if id is not given), or new label if it already exists.
 * : List description (optional)
 * : List flags (optional)
 * : If set, pages will be removed rather than added (optional,  must be present)
 * : Boolean - if given, the list will be deleted (optional,  must be present)
 * : A "watch" token retrieved from action=query&meta=tokens (TBD)

Statuses

 * created: new list was created
 * updated: existing list was updated. This status is returned even if no actual changes were done to the list
 * deleted: list was deleted

Errors

 * badid: list id does not exist
 * exists: a list with this label already exists
 * noidlabel: either label or id must be given
 * noid: id must be given

action=query &amp; list=lists
List all available lists. For now, lists only lists that belong to a current user. Eventually might make it possible to enumerate lists of other users.

Parameters

 * : Optional list of values to get in addition to id. Default = label. Can be label, desc, eventually - flags, etc.
 * : Optional list id to limit info to just these lists
 * : Optional list label to limit info to just one list

action=query &amp; list=listpages
List all pages in a list. This list can be used as a generator. Eventually this module may support the same parameters as in query/allpages, and/or replace the query/watchlistraw.

Parameters

 * : Which list to show. By default shows list 0 (watchlist)
 * : Optional list label to limit info to just one list