|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiurubeans.KiuruHandler | +--kiurubeans.EntityHandler | +--kiurubeans.SpaceGroup
Encapsulation of SpaceGroup data entity.
Field Summary | |
static int |
ACCESSLEVEL_FULL
all modify rights |
static int |
ACCESSLEVEL_NONE
no modify right |
static int |
ACCESSLEVEL_NORMAL
right to modify contents of the spacegroup, but no reserver's access levels |
static int |
ADD_PERSON_CONFIRM
Confirms adding reservers for this spacegroup |
static int |
ADD_PERSONS
Selects reservers for this spacegroup |
static int |
ADD_SPACE_CONFIRM
Confirms adding spaces for this spacegroup |
static int |
ADD_SPACES
Selects spaces for this spacegroup |
static int |
DELETE_PERSONS
Removes reservers from this spacegroup |
static int |
DELETE_SPACES
Removes spaces from this spacegroup |
Fields inherited from class kiurubeans.EntityHandler |
DELETE_RECORD, GET_RECORD, POST_RECORD, RESET_RECORD |
Fields inherited from class kiurubeans.KiuruHandler |
NO_ACTION |
Constructor Summary | |
SpaceGroup()
Dummy empty constructor |
Method Summary | |
void |
addPersons()
Adds selectedPersons to the current spaceGroup. |
void |
addPersons(DB db)
Adds selected persons into the current spaceGroup |
void |
addSpaces()
Adds selected spaces to current spacegroup |
void |
addSpaces(DB db)
Adds selectedSpaces to the current spaceGroup. |
static void |
addToFavorites(Error error,
User user,
java.lang.String[] spaces)
Adds given spaces to user's favorites |
void |
assignSpaceGroupFromDataBase()
Assigns SpaceGroup's properties according to current SpaceGroupId |
void |
assignSpaceGroupFromDataBase(DB db)
Assigns SpaceGroup's properties according to current SpaceGroupId using existing db connection. |
static int |
checkModifyRight(DB db,
User user,
int spaceGroupId)
Checks modify right for spaceGroup with given id. if spaceGroup does not exist or other error is encountered returns 0. |
protected void |
defaultAction()
Performs action based on actionType (eg. addNew, modify, post, delete). |
void |
deletePersons()
Deletes selected persons from current spacegroup |
void |
deleteRecord()
Deletes current spacegroup + relations to spaces & persons |
void |
deleteSpaces()
Deletes selected spaces from current spacegroup |
protected boolean |
doCheckModifyRight()
Implementation of modify rights checking. |
protected void |
doClearActionState(javax.servlet.http.HttpServletRequest request)
Default implementation of clearing action state. |
protected void |
doClearEmptyParameters(javax.servlet.http.HttpServletRequest request)
Implementation of parameter clearing. |
java.lang.String |
getAccessRightLevelAsString()
Returns required accessrightlevel for this spacegroup as string in user's own language. |
int |
getAccessRightLevelId()
Getter for attribute accessRightLevelId. |
boolean |
getAddingNew()
Returns true if entity is in a state of adding a new record.
|
java.lang.String |
getDescription()
Getter for attribute description. |
protected int |
getMaxState()
Returns current max state value. |
int |
getModifyRight()
Getter for attribute modifyRight. |
java.lang.String |
getName()
Returns the name of the spaceGroup |
void |
getRecord()
Retrieves record from database according to current Id field(s) value(s). |
java.lang.String[] |
getSelectedPersons()
Getter for attribute selectedPersons. |
java.lang.String |
getSelectedPersons(int i)
Returns the ith selected person |
java.lang.String[] |
getSelectedSpaces()
Getter for attribute selectedSpaces. |
java.lang.String |
getSelectedSpaces(int i)
Returns the ith selected space |
int |
getSpaceGroupId()
Getter for attribute spaceGroupId. |
static RS2 |
getSpaceGroupTypes()
Returns all spacegrouptypes from database. |
int |
getType()
Returns current spacegroup's type id. |
java.lang.String |
getTypeAsString()
Returns current spacegroup's type as string. |
void |
postRecord()
Saves record to database. |
void |
putSpaceGroupToDataBase()
Saves current spacegroup object to database |
void |
putSpaceGroupToDataBase(DB db)
Saves current spacegroup object to database |
void |
resetRecord()
Clears field values. |
void |
setAccessRightLevelId(int i)
Sets minimum accessRightLevel for reservation requests in this spacegroup Assumes accessrightlevelid is between 1..6 |
void |
setDescription(java.lang.String desc)
Setter for attribute description. |
void |
setName(java.lang.String name)
Sets the name of the spaceGroup. |
void |
setSelectedPersons(int i,
java.lang.String s)
Sets the ith selected person |
void |
setSelectedPersons(java.lang.String[] s)
Setter for attribute selectedPersons. |
void |
setSelectedSpaces(int i,
java.lang.String s)
Sets the ith selected space |
void |
setSelectedSpaces(java.lang.String[] s)
Setter for attribute selectedSpaces. |
void |
setSpaceGroupId(int spaceGroupId)
Setter for attribute spaceGroupId. |
void |
setSubmitAdd(java.lang.String s)
Used with html forms. |
void |
setSubmitAddPersonConfirm(java.lang.String s)
Used with html forms. |
void |
setSubmitAddPersons(java.lang.String s)
Used with html forms. |
void |
setSubmitAddSpace(java.lang.String s)
Used with html forms. |
void |
setSubmitAddSpaceConfirm(java.lang.String s)
Used with html forms. |
void |
setSubmitDelete(java.lang.String s)
Used with html forms. |
void |
setSubmitDeletePersons(java.lang.String s)
Used with html forms. |
void |
setSubmitDeleteSpace(java.lang.String s)
Used with html forms. |
void |
setSubmitModify(java.lang.String s)
Used with html forms. |
void |
setSubmitPost(java.lang.String s)
Used with html forms. |
void |
setType(int spaceGroupType)
Setter for attribute spaceGroupType. |
void |
updateModifyRight()
Returns true is user has right to modify contents of current spacegroup. |
Methods inherited from class kiurubeans.EntityHandler |
clearEmptyParameters, hasModifyRight |
Methods inherited from class kiurubeans.KiuruHandler |
addError, addNotice, getEnumState, getError, getLangId, getOk, getUser, performAction, resetActionState, resetErrorState, setEnumState, setError, setOk, setUser |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ACCESSLEVEL_NONE
public static final int ACCESSLEVEL_NORMAL
public static final int ACCESSLEVEL_FULL
public static final int ADD_SPACES
public static final int ADD_PERSONS
public static final int ADD_SPACE_CONFIRM
public static final int ADD_PERSON_CONFIRM
public static final int DELETE_SPACES
public static final int DELETE_PERSONS
Constructor Detail |
public SpaceGroup()
Method Detail |
protected int getMaxState()
getMaxState
in class EntityHandler
public java.lang.String getName()
public void setName(java.lang.String name)
name
- Name of the spacegrouppublic java.lang.String getTypeAsString()
public int getType()
public void setType(int spaceGroupType)
spaceGroupType
- new spacegroup type id.public int getSpaceGroupId()
public void setSpaceGroupId(int spaceGroupId)
spaceGroupId
- new spacegroup id.public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc
- new spacegroup descriptionpublic java.lang.String[] getSelectedSpaces()
public void setSelectedSpaces(java.lang.String[] s)
s
- The spaces the user has selected for this spacegroup.public void setSelectedSpaces(int i, java.lang.String s)
i
- Which space is going to be sets
- The id of the selected spacepublic java.lang.String getSelectedSpaces(int i)
i
- Which space is given
public java.lang.String[] getSelectedPersons()
public void setSelectedPersons(java.lang.String[] s)
s
- The reservers the user has selected for this spacegroup.public void setSelectedPersons(int i, java.lang.String s)
i
- Which person is going to be sets
- The id of the selected personpublic java.lang.String getSelectedPersons(int i)
i
- Which person is given
public java.lang.String getAccessRightLevelAsString()
public int getAccessRightLevelId()
public void setAccessRightLevelId(int i)
i
- Minimum accessRightLevelpublic void setSubmitAdd(java.lang.String s)
s
- We are not interested in the content of the string, because
it can vary.public void setSubmitModify(java.lang.String s)
s
- We are not interested inpublic void setSubmitPost(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitDelete(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitAddSpace(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitAddSpaceConfirm(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitDeleteSpace(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitAddPersons(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitAddPersonConfirm(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public void setSubmitDeletePersons(java.lang.String s)
s
- We are not interested in the content of the string, because it can vary.public int getModifyRight()
protected void defaultAction() throws java.lang.Exception
defaultAction
in class EntityHandler
java.lang.Exception
- If something went wrong during database operations.KiuruHandler.performAction()
public static RS2 getSpaceGroupTypes() throws java.lang.Exception
RS2
containing name
and spacegroutypeid
of all possible spacegrouptypes.
java.lang.Exception
- If something went wrong during database operations.public void assignSpaceGroupFromDataBase() throws java.lang.Exception
java.lang.Exception
- If something went wrong during database operations.public void assignSpaceGroupFromDataBase(DB db) throws java.lang.Exception
db
- open db connection.
java.lang.Exception
- If something went wrong during database operations.public void putSpaceGroupToDataBase() throws java.lang.Exception
java.lang.Exception
- If something went wrong during database operations.public void putSpaceGroupToDataBase(DB db) throws java.lang.Exception
db
- open db connection
java.lang.Exception
- If something went wrong during database operations.public void deleteRecord()
deleteRecord
in class EntityHandler
public void deleteSpaces()
public void deletePersons()
public void addSpaces() throws java.lang.Exception
java.lang.Exception
- If something went wrong during database operations.public void addSpaces(DB db) throws java.lang.Exception
db
- Database connection
java.lang.Exception
- If something went wrong during database operations.public void addPersons() throws java.lang.Exception
java.lang.Exception
- If something went wrong during database operations.public void addPersons(DB db) throws java.lang.Exception
db
- Database connection
java.lang.Exception
- If something went wrong during database operations.public static void addToFavorites(Error error, User user, java.lang.String[] spaces) throws java.lang.Exception
error
- error
where error messages are sent touser
- User whose favorite list spaces are addedspaces
- array of spaces' id numbers as strings
java.lang.Exception
- If something went wrong during database operations.public void updateModifyRight()
public static int checkModifyRight(DB db, User user, int spaceGroupId) throws java.lang.Exception
db
- Database connectionuser
- User who wants to modify spaceGroupspaceGroupId
- SpaceGroupId of the to be modified spaceGroup
true
if user is allowed to modify spaceGroup
java.lang.Exception
- If something went wrong during database operations.protected boolean doCheckModifyRight()
doCheckModifyRight
in class EntityHandler
EntityHandler.hasModifyRight()
protected void doClearEmptyParameters(javax.servlet.http.HttpServletRequest request)
doClearEmptyParameters
in class KiuruHandler
request
- request
-object from the JSP page.EntityHandler.clearEmptyParameters(HttpServletRequest)
public boolean getAddingNew()
true
if entity is in a state of adding a new record.
Implementation depends of a descendand class.
getAddingNew
in class EntityHandler
True
if entity is in a state of adding a new record.public void getRecord() throws java.lang.Exception
Id field(s) are defined in descendant classes. Method implements also user rights check, eg. if user has no right to retrieve the record, empty object is returned instead.
getRecord
in class EntityHandler
java.lang.Exception
- if there is a problem with DB connectionpublic void postRecord() throws java.lang.Exception
If field values are not valid, sets Ok property to false.
postRecord
in class EntityHandler
java.lang.Exception
- if there is a problem with DB connectionpublic void resetRecord()
Result should be equivalent to constructing a new object. Nothing is saved to database.
resetRecord
in class EntityHandler
protected void doClearActionState(javax.servlet.http.HttpServletRequest request)
doClearActionState
in class EntityHandler
request
- The request-object of the JSP.KiuruHandler.resetActionState(HttpServletRequest)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |