Updated Roster to use new ThdlUser Repository

This commit is contained in:
travismccauley 2004-01-07 18:36:50 +00:00
parent 5ec57eb55a
commit 71ad012fa1
8 changed files with 39 additions and 385 deletions

View file

@ -19,55 +19,18 @@
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/> <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/> <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<property file="${user.home}/.${ant.project.name}-build.properties"/>
<property file="${user.home}/.build.properties"/>
<property file="build.properties"/>
<!-- Classpath Reference --> <!-- Classpath Reference -->
<path id="roster-classpath"> <path id="roster-classpath">
<fileset dir="/usr/local/jakarta-tomcat-4.1.18/common/lib"> <fileset dir="${catalina.home}/common/lib">
<include name="servlet.jar"/> <include name="servlet.jar"/>
<include name="mysql-connector-java-3.0.8-stable-bin.jar"/>
</fileset> </fileset>
<fileset dir="WEB-INF/lib"> <fileset dir="WEB-INF/lib">
<include name="bsf-2.3.0.jar"/> <include name="*.jar"/>
<include name="commons-beanutils-1.6.1.jar"/>
<include name="commons-collections-2.1.jar"/>
<include name="commons-digester-1.5.jar"/>
<include name="commons-fileupload-1.0.jar"/>
<include name="commons-lang-1.0.jar"/>
<include name="commons-logging-1.0.2.jar"/>
<include name="jakarta-oro-2.0.6.jar"/>
<include name="javassist-2.5.1.jar"/>
<include name="log4j-1.2.6.jar"/>
<include name="ognl-2.5.1.jar"/>
<include name="tapestry-3.0-beta-3.jar"/>
<include name="tapestry-contrib-3.0-beta-3.jar"/>
<include name="torque-3.0.jar"/>
<include name="mysql-driver.jar"/>
<include name="jdbc-2.0.jar"/>
<include name="village-2.0-dev-20021111.jar"/>
<include name="commons-configuration-1.0-dev.jar"/>
<include name="stratum-1.0-b3.jar"/>
<include name="commons-dbcp-1.0-dev-20020806.jar"/>
<include name="commons-pool-1.0.jar"/>
<!-- <include name="bcel-5.0.jar"/>
<include name="bsf-2.3.0.jar"/>
<include name="tapestry-2.4-alpha-5.jar"/>
<include name="tapestry-contrib-2.4-alpha-5.jar"/>
<include name="ant-1.5.jar"/>
<include name="commons-beanutils-1.4.1.jar"/>
<include name="commons-collections-2.0.jar"/>
<include name="commons-lang-1.0.jar"/>
<include name="ejb.jar"/>
<include name="jakarta-oro-2.0.6.jar"/>
<include name="jcommon-0.6.4.jar"/>
<include name="jcs-1.0-dev.jar"/>
<include name="jfreechart-0.9.2.jar"/>
<include name="jndi-1.2.1.jar"/>
<include name="junit-3.8.1.jar"/>
<include name="log4j-1.2.6.jar"/>
<include name="ognl-2.3.0-opt.jar"/>
<include name="tomcat-naming-1.0.jar"/>
<include name="velocity-1.3.jar"/>
<include name="xercesImpl-2.0.2.jar"/>
<include name="xml-apis-2.0.2.jar"/> -->
</fileset> </fileset>
<fileset dir="WEB-INF/classes"> <fileset dir="WEB-INF/classes">
<include name="**/*.class"/> <include name="**/*.class"/>
@ -98,6 +61,11 @@
<target name="compile" depends="copy" description="Compile web application"> <target name="compile" depends="copy" description="Compile web application">
<!-- ... construct web application in ${build} subdirectory ... --> <!-- ... construct web application in ${build} subdirectory ... -->
<javac srcdir="${thdluser.home}/src/java"
destdir="${build}/WEB-INF/classes"
deprecation="on"
classpathref="roster-classpath"
debug="on"/>
<javac srcdir="${basedir}/src/java" <javac srcdir="${basedir}/src/java"
destdir="${build}/WEB-INF/classes" destdir="${build}/WEB-INF/classes"
deprecation="on" deprecation="on"
@ -146,10 +114,17 @@
</javadoc> </javadoc>
</target> </target>
<target name="install" description="Install web application" <target name="install" description="Install web application" depends="compile">
depends="compile"> <install url="${url}"
<install url="${url}" username="${username}" password="${password}" username="${username}"
path="${path}" war="file://${build}"/> password="${password}"
path="${path}"
config="file://${basedir}/${roster.context.config}"
war="file://${build}"/>
</target>
<target name="reinstall" description="Remove and Re-install web application" depends="remove">
<antcall target="install"/>
</target> </target>
<target name="reload" description="Reload web application" <target name="reload" description="Reload web application"

View file

@ -71,7 +71,7 @@ public class Person extends org.thdl.roster.om.Member implements RosterMember, j
public Person( ThdlUser user ) throws TorqueException public Person( ThdlUser user ) throws TorqueException
{ {
this(); this();
getPersonData().setThdlUserId( new Integer( user.getId() ) ); getPersonData().setThdlUserId( user.getId() );
getPersonData().setFirstname( user.getFirstname() ); getPersonData().setFirstname( user.getFirstname() );
getPersonData().setMiddlename( user.getMiddlename() ); getPersonData().setMiddlename( user.getMiddlename() );
getPersonData().setLastname( user.getLastname() ); getPersonData().setLastname( user.getLastname() );

View file

@ -54,7 +54,7 @@ public class Home extends RosterPage
Visit visit = (Visit)getVisit(); Visit visit = (Visit)getVisit();
if ( visit.isAuthenticated() ) if ( visit.isAuthenticated() )
{ {
Integer userId = new Integer( visit.getThdlUser().getId() ); Integer userId = visit.getThdlUser().getId() ;
Global global = (Global) getGlobal(); Global global = (Global) getGlobal();
Iterator iter = global.getAllPeople().iterator(); Iterator iter = global.getAllPeople().iterator();
while( iter.hasNext() ) while( iter.hasNext() )

View file

@ -60,10 +60,12 @@ public class Login extends RosterPage
public boolean validateUser() public boolean validateUser()
{ {
boolean rVal = false; boolean rVal = false;
ThdlUser thdlUser = null;
try try
{ {
thdlUser = ThdlUserRepository.getInstance().validate( getLogin(), getPassword() ); ThdlUser thdlUser = new ThdlUser();
thdlUser.setUsername( getLogin() );
thdlUser.setPassword( getPassword() );
thdlUser = ThdlUserRepository.getInstance().validate( thdlUser, "roster" );
rVal = true; rVal = true;
Visit visit = (Visit) getVisit(); Visit visit = (Visit) getVisit();
visit.setThdlUser( thdlUser ); visit.setThdlUser( thdlUser );
@ -73,6 +75,10 @@ public class Login extends RosterPage
{ {
setMessage( ture.getMessage() ); setMessage( ture.getMessage() );
} }
catch ( java.sql.SQLException e )
{
throw new ApplicationRuntimeException( e );
}
return rVal; return rVal;
} }

View file

@ -19,7 +19,7 @@ public class ContactInfoPage extends MemberFormSeries
{ {
Visit visit = (Visit) getVisit(); Visit visit = (Visit) getVisit();
Member member = (Member) visit.getMember(); Member member = (Member) visit.getMember();
member.save( new Integer( visit.getThdlUser().getId() ) ); member.save( visit.getThdlUser().getId() );
try try
{ {
if ( member instanceof Person ) if ( member instanceof Person )

View file

@ -90,7 +90,7 @@ public class MemberData extends MemberFormSeries
//don't move this line! //don't move this line!
List flatDataIds = person.getPersonData().getPersonTypeIdList(); List flatDataIds = person.getPersonData().getPersonTypeIdList();
Integer userId = new Integer( visit.getThdlUser().getId() ); Integer userId = visit.getThdlUser().getId() ;
person.getPersonData().setThdlUserId( userId ); person.getPersonData().setThdlUserId( userId );
person.getPersonData().save(); person.getPersonData().save();
person.setPersonDataKey( member.getPersonData().getPrimaryKey() ); person.setPersonDataKey( member.getPersonData().getPrimaryKey() );

View file

@ -116,7 +116,7 @@ public abstract class MemberFormSeries extends SecureRosterPage
if ( ! member.isNew() ) if ( ! member.isNew() )
{ {
Integer owner = member.getCreatedBy(); Integer owner = member.getCreatedBy();
Integer user = new Integer( visit.getThdlUser().getId() ); Integer user = visit.getThdlUser().getId();
if ( ! owner.equals( user ) ) if ( ! owner.equals( user ) )
{ {
RosterPage home = (RosterPage) cycle.getPage( "Home" ); RosterPage home = (RosterPage) cycle.getPage( "Home" );

View file

@ -1,327 +0,0 @@
org.thdl.roster.om
org.thdl.roster.om
org.thdl.roster.om.map
Failed to create dir or dir already exists: /Users/travis/webapps/roster/src/java/org/thdl/roster/om/
Failed to create dir or dir already exists: /Users/travis/webapps/roster/src/java/org/thdl/roster/om/map/
Failed to create dir or dir already exists: /Users/travis/webapps/roster/src/java/org/thdl/roster/om/
Member
PersonData
ProjectData
OrganizationData
ContactInfo
Address
Phone
Publication
ResearchInterest
Document
Country
CulturalArea
Language
Discipline
DocumentType
ProjectType
OrganizationType
PersonType
PersonPersonType
OrganizationOrganizationType
ProjectProjectType
ResearchInterestLanguage
ResearchInterestCulturalArea
ResearchInterestDiscipline