]> WPIA git - gigi.git/blob - src/org/cacert/gigi/pages/wot/MyPoints.java
Move the "dbObject"s to their own package.
[gigi.git] / src / org / cacert / gigi / pages / wot / MyPoints.java
1 package org.cacert.gigi.pages.wot;
2
3 import java.io.IOException;
4 import java.sql.SQLException;
5 import java.util.HashMap;
6
7 import javax.servlet.http.HttpServletRequest;
8 import javax.servlet.http.HttpServletResponse;
9
10 import org.cacert.gigi.GigiApiException;
11 import org.cacert.gigi.dbObjects.User;
12 import org.cacert.gigi.output.AssurancesDisplay;
13 import org.cacert.gigi.pages.Page;
14
15 public class MyPoints extends Page {
16
17     public static final String PATH = "/wot/mypoints";
18
19     private AssurancesDisplay myDisplay = new AssurancesDisplay("asArr", false);
20
21     private AssurancesDisplay toOtherDisplay = new AssurancesDisplay("otherAsArr", true);
22
23     public MyPoints(String title) {
24         super(title);
25     }
26
27     @Override
28     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
29         HashMap<String, Object> vars = new HashMap<String, Object>();
30         vars.put("pointlist", myDisplay);
31         vars.put("madelist", toOtherDisplay);
32         try {
33             User user = getUser(req);
34             vars.put("asArr", user.getReceivedAssurances());
35             vars.put("otherAsArr", user.getMadeAssurances());
36         } catch (SQLException e) {
37             new GigiApiException(e).format(resp.getWriter(), getLanguage(req));
38             return;
39         }
40         getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
41     }
42
43 }