net.sf.imca.model
Class PersonBO

java.lang.Object
  extended by net.sf.imca.model.PersonBO

public class PersonBO
extends java.lang.Object

Business Object representing the properties, persistence and functionality of the IMCA domain object.

Author:
dougculnane

Constructor Summary
PersonBO()
           
PersonBO(javax.persistence.EntityManager em, long id)
           
PersonBO(javax.persistence.EntityManager em, org.w3c.dom.NodeList nodeList)
           
PersonBO(javax.persistence.EntityManager em, java.lang.String email)
           
PersonBO(javax.persistence.EntityManager em, java.lang.String email, java.lang.String password)
           
PersonBO(PersonEntity personEntity)
           
 
Method Summary
static java.lang.String convertOldXmlCountryCodesToISO(java.lang.String oldXmlCode)
          This is to fix XML data problems.
 java.lang.String getAddressHtml()
           
 AssociationBO[] getCommitteeMemberships(javax.persistence.EntityManager em)
           
 java.lang.String getCountry()
           
 java.lang.String getDefaultCountryCode()
           
 PersonEntity getEntity()
          Get the persistence entity.
 java.util.Locale getLocale()
           
 java.lang.String getName()
          Human friendly name of person.
 AssociationBO[] getOficialIMCACommitteeMemberships(javax.persistence.EntityManager em)
           
 boolean getOnCommittee(javax.persistence.EntityManager em)
           
 java.lang.String getRiderPageUrl()
           
 java.lang.String getSmallPictureUrl()
           
 java.lang.String getXmlId()
           
 boolean isCurrentMember()
           
 boolean isOnWorldsCommitte()
           
 boolean register(javax.persistence.EntityManager em)
           
 void replaceEmail(javax.persistence.EntityManager em, java.lang.String email)
          Change the email address in the enitity if it is unique.
 void sendMembershipConfirmationMail(javax.persistence.EntityManager em, MembershipTypeEntity memType)
           
 void sendMembershipRequestMail(javax.persistence.EntityManager em, MembershipTypeEntity memType)
           
 void sendPassword(javax.persistence.EntityManager em, javax.mail.internet.InternetAddress email)
          Send password by mail.
 void setEntity(PersonEntity entity)
          Set the persistence entity.
 void setPasswordEncodeAndSet(java.lang.String plainTextPassword)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersonBO

public PersonBO()

PersonBO

public PersonBO(javax.persistence.EntityManager em,
                long id)

PersonBO

public PersonBO(javax.persistence.EntityManager em,
                java.lang.String email)

PersonBO

public PersonBO(javax.persistence.EntityManager em,
                java.lang.String email,
                java.lang.String password)
         throws LogInException
Throws:
LogInException

PersonBO

public PersonBO(javax.persistence.EntityManager em,
                org.w3c.dom.NodeList nodeList)

PersonBO

public PersonBO(PersonEntity personEntity)
Method Detail

register

public boolean register(javax.persistence.EntityManager em)
                 throws RegistrationException,
                        javax.mail.internet.AddressException
Throws:
RegistrationException
javax.mail.internet.AddressException

getEntity

public PersonEntity getEntity()
Get the persistence entity.

Returns:
The persistence entity for this Business Object.

setEntity

public void setEntity(PersonEntity entity)
Set the persistence entity.

Parameters:
entity - The new persistence entity for this Business Object.

setPasswordEncodeAndSet

public void setPasswordEncodeAndSet(java.lang.String plainTextPassword)
                             throws java.io.UnsupportedEncodingException,
                                    java.security.NoSuchAlgorithmException,
                                    DataCheckingException
Throws:
java.io.UnsupportedEncodingException
java.security.NoSuchAlgorithmException
DataCheckingException

sendPassword

public void sendPassword(javax.persistence.EntityManager em,
                         javax.mail.internet.InternetAddress email)
                  throws javax.mail.MessagingException,
                         DataCheckingException
Send password by mail. TODO: Mailserver config from properties file.

Parameters:
em - EntityManager for persistence.
email - user supplied email address.
Throws:
javax.mail.MessagingException - When problem occurs.
DataCheckingException

getLocale

public java.util.Locale getLocale()

getName

public java.lang.String getName()
Human friendly name of person.

Returns:

getXmlId

public java.lang.String getXmlId()

convertOldXmlCountryCodesToISO

public static java.lang.String convertOldXmlCountryCodesToISO(java.lang.String oldXmlCode)
This is to fix XML data problems.

Parameters:
oldXmlCode -
Returns:

replaceEmail

public void replaceEmail(javax.persistence.EntityManager em,
                         java.lang.String email)
                  throws DataCheckingException
Change the email address in the enitity if it is unique.

Parameters:
email -
Throws:
DataCheckingException

isOnWorldsCommitte

public boolean isOnWorldsCommitte()

isCurrentMember

public boolean isCurrentMember()

getOnCommittee

public boolean getOnCommittee(javax.persistence.EntityManager em)

getCommitteeMemberships

public AssociationBO[] getCommitteeMemberships(javax.persistence.EntityManager em)

getOficialIMCACommitteeMemberships

public AssociationBO[] getOficialIMCACommitteeMemberships(javax.persistence.EntityManager em)

getDefaultCountryCode

public java.lang.String getDefaultCountryCode()

sendMembershipRequestMail

public void sendMembershipRequestMail(javax.persistence.EntityManager em,
                                      MembershipTypeEntity memType)
                               throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

sendMembershipConfirmationMail

public void sendMembershipConfirmationMail(javax.persistence.EntityManager em,
                                           MembershipTypeEntity memType)
                                    throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getCountry

public java.lang.String getCountry()

getAddressHtml

public java.lang.String getAddressHtml()

getSmallPictureUrl

public java.lang.String getSmallPictureUrl()

getRiderPageUrl

public java.lang.String getRiderPageUrl()


Copyright © 2007-2008 The International Moth Class Association (IMCA).. All Rights Reserved.