|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfi.paatti.paattidatabaseutils.dbservice.PaattiDBService
public class PaattiDBService
The implementation of the interfaces PaattiResearchDBService and PaattiMobileDBService.
TODO: Remove system.out messages and add logging.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Constructor Summary | |
|---|---|
PaattiDBService(String dbAddress,
String dbName,
String userName,
String password)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
addScheduleToGroup(Object groupID,
Object scheduleID)
Adds the schedule to the group. |
boolean |
addUserToGroup(Object groupId,
Object userId)
Adds the user to the group. |
Object |
createGroup(String name,
String description,
Object role,
Object research,
int editor,
Object groupID)
Saves the group's information to the database. |
Object |
createResearch(String name,
String description,
Object researchID)
Saves the research's information to the database. |
Object |
createSchedule(String description,
Date zeroTime,
Object scheduleID,
com.vaadin.data.util.IndexedContainer scheduledEvents)
Creates a new schedule. |
Object |
createUser(Object userID,
String userName,
String firstName,
String lastName,
String userPassword,
String userDescription)
Saves user's information to the database. |
Object |
getCellValueFromTable(String tableName,
String columnName,
String idColumn,
Object rowId)
Returns the value of the given column. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getChoiceContainer(Object eventId)
Returns all the choices that belong to the event with the given id. |
ChoiceContainer |
getChoiceContainerWithListener(Object eventId)
Returns the ChoiceContainer containing all the choices from the given event. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getEventsInSchedule(Object scheduleId)
Returns all the events that belong to the schedule with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getGroupResearch(Object groupId)
Returns all the researches that belong to the group with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getGroupRole(Object groupId)
Returns the role of the given group. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getGroupSchedules(Object groupId)
Returns all the schedules that belong to the group with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getGroupUsers(Object groupId)
Returns all the users that belong to the group with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getResearchGroups(Object researchId)
Returns all the groups that belong to the research with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getSQLContainerFromDBTable(String tableName,
String nameOfIdColumn,
boolean noDeletedRows)
Queries the database for the given table and returns an SQLContainer containing the query results. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getSQLContainerFromDBTableFiltered(String tableName,
String nameOfIdColumn,
boolean noDeletedRows,
com.vaadin.data.Container.Filter filter)
Queries the database for the given table and returns an SQLContainer containing the query results. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getTaskContainer(Object eventId)
Returns all the tasks that belong to the event with the given id. |
TaskContainer |
getTaskContainerWithListener(Object eventId)
Returns the TaskContainer containing all the tasks from the given event. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getUserEventData(Object userId)
Returns all the event data that belongs to the user with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getUserGroups(Object userId)
Returns all the groups that belong to the user with the given id. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getUserGroupsdRolesAndResearches(Integer userID)
Returns the roles and researches of the user's groups. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getUserUnfinishedEvents(Object userId)
Returns all the available events for the user. |
com.vaadin.data.util.sqlcontainer.SQLContainer |
getUserVoluntaryEvents(Object userID)
Returns all the voluntary events that are assigned to the user. |
boolean |
removeRowFromTable(Object itemID,
String tableName,
String idColumnName)
Removes the row from the table. |
boolean |
removeUserFromGroup(Object groupId,
Object userId)
Removes the user from the group. |
boolean |
saveEventTaskData(Object userID,
Stack<TaskData> taskDataStack)
Saves all the data from a single event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PaattiDBService(String dbAddress,
String dbName,
String userName,
String password)
dbAddress - The address of the database.dbName - The name of the database.userName - The username that should be used for logging.password - The password that should be used for logging.| Method Detail |
|---|
public com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTable(String tableName,
String nameOfIdColumn,
boolean noDeletedRows)
getSQLContainerFromDBTable in interface PaattiMobileDBServicegetSQLContainerFromDBTable in interface PaattiResearchDBServicetableName - the name of the database table.nameOfIdColumn - the name of the id column.noDeletedRows - whether to filter deleted rows or not.
public com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTableFiltered(String tableName,
String nameOfIdColumn,
boolean noDeletedRows,
com.vaadin.data.Container.Filter filter)
getSQLContainerFromDBTableFiltered in interface PaattiMobileDBServicegetSQLContainerFromDBTableFiltered in interface PaattiResearchDBServicetableName - the name of the database table.nameOfIdColumn - the name of the id column.noDeletedRows - whether to filter deleted rows or not.filter - the filter that is applied to the search results.
public com.vaadin.data.util.sqlcontainer.SQLContainer getTaskContainer(Object eventId)
getTaskContainer in interface PaattiMobileDBServicegetTaskContainer in interface PaattiResearchDBServiceeventId - the event's id.
public TaskContainer getTaskContainerWithListener(Object eventId)
getTaskContainerWithListener in interface PaattiResearchDBServiceeventId - the ID of the event.
public com.vaadin.data.util.sqlcontainer.SQLContainer getChoiceContainer(Object eventId)
getChoiceContainer in interface PaattiMobileDBServicegetChoiceContainer in interface PaattiResearchDBServiceeventId - the event's id.
public ChoiceContainer getChoiceContainerWithListener(Object eventId)
getChoiceContainerWithListener in interface PaattiResearchDBServiceeventId - the ID of the event.
public com.vaadin.data.util.sqlcontainer.SQLContainer getUserGroups(Object userId)
getUserGroups in interface PaattiResearchDBServiceuserId - the user's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getGroupUsers(Object groupId)
getGroupUsers in interface PaattiMobileDBServicegetGroupUsers in interface PaattiResearchDBServicegroupId - the group's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getGroupSchedules(Object groupId)
getGroupSchedules in interface PaattiResearchDBServicegroupId - the group's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getGroupResearch(Object groupId)
getGroupResearch in interface PaattiResearchDBServicegroupId - the group's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getResearchGroups(Object researchId)
getResearchGroups in interface PaattiResearchDBServiceresearchId - the research's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getUserEventData(Object userId)
getUserEventData in interface PaattiMobileDBServicegetUserEventData in interface PaattiResearchDBServiceuserId - the user's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getUserUnfinishedEvents(Object userId)
getUserUnfinishedEvents in interface PaattiMobileDBServiceuserId - the ID of the user.
public com.vaadin.data.util.sqlcontainer.SQLContainer getGroupRole(Object groupId)
getGroupRole in interface PaattiResearchDBServicegroupId - the id of the group.
public Object createUser(Object userID,
String userName,
String firstName,
String lastName,
String userPassword,
String userDescription)
createUser in interface PaattiResearchDBServiceuserID - the id of the user.userName - the user name of the user.firstName - the first name of the user.lastName - the last name of the user.userPassword - the password of the user.userDescription - the description of the user.
public boolean removeRowFromTable(Object itemID,
String tableName,
String idColumnName)
removeRowFromTable in interface PaattiResearchDBServiceitemID - the id of the row to be removed.tableName - the name of the table containing the rowidColumnName - the id column of the table
public Object createResearch(String name,
String description,
Object researchID)
createResearch in interface PaattiResearchDBServicename - the name of the research.description - the description of the research.researchID - the id of the research.
public Object createGroup(String name,
String description,
Object role,
Object research,
int editor,
Object groupID)
createGroup in interface PaattiResearchDBServicename - the name of ther group.description - the description of the group.role - the role of the group.research - the id of the research this group belong to.editor - the id of the editor.groupID - the id of the group.
public Object getCellValueFromTable(String tableName,
String columnName,
String idColumn,
Object rowId)
getCellValueFromTable in interface PaattiMobileDBServicegetCellValueFromTable in interface PaattiResearchDBServicetableName - the name of the table the column belongs to.columnName - the name of the column.idColumn - the ID column of the table.rowId - the ID of the row where the value will be taken from.
public boolean saveEventTaskData(Object userID,
Stack<TaskData> taskDataStack)
saveEventTaskData in interface PaattiMobileDBServiceuserID - the ID of the user.taskDataStack - the list of TaskData items.
public boolean addUserToGroup(Object groupId,
Object userId)
addUserToGroup in interface PaattiResearchDBServicegroupId - the id of the groupuserId - the id of the user
public boolean removeUserFromGroup(Object groupId,
Object userId)
removeUserFromGroup in interface PaattiResearchDBServicegroupId - the ID of the user's group.userId - the ID of the user.
public com.vaadin.data.util.sqlcontainer.SQLContainer getEventsInSchedule(Object scheduleId)
getEventsInSchedule in interface PaattiResearchDBServicescheduleId - the schedule's id.
public com.vaadin.data.util.sqlcontainer.SQLContainer getUserVoluntaryEvents(Object userID)
getUserVoluntaryEvents in interface PaattiMobileDBServiceuserID - the ID of the user.
public com.vaadin.data.util.sqlcontainer.SQLContainer getUserGroupsdRolesAndResearches(Integer userID)
getUserGroupsdRolesAndResearches in interface PaattiResearchDBServiceuserID - the ID of the user.
public Object createSchedule(String description,
Date zeroTime,
Object scheduleID,
com.vaadin.data.util.IndexedContainer scheduledEvents)
createSchedule in interface PaattiResearchDBServicedescription - the description of the schedule.zeroTime - the start date of the schedule.scheduleID - the id of the schedule.scheduledEvents - the list of events that belong to the schedule.
public boolean addScheduleToGroup(Object groupID,
Object scheduleID)
addScheduleToGroup in interface PaattiResearchDBServicegroupID - the id of the group.scheduleID - the id of the schedule.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||