Transforming the Transforming the e-Concordiensise-Concordiensis
Edward MaasEdward Maas
Senior Capstone Design Senior Capstone Design ProjectProject
Advisor: Professor CassAdvisor: Professor Cass
About the ProjectAbout the Project Client: Concordiensis ( School Newspaper )Client: Concordiensis ( School Newspaper ) Website: Website: http://concordy.union.eduhttp://concordy.union.edu Project: created a robust electronic Project: created a robust electronic
publishing infrastructure.publishing infrastructure. Transformed From: HTML & PDF ArticlesTransformed From: HTML & PDF Articles
Technology UsedTechnology Used Custom Content Management SystemCustom Content Management System
Open Source JAVA Tools: Open Source JAVA Tools: Model-View-Controller for the Web Model-View-Controller for the Web
Struts (Struts (http://struts.apache.org/http://struts.apache.org/ ) ) Object / Relational Persistence and Query Service Object / Relational Persistence and Query Service
Hibernate (Hibernate (http://www.hibernate.org/http://www.hibernate.org/ ) )
Image ManipulationImage Manipulation Image Conversion (TIFF-to-PNG)Image Conversion (TIFF-to-PNG)
Tiff2png tool Tiff2png tool ((http://www.libpng.org/pub/png/apps/tiff2png.htmlhttp://www.libpng.org/pub/png/apps/tiff2png.html))
Image ScalingImage Scaling JMagick (JMagick (http://www.yeo.id.au/jmagick/http://www.yeo.id.au/jmagick/))
Relational Database (MySQL 4.1)
Model View (JSP) Controller
Presentation ( jsp includes & tiles )
Browser (Mozilla, IE, Firefox, Safari)
Objec
t 2 R
elatio
nal
(Hibe
rnat
e)
STRUTS
How it works?How it works?
RequestRequest Business Business
LogicLogic Data Data
Access Access (hibernate(hibernate))
ViewView ResponseResponse
1
4
5
3
22
How Struts is Used!How Struts is Used! Created Forms (model)Created Forms (model)
AddArticleForm, LoginForm, etcAddArticleForm, 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 formsWrote classes to process formsedu.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 correctStaff authUser = (Staff)smanager.getBySignInCredentials(username, password);//On Login Successreturn (mapping.findForward("success"));
HibernateCall
Struts Usage Struts Usage Continued…Continued…
<global-forwards> <forward name="failure" path="/admin/Login.do" /> <forward name="login" path="/admin/Login.do" /></global-forwards>
Failure is defined globallyFailure is defined globally
<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>
Create Action Mappings (controller)Create Action Mappings (controller) Validation & Forwards Validation & Forwards
Data Organization Data Organization (relational)(relational)
ER Diagram
How Hibernate Works!How Hibernate Works!
Define HBMDefine HBM XML config, Struts uses one too!XML config, Struts uses one too! Defines correspondence between tables Defines correspondence between tables
and classesand classes Defines Keys / RelationshipsDefines Keys / Relationships
Create Value Object ClassesCreate Value Object Classespublic Integer getId() { return this.Id;}
public void setId(Integer Id) { this.Id = Id;}
Data OrganizationData Organization
Hibernate Data Pseudo Diagram
Edition.java{Date, Volume, Publish}
Sports Arts News Features
Sec
tion.
java
ArticlesImages
Staff
{Title }
{ AuthorNameHeadlineContent }
{ FilenameHeightWidth }
Sets Sets Represent Represent Multi-Multi-valued valued RelationshiRelationshipsps
Update can Update can be made be made with a with a single single actionaction
Hibernate In Action!Hibernate In Action!
Create Queries (HQL)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 });
Staff authUser = (Staff) smanager.getBySignInCredentials(username, password);
Integrate within Controller (Struts)Integrate within Controller (Struts)
Presentation Layer !Presentation Layer !
JSP JSP Templates Templates (Green)(Green)
Struts & Struts & Standard JSP Standard JSP Tags for form Tags for form elements elements (Black)(Black)
Custom Java Custom Java Tags Tags (Yellow)(Yellow)
AssignPhoto FormCustom
Layout Tag: StoryTag.ja
va
Struts at work –
CheckImages.jsp
Putting it All Together!Putting it All Together!
Code written primarily on LinuxCode written primarily on Linux Revisions tracked with cvsRevisions tracked with cvs Build & Deployment Process: Build & Deployment Process:
Apache AntApache Ant Java Container: Jakarta Tomcat 5.xJava Container: Jakarta Tomcat 5.x
Next Steps & Neat Next Steps & Neat Additions!Additions!
Present Finished Product to Concordy Present Finished Product to Concordy Editors for beta testingEditors for beta testing
Deploy Database and Application on VUDeploy Database and Application on VU Performance Test under actual traffic!Performance Test under actual traffic!
Add Editing features to data in the Add Editing features to data in the Content ManagerContent Manager
Fix Access Control ListsFix Access Control Lists Create RSS Syndication FeedsCreate RSS Syndication Feeds More cross browser/ machine layout & More cross browser/ machine layout &
GUIGUI
Questions ?Questions ?
Top Related