示例#1
0
  @Override
  public void doPost(
      HttpServletRequest request, HttpServletResponse response, Identity subject, Identity object)
      throws Exception {
    String languageCode = request.getParameter("languagecode");
    String contrycode = request.getParameter("countrycode");

    if (languageCode != null) {
      User user = new User(subject);
      user.setLanguage(languageCode, contrycode, request, response);
      response.setStatus(200);
    }
  }
示例#2
0
  @Override
  public void doGet(
      HttpServletRequest request, HttpServletResponse response, Identity subject, Identity object)
      throws Exception {

    User user = new User(subject);

    JSONObject userObject = new JSONObject();
    JSONObject currentLanguage = new JSONObject();
    currentLanguage.put("languagecode", user.getLanguageCode(request));
    currentLanguage.put("countrycode", user.getCountryCode(request));

    userObject.put("currentLanguage", currentLanguage);
    userObject.put("userTags", new JSONArray(user.getTags()));
    userObject.put("friends", new JSONObject(user.getFriendOpenIds()));

    response.getWriter().print(userObject.toString());
    response.setStatus(200);
  }
 /** Test method for {@link org.b3mn.poem.util.HandlerInfo#getExportInfo()}. */
 @Test
 public final void testSaveNewModel() {
   newModelIdentity = Identity.newModel(user.getIdentity(), title, type, summary, svg, data);
   assertNotNull(newModelIdentity);
 }