Beispiel #1
0
  private JSONObject setSessionFromJSON() throws Exception {

    @SuppressWarnings("unchecked")
    Vector<String> destVec = (Vector<String>) session.getAttribute("destVec");
    if (destVec == null) {
      destVec = new Vector<String>();
      session.setAttribute("destVec", destVec);
    }

    String zingFolder = objIn.optString("zingFolder");
    if (zingFolder != null) {
      System.out.println("Got a zingFolder value: " + zingFolder);
      // first remove the folder if it exists later in the vector
      for (int i = 0; i < destVec.size(); i++) {
        if (destVec.elementAt(i).equals(zingFolder)) {
          destVec.remove(i);
          break;
        }
      }
      destVec.add(0, zingFolder);
    }

    String zingPat = objIn.optString("zingPat");
    if (zingPat != null) {
      System.out.println("Got a zingPat value: " + zingPat);
      session.setAttribute("zingpat", zingPat);
    }

    String filter = objIn.optString("filter");
    if (filter != null) {
      session.setAttribute("filter", filter);
    }

    String oldFilter = objIn.optString("oldFilter");
    if (oldFilter != null) {
      session.setAttribute("oldFilter", oldFilter);
    }

    if (objIn.has("maxFlag")) {
      // ask for the boolean only when something exists to check
      if (objIn.getBoolean("maxFlag")) {
        session.setAttribute("maxFlag", "yes");
      } else {
        session.setAttribute("maxFlag", "no");
      }
    }

    return getSessionJSON(req);
  }
 public String getRole() throws Exception {
   return root.optString("role");
 }
 public String getCreator() throws Exception {
   return root.optString("creator");
 }
 public String getNotes() throws Exception {
   return root.optString("notes");
 }