|
public abstract class Repository {
public Entry get (String list, String key) throws WftkException {
Entry result = new Entry (this);
result.list_id = list;
result.key = key;
_get(result);
return result;
}
abstract void _get (Entry e) throws WftkException;
public Entry get_task (Entry e, String local_key) throws WftkException {
Entry result = new Entry (this);
result.list_id = "_tasks";
_get_task(result, e.list_id, e.key, local_key);
return result;
}
abstract void _get_task (Entry e, String list, String key, String local_key) throws WftkException;
public String format (String list, String key, String mode) throws WftkException {
return _format(list, key, mode);
}
abstract String _format (String list, String key, String mode) throws WftkException;
public void add (String list, Entry obj) throws WftkException {
obj.list_id = list;
_add (list, obj); // _add must set "key" attribute properly according to implementation (SOAP returns it, for instance)
}
abstract void _add (String list, Entry obj) throws WftkException;
public void merge (String list, Entry obj, String key) throws WftkException {
_merge (list, obj, key);
}
abstract void _merge (String list, Entry obj, String key) throws WftkException;
public void mod (String list, Entry obj, String key) throws WftkException {
_mod (list, obj, key);
}
abstract void _mod (String list, Entry obj, String key) throws WftkException;
public void del (String list, String key) throws WftkException {
_del (list, key);
}
abstract void _del (String list, String key) throws WftkException;
public List list (String list) throws WftkException {
List l = new List (this);
l.id = list;
_list (l);
return (l);
}
public void list (List l) throws WftkException {
_list (l);
}
abstract void _list (List l) throws WftkException;
public List lists () throws WftkException { return (list("_lists")); }
public List tasks () throws WftkException {
List t = new List(this);
t.id = "_tasks";
_tasks (t);
return (t);
}
public List tasks (Entry e) throws WftkException {
List t = new List(this);
t.id = "_tasks";
_tasks (t,e);
return (t);
}
abstract void _tasks (List t) throws WftkException;
abstract void _tasks (List t, Entry e) throws WftkException;
public List todo () throws WftkException {
List t = new List(this);
t.id = "_todo";
_todo (t);
return (t);
}
abstract void _todo (List t) throws WftkException;
String userid = null;
String authtoken = null;
public boolean auth (String userid, String passwd) throws WftkException {
this.userid = userid;
return _auth (userid, passwd);
}
abstract boolean _auth (String userid, String passwd) throws WftkException;
private Log log = null;
public void setlog (Log _log) { log = _log; }
public void textlog (int level, String str) {
if (log == null) return;
if (level > loglevel) return;
log.textLog (str);
}
public void linklog (int level, String linktext, String content) {
if (log == null) return;
if (level > loglevel) return;
log.linkLog (linktext, content);
}
private int loglevel = 0;
public void set_loglevel (int level) { loglevel = level; }
public int get_loglevel () { return loglevel; }
}
|