|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.janicke.hj.tools.servlet.AbstractVocAdmin
Handles the vocable administration with a Database.
Constructor Summary | |
AbstractVocAdmin()
|
Method Summary | |
abstract boolean |
addLanguage(User user,
java.lang.String languagename)
Adds a language to the database. |
abstract boolean |
addUnit(User user,
java.lang.String unitname)
Adds a unit to the database. |
abstract boolean |
addVocable(Vocable vocableSet,
User user)
Adds a vocable object in the database with the owner given by the userId of the user. |
abstract boolean |
checkVocable(Vocable vocable,
int modus)
Checks if the vocable is in the database. |
abstract boolean |
delLanguage(User user,
int languageId)
Deletes a language from the database. |
boolean |
delLanguage(User user,
java.lang.String languagename)
Deletes a language from the database. |
abstract boolean |
delUnit(User user,
int unitId)
Deletes a unit specified by unitId from the database. |
boolean |
delUnit(User user,
java.lang.String unitname)
Deletes a unit from the database. |
abstract boolean |
delVocable(Vocable vocable,
User user)
Deletes a record of the database selected by the vocId of the vocable-object. |
abstract boolean |
editVocable(Vocable vocableSet,
boolean status,
User user)
Edits the state of a record in the database selected by the vocId of the vocable object. |
abstract boolean |
editVocable(Vocable vocableSet,
User user)
Edits a record of the database selected by the vocId of the vocable object. |
abstract java.util.Vector |
getAllLanguages()
Returns a vector of all languages defined in the database. |
abstract java.util.Vector |
getAllUnitNames()
Gets all unitnames specified in the database. |
abstract int |
getLanguageIdByLanguagename(java.lang.String languagename)
Returns the id of the language from the database. |
java.util.Vector |
getResultSet(User user,
int lang1,
int lang2)
Returns a vector of vocable objects from the database, where userId and languages, given by the languageId, equals with the database. |
abstract java.util.Vector |
getResultSet(User user,
int lang1,
int lang2,
java.lang.String date)
Returns a vector of vocable objects from the database, where userId, languages given by the languageId equals with the database and where the date of the vocable is younger than the given date. |
java.util.Vector |
getResultSet(User user,
java.lang.String langName1,
java.lang.String langName2)
Returns a vector of vocable objects from the database, where userId and languages, given by the language, equals with the database. |
java.util.Vector |
getResultSet(User user,
java.lang.String langName1,
java.lang.String langName2,
java.lang.String date)
Returns a vector of vocable objects from the database, where userId, languages given by the language equals with the database and where the date of the vocable is younger than the given date. |
abstract int |
getUnitIdByUnitName(java.lang.String unitName)
Gets the UnitId by looking for the unitname in the Database. |
abstract Vocable |
getVocable(int vocId)
Returns the vocable object specified by the vocId. |
abstract Vocable |
getVocable(User user,
int langId1,
int langId2,
int modus,
java.lang.String date,
int unitId)
Returns a vocable object from a user out of the database. |
Vocable |
getVocable(User user,
int langId1,
int langId2,
int modus,
java.lang.String date,
java.lang.String unit)
Returns a vocable object from a user out of the database. |
Vocable |
getVocable(User user,
java.lang.String lang1,
java.lang.String lang2,
int modus,
java.lang.String date,
int unitid)
Returns a vocable object from a user out of the database. |
abstract Vocable |
getVocableFromResultSetByDateRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly by an algorithmen using the date of the vocable object. |
abstract Vocable |
getVocableFromResultSetByStateRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly by an algorithmen using the state of the vocable object. |
abstract Vocable |
getVocableFromResultSetRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly. |
abstract void |
init()
Initializes the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractVocAdmin()
Method Detail |
public abstract void init() throws java.lang.Exception
java.lang.Exception
- if there is no connect to the database, or the precompile of SQL statements fails.public abstract Vocable getVocable(User user, int langId1, int langId2, int modus, java.lang.String date, int unitId) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.langId1
- The source language.langId2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unitid
- The unit id to get the vocabluaries from.public Vocable getVocable(User user, java.lang.String lang1, java.lang.String lang2, int modus, java.lang.String date, int unitid) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.lang1
- The source language.lang2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unitid
- The unit id to get the vocabluaries from.InvalidArgumentException
- if java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocable(User user, int langId1, int langId2, int modus, java.lang.String date, java.lang.String unit) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.langId1
- The source language.langId2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unit
- The unit to get the vocabluaries from.InvalidArgumentException
- if java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract Vocable getVocable(int vocId) throws java.sql.SQLException
vocId
- The primary key of the vocable table in the database.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract Vocable getVocableFromResultSetRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A vector of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract Vocable getVocableFromResultSetByStateRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A vector of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract Vocable getVocableFromResultSetByDateRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A set of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, int lang1, int lang2) throws java.sql.SQLException
user
- A User-Object.lang1
- LanguageId of Vocable1.lang2
- LanguageId of Vocable2.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, java.lang.String langName1, java.lang.String langName2) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- A user object.langName1
- Languagename of vocable1.langName2
- Languagename of vocable2.InvalidArgumentException
- if the at least one of the languages does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract java.util.Vector getResultSet(User user, int lang1, int lang2, java.lang.String date) throws java.sql.SQLException
user
- A user object.lang1
- LanguageId of vocable1.lang2
- LanguageId of vocable2.date
- The date of the oldest vocable that will be returned.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, java.lang.String langName1, java.lang.String langName2, java.lang.String date) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- A user object.langName1
- Languagename of vocable1.langName2
- Languagename of vocable2.date
- The date of the oldest vocable that will be returned.InvalidArgumentException
- if the at least one of the languages does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract boolean checkVocable(Vocable vocable, int modus) throws java.lang.IllegalArgumentException, java.sql.SQLException
vocable
- The Vocable-Object to check.modus
- The current modus.InvalidArgumentException
- if the modus was invalid.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract boolean addUnit(User user, java.lang.String unitname) throws java.sql.SQLException
user
- To determine if user is superuser.unitname
- The name of the unit to add.java.sql.SQLException
- if data couldn't be addedd to the database.public boolean delUnit(User user, java.lang.String unitname) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- To determine if user is superuser.unitname
- The name of the unit to delete.InvalidArgumentException
- if the unitname does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public abstract boolean delUnit(User user, int unitId) throws java.sql.SQLException
user
- To determine if user is superuser.unitId
- The id of the unit to delete.java.sql.SQLException
- if data couldn't be deleted from the database.public abstract int getUnitIdByUnitName(java.lang.String unitName) throws java.lang.IllegalArgumentException, java.sql.SQLException
unitName
- The name of the choosen unit.InvalidArgumentException
- if the unitname does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract java.util.Vector getAllUnitNames() throws java.sql.SQLException
java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract boolean addLanguage(User user, java.lang.String languagename) throws java.sql.SQLException
user
- To determine if user is superuser.languagename
- The name of the language to add.java.sql.SQLException
- if data couldn't be added to the database.public boolean delLanguage(User user, java.lang.String languagename) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- To determine if user is superuser.languagename
- The name of the language to delete.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public abstract boolean delLanguage(User user, int languageId) throws java.sql.SQLException
user
- To determine if user is superuser.languageId
- The id of the language to delete.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public abstract java.util.Vector getAllLanguages() throws java.sql.SQLException
java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract int getLanguageIdByLanguagename(java.lang.String languagename) throws java.lang.IllegalArgumentException, java.sql.SQLException
languagename
- The language.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public abstract boolean addVocable(Vocable vocableSet, User user) throws java.sql.SQLException
vocableSet
- This vocable object will be added in the database.user
- The owner of the vocableSet.java.sql.SQLException
- if data couldn't be added to the database.public abstract boolean delVocable(Vocable vocable, User user) throws java.sql.SQLException
vocable
- This vocable object will be deleted in the database.java.sql.SQLException
- if data couldn't be deleted in the database.public abstract boolean editVocable(Vocable vocableSet, boolean status, User user) throws java.sql.SQLException
vocableSet
- The state of this vocable object will be updated in the database.status
- If the answer was correct then status must be true else false.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be updated in the database.public abstract boolean editVocable(Vocable vocableSet, User user) throws java.sql.SQLException
vocableSet
- This vocable object will be updated in the database.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be updated in the database.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |