Skip to content

Commit

Permalink
small tweaks to view rendering of search results
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Dec 8, 2010
1 parent 15a3348 commit 86f1ba3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/main/java/gov/nysenate/openleg/APIServlet.java
Expand Up @@ -17,6 +17,7 @@

import java.io.IOException;
import java.net.URLDecoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -55,6 +56,8 @@ public class APIServlet extends HttpServlet implements OpenLegConstants {
private final static String DEFAULT_SEARCH_FORMAT = "json";
private final static String DEFAULT_SESSION_YEAR = "2009";

private final static DateFormat DATE_FORMAT_MED = SimpleDateFormat.getDateInstance(SimpleDateFormat.MEDIUM);

//Jackson JSON parser
private static ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally

Expand Down Expand Up @@ -792,9 +795,10 @@ else if (type.equals("action"))

title = billEvent.getEventText();

fields.put("date", billEvent.getEventDate().toLocaleString());
fields.put("date", DATE_FORMAT_MED.format(billEvent.getEventDate()));

fields.put("billno", billId);


}
else if (type.equals("vote"))
Expand All @@ -811,7 +815,7 @@ else if (vote.getVoteType() == Vote.VOTE_TYPE_FLOOR)

Bill bill = vote.getBill();

title += bill.getSenateBillNo()+'-'+bill.getYear();
//title += bill.getSenateBillNo()+'-'+bill.getYear();

if (bill.getSponsor()!=null)
fields.put("sponsor",bill.getSponsor().getFullname());
Expand All @@ -820,10 +824,12 @@ else if (vote.getVoteType() == Vote.VOTE_TYPE_FLOOR)
fields.put("committee", bill.getCurrentCommittee());

fields.put("billno", bill.getSenateBillNo());
fields.put("year", bill.getYear()+"");

}

//fields.put("date",vote.getVoteDate().toLocaleString());
title += " (" + vote.getVoteDate().toLocaleString() + ")";
title += vote.getVoteDate().toLocaleString();

summary = vote.getDescription();

Expand Down
6 changes: 4 additions & 2 deletions src/main/webapp/views/search-html.jsp
Expand Up @@ -182,8 +182,10 @@ String resultTitle = null;
resultTitle = "(no title)";
else {
if(contentType.equals("bill")) {
resultTitle = sresult.getFields().get("billno")
+ "-" + sresult.getFields().get("year") + resultTitle;
senateType += " " + sresult.getFields().get("billno");
if (sresult.getFields().get("year") != null)
senateType += "-" + sresult.getFields().get("year");
}
}
Expand Down

0 comments on commit 86f1ba3

Please sign in to comment.