|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiurubeans.KiuruHandler | +--kiurubeans.EntityHandler | +--kiurubeans.KiuruSpace
Representation of Space db entity.
Field Summary | |
static int |
ADD_SPACEGROUP
Selects spacegroups for this space |
static int |
ADD_SPACEGROUP_CONFIRM
Confirms adding spacegroups to this space |
Fields inherited from class kiurubeans.EntityHandler |
DELETE_RECORD, GET_RECORD, POST_RECORD, RESET_RECORD |
Fields inherited from class kiurubeans.KiuruHandler |
NO_ACTION |
Constructor Summary | |
KiuruSpace()
Default constructor |
|
KiuruSpace(int id,
Error e)
Constructor for KiuruSpace. |
Method Summary | |
void |
addSpaceGroups()
Adds current space to selected space groups. |
void |
assignSpaceFromDataBase()
Gets the data for the space from the database according to the spaceId. |
void |
assignSpaceFromDataBase(DB db,
int aid)
Gets the data for the KiuruSpace from database using existing connection. |
void |
assignSpaceFromDataBase(int aid)
Gets the data for the kiuruSpace from database. |
static boolean |
checkReservationRequestRight(int spaceId,
User user)
Checks if given user has rights to make reservation requests to given space. |
static boolean |
checkUserRights(int spaceID,
User user)
Checks if given user has rights to make reservations to given space. |
protected void |
defaultAction()
Performs action based on actionType (eg. addNew, modify, post, delete). |
void |
deleteRecord()
Deletes current space & relations to resource, spacegroup & event. |
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. |
boolean |
equals(java.lang.Object o)
Tells if current KiuruSpace object is equivalent with another object. |
boolean |
getAddingNew()
Returns if entity is in a state of adding a new record. |
int |
getIntSize()
Returns the size of the space as int number. |
protected int |
getMaxState()
Returns current max state value. |
java.lang.String |
getName()
Returns the of the space |
int |
getOrganisationId()
Returns the organisation that "owns" this space. |
void |
getRecord()
Retrieves record from database according to current Id field(s) value(s). |
java.lang.String |
getReservationMethod()
Returns the name of the reservation method used for this space. |
java.util.ArrayList |
getReservationMethodList()
Returns the list of available reservation methods for spaces. |
java.lang.String[] |
getSelectedSpaceGroups()
Returns the selected spaceGroups. |
java.lang.String |
getSelectedSpaceGroups(int i)
Returns the ith selected spaceGroup |
java.lang.String |
getSize()
Returns the size of the space in String. |
static KiuruSpace |
getSpaceFromDataBase(DB db,
int aid)
Creates a new kiuruSpace object and gets data from database for newly created kiuruSpace. |
static KiuruSpace |
getSpaceFromDataBase(int aid)
Creates a new kiuruSpace object and gets data from database for newly created kiuruSpace. |
int |
getSpaceId()
Returns the spaceId of the current object. |
static RS2 |
getSpaceTypes()
Returns all spacegrouptypes from database. |
int |
getType()
Returns the type of space. |
void |
postRecord()
Saves record to database. |
void |
putSpaceToDataBase()
Stores the data of the object into the database |
void |
resetRecord()
Clears field values. |
void |
setName(java.lang.String name)
Sets the name of the space |
void |
setOrganisationId(int i)
Organisation that "owns" the space. |
void |
setReservationMethod(java.lang.String reservationMethod)
Sets reservation method for this space. |
void |
setSelectedSpaceGroups(int i,
java.lang.String s)
Sets the ith selected spacegroup |
void |
setSelectedSpaceGroups(java.lang.String[] s)
User wants to e.g. add this space into these spaceGroups |
void |
setSize(int size)
Sets the size of the space. |
void |
setSize(java.lang.String size)
Sets the size of the space. |
void |
setSpaceId(int id)
Sets the id for the current space. |
void |
setSpaceId(java.lang.String id)
Sets the spaceId for the current space. |
void |
setSubmitAdd(java.lang.String s)
Used with html forms. |
void |
setSubmitAddSpaceGroup(java.lang.String s)
Used with html forms. |
void |
setSubmitAddSpaceGroupConfirm(java.lang.String s)
Used with html forms. |
void |
setSubmitDeleteRecord(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 spaceType)
Sets the type of the space. |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ADD_SPACEGROUP
public static final int ADD_SPACEGROUP_CONFIRM
Constructor Detail |
public KiuruSpace(int id, Error e)
id
- The spaceId for the spacee
- Error objects. Possible error messages are delivered here.public KiuruSpace()
Method Detail |
protected int getMaxState()
getMaxState
in class EntityHandler
public boolean getAddingNew()
getAddingNew
in class EntityHandler
public java.util.ArrayList getReservationMethodList()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- Name of the spacepublic int getIntSize()
public java.lang.String getSize()
public void setSize(int size)
size
- How many people are allowed to be in the space at the same time.public void setSize(java.lang.String size)
size
- String that tells how many people are allowed to be in the space at the same
time. String has to contain a non-negative integer number.public java.lang.String getReservationMethod()
public void setReservationMethod(java.lang.String reservationMethod)
reservationMethod
- How is reservations supervised. Not really needed if we use only Korppipublic int getSpaceId()
public void setSpaceId(int id)
id
- New spaceIdpublic void setSpaceId(java.lang.String id)
id
- String containing the new space id. id must be an integer.public void setOrganisationId(int i)
i
- Id of the organisationpublic int getOrganisationId()
public int getType()
public void setType(int spaceType)
spaceType
- spaceTypeId of the new type.public java.lang.String[] getSelectedSpaceGroups()
public void setSelectedSpaceGroups(java.lang.String[] s)
s
- The string array containing the ids of the spaceGroups the user has selected.public void setSelectedSpaceGroups(int i, java.lang.String s)
i
- Which spaceGroup is going to be sets
- The id of the selected spaceGrouppublic java.lang.String getSelectedSpaceGroups(int i)
i
- Which spaceGroup is given
public void setSubmitAdd(java.lang.String s)
s
- We are not interested in the content of the string,
because it can be translated. The most important thing is that it exists.EntityHandler.RESET_RECORD
public void setSubmitModify(java.lang.String s)
s
- We are not interested in the content of the string,
because it can be translated. The most important thing is that it exists.EntityHandler.GET_RECORD
public void setSubmitPost(java.lang.String s)
s
- We are not interested in the content of the string,
because it can be translated. The most important thing is that it exists.EntityHandler.POST_RECORD
public void setSubmitDeleteRecord(java.lang.String s)
s
- We are not interested in the content of the string,
because it can be translated. The most important thing is that it exists.EntityHandler.DELETE_RECORD
public void setSubmitAddSpaceGroup(java.lang.String s)
s
- We are not interested in the content of the string,
because it can be translated. The most important thing is that it exists.ADD_SPACEGROUP
public void setSubmitAddSpaceGroupConfirm(java.lang.String s)
s
- We are not interested in this, because it can be translated. The most important
thing is that it exists.ADD_SPACEGROUP_CONFIRM
public void resetRecord()
Result should be equivalent to constructing a new object. Nothing is saved to database.
resetRecord
in class EntityHandler
protected void defaultAction() throws java.lang.Exception
defaultAction
in class EntityHandler
java.lang.Exception
- If something went wrong in the actual actions performed.KiuruHandler.performAction()
public void assignSpaceFromDataBase() throws java.lang.Exception
java.lang.Exception
- If database handling was not successfulpublic void assignSpaceFromDataBase(DB db, int aid) throws java.lang.Exception
db
- Database connectionaid
- spaceId of the wanted space.
java.lang.Exception
- If something went wrong during the database query.public void assignSpaceFromDataBase(int aid) throws java.lang.Exception
aid
- The spaceId of wanted space.
java.lang.Exception
- If something went wrong during database handling.public static KiuruSpace getSpaceFromDataBase(int aid) throws java.lang.Exception
aid
- spaceId of the wanted space.
java.lang.Exception
- If something went wrong during database handling.public static KiuruSpace getSpaceFromDataBase(DB db, int aid) throws java.lang.Exception
db
- Database connection.aid
- spaceId of the wanted space.
java.lang.Exception
- If something went wrong during database handling.public void putSpaceToDataBase() throws java.lang.Exception
java.lang.Exception
- Saving into the database was not ok.public void deleteRecord()
deleteRecord
in class EntityHandler
public void addSpaceGroups() throws java.lang.Exception
java.lang.Exception
- if there is a problem with db connection.public static RS2 getSpaceTypes() throws java.lang.Exception
name
and spacetypeid
of the
spacegrouptypes.
java.lang.Exception
- Database handling was not ok.public static boolean checkUserRights(int spaceID, User user) throws java.lang.Exception
spaceID
- spaceId of the space where user wants to make reservations.user
- User who is making the reservation.
java.lang.Exception
- Database query was not ok.public static boolean checkReservationRequestRight(int spaceId, User user) throws java.lang.Exception
spaceId
- spaceId of the space where user wants to make reservations.user
- User who is making the reservation request.
java.lang.Exception
- Database query was not ok.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Object that we are comparing our KiuruSpace object with.
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 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 connectionprotected 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 |