Created
April 13, 2012 00:30
-
-
Save dgs700/2372284 to your computer and use it in GitHub Desktop.
A slice from an old Java, Struts2, Hibernate, Spring application - the applications part is still in service at http://conservationcorpsnorthbay.org/f/eng/hyc_programs_apply
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.model; | |
import java.io.Serializable; | |
import java.util.Date; | |
import javax.persistence.*; | |
/** | |
* application table entity class | |
* @author david | |
*/ | |
@Entity | |
@Table(name = "applications") | |
@NamedQueries({}) | |
public class Application implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue | |
@Column(name = "id", nullable = false) | |
private Integer id; | |
@Column(name = "date_appl") | |
private String dateAppl; | |
@Lob | |
@Column(name = "date_birth") | |
private String dateBirth; | |
@Column(name = "last_name") | |
private String lastName; | |
@Column(name = "first_name") | |
private String firstName; | |
@Lob | |
@Column(name = "middle") | |
private String middle; | |
@Lob | |
@Column(name = "street_address_pres") | |
private String streetAddressPres; | |
@Lob | |
@Column(name = "city_pres") | |
private String cityPres; | |
@Lob | |
@Column(name = "state_pres") | |
private String statePres; | |
@Lob | |
@Column(name = "zip_pres") | |
private String zipPres; | |
@Lob | |
@Column(name = "street_address_perm") | |
private String streetAddressPerm; | |
@Lob | |
@Column(name = "city_perm") | |
private String cityPerm; | |
@Lob | |
@Column(name = "state_perm") | |
private String statePerm; | |
@Lob | |
@Column(name = "zip_perm") | |
private String zipPerm; | |
@Lob | |
@Column(name = "home_phone") | |
private String homePhone; | |
@Lob | |
@Column(name = "cell_phone") | |
private String cellPhone; | |
@Lob | |
@Column(name = "email_address") | |
private String emailAddress; | |
@Column(name = "position") | |
private String position; | |
@Column(name = "heard_from") | |
private String heardFrom; | |
@Column(name = "prior_work") | |
private String priorWork; | |
@Lob | |
@Column(name = "previous_supervisor") | |
private String previousSupervisor; | |
@Column(name = "friends") | |
private String friends; | |
@Lob | |
@Column(name = "friends_names") | |
private String friendsNames; | |
@Lob | |
@Column(name = "age_range") | |
private String ageRange; | |
@Column(name = "transportation") | |
private String transportation; | |
@Column(name = "citizenship") | |
private String citizenship; | |
@Column(name = "license") | |
private String license; | |
@Column(name = "able") | |
private String able; | |
@Lob | |
@Column(name = "functions") | |
private String functions; | |
@Column(name = "offense") | |
private String offense; | |
@Lob | |
@Column(name = "offense_details") | |
private String offenseDetails; | |
@Lob | |
@Column(name = "school_address_hs") | |
private String schoolAddressHs; | |
@Lob | |
@Column(name = "years_completed_hs") | |
private String yearsCompletedHs; | |
@Column(name = "graduated_hs") | |
private String graduatedHs; | |
@Lob | |
@Column(name = "degree_hs") | |
private String degreeHs; | |
@Lob | |
@Column(name = "school_address_coll") | |
private String schoolAddressColl; | |
@Lob | |
@Column(name = "years_completed_coll") | |
private String yearsCompletedColl; | |
@Column(name = "graduated_coll") | |
private String graduatedColl; | |
@Lob | |
@Column(name = "degree_coll") | |
private String degreeColl; | |
@Lob | |
@Column(name = "school_address_coll2") | |
private String schoolAddressColl2; | |
@Lob | |
@Column(name = "years_completed_coll2") | |
private String yearsCompletedColl2; | |
@Column(name = "graduated_coll2") | |
private String graduatedColl2; | |
@Lob | |
@Column(name = "degree_coll2") | |
private String degreeColl2; | |
@Lob | |
@Column(name = "school_address_other") | |
private String schoolAddressOther; | |
@Lob | |
@Column(name = "years_completed_other") | |
private String yearsCompletedOther; | |
@Column(name = "graduated_other") | |
private String graduatedOther; | |
@Lob | |
@Column(name = "degree_other") | |
private String degreeOther; | |
@Lob | |
@Column(name = "highest_grade") | |
private String highestGrade; | |
@Lob | |
@Column(name = "diploma") | |
private String diploma; | |
@Column(name = "interested") | |
private String interested; | |
@Column(name = "fluent") | |
private String fluent; | |
@Lob | |
@Column(name = "fluent_details") | |
private String fluentDetails; | |
@Column(name = "qualifications") | |
private String qualifications; | |
@Lob | |
@Column(name = "qualifications_details") | |
private String qualificationsDetails; | |
@Lob | |
@Column(name = "empl_name0") | |
private String emplName0; | |
@Lob | |
@Column(name = "empl_phone0") | |
private String emplPhone0; | |
@Lob | |
@Column(name = "empl_address0") | |
private String emplAddress0; | |
@Lob | |
@Column(name = "empl_supervisor0") | |
private String emplSupervisor0; | |
@Lob | |
@Column(name = "reason0") | |
private String reason0; | |
@Lob | |
@Column(name = "date_from0") | |
private String dateFrom0; | |
@Lob | |
@Column(name = "date_to0") | |
private String dateTo0; | |
@Lob | |
@Column(name = "wage0") | |
private String wage0; | |
@Lob | |
@Column(name = "hours0") | |
private String hours0; | |
@Lob | |
@Column(name = "duties0") | |
private String duties0; | |
@Column(name = "contact0") | |
private String contact0; | |
@Lob | |
@Column(name = "empl_name1") | |
private String emplName1; | |
@Lob | |
@Column(name = "empl_phone1") | |
private String emplPhone1; | |
@Lob | |
@Column(name = "empl_address1") | |
private String emplAddress1; | |
@Lob | |
@Column(name = "empl_supervisor1") | |
private String emplSupervisor1; | |
@Lob | |
@Column(name = "reason1") | |
private String reason1; | |
@Lob | |
@Column(name = "date_from1") | |
private String dateFrom1; | |
@Lob | |
@Column(name = "date_to1") | |
private String dateTo1; | |
@Lob | |
@Column(name = "wage1") | |
private String wage1; | |
@Lob | |
@Column(name = "hours1") | |
private String hours1; | |
@Lob | |
@Column(name = "duties1") | |
private String duties1; | |
@Column(name = "contact1") | |
private String contact1; | |
@Lob | |
@Column(name = "empl_name2") | |
private String emplName2; | |
@Lob | |
@Column(name = "empl_phone2") | |
private String emplPhone2; | |
@Lob | |
@Column(name = "empl_address2") | |
private String emplAddress2; | |
@Lob | |
@Column(name = "empl_supervisor2") | |
private String emplSupervisor2; | |
@Lob | |
@Column(name = "reason2") | |
private String reason2; | |
@Lob | |
@Column(name = "date_from2") | |
private String dateFrom2; | |
@Lob | |
@Column(name = "date_to2") | |
private String dateTo2; | |
@Lob | |
@Column(name = "wage2") | |
private String wage2; | |
@Lob | |
@Column(name = "hours2") | |
private String hours2; | |
@Lob | |
@Column(name = "duties2") | |
private String duties2; | |
@Column(name = "contact2") | |
private String contact2; | |
@Lob | |
@Column(name = "empl_name3") | |
private String emplName3; | |
@Lob | |
@Column(name = "empl_phone3") | |
private String emplPhone3; | |
@Lob | |
@Column(name = "empl_address3") | |
private String emplAddress3; | |
@Lob | |
@Column(name = "empl_supervisor3") | |
private String emplSupervisor3; | |
@Lob | |
@Column(name = "reason3") | |
private String reason3; | |
@Lob | |
@Column(name = "date_from3") | |
private String dateFrom3; | |
@Lob | |
@Column(name = "date_to3") | |
private String dateTo3; | |
@Lob | |
@Column(name = "wage3") | |
private String wage3; | |
@Lob | |
@Column(name = "hours3") | |
private String hours3; | |
@Lob | |
@Column(name = "duties3") | |
private String duties3; | |
@Column(name = "contact3") | |
private String contact3; | |
@Lob | |
@Column(name = "initial1") | |
private String initial1; | |
@Lob | |
@Column(name = "initial2") | |
private String initial2; | |
@Lob | |
@Column(name = "initial3") | |
private String initial3; | |
@Lob | |
@Column(name = "initial4") | |
private String initial4; | |
@Lob | |
@Column(name = "initial5") | |
private String initial5; | |
@Column(name = "waiver") | |
private String waiver; | |
@Lob | |
@Column(name = "full_name") | |
private String fullName; | |
@Lob | |
@Column(name = "resume_link") | |
private String resumeLink; | |
@Column(name = "category") | |
private String category; | |
@Column(name = "hidden") | |
private String hidden; | |
@Column(name = "created") | |
@Temporal(TemporalType.DATE) | |
private Date created; | |
/** | |
* constructor | |
*/ | |
public Application() | |
{ | |
this.created = new Date(); | |
} | |
public Application(String category) | |
{ | |
this.created = new Date(); | |
this.category = category; | |
this.hidden = "No"; | |
this.position = "Unspecified"; | |
this.resumeLink = ""; | |
} | |
public Integer getId() | |
{ | |
return id; | |
} | |
public void setId(Integer id) | |
{ | |
this.id = id; | |
} | |
public String getDateAppl() | |
{ | |
return dateAppl; | |
} | |
public void setDateAppl(String dateAppl) | |
{ | |
this.dateAppl = dateAppl; | |
} | |
public String getDateBirth() | |
{ | |
return dateBirth; | |
} | |
public void setDateBirth(String dateBirth) | |
{ | |
this.dateBirth = dateBirth; | |
} | |
public String getLastName() | |
{ | |
return lastName; | |
} | |
public void setLastName(String lastName) | |
{ | |
this.lastName = lastName; | |
} | |
public String getFirstName() | |
{ | |
return firstName; | |
} | |
public void setFirstName(String firstName) | |
{ | |
this.firstName = firstName; | |
} | |
public String getMiddle() | |
{ | |
return middle; | |
} | |
public void setMiddle(String middle) | |
{ | |
this.middle = middle; | |
} | |
public String getStreetAddressPres() | |
{ | |
return streetAddressPres; | |
} | |
public void setStreetAddressPres(String streetAddressPres) | |
{ | |
this.streetAddressPres = streetAddressPres; | |
} | |
public String getCityPres() | |
{ | |
return cityPres; | |
} | |
public void setCityPres(String cityPres) | |
{ | |
this.cityPres = cityPres; | |
} | |
public String getStatePres() | |
{ | |
return statePres; | |
} | |
public void setStatePres(String statePres) | |
{ | |
this.statePres = statePres; | |
} | |
public String getZipPres() | |
{ | |
return zipPres; | |
} | |
public void setZipPres(String zipPres) | |
{ | |
this.zipPres = zipPres; | |
} | |
public String getStreetAddressPerm() | |
{ | |
return streetAddressPerm; | |
} | |
public void setStreetAddressPerm(String streetAddressPerm) | |
{ | |
this.streetAddressPerm = streetAddressPerm; | |
} | |
public String getCityPerm() | |
{ | |
return cityPerm; | |
} | |
public void setCityPerm(String cityPerm) | |
{ | |
this.cityPerm = cityPerm; | |
} | |
public String getStatePerm() | |
{ | |
return statePerm; | |
} | |
public void setStatePerm(String statePerm) | |
{ | |
this.statePerm = statePerm; | |
} | |
public String getZipPerm() | |
{ | |
return zipPerm; | |
} | |
public void setZipPerm(String zipPerm) | |
{ | |
this.zipPerm = zipPerm; | |
} | |
public String getHomePhone() | |
{ | |
return homePhone; | |
} | |
public void setHomePhone(String homePhone) | |
{ | |
this.homePhone = homePhone; | |
} | |
public String getCellPhone() | |
{ | |
return cellPhone; | |
} | |
public void setCellPhone(String cellPhone) | |
{ | |
this.cellPhone = cellPhone; | |
} | |
public String getEmailAddress() | |
{ | |
return emailAddress; | |
} | |
public void setEmailAddress(String emailAddress) | |
{ | |
this.emailAddress = emailAddress; | |
} | |
public String getPosition() | |
{ | |
return position; | |
} | |
public void setPosition(String position) | |
{ | |
this.position = position; | |
} | |
public String getPriorWork() | |
{ | |
return priorWork; | |
} | |
public void setPriorWork(String priorWork) | |
{ | |
this.priorWork = priorWork; | |
} | |
public String getPreviousSupervisor() | |
{ | |
return previousSupervisor; | |
} | |
public void setPreviousSupervisor(String previousSupervisor) | |
{ | |
this.previousSupervisor = previousSupervisor; | |
} | |
public String getFriends() | |
{ | |
return friends; | |
} | |
public void setFriends(String friends) | |
{ | |
this.friends = friends; | |
} | |
public String getFriendsNames() | |
{ | |
return friendsNames; | |
} | |
public void setFriendsNames(String friendsNames) | |
{ | |
this.friendsNames = friendsNames; | |
} | |
public String getAgeRange() | |
{ | |
return ageRange; | |
} | |
public void setAgeRange(String ageRange) | |
{ | |
this.ageRange = ageRange; | |
} | |
public String getTransportation() | |
{ | |
return transportation; | |
} | |
public void setTransportation(String transportation) | |
{ | |
this.transportation = transportation; | |
} | |
public String getCitizenship() | |
{ | |
return citizenship; | |
} | |
public void setCitizenship(String citizenship) | |
{ | |
this.citizenship = citizenship; | |
} | |
public String getLicense() | |
{ | |
return license; | |
} | |
public void setLicense(String license) | |
{ | |
this.license = license; | |
} | |
public String getAble() | |
{ | |
return able; | |
} | |
public void setAble(String able) | |
{ | |
this.able = able; | |
} | |
public String getFunctions() | |
{ | |
return functions; | |
} | |
public void setFunctions(String functions) | |
{ | |
this.functions = functions; | |
} | |
public String getOffense() | |
{ | |
return offense; | |
} | |
public void setOffense(String offense) | |
{ | |
this.offense = offense; | |
} | |
public String getOffenseDetails() | |
{ | |
return offenseDetails; | |
} | |
public void setOffenseDetails(String offenseDetails) | |
{ | |
this.offenseDetails = offenseDetails; | |
} | |
public String getSchoolAddressHs() | |
{ | |
return schoolAddressHs; | |
} | |
public void setSchoolAddressHs(String schoolAddressHs) | |
{ | |
this.schoolAddressHs = schoolAddressHs; | |
} | |
public String getYearsCompletedHs() | |
{ | |
return yearsCompletedHs; | |
} | |
public void setYearsCompletedHs(String yearsCompletedHs) | |
{ | |
this.yearsCompletedHs = yearsCompletedHs; | |
} | |
public String getGraduatedHs() | |
{ | |
return graduatedHs; | |
} | |
public void setGraduatedHs(String graduatedHs) | |
{ | |
this.graduatedHs = graduatedHs; | |
} | |
public String getDegreeHs() | |
{ | |
return degreeHs; | |
} | |
public void setDegreeHs(String degreeHs) | |
{ | |
this.degreeHs = degreeHs; | |
} | |
public String getSchoolAddressColl() | |
{ | |
return schoolAddressColl; | |
} | |
public void setSchoolAddressColl(String schoolAddressColl) | |
{ | |
this.schoolAddressColl = schoolAddressColl; | |
} | |
public String getYearsCompletedColl() | |
{ | |
return yearsCompletedColl; | |
} | |
public void setYearsCompletedColl(String yearsCompletedColl) | |
{ | |
this.yearsCompletedColl = yearsCompletedColl; | |
} | |
public String getGraduatedColl() | |
{ | |
return graduatedColl; | |
} | |
public void setGraduatedColl(String graduatedColl) | |
{ | |
this.graduatedColl = graduatedColl; | |
} | |
public String getDegreeColl() | |
{ | |
return degreeColl; | |
} | |
public void setDegreeColl(String degreeColl) | |
{ | |
this.degreeColl = degreeColl; | |
} | |
public String getSchoolAddressOther() | |
{ | |
return schoolAddressOther; | |
} | |
public void setSchoolAddressOther(String schoolAddressOther) | |
{ | |
this.schoolAddressOther = schoolAddressOther; | |
} | |
public String getYearsCompletedOther() | |
{ | |
return yearsCompletedOther; | |
} | |
public void setYearsCompletedOther(String yearsCompletedOther) | |
{ | |
this.yearsCompletedOther = yearsCompletedOther; | |
} | |
public String getGraduatedOther() | |
{ | |
return graduatedOther; | |
} | |
public void setGraduatedOther(String graduatedOther) | |
{ | |
this.graduatedOther = graduatedOther; | |
} | |
public String getDegreeOther() | |
{ | |
return degreeOther; | |
} | |
public void setDegreeOther(String degreeOther) | |
{ | |
this.degreeOther = degreeOther; | |
} | |
public String getHighestGrade() | |
{ | |
return highestGrade; | |
} | |
public void setHighestGrade(String highestGrade) | |
{ | |
this.highestGrade = highestGrade; | |
} | |
public String getDiploma() | |
{ | |
return diploma; | |
} | |
public void setDiploma(String diploma) | |
{ | |
this.diploma = diploma; | |
} | |
public String getInterested() | |
{ | |
return interested; | |
} | |
public void setInterested(String interested) | |
{ | |
this.interested = interested; | |
} | |
public String getFluent() | |
{ | |
return fluent; | |
} | |
public void setFluent(String fluent) | |
{ | |
this.fluent = fluent; | |
} | |
public String getFluentDetails() | |
{ | |
return fluentDetails; | |
} | |
public void setFluentDetails(String fluentDetails) | |
{ | |
this.fluentDetails = fluentDetails; | |
} | |
public String getQualifications() | |
{ | |
return qualifications; | |
} | |
public void setQualifications(String qualifications) | |
{ | |
this.qualifications = qualifications; | |
} | |
public String getQualificationsDetails() | |
{ | |
return qualificationsDetails; | |
} | |
public void setQualificationsDetails(String qualificationsDetails) | |
{ | |
this.qualificationsDetails = qualificationsDetails; | |
} | |
public String getEmplName0() | |
{ | |
return emplName0; | |
} | |
public void setEmplName0(String emplName0) | |
{ | |
this.emplName0 = emplName0; | |
} | |
public String getEmplPhone0() | |
{ | |
return emplPhone0; | |
} | |
public void setEmplPhone0(String emplPhone0) | |
{ | |
this.emplPhone0 = emplPhone0; | |
} | |
public String getEmplAddress0() | |
{ | |
return emplAddress0; | |
} | |
public void setEmplAddress0(String emplAddress0) | |
{ | |
this.emplAddress0 = emplAddress0; | |
} | |
public String getEmplSupervisor0() | |
{ | |
return emplSupervisor0; | |
} | |
public void setEmplSupervisor0(String emplSupervisor0) | |
{ | |
this.emplSupervisor0 = emplSupervisor0; | |
} | |
public String getReason0() | |
{ | |
return reason0; | |
} | |
public void setReason0(String reason0) | |
{ | |
this.reason0 = reason0; | |
} | |
public String getDateFrom0() | |
{ | |
return dateFrom0; | |
} | |
public void setDateFrom0(String dateFrom0) | |
{ | |
this.dateFrom0 = dateFrom0; | |
} | |
public String getDateTo0() | |
{ | |
return dateTo0; | |
} | |
public void setDateTo0(String dateTo0) | |
{ | |
this.dateTo0 = dateTo0; | |
} | |
public String getWage0() | |
{ | |
return wage0; | |
} | |
public void setWage0(String wage0) | |
{ | |
this.wage0 = wage0; | |
} | |
public String getHours0() | |
{ | |
return hours0; | |
} | |
public void setHours0(String hours0) | |
{ | |
this.hours0 = hours0; | |
} | |
public String getDuties0() | |
{ | |
return duties0; | |
} | |
public void setDuties0(String duties0) | |
{ | |
this.duties0 = duties0; | |
} | |
public String getContact0() | |
{ | |
return contact0; | |
} | |
public void setContact0(String contact0) | |
{ | |
this.contact0 = contact0; | |
} | |
public String getEmplName1() | |
{ | |
return emplName1; | |
} | |
public void setEmplName1(String emplName1) | |
{ | |
this.emplName1 = emplName1; | |
} | |
public String getEmplPhone1() | |
{ | |
return emplPhone1; | |
} | |
public void setEmplPhone1(String emplPhone1) | |
{ | |
this.emplPhone1 = emplPhone1; | |
} | |
public String getEmplAddress1() | |
{ | |
return emplAddress1; | |
} | |
public void setEmplAddress1(String emplAddress1) | |
{ | |
this.emplAddress1 = emplAddress1; | |
} | |
public String getEmplSupervisor1() | |
{ | |
return emplSupervisor1; | |
} | |
public void setEmplSupervisor1(String emplSupervisor1) | |
{ | |
this.emplSupervisor1 = emplSupervisor1; | |
} | |
public String getReason1() | |
{ | |
return reason1; | |
} | |
public void setReason1(String reason1) | |
{ | |
this.reason1 = reason1; | |
} | |
public String getDateFrom1() | |
{ | |
return dateFrom1; | |
} | |
public void setDateFrom1(String dateFrom1) | |
{ | |
this.dateFrom1 = dateFrom1; | |
} | |
public String getDateTo1() | |
{ | |
return dateTo1; | |
} | |
public void setDateTo1(String dateTo1) | |
{ | |
this.dateTo1 = dateTo1; | |
} | |
public String getWage1() | |
{ | |
return wage1; | |
} | |
public void setWage1(String wage1) | |
{ | |
this.wage1 = wage1; | |
} | |
public String getHours1() | |
{ | |
return hours1; | |
} | |
public void setHours1(String hours1) | |
{ | |
this.hours1 = hours1; | |
} | |
public String getDuties1() | |
{ | |
return duties1; | |
} | |
public void setDuties1(String duties1) | |
{ | |
this.duties1 = duties1; | |
} | |
public String getContact1() | |
{ | |
return contact1; | |
} | |
public void setContact1(String contact1) | |
{ | |
this.contact1 = contact1; | |
} | |
public String getEmplName2() | |
{ | |
return emplName2; | |
} | |
public void setEmplName2(String emplName2) | |
{ | |
this.emplName2 = emplName2; | |
} | |
public String getEmplPhone2() | |
{ | |
return emplPhone2; | |
} | |
public void setEmplPhone2(String emplPhone2) | |
{ | |
this.emplPhone2 = emplPhone2; | |
} | |
public String getEmplAddress2() | |
{ | |
return emplAddress2; | |
} | |
public void setEmplAddress2(String emplAddress2) | |
{ | |
this.emplAddress2 = emplAddress2; | |
} | |
public String getEmplSupervisor2() | |
{ | |
return emplSupervisor2; | |
} | |
public void setEmplSupervisor2(String emplSupervisor2) | |
{ | |
this.emplSupervisor2 = emplSupervisor2; | |
} | |
public String getReason2() | |
{ | |
return reason2; | |
} | |
public void setReason2(String reason2) | |
{ | |
this.reason2 = reason2; | |
} | |
public String getDateFrom2() | |
{ | |
return dateFrom2; | |
} | |
public void setDateFrom2(String dateFrom2) | |
{ | |
this.dateFrom2 = dateFrom2; | |
} | |
public String getDateTo2() | |
{ | |
return dateTo2; | |
} | |
public void setDateTo2(String dateTo2) | |
{ | |
this.dateTo2 = dateTo2; | |
} | |
public String getWage2() | |
{ | |
return wage2; | |
} | |
public void setWage2(String wage2) | |
{ | |
this.wage2 = wage2; | |
} | |
public String getHours2() | |
{ | |
return hours2; | |
} | |
public void setHours2(String hours2) | |
{ | |
this.hours2 = hours2; | |
} | |
public String getDuties2() | |
{ | |
return duties2; | |
} | |
public void setDuties2(String duties2) | |
{ | |
this.duties2 = duties2; | |
} | |
public String getContact2() | |
{ | |
return contact2; | |
} | |
public void setContact2(String contact2) | |
{ | |
this.contact2 = contact2; | |
} | |
public String getInitial1() | |
{ | |
return initial1; | |
} | |
public void setInitial1(String initial1) | |
{ | |
this.initial1 = initial1; | |
} | |
public String getInitial2() | |
{ | |
return initial2; | |
} | |
public void setInitial2(String initial2) | |
{ | |
this.initial2 = initial2; | |
} | |
public String getInitial3() | |
{ | |
return initial3; | |
} | |
public void setInitial3(String initial3) | |
{ | |
this.initial3 = initial3; | |
} | |
public String getInitial4() | |
{ | |
return initial4; | |
} | |
public void setInitial4(String initial4) | |
{ | |
this.initial4 = initial4; | |
} | |
public String getWaiver() | |
{ | |
return waiver; | |
} | |
public void setWaiver(String waiver) | |
{ | |
this.waiver = waiver; | |
} | |
public String getFullName() | |
{ | |
return fullName; | |
} | |
public void setFullName(String fullName) | |
{ | |
this.fullName = fullName; | |
} | |
public String getCategory() | |
{ | |
return category; | |
} | |
public void setCategory(String category) | |
{ | |
this.category = category; | |
} | |
public String getHidden() | |
{ | |
return hidden; | |
} | |
public void setHidden(String hidden) | |
{ | |
this.hidden = hidden; | |
} | |
public Date getCreated() | |
{ | |
return created; | |
} | |
public void setCreated(Date created) | |
{ | |
this.created = created; | |
} | |
@Override | |
public int hashCode() | |
{ | |
int hash = 0; | |
hash += (id != null ? id.hashCode() : 0); | |
return hash; | |
} | |
@Override | |
public boolean equals(Object object) | |
{ | |
// TODO: Warning - this method won't work in the case the id fields are not set | |
if (!(object instanceof Application)) { | |
return false; | |
} | |
Application other = (Application) object; | |
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { | |
return false; | |
} | |
return true; | |
} | |
@Override | |
public String toString() | |
{ | |
return "org.ccnb.model.Application[id=" + id + "]"; | |
} | |
public String getInitial5() | |
{ | |
return initial5; | |
} | |
public void setInitial5(String initial5) | |
{ | |
this.initial5 = initial5; | |
} | |
public String getHeardFrom() | |
{ | |
return heardFrom; | |
} | |
public void setHeardFrom(String heardFrom) | |
{ | |
this.heardFrom = heardFrom; | |
} | |
public String getSchoolAddressColl2() | |
{ | |
return schoolAddressColl2; | |
} | |
public void setSchoolAddressColl2(String schoolAddressColl2) | |
{ | |
this.schoolAddressColl2 = schoolAddressColl2; | |
} | |
public String getYearsCompletedColl2() | |
{ | |
return yearsCompletedColl2; | |
} | |
public void setYearsCompletedColl2(String yearsCompletedColl2) | |
{ | |
this.yearsCompletedColl2 = yearsCompletedColl2; | |
} | |
public String getGraduatedColl2() | |
{ | |
return graduatedColl2; | |
} | |
public void setGraduatedColl2(String graduatedColl2) | |
{ | |
this.graduatedColl2 = graduatedColl2; | |
} | |
public String getDegreeColl2() | |
{ | |
return degreeColl2; | |
} | |
public void setDegreeColl2(String degreeColl2) | |
{ | |
this.degreeColl2 = degreeColl2; | |
} | |
public String getEmplName3() | |
{ | |
return emplName3; | |
} | |
public void setEmplName3(String emplName3) | |
{ | |
this.emplName3 = emplName3; | |
} | |
public String getEmplPhone3() | |
{ | |
return emplPhone3; | |
} | |
public void setEmplPhone3(String emplPhone3) | |
{ | |
this.emplPhone3 = emplPhone3; | |
} | |
public String getEmplAddress3() | |
{ | |
return emplAddress3; | |
} | |
public void setEmplAddress3(String emplAddress3) | |
{ | |
this.emplAddress3 = emplAddress3; | |
} | |
public String getEmplSupervisor3() | |
{ | |
return emplSupervisor3; | |
} | |
public void setEmplSupervisor3(String emplSupervisor3) | |
{ | |
this.emplSupervisor3 = emplSupervisor3; | |
} | |
public String getReason3() | |
{ | |
return reason3; | |
} | |
public void setReason3(String reason3) | |
{ | |
this.reason3 = reason3; | |
} | |
public String getDateFrom3() | |
{ | |
return dateFrom3; | |
} | |
public void setDateFrom3(String dateFrom3) | |
{ | |
this.dateFrom3 = dateFrom3; | |
} | |
public String getDateTo3() | |
{ | |
return dateTo3; | |
} | |
public void setDateTo3(String dateTo3) | |
{ | |
this.dateTo3 = dateTo3; | |
} | |
public String getWage3() | |
{ | |
return wage3; | |
} | |
public void setWage3(String wage3) | |
{ | |
this.wage3 = wage3; | |
} | |
public String getHours3() | |
{ | |
return hours3; | |
} | |
public void setHours3(String hours3) | |
{ | |
this.hours3 = hours3; | |
} | |
public String getDuties3() | |
{ | |
return duties3; | |
} | |
public void setDuties3(String duties3) | |
{ | |
this.duties3 = duties3; | |
} | |
public String getContact3() | |
{ | |
return contact3; | |
} | |
public void setContact3(String contact3) | |
{ | |
this.contact3 = contact3; | |
} | |
public String getResumeLink() | |
{ | |
return resumeLink; | |
} | |
public void setResumeLink(String resumeLink) | |
{ | |
this.resumeLink = resumeLink; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.action; | |
import java.util.*; | |
import java.io.File; | |
//import org.apache.commons.logging.Log; | |
//import org.apache.commons.logging.LogFactory; | |
import com.opensymphony.xwork2.validator.annotations.*;//so we don't have to use xml file | |
import org.apache.struts2.interceptor.validation.SkipValidation; | |
import org.ccnb.model.Application; | |
import org.ccnb.service.ApplicationService; | |
import org.ccnb.service.MailNotifier; | |
/** | |
* controller class for handling job application rendering and submits | |
* @author david | |
*/ | |
public class ApplicationAction extends CcnbPageAction { | |
//defaults | |
private static final String ERROR_MSG = "Were sorry. There was an error submitting your application. Please try again later or contact us at the link on the top ot the page"; | |
private static final String ACTION_MSG = "Thank you for your application. One of our staff members will respond. Please save or print the following for your records."; | |
private String resumeFilePath = "C:\\NetBeansProjects\\ccnb_static\\build\\web\\hr\\resume\\"; | |
private String resumePath = "http://localhost:81/hr/resume/"; | |
private ApplicationService service; | |
private Application application; | |
//form fields | |
private List<Application> applications; | |
private Integer id = 0; | |
private String dateAppl = ""; | |
private String dateBirth = ""; | |
private String lastName = ""; | |
private String firstName = ""; | |
private String middle = ""; | |
private String streetAddressPres = ""; | |
private String cityPres = ""; | |
private String statePres = ""; | |
private String zipPres = ""; | |
private String streetAddressPerm = ""; | |
private String cityPerm = ""; | |
private String statePerm = ""; | |
private String zipPerm = ""; | |
private String homePhone = ""; | |
private String cellPhone = ""; | |
private String emailAddress = ""; | |
private String position = ""; | |
private String heardFrom = ""; | |
private String priorWork = ""; | |
private String previousSupervisor = ""; | |
private String friends = ""; | |
private String friendsNames = ""; | |
private String ageRange = ""; | |
private String transportation = ""; | |
private String citizenship = ""; | |
private String license = ""; | |
private String able = ""; | |
private String functions = ""; | |
private String offense = ""; | |
private String offenseDetails = ""; | |
private String schoolAddressHs = ""; | |
private String yearsCompletedHs = ""; | |
private String graduatedHs = ""; | |
private String degreeHs = ""; | |
private String schoolAddressColl = ""; | |
private String yearsCompletedColl = ""; | |
private String graduatedColl = ""; | |
private String degreeColl = ""; | |
private String schoolAddressColl2 = ""; | |
private String yearsCompletedColl2 = ""; | |
private String graduatedColl2 = ""; | |
private String degreeColl2 = ""; | |
private String schoolAddressOther = ""; | |
private String yearsCompletedOther = ""; | |
private String graduatedOther = ""; | |
private String degreeOther = ""; | |
private String highestGrade = ""; | |
private String diploma = ""; | |
private String interested = ""; | |
private String fluent = ""; | |
private String fluentDetails = ""; | |
private String qualifications = ""; | |
private String qualificationsDetails = ""; | |
private String emplName0 = ""; | |
private String emplPhone0 = ""; | |
private String emplAddress0 = ""; | |
private String emplSupervisor0 = ""; | |
private String reason0 = ""; | |
private String dateFrom0 = ""; | |
private String dateTo0 = ""; | |
private String wage0 = ""; | |
private String hours0 = ""; | |
private String duties0 = ""; | |
private String contact0 = ""; | |
private String emplName1 = ""; | |
private String emplPhone1 = ""; | |
private String emplAddress1 = ""; | |
private String emplSupervisor1 = ""; | |
private String reason1 = ""; | |
private String dateFrom1 = ""; | |
private String dateTo1 = ""; | |
private String wage1 = ""; | |
private String hours1 = ""; | |
private String duties1 = ""; | |
private String contact1 = ""; | |
private String emplName2 = ""; | |
private String emplPhone2 = ""; | |
private String emplAddress2 = ""; | |
private String emplSupervisor2 = ""; | |
private String reason2 = ""; | |
private String dateFrom2 = ""; | |
private String dateTo2 = ""; | |
private String wage2 = ""; | |
private String hours2 = ""; | |
private String duties2 = ""; | |
private String contact2 = ""; | |
private String emplName3 = ""; | |
private String emplPhone3 = ""; | |
private String emplAddress3 = ""; | |
private String emplSupervisor3 = ""; | |
private String reason3 = ""; | |
private String dateFrom3 = ""; | |
private String dateTo3 = ""; | |
private String wage3 = ""; | |
private String hours3 = ""; | |
private String duties3 = ""; | |
private String contact3 = ""; | |
private String initial1 = ""; | |
private String initial2 = ""; | |
private String initial3 = ""; | |
private String initial4 = ""; | |
private String initial5 = ""; | |
private String waiver = ""; | |
private String fullName = ""; | |
private String resumeLink = ""; | |
private String category = ""; | |
private String hidden = "No"; | |
private String sort; | |
/** | |
* controller class constructor for handling job application rendering and submits | |
* @param service | |
*/ | |
public ApplicationAction( ApplicationService service ) | |
{ | |
//LOG.debug("ApplicationAction: constructor called"); | |
this.service = service; | |
} | |
//display the user info-application form | |
@SkipValidation | |
public String execute(){ | |
return "success"; | |
} | |
//display index of non-hidden applications to staff | |
/** | |
* display index of non-hidden applications to staff | |
* @return String | |
*/ | |
@SkipValidation | |
@SuppressWarnings("unchecked") | |
public String list(){ | |
this.applications = new ArrayList<Application>(); | |
if(category.equals("")) | |
this.setApplications(service.findAll()); | |
else | |
this.setApplications(service.findByCategory(getCategory())); | |
return "success"; | |
} | |
/** | |
* | |
* @return String | |
*/ | |
@SkipValidation | |
@SuppressWarnings("unchecked") | |
public String listCustom(){ | |
this.applications = new ArrayList<Application>(); | |
if(sort.equals("position")) | |
this.setApplications(service.findAllOrderPosition()); | |
else if(sort.equals("lastName")) | |
this.setApplications(service.findAllOrderLastName()); | |
else | |
this.setApplications(service.findAll()); | |
return "success"; | |
} | |
/** | |
* display index of non-hidden applications to staff | |
* @return String | |
*/ | |
@SkipValidation | |
@SuppressWarnings("unchecked") | |
public String hide(){ | |
application = service.find(id); | |
application.setHidden("Yes"); | |
service.save(application); | |
return "success_hide"; | |
} | |
/** | |
* display index of non-hidden applications to staff | |
* @return String | |
*/ | |
@SkipValidation | |
@SuppressWarnings("unchecked") | |
public String view(){ | |
this.application = service.find(id); | |
return "success_view"; | |
} | |
/** | |
* delete an application | |
* @return String | |
*/ | |
@SkipValidation | |
public String delete(){ | |
service.remove(id); | |
return "success_hide"; | |
} | |
/** | |
* process user info-application to database and email notify staff | |
* @return String | |
*/ | |
@SuppressWarnings("unchecked") | |
public String edit(){ | |
//get id of previous record, add 1 to get this id | |
id = (Integer) service.getLastInsertId()+1; | |
application = new Application(category); | |
setApplicationProperties(); | |
if (uploaded) { | |
this.resumePath = (String)get("resumePath"); //uncomment for production | |
this.resumeFilePath = (String)get("resumeFilePath"); | |
//id is added to make filename unique | |
File newFile = new File(resumeFilePath + id + this.filename); | |
this.file.renameTo(newFile); | |
application.setResumeLink(resumePath + id + filename); | |
//application.setResumeLink(this.handleUpload(resumeFilePath, resumePath, this.filename, this.)); | |
} | |
try{ | |
service.save(application); | |
}catch(Exception e){ | |
this.addActionError(ApplicationAction.ERROR_MSG); | |
return "error"; | |
//return "edit_success"; | |
} | |
try{ | |
MailNotifier mn = new MailNotifier((String)get("localHost"),(String)get("mailHost"), | |
Integer.parseInt((String)get("smtpPort")),(String)get("smtpUser"),(String)get("smtpPass"),(String)get("replyTo")); | |
String mailTo = (String)get("corpApplAddr"); | |
String subject = "New employment application from website"; | |
String text = "There is a new website application for information\n"; | |
text += (String)get("appURL") + "viewEmploymentAdmin.action?id="+id; | |
mn.send(mailTo, subject, text); | |
}catch(Exception e){ | |
e.printStackTrace(); | |
} | |
this.addActionMessage(ACTION_MSG); | |
return "edit_success"; | |
} | |
private void setApplicationProperties(){ | |
application.setAble(able); | |
application.setAgeRange(ageRange); | |
application.setCategory(category); | |
application.setCellPhone(cellPhone); | |
application.setCitizenship(citizenship); | |
application.setCityPerm(cityPerm); | |
application.setCityPres(cityPres); | |
application.setContact0(contact0); | |
application.setContact1(contact1); | |
application.setContact2(contact2); | |
application.setDateAppl(dateAppl); | |
application.setDateBirth(dateBirth); | |
application.setDateFrom0(dateFrom0); | |
application.setDateFrom1(dateFrom1); | |
application.setDateFrom2(dateFrom2); | |
application.setDateTo0(dateTo0); | |
application.setDateTo1(dateTo1); | |
application.setDateTo2(dateTo2); | |
application.setDegreeColl(degreeColl); | |
application.setDegreeHs(degreeHs); | |
application.setDegreeOther(degreeOther); | |
application.setDiploma(diploma); | |
application.setDuties0(duties0); | |
application.setDuties1(duties1); | |
application.setDuties2(duties2); | |
application.setEmailAddress(emailAddress); | |
application.setEmplAddress0(emplAddress0); | |
application.setEmplAddress1(emplAddress1); | |
application.setEmplAddress2(emplAddress2); | |
application.setEmplName0(emplName0); | |
application.setEmplName1(emplName1); | |
application.setEmplName2(emplName2); | |
application.setEmplPhone0(emplPhone0); | |
application.setEmplPhone1(emplPhone1); | |
application.setEmplPhone2(emplPhone2); | |
application.setEmplSupervisor0(emplSupervisor0); | |
application.setEmplSupervisor1(emplSupervisor1); | |
application.setEmplSupervisor2(emplSupervisor2); | |
application.setFirstName(firstName); | |
application.setFluent(fluent); | |
application.setFluentDetails(fluentDetails); | |
application.setFriends(friends); | |
application.setFriendsNames(friendsNames); | |
application.setFullName(fullName); | |
application.setFunctions(functions); | |
application.setGraduatedColl(graduatedColl); | |
application.setGraduatedHs(graduatedHs); | |
application.setGraduatedOther(graduatedOther); | |
application.setHeardFrom(heardFrom); | |
application.setHighestGrade(highestGrade); | |
application.setHomePhone(homePhone); | |
application.setHours0(hours0); | |
application.setHours1(hours1); | |
application.setHours2(hours2); | |
application.setInitial1(initial1); | |
application.setInitial2(initial2); | |
application.setInitial3(initial3); | |
application.setInitial4(initial4); | |
application.setInitial5(initial5); | |
application.setLastName(lastName); | |
application.setInterested(interested); | |
application.setLicense(license); | |
application.setMiddle(middle); | |
application.setOffense(offense); | |
application.setOffenseDetails(offenseDetails); | |
application.setPosition(position); | |
application.setPreviousSupervisor(previousSupervisor); | |
application.setPriorWork(priorWork); | |
application.setQualifications(qualifications); | |
application.setQualificationsDetails(qualificationsDetails); | |
application.setReason0(reason0); | |
application.setReason1(reason1); | |
application.setReason2(reason2); | |
application.setSchoolAddressColl(schoolAddressColl); | |
application.setSchoolAddressHs(schoolAddressHs); | |
application.setSchoolAddressOther(schoolAddressOther); | |
application.setStatePerm(statePerm); | |
application.setStatePres(statePres); | |
application.setStreetAddressPerm(streetAddressPerm); | |
application.setStreetAddressPres(streetAddressPres); | |
application.setTransportation(transportation); | |
application.setWage0(wage0); | |
application.setWage1(wage1); | |
application.setWage2(wage2); | |
application.setWaiver(waiver); | |
application.setYearsCompletedColl(yearsCompletedColl); | |
application.setYearsCompletedHs(yearsCompletedHs); | |
application.setYearsCompletedOther(yearsCompletedOther); | |
application.setZipPerm(zipPerm); | |
application.setZipPres(zipPres); | |
application.setYearsCompletedColl2(yearsCompletedColl2); | |
application.setGraduatedColl2(graduatedColl2); | |
application.setSchoolAddressColl2(schoolAddressColl2); | |
application.setDegreeColl2(degreeColl2); | |
application.setEmplName3(emplName3); | |
application.setEmplAddress3(emplAddress3); | |
application.setEmplPhone3(emplPhone3); | |
application.setEmplSupervisor3(emplSupervisor3); | |
application.setReason3(reason3); | |
application.setDateFrom3(dateFrom3); | |
application.setDateTo3(dateTo3); | |
application.setWage3(wage3); | |
application.setHours3(hours3); | |
application.setDuties3(duties3); | |
application.setContact3(contact3); | |
} | |
public Application getApplication() | |
{ | |
return application; | |
} | |
public void setApplication(Application application) | |
{ | |
this.application = application; | |
} | |
public List<Application> getApplications() | |
{ | |
return applications; | |
} | |
public void setApplications(List<Application> applications) | |
{ | |
this.applications = applications; | |
} | |
public Integer getId() { return id; } | |
public void setId(Integer id) { this.id = id; } | |
public void setDateAppl(String dateAppl) { this.dateAppl = dateAppl; } | |
public void setDateBirth(String dateBirth) { this.dateBirth = dateBirth; } | |
@RequiredStringValidator(message = "Lastname required", key = "error.lastname.required") | |
public String getLastName() { return lastName; } | |
public void setLastName(String lastName) { this.lastName = lastName; } | |
public void setFirstName(String firstName) { this.firstName = firstName; } | |
public void setMiddle(String middle) { this.middle = middle; } | |
public void setStreetAddressPres(String streetAddressPres) { this.streetAddressPres = streetAddressPres; } | |
public void setCityPres(String cityPres) { this.cityPres = cityPres; } | |
public void setStatePres(String statePres) { this.statePres = statePres; } | |
public void setZipPres(String zipPres) { this.zipPres = zipPres; } | |
public void setStreetAddressPerm(String streetAddressPerm) { this.streetAddressPerm = streetAddressPerm; } | |
public void setCityPerm(String cityPerm) { this.cityPerm = cityPerm; } | |
public void setStatePerm(String statePerm) { this.statePerm = statePerm; } | |
public void setZipPerm(String zipPerm) { this.zipPerm = zipPerm; } | |
public void setHomePhone(String homePhone) { this.homePhone = homePhone; } | |
public void setCellPhone(String cellPhone) { this.cellPhone = cellPhone; } | |
public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } | |
@RequiredStringValidator(message = "Position required", key = "error.position.required") | |
public String getPosition() { return position; } | |
public void setPosition(String position) { this.position = position; } | |
public void setPriorWork(String priorWork) { this.priorWork = priorWork; } | |
public void setPreviousSupervisor(String previousSupervisor) { this.previousSupervisor = previousSupervisor; } | |
public void setFriends(String friends) { this.friends = friends; } | |
public void setFriendsNames(String friendsNames) { this.friendsNames = friendsNames; } | |
public void setAgeRange(String ageRange) { this.ageRange = ageRange; } | |
public void setTransportation(String transportation) { this.transportation = transportation; } | |
public void setCitizenship(String citizenship) { this.citizenship = citizenship; } | |
public void setLicense(String license) { this.license = license; } | |
public void setAble(String able) { this.able = able; } | |
public void setFunctions(String functions) { this.functions = functions; } | |
public void setOffense(String offense) { this.offense = offense; } | |
public void setOffenseDetails(String offenseDetails) { this.offenseDetails = offenseDetails; } | |
public void setSchoolAddressHs(String schoolAddressHs) { this.schoolAddressHs = schoolAddressHs; } | |
public void setYearsCompletedHs(String yearsCompletedHs) { this.yearsCompletedHs = yearsCompletedHs; } | |
public void setGraduatedHs(String graduatedHs) { this.graduatedHs = graduatedHs; } | |
public void setDegreeHs(String degreeHs) { this.degreeHs = degreeHs; } | |
public void setSchoolAddressColl(String schoolAddressColl) { this.schoolAddressColl = schoolAddressColl; } | |
public void setYearsCompletedColl(String yearsCompletedColl) { this.yearsCompletedColl = yearsCompletedColl; } | |
public void setGraduatedColl(String graduatedColl) { this.graduatedColl = graduatedColl; } | |
public void setDegreeColl(String degreeColl) { this.degreeColl = degreeColl; } | |
public void setSchoolAddressOther(String schoolAddressOther) { this.schoolAddressOther = schoolAddressOther; } | |
public void setYearsCompletedOther(String yearsCompletedOther) { this.yearsCompletedOther = yearsCompletedOther; } | |
public void setGraduatedOther(String graduatedOther) { this.graduatedOther = graduatedOther; } | |
public void setDegreeOther(String degreeOther) { this.degreeOther = degreeOther; } | |
public void setHighestGrade(String highestGrade) { this.highestGrade = highestGrade; } | |
public void setDiploma(String diploma) { this.diploma = diploma; } | |
public void setInterested(String interested) { this.interested = interested; } | |
public void setFluent(String fluent) { this.fluent = fluent; } | |
public void setFluentDetails(String fluentDetails) { this.fluentDetails = fluentDetails; } | |
public void setQualifications(String qualifications) { this.qualifications = qualifications; } | |
public void setQualificationsDetails(String qualificationsDetails) { this.qualificationsDetails = qualificationsDetails; } | |
public void setEmplName0(String emplName0) { this.emplName0 = emplName0; } | |
public void setEmplPhone0(String emplPhone0) { this.emplPhone0 = emplPhone0; } | |
public void setEmplAddress0(String emplAddress0) { this.emplAddress0 = emplAddress0; } | |
public void setEmplSupervisor0(String emplSupervisor0) { this.emplSupervisor0 = emplSupervisor0; } | |
public void setReason0(String reason0) { this.reason0 = reason0; } | |
public void setDateFrom0(String dateFrom0) { this.dateFrom0 = dateFrom0; } | |
public void setDateTo0(String dateTo0) { this.dateTo0 = dateTo0; } | |
public void setWage0(String wage0) { this.wage0 = wage0; } | |
public void setHours0(String hours0) { this.hours0 = hours0; } | |
public void setDuties0(String duties0) { this.duties0 = duties0; } | |
public void setContact0(String contact0) { this.contact0 = contact0; } | |
public void setEmplName1(String emplName1) { this.emplName1 = emplName1; } | |
public void setEmplPhone1(String emplPhone1) { this.emplPhone1 = emplPhone1; } | |
public void setEmplAddress1(String emplAddress1) { this.emplAddress1 = emplAddress1; } | |
public void setEmplSupervisor1(String emplSupervisor1) { this.emplSupervisor1 = emplSupervisor1; } | |
public void setReason1(String reason1) { this.reason1 = reason1; } | |
public void setDateFrom1(String dateFrom1) { this.dateFrom1 = dateFrom1; } | |
public void setDateTo1(String dateTo1) { this.dateTo1 = dateTo1; } | |
public void setWage1(String wage1) { this.wage1 = wage1; } | |
public void setHours1(String hours1) { this.hours1 = hours1; } | |
public void setDuties1(String duties1) { this.duties1 = duties1; } | |
public void setContact1(String contact1) { this.contact1 = contact1; } | |
public void setEmplName2(String emplName2) { this.emplName2 = emplName2; } | |
public void setEmplPhone2(String emplPhone2) { this.emplPhone2 = emplPhone2; } | |
public void setEmplAddress2(String emplAddress2) { this.emplAddress2 = emplAddress2; } | |
public void setEmplSupervisor2(String emplSupervisor2) { this.emplSupervisor2 = emplSupervisor2; } | |
public void setReason2(String reason2) { this.reason2 = reason2; } | |
public void setDateFrom2(String dateFrom2) { this.dateFrom2 = dateFrom2; } | |
public void setDateTo2(String dateTo2) { this.dateTo2 = dateTo2; } | |
public void setWage2(String wage2) { this.wage2 = wage2; } | |
public void setHours2(String hours2) { this.hours2 = hours2; } | |
public void setDuties2(String duties2) { this.duties2 = duties2; } | |
public void setContact2(String contact2) { this.contact2 = contact2; } | |
public void setInitial1(String initial1) { this.initial1 = initial1; } | |
public void setInitial2(String initial2) { this.initial2 = initial2; } | |
public void setInitial3(String initial3) { this.initial3 = initial3; } | |
public void setInitial4(String initial4) { this.initial4 = initial4; } | |
public void setWaiver(String waiver) { this.waiver = waiver; } | |
public void setFullName(String fullName) { this.fullName = fullName; } | |
public void setCategory(String category) { this.category = category; } | |
public void setHidden(String hidden) { this.hidden = hidden; } | |
public String getCategory() | |
{ | |
return category; | |
} | |
public String getHidden() | |
{ | |
return hidden; | |
} | |
public void setInitial5(String initial5) | |
{ | |
this.initial5 = initial5; | |
} | |
public void setHeardFrom(String heardFrom) | |
{ | |
this.heardFrom = heardFrom; | |
} | |
public void setSchoolAddressColl2(String schoolAddressColl2) | |
{ | |
this.schoolAddressColl2 = schoolAddressColl2; | |
} | |
public void setYearsCompletedColl2(String yearsCompletedColl2) | |
{ | |
this.yearsCompletedColl2 = yearsCompletedColl2; | |
} | |
public void setGraduatedColl2(String graduatedColl2) | |
{ | |
this.graduatedColl2 = graduatedColl2; | |
} | |
public void setDegreeColl2(String degreeColl2) | |
{ | |
this.degreeColl2 = degreeColl2; | |
} | |
public void setEmplName3(String emplName3) | |
{ | |
this.emplName3 = emplName3; | |
} | |
public void setEmplPhone3(String emplPhone3) | |
{ | |
this.emplPhone3 = emplPhone3; | |
} | |
public void setEmplAddress3(String emplAddress3) | |
{ | |
this.emplAddress3 = emplAddress3; | |
} | |
public void setEmplSupervisor3(String emplSupervisor3) | |
{ | |
this.emplSupervisor3 = emplSupervisor3; | |
} | |
public void setReason3(String reason3) | |
{ | |
this.reason3 = reason3; | |
} | |
public void setDateFrom3(String dateFrom3) | |
{ | |
this.dateFrom3 = dateFrom3; | |
} | |
public void setDateTo3(String dateTo3) | |
{ | |
this.dateTo3 = dateTo3; | |
} | |
public void setWage3(String wage3) | |
{ | |
this.wage3 = wage3; | |
} | |
public void setHours3(String hours3) | |
{ | |
this.hours3 = hours3; | |
} | |
public void setDuties3(String duties3) | |
{ | |
this.duties3 = duties3; | |
} | |
public void setContact3(String contact3) | |
{ | |
this.contact3 = contact3; | |
} | |
public String getResumeLink() | |
{ | |
return resumeLink; | |
} | |
public void setResumeLink(String resumeLink) | |
{ | |
this.resumeLink = resumeLink; | |
} | |
public String getSort() | |
{ | |
return sort; | |
} | |
public void setSort(String sort) | |
{ | |
this.sort = sort; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.service; | |
import java.util.List; | |
import org.ccnb.model.Application; | |
public interface ApplicationService { | |
public List<Application> findAll(); | |
public List<Application> findAllOrderLastName(); | |
public List<Application> findAllOrderPosition(); | |
public List<Application> findAllCustom(String category, String sort); | |
public List<Application> findByCategory(String category); | |
public Application find(int id); | |
public void save(Application application); | |
public void remove(int id); | |
public int getLastInsertId(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.service; | |
import java.util.List; | |
import javax.persistence.*; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.springframework.transaction.annotation.Transactional; | |
import org.ccnb.model.Application; | |
/** | |
* CRUD data queries for job applications | |
* @author david | |
*/ | |
@Transactional | |
public class ApplicationServiceImpl implements ApplicationService{ | |
private static final Log LOG = LogFactory.getLog(ApplicationServiceImpl.class); | |
/** | |
* spring injected entity manager object | |
*/ | |
private EntityManager em; | |
/** | |
* entity manager mutator | |
* @param em | |
*/ | |
@PersistenceContext | |
public void setEntityManager(EntityManager em) | |
{ | |
this.em = em; | |
LOG.debug("XXXX ApplicationServiceImpl.em is set XXXXX"); | |
} | |
/** | |
* entity manager accessor | |
* @return em | |
*/ | |
private EntityManager getEntityManager() | |
{ | |
return em; | |
} | |
/** | |
* returns all persisted Application ojects | |
* @return Applications | |
*/ | |
@SuppressWarnings("unchecked") | |
public List<Application> findAll() | |
{ | |
Query query = getEntityManager().createQuery("select a FROM Application a WHERE a.hidden = 'No' ORDER BY a.id DESC"); | |
return query.getResultList(); | |
} | |
//sorted by last name | |
@SuppressWarnings("unchecked") | |
public List<Application> findAllOrderLastName() | |
{ | |
Query query = getEntityManager().createQuery("select a FROM Application a WHERE a.hidden = 'No' ORDER BY a.lastName ASC, a.id DESC"); | |
return query.getResultList(); | |
} | |
//sorted by position | |
@SuppressWarnings("unchecked") | |
public List<Application> findAllOrderPosition() | |
{ | |
Query query = getEntityManager().createQuery("select a FROM Application a WHERE a.hidden = 'No' ORDER BY a.position ASC, a.id DESC"); | |
return query.getResultList(); | |
} | |
//this does not work! | |
@SuppressWarnings("unchecked") | |
public List<Application> findAllCustom(String category, String sort) | |
{ | |
Query query = getEntityManager().createNativeQuery( | |
"SELECT id,last_name,first_name,category,position,date_appl FROM `applications` WHERE category = '"+category+"' ORDER BY "+sort+" ASC,id DESC"); | |
return query.getResultList(); | |
} | |
@SuppressWarnings("unchecked") | |
public List<Application> findByCategory(String category) | |
{ | |
Query query = getEntityManager().createQuery("select a FROM Application a WHERE a.category = :category AND a.hidden = 'No'"); | |
query.setParameter("category", category); | |
return query.getResultList(); | |
} | |
/** | |
* return an application given an id | |
* @param id | |
* @return application | |
*/ | |
public Application find(int id) | |
{ | |
return em.find(Application.class, id); | |
} | |
/** | |
* persist a new or modified application | |
* @param application | |
*/ | |
public void save(Application application) | |
{ | |
if (application.getId() == null) { | |
em.persist(application); | |
} else { | |
em.merge(application); | |
} | |
} | |
/** | |
* delete an application from persistance | |
* @param id | |
*/ | |
public void remove(int id) | |
{ | |
Application application = find(id); | |
if (application != null) { | |
em.remove(application); | |
} | |
} | |
@SuppressWarnings("unchecked") | |
public int getLastInsertId(){ | |
Query query = getEntityManager().createNativeQuery("SELECT id FROM `applications` ORDER BY id DESC LIMIT 1"); | |
return (Integer)query.getSingleResult(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.action; | |
import java.util.*; | |
import com.opensymphony.xwork2.ActionSupport; | |
import org.apache.struts2.ServletActionContext; | |
import com.opensymphony.xwork2.Action; | |
import org.apache.struts2.interceptor.SessionAware;// prefered way to get session access | |
import org.apache.struts2.interceptor.ApplicationAware; | |
//import com.opensymphony.xwork2.validator.annotations.*;//so we don't have to use xml file | |
import org.apache.struts2.interceptor.validation.SkipValidation; | |
//import com.opensymphony.xwork2.validator.annotations.*;//so we don't have to use xml file | |
/** | |
* methods and fields common to most action classes, i.e. session object | |
* @author david | |
*/ | |
public class CcnbActionSupport extends ActionSupport implements SessionAware, ApplicationAware | |
{ | |
private Map context; | |
/** | |
* user session object assigned by container- set by sessionAware interceptor | |
*/ | |
protected Map session; | |
/** | |
* session check boolean | |
*/ | |
protected boolean validSession = false; | |
protected SortedMap<String, String> pref; | |
protected String[] keys = {"corp","americorp","jrcorp","donor","staff","volunteer","alumni", | |
"partner","employer"}; | |
protected String[] values = {"Corpmembers<br />","AmeriCorps ","JrCorps<br />","Donors ","Staff ","Volunteers ","Alumni ", | |
"Partner ","Employer "}; | |
protected Map<String, String> yn; | |
protected String nextAction; | |
protected String nextPage = "/application1.jsp"; | |
protected String previousPage; | |
protected String thisPage = "/application1.jsp"; | |
protected String lastName = ""; | |
protected String firstName = ""; | |
protected String middle = ""; | |
protected String title = ""; | |
protected String username = ""; | |
protected String password = ""; | |
protected String street = ""; | |
protected String street2 = ""; | |
protected String city = ""; | |
protected String state = "CA"; | |
protected String zip = ""; | |
protected String homePhone = ""; | |
protected String cellPhone = ""; | |
protected String workPhone = ""; | |
protected String emailAddress = ""; | |
protected String category = ""; | |
protected String approved = "No"; | |
protected String appType; | |
protected String position = ""; //this needs to be input automatically | |
CcnbActionSupport(){ | |
this.pref = new TreeMap<String, String>(); | |
for(int i=0;i<keys.length;i++){ | |
pref.put(keys[i], values[i]); | |
} | |
yn = new HashMap<String, String>(); | |
yn.put("yes", "Yes"); | |
yn.put("no", "No"); | |
} | |
/** | |
* generic execute method- default method called for action classes that arent | |
* yet implemented | |
* @return success | |
*/ | |
@SkipValidation | |
public String execute() | |
{ | |
return "success"; | |
} | |
@SkipValidation | |
public String show() | |
{ | |
return Action.SUCCESS; | |
} | |
/** | |
* sets a session variable, called by login action | |
*/ | |
public void setValidSession() | |
{ | |
try { | |
if (session.get("valid").equals("valid")) { | |
validSession = true; | |
} else { | |
validSession = false; | |
} | |
} catch (NullPointerException e) { | |
validSession = false; | |
} | |
} | |
/** | |
* is session valid | |
* @return true false | |
*/ | |
public boolean isValidSession() | |
{ | |
return validSession; | |
} | |
/** | |
* user session accessor | |
* @return session | |
*/ | |
public Map getSession() | |
{ | |
return session; | |
} | |
/** | |
* user session mutator | |
* @param value | |
*/ | |
public void setSession(Map value) | |
{ | |
session = value; | |
} | |
public void setApplication(Map application) | |
{ | |
this.context = application; | |
} | |
/** | |
* generic app context value accessor | |
* @param name | |
* @return value | |
*/ | |
protected Object get(String name) | |
{ | |
return ServletActionContext.getContext().getApplication().get(name); | |
} | |
/** | |
* generic app context value mutator | |
* @param name | |
* @param value | |
*/ | |
@SuppressWarnings("unchecked") | |
protected void set(String name, Object value) | |
{ | |
ServletActionContext.getContext().getApplication().put(name, value); | |
} | |
public String cancel() { | |
return "cancel"; | |
} | |
public SortedMap<String, String> getPref() | |
{ | |
return pref; | |
} | |
public void setPref(SortedMap<String, String> pref) | |
{ | |
this.pref = pref; | |
} | |
public String getNextPage() | |
{ | |
return nextPage; | |
} | |
public void setNextPage(String nextPage) | |
{ | |
this.nextPage = nextPage; | |
} | |
public String getPreviousPage() | |
{ | |
return previousPage; | |
} | |
public void setPreviousPage(String previousPage) | |
{ | |
this.previousPage = previousPage; | |
} | |
public String getThisPage() | |
{ | |
return thisPage; | |
} | |
public void setThisPage(String thisPage) | |
{ | |
this.thisPage = thisPage; | |
} | |
public String getMiddle() { return middle; } | |
public void setMiddle(String middle) { this.middle = middle; } | |
public String getTitle() { return title; } | |
public void setTitle(String title) { this.title = title; } | |
public String getStreet() { return street; } | |
public void setStreet(String street) { this.street = street; } | |
public String getStreet2() { return street2; } | |
public void setStreet2(String street2) { this.street2 = street2; } | |
public String getCity() { return city; } | |
public void setCity(String city) { this.city = city; } | |
public String getState() { return state; } | |
public void setState(String state) { this.state = state; } | |
public String getZip() { return zip; } | |
public void setZip(String zip) { this.zip = zip; } | |
public String getHomePhone() { return homePhone; } | |
public void setHomePhone(String homePhone) { this.homePhone = homePhone; } | |
public String getCellPhone() { return cellPhone; } | |
public void setCellPhone(String cellPhone) { this.cellPhone = cellPhone; } | |
public String getWorkPhone() { return workPhone; } | |
public void setWorkPhone(String workPhone) { this.workPhone = workPhone; } | |
public String getEmailAddress() { return emailAddress; } | |
public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } | |
public String getCategory() { return category; } | |
public void setCategory(String category) { this.category = category; } | |
public String getUsername() { return username; } | |
public void setUsername(String username) { this.username = username; } | |
public String getPassword() { return password; } | |
public void setPassword(String password) { this.password = password; } | |
public String getPosition() { return position; } | |
public void setPosition(String position) { this.position = position; } | |
public String getNextAction() | |
{ | |
return nextAction; | |
} | |
public void setNextAction(String nextAction) | |
{ | |
this.nextAction = nextAction; | |
} | |
/** | |
* for ui rendering only | |
* @return yn | |
*/ | |
public Map<String, String> getYn() | |
{ | |
return yn; | |
} | |
/** | |
* for ui rendering only | |
* @param yn | |
*/ | |
public void setYn(Map<String, String> yn) | |
{ | |
this.yn = yn; | |
} | |
public String getApproved() | |
{ | |
return approved; | |
} | |
public void setApproved(String approved) | |
{ | |
this.approved = approved; | |
} | |
public String getAppType() | |
{ | |
return appType; | |
} | |
public void setAppType(String appType) | |
{ | |
this.appType = appType; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.init; | |
import java.util.*; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletContextListener; | |
import javax.servlet.ServletContextEvent; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.hibernate.*; | |
import org.hibernate.Transaction.*; | |
import org.ccnb.model.*; | |
/** | |
* application context class | |
* @author david | |
*/ | |
public final class CcnbAppListener implements ServletContextListener { | |
private Log log = LogFactory.getLog(this.getClass()); | |
private ServletContext context = null; | |
/** | |
* init callback | |
* run some queries and set some attributes | |
* @param sc_event | |
*/ | |
@SuppressWarnings("unchecked") | |
public void contextInitialized(ServletContextEvent sc_event) { | |
log.info("XXXX Context Initialized XXXXX"); | |
Date curDate = new Date(); | |
Session hsession = HibernateUtil.getSessionFactory().getCurrentSession(); | |
//Applicant applicant = null; | |
//List<Applicant> applicants; | |
List<Login> users; | |
List<VolunteerOpp> events; | |
List<Job> jobs; | |
List<Cotm> cotms; | |
List<Sotm> sotms; | |
List<Story> stories; | |
HashMap<String, Login> logins = new HashMap(); | |
ArrayList<Story> corpsStories = new ArrayList(); | |
ArrayList<Story> donorStories = new ArrayList(); | |
ArrayList<StaffEntry> staff = new ArrayList(); | |
hsession.beginTransaction(); | |
Query query1 = hsession.createQuery("select l FROM Login l"); | |
users = query1.list(); | |
//Query query2 = hsession.createQuery("select e FROM Event e WHERE e.expDate > :curDate"); | |
Query query2 = hsession.createQuery("select v FROM VolunteerOpp v ORDER BY v.displayOrder ASC"); | |
//query2.setDate("curDate", curDate); | |
events = query2.list(); | |
Query query3 = hsession.createQuery("select j FROM Job j ORDER BY j.created ASC"); | |
jobs = query3.list(); | |
Query query4 = hsession.createQuery("select c FROM Cotm c ORDER BY c.sortDate DESC"); | |
cotms = query4.list(); | |
Query query5 = hsession.createQuery("select s FROM Sotm s ORDER BY s.sortDate DESC"); | |
sotms = query5.list(); | |
Query query6 = hsession.createQuery("select s FROM Story s WHERE s.published = 'Yes' ORDER BY s.created DESC"); | |
stories = query6.list(); | |
Query query7 = hsession.createQuery("select s FROM StaffEntry s ORDER BY s.displayOrder ASC"); | |
staff = (ArrayList<StaffEntry>)query7.list(); | |
/* | |
Query query2 = hsession.createQuery("select e FROM Event e WHERE e.expDate > :curDate AND e.official = 'No'"); | |
query2.setDate("curDate", curDate); | |
oevents = query2.list(); | |
Query query3 = hsession.createQuery("select m FROM Meeting m WHERE m.peninsula = 'Yes'"); | |
local_meetings = query3.list(); | |
Query query9 = hsession.createQuery("select a FROM Archive a WHERE a.category = 'minutes' ORDER BY a.date DESC"); | |
minutes = query9.list(); | |
*/ | |
hsession.getTransaction().commit(); | |
for(Login l : users){ | |
logins.put(l.getUsername(), l); | |
} | |
for(Story s: stories){ | |
if(s.getCategory().equals("donor")) | |
donorStories.add(s); | |
else | |
corpsStories.add(s); | |
} | |
this.context = sc_event.getServletContext(); | |
context.setAttribute("users", logins); | |
context.setAttribute("events", events); | |
context.setAttribute("jobs", jobs); | |
context.setAttribute("cotms", cotms); | |
context.setAttribute("sotms", sotms); | |
context.setAttribute("donorStories", donorStories); | |
context.setAttribute("corpsStories", corpsStories); | |
context.setAttribute("staff", staff); | |
} | |
/** | |
* app cleanup | |
* @param event | |
*/ | |
public void contextDestroyed(ServletContextEvent event) { | |
log.info("XXXX Context Destroyed XXXXX"); | |
context.removeAttribute("users"); | |
context.removeAttribute("events"); | |
context.removeAttribute("jobs"); | |
context.removeAttribute("cotms"); | |
context.removeAttribute("sotms"); | |
context.removeAttribute("donorStories"); | |
context.removeAttribute("corpsStories"); | |
context.removeAttribute("staff"); | |
context = null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.action; | |
import java.util.*; | |
import java.io.File; | |
import com.opensymphony.xwork2.ActionSupport; | |
import com.opensymphony.xwork2.Action; | |
//import com.opensymphony.xwork2.validator.annotations.*;//so we don't have to use xml file | |
import org.apache.struts2.ServletActionContext; | |
import org.apache.struts2.interceptor.SessionAware;// prefered way to get session access | |
import org.apache.struts2.interceptor.ApplicationAware; | |
import org.apache.struts2.interceptor.validation.SkipValidation; | |
/** | |
* props and methods common to page generation activities | |
* @author david | |
*/ | |
public abstract class CcnbPageAction extends ActionSupport implements SessionAware, ApplicationAware | |
{ | |
private Map context; | |
/** | |
* user session object assigned by container- set by sessionAware interceptor | |
*/ | |
protected Map session; | |
/** | |
* session check boolean | |
*/ | |
protected boolean validSession = false; | |
protected Map<String, String> yn; | |
//public/private view flag for rendering | |
protected String view = "public"; | |
//file upload properties | |
protected File file; | |
protected boolean uploaded = false; | |
protected String contentType; | |
protected String filename; | |
protected File file2; | |
protected boolean uploaded2 = false; | |
protected String contentType2; | |
protected String filename2; | |
CcnbPageAction(){ | |
yn = new HashMap<String, String>(); | |
yn.put("Yes", "Yes"); | |
yn.put("No", "No"); | |
} | |
/** | |
* generic execute method- default method called for action classes that arent | |
* yet implemented | |
* @return success | |
*/ | |
@SkipValidation | |
public String execute() | |
{ | |
return "success"; | |
} | |
@SkipValidation | |
public String menu() | |
{ | |
return "menu_success"; | |
} | |
public String handleUpload(String imgPath, String path, String img, File fileHandle){ | |
File newFile = new File(imgPath + img); | |
fileHandle.renameTo(newFile); | |
//set("file", fileHandle); //??? | |
return path + img; | |
} | |
/** | |
* sets a session variable, called by login action | |
*/ | |
public void setValidSession() | |
{ | |
try { | |
if (session.get("valid").equals("valid")) { | |
validSession = true; | |
} else { | |
validSession = false; | |
} | |
} catch (NullPointerException e) { | |
validSession = false; | |
} | |
} | |
/** | |
* is session valid | |
* @return true false | |
*/ | |
public boolean isValidSession() | |
{ | |
return validSession; | |
} | |
/** | |
* user session accessor | |
* @return session | |
*/ | |
public Map getSession() | |
{ | |
return session; | |
} | |
/** | |
* user session mutator | |
* @param value | |
*/ | |
public void setSession(Map value) | |
{ | |
session = value; | |
} | |
public void setApplication(Map application) | |
{ | |
this.context = application; | |
} | |
protected Object get(String name) | |
{ | |
return ServletActionContext.getContext().getApplication().get(name); | |
} | |
@SuppressWarnings("unchecked") | |
protected void set(String name, Object value) | |
{ | |
ServletActionContext.getContext().getApplication().put(name, value); | |
} | |
public String cancel() { | |
return "cancel"; | |
} | |
/** | |
* for ui rendering only | |
* @return yn | |
*/ | |
public Map<String, String> getYn() | |
{ | |
return yn; | |
} | |
/** | |
* for ui rendering only | |
* @param yn | |
*/ | |
public void setYn(Map<String, String> yn) | |
{ | |
this.yn = yn; | |
} | |
///// the methods needed by fileupload interceptor for file field named "upload" | |
public void setUpload(File file) | |
{ | |
this.file = file; | |
this.uploaded = true; | |
} | |
public void setUploadFileName(String filename) | |
{ | |
this.filename = filename; | |
} | |
public void setUploadContentType(String contentType) | |
{ | |
this.contentType = contentType; | |
} | |
//////// | |
///// the methods needed by fileupload interceptor for file field named "upload" | |
public void setUpload2(File file2) | |
{ | |
this.file2 = file2; | |
this.uploaded2 = true; | |
} | |
public void setUpload2FileName(String filename2) | |
{ | |
this.filename2 = filename2; | |
} | |
public void setUpload2ContentType(String contentType2) | |
{ | |
this.contentType2 = contentType2; | |
} | |
//////// | |
public File getUpload() | |
{ | |
return file; | |
} | |
public String getFilename() | |
{ | |
return filename; | |
} | |
//public void setFilename(String filename) | |
//{ | |
// this.filename = filename; | |
//} | |
public boolean getUploaded(){ | |
return uploaded; | |
} | |
public String getView() | |
{ | |
return view; | |
} | |
public void setView(String view) | |
{ | |
this.view = view; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.tag; | |
/** | |
* class for dojofying text fields in struts / jsp templates, adds non-standard declarative attributes | |
* @author david | |
*/ | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.struts2.views.annotations.StrutsTag; | |
import org.apache.struts2.views.annotations.StrutsTagAttribute; | |
import com.opensymphony.xwork2.util.ValueStack; | |
import org.apache.struts2.components.TextField; | |
@StrutsTag(name="textfield", tldTagClass="org.penypaa.tag.DojoTextFieldTag", description="Render a Dojo textfield widgit") | |
public class DojoTextField extends TextField{ | |
protected String dojoType; | |
protected String trim; | |
protected String propercase; | |
protected String regExp; | |
protected String invalidMessage; | |
protected String type; | |
protected String promptMessage; | |
public DojoTextField(ValueStack stack, HttpServletRequest request, HttpServletResponse response) { | |
super(stack, request, response); | |
} | |
protected void evaluateExtraParams() { | |
super.evaluateExtraParams(); | |
if (dojoType != null) { | |
addParameter("dojoType", findString(dojoType)); | |
} | |
if (trim != null) { | |
addParameter("trim", findValue(trim, Boolean.class)); | |
} | |
if (propercase != null) { | |
addParameter("propercase", findValue(propercase, Boolean.class)); | |
} | |
if (regExp != null) { | |
addParameter("regExp", findString(regExp)); | |
} | |
if (invalidMessage != null) { | |
addParameter("invalidMessage", findString(invalidMessage)); | |
} | |
if (type != null) { | |
addParameter("type", findString(type)); | |
} | |
if (promptMessage != null) { | |
addParameter("promptMessage", findString(promptMessage)); | |
} | |
} | |
@StrutsTagAttribute(description="Dojo type", type="String") | |
public void setDojoType(String dojoType) | |
{ | |
this.dojoType = dojoType; | |
} | |
@StrutsTagAttribute(description="Trim white space", type="Boolean", defaultValue="true") | |
public void setTrim(String trim) | |
{ | |
this.trim = trim; | |
} | |
@StrutsTagAttribute(description="Capitalize", type="Boolean", defaultValue="false") | |
public void setPropercase(String propercase) | |
{ | |
this.propercase = propercase; | |
} | |
@StrutsTagAttribute(description="field validation condition", type="String") | |
public void setRegExp(String regExp) | |
{ | |
this.regExp = regExp; | |
} | |
@StrutsTagAttribute(description="invalid field tooltip message", type="String") | |
public void setInvalidMessage(String invalidMessage) | |
{ | |
this.invalidMessage = invalidMessage; | |
} | |
@StrutsTagAttribute(description="set type other than text", type="String") | |
public void setType(String type) | |
{ | |
this.type = type; | |
} | |
@StrutsTagAttribute(description="set prompt message", type="String") | |
public void setPromptMessage(String promptMessage) | |
{ | |
this.promptMessage = promptMessage; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ccnb.tag; | |
/** | |
* Struts tag ext for dojofying text fields | |
* @author david | |
*/ | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.struts2.components.Component; | |
import org.apache.struts2.components.TextField; | |
import com.opensymphony.xwork2.util.ValueStack; | |
import org.apache.struts2.views.jsp.ui.TextFieldTag; | |
public class DojoTextFieldTag extends TextFieldTag { | |
private static final long serialVersionUID = 5811285953670562288L; | |
protected String dojoType; | |
protected String trim; | |
protected String propercase; | |
protected String regExp; | |
protected String invalidMessage; | |
protected String type; | |
protected String promptMessage; | |
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { | |
return new DojoTextField(stack, req, res); | |
} | |
protected void populateParams() { | |
super.populateParams(); | |
DojoTextField textField = ((DojoTextField) component); | |
textField.setDojoType(dojoType); | |
textField.setTrim(trim); | |
textField.setPropercase(propercase); | |
textField.setRegExp(regExp); | |
textField.setInvalidMessage(invalidMessage); | |
textField.setType(type); | |
textField.setPromptMessage(promptMessage); | |
} | |
public void setDojoType(String dojoType) | |
{ | |
this.dojoType = dojoType; | |
} | |
public void setTrim(String trim) | |
{ | |
this.trim = trim; | |
} | |
public void setPropercase(String propercase) | |
{ | |
this.propercase = propercase; | |
} | |
public void setRegExp(String regExp) | |
{ | |
this.regExp = regExp; | |
} | |
public void setInvalidMessage(String invalidMessage) | |
{ | |
this.invalidMessage = invalidMessage; | |
} | |
public void setType(String type) | |
{ | |
this.type = type; | |
} | |
public void setPromptMessage(String promptMessage) | |
{ | |
this.promptMessage = promptMessage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment