Thursday, January 19

Q&A For The Week 15 Jan 2012

Some recent research:

How do I import a script file into a Play Framework application?

Documentation 1.2.4

#{script 'jquery-1.4.2.min.js' /}

What's the best way to sort an internal JPA collection?

Sort them in Java, Comparator

List getRegions(){
  sorted = new List(regions);
  Collections.sort(sorted, new RegionComparator(getUserLanguage()));
  return sorted;
}

How to use Java enums in a Play Framework's YAML datafile?

enum value from yaml fixtures

// try just the enum value
// snake YAML can infer the rest...
category: Third

How do I tie into Play's style and script import system?

morestyles and morescripts

#{set 'moreStyles'}
    #{get 'moreStyles' /}
    #{stylesheet 'main.css' /}
#{/set}