kiurubeans
Class ContactPerson

java.lang.Object
  |
  +--kiurubeans.KiuruHandler
        |
        +--kiurubeans.EntityHandler
              |
              +--kiurubeans.ContactPerson
All Implemented Interfaces:
EnumType

public class ContactPerson
extends EntityHandler

Representation of a contact person.


Field Summary
 
Fields inherited from class kiurubeans.EntityHandler
DELETE_RECORD, GET_RECORD, POST_RECORD, RESET_RECORD
 
Fields inherited from class kiurubeans.KiuruHandler
NO_ACTION
 
Constructor Summary
ContactPerson()
          Default constructor
 
Method Summary
 void deleteRecord()
          Deletes current record from database.
protected  boolean doCheckModifyRight()
          Implementation of modify rights checking.
protected  void doClearActionState(javax.servlet.http.HttpServletRequest request)
          Implementation of clearing action state.
protected  void doClearEmptyParameters(javax.servlet.http.HttpServletRequest request)
          Implementation of parameter clearing.
 boolean getAddingNew()
          Returns if entity is in a state of adding a new record.
 int getIntOrganisationId()
          Getter for property organisationId.
 java.lang.String getLastName()
          Getter for property lastName.
 java.lang.String getOrganisationId()
          Returns ID of organisation that contact person is related to.
 int getPersonId()
          Getter for property personId.
 void getRecord()
          Retrieves record from database according to current Id field(s) value(s).
 void postRecord()
          Saves record to database.
 void resetRecord()
          Clears field values.
 void setLastName(java.lang.String lastName)
          Setter for property lastName.
 void setOrganisationId(int organisationId)
          Setter for property organisationId.
 void setOrganisationId(java.lang.String organisationId)
          Setter for property organisationId.
 void setPersonId(int personId)
          Setter for property personId.
 void setSubmitPost(java.lang.String s)
          This method sets the internal state of the object into "Post".
 
Methods inherited from class kiurubeans.EntityHandler
clearEmptyParameters, defaultAction, getMaxState, 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
 

Constructor Detail

ContactPerson

public ContactPerson()
Default constructor

Method Detail

getPersonId

public int getPersonId()
Getter for property personId.

Returns:
Value of property personId.

setPersonId

public void setPersonId(int personId)
Setter for property personId.

Parameters:
personId - New value of property personId.

getLastName

public java.lang.String getLastName()
Getter for property lastName.

Returns:
Value of property lastName.

setLastName

public void setLastName(java.lang.String lastName)
Setter for property lastName.

Parameters:
lastName - New value of property lastName.

getIntOrganisationId

public int getIntOrganisationId()
Getter for property organisationId.

Returns:
Value of property organisationId.

getOrganisationId

public java.lang.String getOrganisationId()
Returns ID of organisation that contact person is related to.

Returns:
The OrganisationId of the contact person.

setOrganisationId

public void setOrganisationId(java.lang.String organisationId)
Setter for property organisationId.

Parameters:
organisationId - New value of property organisationId.

setOrganisationId

public void setOrganisationId(int organisationId)
Setter for property organisationId.

Parameters:
organisationId - New value of property organisationId.

setSubmitPost

public void setSubmitPost(java.lang.String s)
This method sets the internal state of the object into "Post".

Parameters:
s - Actually not needed. The important thing is that it exists.

doCheckModifyRight

protected boolean doCheckModifyRight()
Implementation of modify rights checking. This should be called

Specified by:
doCheckModifyRight in class EntityHandler
Returns:
true is user can modify entity.
See Also:
EntityHandler.hasModifyRight()

deleteRecord

public void deleteRecord()
Deletes current record from database. NOT IMPLEMENTED YET.

Actually applies deleted=true. Object is cleared after deletion.

Specified by:
deleteRecord in class EntityHandler

getRecord

public void getRecord()
Retrieves record from database according to current Id field(s) value(s).

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.

Specified by:
getRecord in class EntityHandler

postRecord

public void postRecord()
                throws java.lang.Exception
Saves record to database.

If field values are not valid, sets Ok property to false.

Specified by:
postRecord in class EntityHandler
Throws:
java.lang.Exception - if there is a problem with DB connection.

resetRecord

public void resetRecord()
Clears field values.

Result should be equivalent to constructing a new object. Nothing is saved to database.

Specified by:
resetRecord in class EntityHandler

doClearEmptyParameters

protected void doClearEmptyParameters(javax.servlet.http.HttpServletRequest request)
Implementation of parameter clearing. Clears parameters that wasn't given from the JSP.

Specified by:
doClearEmptyParameters in class KiuruHandler
Parameters:
request - Request-object from the JSP page.
See Also:
EntityHandler.clearEmptyParameters(HttpServletRequest)

getAddingNew

public boolean getAddingNew()
Returns if entity is in a state of adding a new record. Implementation depends of a descendant class.

Specified by:
getAddingNew in class EntityHandler
Returns:
True if the record doesn't exist in the database, yet.

doClearActionState

protected void doClearActionState(javax.servlet.http.HttpServletRequest request)
Implementation of clearing action state.

Overrides:
doClearActionState in class EntityHandler
Parameters:
request - The request-object from the JSP-page.
See Also:
EntityHandler.clearEmptyParameters(HttpServletRequest)