|
||||||||||
| 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.ChangeEvent, 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. |
String |
getExportName()
get the root XML element name for this model's XML representation |
String |
getInfo()
return user readable information about the model |
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(InputStream is)
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()
|
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 |
void |
update(Model.ChangeEvent event)
Called to notify Listener when the Model is changed. |
| Methods inherited from class net.sf.borg.model.Model |
|---|
addListener, getExistingModels, refreshListeners, refreshListeners, remove, removeListener, removeListeners, syncModels |
| 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 exception
public void delete(int tasknum)
throws Exception
tasknum - the task id
Exception - the exception
public void delete(int tasknum,
boolean undo)
throws Exception
tasknum - the task idundo - true if we are executing an undo
Exception - the exception
public void deleteProject(int id)
throws Exception
id - the project id
Exception - the exception
public void savetask(Task task)
throws Exception
task - the task
Exception - the exception
public 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 exception
public void close(int num)
throws Exception,
Warning
num - the task id
Exception - the exception
Warning - the warning
public void closeProject(int num)
throws Exception,
Warning
num - the project id
Exception - the exception
Warning - the warning
public void export(Writer fw)
throws Exception
export in class Modelfw - the writer to send XML to
Exception - the exception
public Collection<Project> getProjects()
throws Exception
Exception - the exception
public Project getProject(int id)
throws Exception
id - the id
Exception - the exception
public void importXml(InputStream is)
throws Exception
importXml in class Modelis - the input stream containing the XML
Exception - the exceptionpublic void sync()
sync in class Modelpublic void refresh()
public void update(Model.ChangeEvent event)
Model.Listener
update in interface Model.Listener
public Collection<Subtask> getSubTasks(int taskid)
throws Exception
taskid - the task id
Exception - the exception
public Collection<Subtask> getSubTasks()
throws Exception
Exception - the exception
public Subtask getSubTask(int id)
throws Exception
id - the subtask id
Exception - the exception
public Collection<Task> getTasks(int projectid)
throws Exception
projectid - the projectid
Exception - the exception
public Collection<Project> getSubProjects(int projectid)
throws Exception
projectid - the project id
Exception - the exception
public Collection<Project> getAllSubProjects(int projectid)
throws Exception
projectid - the root project id
Exception - the exception
public void deleteSubTask(int id)
throws Exception
id - the subtask id
Exception - the exception
public void deleteSubTask(int id,
boolean undo)
throws Exception
id - the subtask idundo - true if we are executing an undo
Exception - the exception
public void saveSubTask(Subtask s)
throws Exception
s - the subtask
Exception - the exception
public void saveSubTask(Subtask s,
boolean undo)
throws Exception
s - the subtaskundo - true if we are executing an undo
Exception - the exception
public void addLog(int taskid,
String desc)
throws Exception
taskid - the task iddesc - the log message
Exception - the exception
public Collection<Tasklog> getLogs(int taskid)
throws Exception
taskid - the task id
Exception - the exception
public 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 exception
public 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
public String getExportName()
Model
getExportName in class Model
public String getInfo()
throws Exception
Model
getInfo in class ModelException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||