A few Master program students have contributed to this exercise. Thanks to Anete Ozola for providing her application Mtest.lv written in RubyRails. Vladimirs Potapovs suggested the Spring's solution for an internationalization filter. (Prior to that a more complicated custom solution was used to support UTF-8 encoding for Web forms.) Here is the solution (see also the file edu_demo/webapp/WEB-INF/web.xml):
... <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ...
A simple multiple-choice testing application illustrates how a domain model can be mapped to a relational database, and how a Spring MVC application may be used to be the Web layer for that database application. The domain model (the design of lv.webkursi.mtest.lab02.domain) is available as an image in PNG and SVG formats.
In this exercise you will create a Java analogue to an existing application done in Ruby/Rails. Here are instructions how to run the RubyRails prototype application Mtest.lv:
RubyRails instalācijas instrukciju sk. www.rubyonrails.com. Aptuvena solju seciiba: (1) Instaleet Ruby (piemeeram ruby186-25.exe no http://rubyforge.org/frs/?group_id=167 ). (2) Ja atrodaties aiz PROXY servera, tad DOS lodzinjaa uzstaadiet pagaidu mainiigo: set HTTP_PROXY=http://your.proxyserver.url:8080 Preteejaa gadiijumaa izlaidiet sho instrukciju. (3) Izpildiet DOS komandu: gem install rails --include-dependencies Pēc Ruby un Rails instalēšanas var sagatavot un izpildīt mtest.lv aplikāciju: (4) Palaist BAT failu initialize-db-and-run-webrick.bat. Šis .bat failiņš: -izveido localhost datubāzi 'mtest' (mysql login/parole root/root) -izveido lietotāju Admin (mtest login/PAROLE admin/admin) -ieraksta datubāzē pāris testa moduļus -startē Webrick (http://localhost:3000)
Check out the code from the following BerliOS repository (e.g. with Subclipse): https://firstname.lastname@example.org/svnroot/repos/klucis/portalEduTrunk. It should not ask for any passwords, if you access that repository in read-only mode.
You will mostly edit files under the packages lv.webkursi.mtest.lab02.* under the "edu_core", and also all kinds of files under the "edu_demo". There should be very few dependencies from "lv.webkursi.mtest.lab02.*" packages to any "lv.webkursi.mtest.core" (the latter deals with RDF data processing and is not needed for this exercise).
In this exercise a special attention will be paid to the completeness to your test suites. Make sure that all the DAO methods you need are tested (i.e. you would need tests for the new DAO methods regarding Assignments, Sessions and Answers, which persist the domain objects from the package lv.webkursi.mtest.lab02.domain), and also JUnit tests for various other objects, e.g. validators.
Your Selenium tests would need to cover all kinds of normal behaviors and also abnormal ones (invalid form submissions, someone attempting to do something without proper authorization, e.g. a non-admin user doing admin functionality, etc.)
As before, you are requested to write a presentation lab02.ppt, which you can include under "portalEduTrunk/doc" directory. This presentation should contain short description of all your main activities and design solutions taken for this exercise and also the full names of all participants in your team. Having a PPT presentation is mandatory; submissions, which do not contain it will be rejected.
When you are finished doing all the things described under "Design Problem", please run the Ant task "ant submit" in the root directory of "portalEduTrunk". It should create a file lab02.not_a_zip, which one of your team can send as a regular e-mail attachment to the "kalvis.apsitis" account at "gmail.com". (The file actually IS a ZIP file, but it has a different extension to bypass checking for executable BAT files, which may be contained in this attachment.)
It is recommended that you understand Hibernate and Spring MVC before attempting this exercise.
Design and configuration for a typical Spring/Hibernate database application; also its development steps and testing.
Each of the 6 exercises in "Design problems" is worth 3 points. Points may be reduced, if your code is not properly object-oriented (e.g. if you write the command-line utility as a huge main() method), also, if the code is not well readable and does not properly handle resources (like database connections, uploaded image files, etc.), is potentially insecure or iniefficient. Also, if the JUnit/Selenium tests are incomplete. The remaining 2 points will be given for the PPT presentation.
Mārtiņš Barinskis atzīmē sekojošas izmaiņas, ja darbina Mtest.lv (t.i. Ruby/Rails aplikāciju) uz Unix-veida platformas.
chmod 755 public/dispatch.fcgi
acīmredzot, kaut kas bija noticis ar šī faila piekļuves tiesībām.
#!/usr/local/bin/ruby require 'rubygems' require 'active_record' require 'rexml/document' require 'logger'
If you have difficulties checking out the project, you may proceed in either of two ways:
In order to install Subclipse and to use it from behind the proxy - open Window -> Preferences. Select "Install/Update" in the left part of the screen. Then check the Proxy Server and fill in your proxy server details.