Successfully reported this slideshow.
Your SlideShare is downloading. ×

jRecruiter - The AJUG Job Posting Service

Advertisement

More Related Content

Advertisement
Advertisement

jRecruiter - The AJUG Job Posting Service

  1. 1. jRecruiter The AJUG Job Posting Service Gunnar Hillert 1
  2. 2. About Myself 1998-2002 CS at Univ. of Applied Sciences (HTW) Berlin, Germany 2002 Thesis 2002-2005 Business Integration Consultant 2005-today Mostly web application development Struts 1, Spring MVC, Struts 2, GWT 2
  3. 3. Sometimes I don’t code... but rather enjoy red clay and humidity 3
  4. 4. About jRecruiter Google Code: http://code.google.com/p/jrecruiter/ CI: http://74.207.227.71:9080/hudson/job/jRecruiter/ Website: http://www.jrecruiter.org/ AJUG Job Posting Site: http://www.ajug.org/jrecruiter/ 4
  5. 5. History 2005 jRecruiter 1.0 (Struts 1, Hibernate) 2006 jRecruiter 1.2 (Design changes, validation) 2009 jRecruiter 2.0 (Struts 2.1, Spring 3.0, JPA (Hibernate)) 5
  6. 6. Changes Heavy Use of Annotations (Spring 2.5+) Google Maps Integration Hibernate Search RSS Better Security Flex Integration Example 6
  7. 7. Maven 2 jRecruiter uses Maven 2 3 Modules jrecruiter-server jrecruiter-web jrecruiter-flex 7
  8. 8. AppFuse If you develop Java web-applications, it’s a must-know! http://www.appfuse.org Developed by Matt Raible - www.raibledesigns.com jRecruiter is loosely based on AppFuse 8
  9. 9. Spring 2.5/3.0 Use annotations to reduce XML clutter @Autowired - eliminate getters/setters <tx:annotation-driven/> <context:annotation-config /> <context:component-scan base-package="org.jrecruiter.dao.jpa" /> <context:component-scan base-package="org.jrecruiter.service.impl" /> 9
  10. 10. Spring Tips If using @Autowired and no setters - How to unit-test? org.springframework.test.util.ReflectionTestUtils Allows for setting private instance variables EasyMock is awesome 10
  11. 11. Table Pluralization I What about rails-like table pluralization? You could do: @Table(name="users") Better: Hibernate Naming Strategy org.hibernate.cfg.DefaultNamingStrategy org.hibernate.cfg.ImprovedNamingStrategy 11
  12. 12. Table Pluralization II How to do pluralization? inflector project (http://inflector.dev.java.net) e.g. String cats = Noun.pluralOf(“cat”) jRecruiter: ImprovedPluralizedNamingStrategy 12
  13. 13. Data Migration How to deal with external services referencing jobs? Primary key ids may change across data migrations Solution: UUID for Job postings How to map old urls to the new one? Solution: urlrewriter (http://tuckey.org/urlrewrite/) 13
  14. 14. Lorem Ipsum Generate an arbitrary number of job postings Fill them with Dummy Data aka ‘place holder text’ http://en.wikipedia.org/wiki/Lorem_ipsum Library for Java: http://loremipsum.sourceforge.net/ 14
  15. 15. Struts 2.1 Annotation-driven configuration Using Convention Plugin (Bundled with Struts 2.1) VERY similar to Spring MVC 3.0 Which one is better? 15
  16. 16. I18N part I support for German (80% complete) support for Spanish is planned Advice: UTF-8 for everything! Java properties files are a bit ‘iffy’ 16
  17. 17. I18N part II by default Java properties files are in ISO-8859-1 UTF-8 characters need to be escaped - ugly! Java 6 has better support: ResourceBundle.Control ResourceBundle bundle = ResourceBundle.getBundle("messages", new MyControl()); 17
  18. 18. I18N part III Spring: ReloadableResourceBundleMessageSource <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" > <property name="basenames" > <list> <value>classpath:messages</value> </list> </property> <property name="defaultEncoding" value="utf-8"/> <property name="cacheSeconds" value="0"/> </bean> Spring JSP message tag can use it Good plugin for eclipse: Eclipse ResourceBundle Editor http://sourceforge.net/projects/eclipse-rbe/ 18
  19. 19. Security in jRecruiter SSL for all administrative pages Account verification at signup (Email) User Login: Email + Password Under the covers: Email OR Username + Password 19
  20. 20. Jasypt http://www.jasypt.org/ http://www.jasypt.org/howtoencryptuserpasswords.html <bean id="stringDigester" class="org.jasypt.digest.StandardStringDigester" > <property name="algorithm" value="SHA-512" /> <property name="iterations" value="100000" /> <property name="saltSizeBytes" value="16" /> </bean> <bean id="passwordEncoder" class="org.jasypt.spring.security2.PasswordEncoder"> <property name="stringDigester"> <ref bean="stringDigester" /> </property> </bean> 20
  21. 21. reCATPCHA http://recaptcha.net/ Ensure a human is filling out the form APIs for many languages Java, Ruby, Python, .Net… Recaptcha4j (http://code.google.com/p/recaptcha/) 21
  22. 22. Google Maps jRecruiter uses: Maps Api (Version 2) Maps Api for Flash Static Maps API Be careful with SSL! http://code.google.com/p/gmaps-api-issues/issues/detail?id=591 22
  23. 23. Google Maps for PDF Using Static Maps API Server makes call Image embedded using iText 23
  24. 24. Twitter and bit.ly Twitter4J (http://yusuke.homeip.net/twitter4j/ java-twitter (http://code.google.com/p/java-twitter/) Jtwitter (http://www.winterwell.com/software/ jtwitter.php) jRecruiter uses Twitter4J: final Twitter twitter = new Twitter(“my_username”, “my password”); try { twitter.updateStatus(“tweet”); } catch (TwitterException e) { …} 24
  25. 25. bit.ly similar to TinyUrl, just cooler there is a Java library available bitlyj http://code.google.com/p/bitlyj/ bitlyj works okay but needs some work final Bitly bitly = BitlyFactory.newInstance(“username”, “password”); try { final BitlyUrl bUrl = bitly.shorten(“http://www.google.com/”); return bUrl.getShortUrl(); } catch (final IOException e) { … } 25
  26. 26. Managing API Keys Dealing with one API key is easy, but many? Google Maps, Twitter, bit.ly, reCAPTCHA ... Centrally stored in jrecruiter.properties org.jrecruiter.common.ApiKeysHolder Spring-injected 26
  27. 27. RSS Feed Support Provide the latest 20 Job postings as Feed ROME https://rome.dev.java.net/ Struts2 integration with s2-rome http://code.google.com/p/s2-rome/ 27
  28. 28. Web Services (Indeed.com) Used JDOM at first, yet memory intensive StAX - Streaming API for XML Stream XML data to client Advantage: Lower Memory Footprint Part of Java 6 28
  29. 29. YSlow 80% of the end-user response time is spent on the front-end. Reduce HTTP requests, GZIP, Minify … http://developer.yahoo.com/yslow/ http://developer.yahoo.com/performance/rules.html 29
  30. 30. Jawr https://jawr.dev.java.net/ Bundling Minification GZipping DWR Integration JMX Support 30
  31. 31. Flex Spring BlazeDS Integration http://www.springsource.org/spring-flex http://coenraets.org (Christophe Coenraets) SWFObject 2 - Easier Flex Embedding http://code.google.com/p/swfobject/ 31
  32. 32. flexmojos http://flexmojos.sonatype.org/ Build Flex projects with Maven Now part of Sonatype 32
  33. 33. ¿Questions? Feature requests/issues/feedback gunnar@hillert.com http://blog.hillert.com Slides available at: http://www.slideshare.net/hillert/jrecruiter-the-ajug-job-posting-service 33

Editor's Notes

×