mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-16 08:01:39 +00:00
notes and API docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
55e8daa4ce
commit
6a0dc89c45
@ -54,6 +54,53 @@ function(name, get, update, ...args){
|
||||
//---------------------------------------------------------------------
|
||||
// Store...
|
||||
|
||||
//
|
||||
// API levels:
|
||||
// Level 1 -- implementation API
|
||||
// This level is the base API, this is used by all other Levels.
|
||||
// This is the only level that needs to be fully overloaded by store
|
||||
// implementations (no super calls necessary).
|
||||
// The base methods that need to be overloaded for the store to work:
|
||||
// .__paths__()
|
||||
// -> <keys>
|
||||
// .__exists__(path, ..)
|
||||
// -> <path>
|
||||
// -> false
|
||||
// .__get__(path, ..)
|
||||
// -> <data>
|
||||
// Optional for r/w stores:
|
||||
// .__update__(path, ..)
|
||||
// .__delete__(path, ..)
|
||||
// Level 2 -- feature API
|
||||
// This can use Level 1 and Level 2 internally.
|
||||
// When overloading it is needed to to call the super method to
|
||||
// retain base functionality.
|
||||
// All overloading here is optional.
|
||||
// .paths()
|
||||
// -> <path-list>
|
||||
// .names()
|
||||
// -> <name-index>
|
||||
// .exists(<path>)
|
||||
// -> <real-path>
|
||||
// -> false
|
||||
// .get(<path>)
|
||||
// -> <data>
|
||||
// -> undefined
|
||||
// .metadata(<path>[, <data>])
|
||||
// -> <store> -- on write
|
||||
// -> <data>
|
||||
// -> undefined
|
||||
// .update(<path>, <data>)
|
||||
// -> <store>
|
||||
// .delete(<path>)
|
||||
// -> <store>
|
||||
// .load(..)
|
||||
// -> <store>
|
||||
// .json(..)
|
||||
// -> <json>
|
||||
// Level 3
|
||||
// ...
|
||||
//
|
||||
//
|
||||
// To create a store adapter:
|
||||
// - inherit from BaseStore
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
/**********************************************************************
|
||||
*
|
||||
*
|
||||
* XXX might be a good idea to make some methods that only access the
|
||||
* index sync -- this will make the store unusable while indexing
|
||||
* though...
|
||||
* XXX ASAP prevent paths from using reserved chars like: ":", "#", ...
|
||||
* XXX FEATURE list macro paging...
|
||||
* ...should this be macro level or handled in .each()
|
||||
@ -34,6 +37,12 @@
|
||||
* /some/path/!action
|
||||
* ..."!" is removed before the <store>.__<name>__(..) calls...
|
||||
* XXX ENERGETIC revise naming...
|
||||
* XXX OPTIMIZE might be a good idea to move stuff down the stack to Store:
|
||||
* .each() -> .store.each(<path>)
|
||||
* ...this will enable ups to optimize page loading on a store
|
||||
* level...
|
||||
* ...another approach would be to make .get(..) accept a list of
|
||||
* paths and return an iterator...
|
||||
* XXX OPTIMIZE page search: make things invariant via .names
|
||||
* - if a page is in a system path and there are no alternatives
|
||||
* just return it and do not search.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user