|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.borg.model.Model
net.sf.borg.model.TaskModel
public class TaskModel
TaksModel manages all of the task related entities - Task, Project, Subtask, and Tasklog
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.borg.model.Model |
---|
Model.Listener |
Method Summary | |
---|---|
void |
addLog(int taskid,
String desc)
Add a task log entry. |
void |
beginTransaction()
|
void |
close(int num)
close a task |
void |
closeProject(int num)
Close a project. |
void |
commitTransaction()
|
static int |
daysBetween(Date start,
Date dd)
determine the number fo days between two dates |
static int |
daysLeft(Date dd)
return the number of days left before a given date. |
void |
delete(int tasknum)
Delete a task |
void |
delete(int tasknum,
boolean undo)
Delete a task |
void |
deleteProject(int id)
Delete a project. |
void |
deleteSubTask(int id)
Delete a sub task. |
void |
deleteSubTask(int id,
boolean undo)
Delete a sub task. |
void |
export(Writer fw)
export the task data for all tasks to XML. |
Collection<Project> |
get_projects(Date d)
Get all projects due on a particular date |
Collection<Subtask> |
get_subtasks(Date d)
Get all subtasks due on a particular date |
Vector<Task> |
get_tasks()
Get all open tasks with a due date |
Collection<Task> |
get_tasks(Date d)
Get all tasks due on a particular date |
Collection<Project> |
getAllSubProjects(int projectid)
Gets the entire project tree for a project |
Collection<String> |
getCategories()
Gets the list of all categories from all entities in the source model |
TaskDB |
getDB()
Gets the dB. |
Collection<Tasklog> |
getLogs()
Get all task logs. |
Collection<Tasklog> |
getLogs(int taskid)
Get all task logs for a task. |
Project |
getProject(int id)
Get a project by id. |
Collection<Project> |
getProjects()
Get all projects. |
static TaskModel |
getReference()
Gets the singleton. |
Collection<Project> |
getSubProjects(int projectid)
Get sub projects for a project - direct children only |
Subtask |
getSubTask(int id)
Get a sub task by id. |
Collection<Subtask> |
getSubTasks()
Get all sub tasks. |
Collection<Subtask> |
getSubTasks(int taskid)
Get the sub tasks for a task |
Task |
getTask(int num)
Gets a task by id. |
Collection<Task> |
getTasks()
Get all tasks. |
Collection<Task> |
getTasks(int projectid)
Get all tasks for a project. |
TaskTypes |
getTaskTypes()
Gets the task types. |
void |
importXml(String fileName)
Import xml. |
static boolean |
isClosed(Project p)
Checks if a project is closed. |
static boolean |
isClosed(Task t)
Checks if a task is closed. |
Task |
newMR()
create a new task |
void |
refresh()
Called to notify Listener when the Model is changed. |
void |
rollbackTransaction()
|
void |
saveProject(Project p)
Save a project. |
void |
saveProject(Project p,
boolean undo)
Save a project. |
void |
saveSubTask(Subtask s)
Save a sub task. |
void |
saveSubTask(Subtask s,
boolean undo)
Save a sub task. |
void |
savetask(Task task)
Save a task. |
void |
savetask(Task task,
boolean undo)
Save a task. |
void |
saveTaskTypes(TaskTypes tt)
save the task types to the db |
Collection<KeyedEntity> |
search(SearchCriteria criteria)
Return a collection of all records that match the given search criteria |
void |
sync()
sync with db |
Methods inherited from class net.sf.borg.model.Model |
---|
addListener, refreshListeners, remove, removeListener, removeListeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public TaskDB getDB()
public Collection<Task> get_tasks(Date d)
d
- the date
public Collection<Subtask> get_subtasks(Date d)
d
- the date
public Collection<Project> get_projects(Date d)
d
- the date
public Vector<Task> get_tasks()
public static TaskModel getReference()
public TaskTypes getTaskTypes()
public void saveTaskTypes(TaskTypes tt) throws Exception
tt
- the task types
Exception
- the exceptionpublic Collection<String> getCategories()
CategoryModel.CategorySource
getCategories
in interface CategoryModel.CategorySource
public Collection<Task> getTasks() throws Exception
Exception
- the exceptionpublic void delete(int tasknum) throws Exception
tasknum
- the task id
Exception
- the exceptionpublic void delete(int tasknum, boolean undo) throws Exception
tasknum
- the task idundo
- true if we are executing an undo
Exception
- the exceptionpublic void deleteProject(int id) throws Exception
id
- the project id
Exception
- the exceptionpublic void savetask(Task task) throws Exception
task
- the task
Exception
- the exceptionpublic void savetask(Task task, boolean undo) throws Exception
task
- the taskundo
- true if we are executing an undo
Exception
- the exceptionpublic Task newMR()
public Task getTask(int num) throws Exception
num
- the id
Exception
- the exceptionpublic void close(int num) throws Exception, Warning
num
- the task id
Exception
- the exception
Warning
- the warningpublic void closeProject(int num) throws Exception, Warning
num
- the project id
Exception
- the exception
Warning
- the warningpublic void export(Writer fw) throws Exception
fw
- the writer to send XML to
Exception
- the exceptionpublic Collection<Project> getProjects() throws Exception
Exception
- the exceptionpublic Project getProject(int id) throws Exception
id
- the id
Exception
- the exceptionpublic void importXml(String fileName) throws Exception
fileName
- the file name of the file containing the XML
Exception
- the exceptionpublic void sync()
public void refresh()
Model.Listener
refresh
in interface Model.Listener
public Collection<Subtask> getSubTasks(int taskid) throws Exception
taskid
- the task id
Exception
- the exceptionpublic Collection<Subtask> getSubTasks() throws Exception
Exception
- the exceptionpublic Subtask getSubTask(int id) throws Exception
id
- the subtask id
Exception
- the exceptionpublic Collection<Task> getTasks(int projectid) throws Exception
projectid
- the projectid
Exception
- the exceptionpublic Collection<Project> getSubProjects(int projectid) throws Exception
projectid
- the project id
Exception
- the exceptionpublic Collection<Project> getAllSubProjects(int projectid) throws Exception
projectid
- the root project id
Exception
- the exceptionpublic void deleteSubTask(int id) throws Exception
id
- the subtask id
Exception
- the exceptionpublic void deleteSubTask(int id, boolean undo) throws Exception
id
- the subtask idundo
- true if we are executing an undo
Exception
- the exceptionpublic void saveSubTask(Subtask s) throws Exception
s
- the subtask
Exception
- the exceptionpublic void saveSubTask(Subtask s, boolean undo) throws Exception
s
- the subtaskundo
- true if we are executing an undo
Exception
- the exceptionpublic void addLog(int taskid, String desc) throws Exception
taskid
- the task iddesc
- the log message
Exception
- the exceptionpublic Collection<Tasklog> getLogs(int taskid) throws Exception
taskid
- the task id
Exception
- the exceptionpublic Collection<Tasklog> getLogs() throws Exception
Exception
- the exceptionpublic static int daysLeft(Date dd)
dd
- the date
public static int daysBetween(Date start, Date dd)
start
- the first datedd
- the later date
public void beginTransaction() throws Exception
Exception
public void commitTransaction() throws Exception
Exception
public void rollbackTransaction() throws Exception
Exception
public void saveProject(Project p) throws Exception
p
- the project
Exception
- the exceptionpublic void saveProject(Project p, boolean undo) throws Exception
p
- the projectundo
- true if we are executing an undo
Exception
- the exceptionpublic static boolean isClosed(Task t)
t
- the task
public static boolean isClosed(Project p)
p
- the project
public Collection<KeyedEntity> search(SearchCriteria criteria)
Searchable
search
in interface Searchable<KeyedEntity>
criteria
- the search criteria
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |