140 likes | 236 Views
Transforming the e-Concordiensis. Edward Maas Senior Capstone Design Project Advisor: Professor Cass. About the Project. Client: Concordiensis ( School Newspaper ) Website: http://concordy.union.edu Project: created a robust electronic publishing infrastructure.
E N D
Transforming the e-Concordiensis Edward Maas Senior Capstone Design Project Advisor: Professor Cass
About the Project • Client: Concordiensis ( School Newspaper ) • Website: http://concordy.union.edu • Project: created a robust electronic publishing infrastructure. • Transformed From: HTML & PDF Articles
Technology Used • Custom Content Management System • Open Source JAVA Tools: • Model-View-Controller for the Web • Struts (http://struts.apache.org/ ) • Object / Relational Persistence and Query Service • Hibernate (http://www.hibernate.org/ ) • Image Manipulation • Image Conversion (TIFF-to-PNG) • Tiff2png tool (http://www.libpng.org/pub/png/apps/tiff2png.html) • Image Scaling • JMagick (http://www.yeo.id.au/jmagick/)
2 2 How it works? • Request • Business Logic • Data Access (hibernate) • View • Response 5 1 4 3
How Struts is Used! • Created Forms (model) • AddArticleForm, LoginForm, etc <form-bean name="LoginForm" type="org.apache.struts.validator.DynaValidatorForm"> <form-property name="username" type="java.lang.String" /> <form-property name="password" type="java.lang.String" /> </form-bean> • Wrote classes to process forms edu.union.struts.LoginForm.java: // Get Username & Password from form String username = (String)(newLoginForm.get("username")); String password = (String)(newLoginForm.get("password")); // Check to make sure they’re in the database & passwords are correct Staff authUser = (Staff)smanager.getBySignInCredentials(username, password); //On Login Success return (mapping.findForward("success")); Hibernate Call
Struts Usage Continued… • Create Action Mappings (controller) • Validation & Forwards <action path="/admin/LoginForm" type="edu.union.struts.LoginForm" name="LoginForm" scope="request" validate="true" input="/Login.jsp"> <forward name="success" path="/AdminIndex.jsp" /> </action> • Failure is defined globally <global-forwards> <forward name="failure" path="/admin/Login.do" /> <forward name="login" path="/admin/Login.do" /> </global-forwards>
Data Organization (relational) ER Diagram
How Hibernate Works! • Define HBM • XML config, Struts uses one too! • Defines correspondence between tables and classes • Defines Keys / Relationships • Create Value Object Classes public Integer getId() { return this.Id; } public void setId(Integer Id) { this.Id = Id; }
Data Organization • Sets Represent Multi-valued Relationships • Update can be made with a single action Hibernate Data Pseudo Diagram
Hibernate In Action! • Create Queries (HQL) List users= session.find( "from Staff as staff where " + "staff.username = ? and staff.password = ?", new Object[] { uUsername, uPassword }, new Type[] { Hibernate.STRING, Hibernate.STRING }); • Integrate within Controller (Struts) • Staff authUser = (Staff) smanager.getBySignInCredentials(username, password);
AssignPhoto Form Custom Layout Tag: StoryTag.java Struts at work – CheckImages.jsp Presentation Layer ! • JSP Templates (Green) • Struts & Standard JSP Tags for form elements (Black) • Custom Java Tags (Yellow)
Putting it All Together! • Code written primarily on Linux • Revisions tracked with cvs • Build & Deployment Process: Apache Ant • Java Container: Jakarta Tomcat 5.x
Next Steps & Neat Additions! • Present Finished Product to Concordy Editors for beta testing • Deploy Database and Application on VU • Performance Test under actual traffic! • Add Editing features to data in the Content Manager • Fix Access Control Lists • Create RSS Syndication Feeds • More cross browser/ machine layout & GUI