edu.jhu.cs.oose.group3.intelligentbook.backingbeans
Class AddPersonalInfoBackingBean

java.lang.Object
  extended by edu.jhu.cs.oose.group3.intelligentbook.backingbeans.SuperBackingBean
      extended by edu.jhu.cs.oose.group3.intelligentbook.backingbeans.SessionBackingBean
          extended by edu.jhu.cs.oose.group3.intelligentbook.backingbeans.AddContactBackingBean
              extended by edu.jhu.cs.oose.group3.intelligentbook.backingbeans.AddPersonalInfoBackingBean

public class AddPersonalInfoBackingBean
extends AddContactBackingBean

This class is the backing bean for adding personal information. Personal emails and phones are handled by this bean. Mutiple emails and phones can be added. Emails and phones not needed can be removed.


Field Summary
private  java.util.List<Entry<java.lang.String,EmailContactItem>> emails
          Here we are using an entry because we are passing a pair of information around.
private  java.lang.String jumpLocation
          This is used to know the position of the form
private  int nextEmailId
           
private  int nextPhoneId
           
private  java.util.List<Entry<java.lang.String,PhoneContactItem>> phones
           
private  boolean[] renderEmails
           
private  boolean[] renderPhones
           
private  java.lang.String targetEmail
           
private  java.lang.String targetPhone
           
 
Constructor Summary
AddPersonalInfoBackingBean()
           
 
Method Summary
 java.lang.String addOneEmail()
          Add one more email to the form
 java.lang.String addOnePhone()
          Add one phone to the form
 java.lang.String clearOneEmail()
          Clear on email entry from the form
 java.lang.String clearOnePhone()
          Clear one phone from the form
 java.util.List<Entry<java.lang.String,EmailContactItem>> getEmails()
          Get the email entries to be filled in the form
 java.lang.String getJumpLocation()
          Get the jump location, for knowing the position in the form
 int getMaxEmails()
          Get the max number of emails
 int getMaxPhones()
          Get the max number of emails
 java.util.List<Entry<java.lang.String,PhoneContactItem>> getPhones()
          Get the phone entries to fill in the form
 boolean[] getRenderEmails()
          Get whether to render emails
 boolean[] getRenderPhones()
          Get whether it's ok to render phone entries
 java.lang.String getTargetEmail()
          Get the target email, for knowing which email is being referred
 java.lang.String getTargetPhone()
          Get the target phone, for knowing which phone is being referred
 boolean isOkToAddEmail()
          Whether it's ok to add an email
 boolean isOkToAddPhone()
          Whether it's ok to add one phone
 java.lang.String removeOneEmail()
          Remove one email entry from the form
 java.lang.String removeOnePhone()
          Remove one phone from the form
 void setEmails(java.util.List<Entry<java.lang.String,EmailContactItem>> emails)
          Set the email entries to be filled in the form
 void setJumpLocation(java.lang.String jumpLocation)
          Set the jump location, for knowing the position in the form
 void setPhones(java.util.List<Entry<java.lang.String,PhoneContactItem>> phones)
          Set the phone entries to fill in the form
 void setTargetEmail(java.lang.String targetEmail)
          Set the target email, for knowing which email is being referred
 void setTargetPhone(java.lang.String targetPhone)
          Set the target phone, for knowing which phone is being referred
 java.lang.String updateContact()
          Save/update the contact items
 
Methods inherited from class edu.jhu.cs.oose.group3.intelligentbook.backingbeans.AddContactBackingBean
getAllContactGroups, getAllStates, getContactItemKeys, getContactService, setContactItemKeys, setContactService
 
Methods inherited from class edu.jhu.cs.oose.group3.intelligentbook.backingbeans.SessionBackingBean
getAllEnumeratedGroups, getCurrentUser, setCurrentUser
 
Methods inherited from class edu.jhu.cs.oose.group3.intelligentbook.backingbeans.SuperBackingBean
getErrors, getNotices, setErrors, setNotices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emails

private java.util.List<Entry<java.lang.String,EmailContactItem>> emails
Here we are using an entry because we are passing a pair of information around. Entry is same as Map.Entry, except that Map.Entry cannot be instantiated, which is why Entry is used.


targetEmail

private java.lang.String targetEmail

nextEmailId

private int nextEmailId

renderEmails

private boolean[] renderEmails

phones

private java.util.List<Entry<java.lang.String,PhoneContactItem>> phones

targetPhone

private java.lang.String targetPhone

nextPhoneId

private int nextPhoneId

renderPhones

private boolean[] renderPhones

jumpLocation

private java.lang.String jumpLocation
This is used to know the position of the form

Constructor Detail

AddPersonalInfoBackingBean

public AddPersonalInfoBackingBean()
Method Detail

getEmails

public java.util.List<Entry<java.lang.String,EmailContactItem>> getEmails()
Get the email entries to be filled in the form

Returns:
emails email entries to be filled in the form

setEmails

public void setEmails(java.util.List<Entry<java.lang.String,EmailContactItem>> emails)
Set the email entries to be filled in the form

Parameters:
emails - email entries to fill the form

getMaxEmails

public int getMaxEmails()
Get the max number of emails

Returns:
max number of emails

isOkToAddEmail

public boolean isOkToAddEmail()
Whether it's ok to add an email

Returns:
whether it's ok to add an email

addOneEmail

public java.lang.String addOneEmail()
Add one more email to the form

Returns:
status

getTargetEmail

public java.lang.String getTargetEmail()
Get the target email, for knowing which email is being referred

Returns:
target email, for knowing which email is being referred.

setTargetEmail

public void setTargetEmail(java.lang.String targetEmail)
Set the target email, for knowing which email is being referred

Parameters:
targetEmail - the target email, for knowing which email is being referred

removeOneEmail

public java.lang.String removeOneEmail()
Remove one email entry from the form

Returns:
status

clearOneEmail

public java.lang.String clearOneEmail()
Clear on email entry from the form

Returns:
status

getRenderEmails

public boolean[] getRenderEmails()
Get whether to render emails

Returns:
get whether to render emails

getPhones

public java.util.List<Entry<java.lang.String,PhoneContactItem>> getPhones()
Get the phone entries to fill in the form

Returns:
phones phone entries to fill in the form

setPhones

public void setPhones(java.util.List<Entry<java.lang.String,PhoneContactItem>> phones)
Set the phone entries to fill in the form

Parameters:
phones - phone entries to fill in the form

getMaxPhones

public int getMaxPhones()
Get the max number of emails

Returns:
the max number of emails

isOkToAddPhone

public boolean isOkToAddPhone()
Whether it's ok to add one phone

Returns:
whether it's ok to add one phone

addOnePhone

public java.lang.String addOnePhone()
Add one phone to the form

Returns:
status

getTargetPhone

public java.lang.String getTargetPhone()
Get the target phone, for knowing which phone is being referred

Returns:
target phone, for knowing which phone is being referred

setTargetPhone

public void setTargetPhone(java.lang.String targetPhone)
Set the target phone, for knowing which phone is being referred

Parameters:
targetPhone - target from for knowing which phone is being referred

removeOnePhone

public java.lang.String removeOnePhone()
Remove one phone from the form

Returns:
status

clearOnePhone

public java.lang.String clearOnePhone()
Clear one phone from the form

Returns:
status

getRenderPhones

public boolean[] getRenderPhones()
Get whether it's ok to render phone entries

Returns:
whether it's ok to render phone entries

getJumpLocation

public java.lang.String getJumpLocation()
Get the jump location, for knowing the position in the form

Returns:
for knowing the position in the form

setJumpLocation

public void setJumpLocation(java.lang.String jumpLocation)
Set the jump location, for knowing the position in the form

Parameters:
jumpLocation -

updateContact

public java.lang.String updateContact()
Save/update the contact items

Specified by:
updateContact in class AddContactBackingBean
Returns:
update status