Esempio n. 1
0
 private void makeUpdateTZAction() {
   Action act = new Action(Permission.READ, new UpdateTZHandler());
   if (conn.timezones == null) return;
   Set<String> enums = new HashSet<String>(conn.timezones.values());
   String defaultTz = node.getAttribute("Time zone").getString();
   act.addParameter(new Parameter("Time zone", ValueType.makeEnum(enums), new Value(defaultTz)));
   Node anode = node.getChild("update time zone");
   if (anode == null)
     node.createChild("update time zone").setAction(act).build().setSerializable(false);
   else anode.setAction(act);
 }
Esempio n. 2
0
  void init() {

    loadStations();

    Action act = new Action(Permission.READ, new DeleteHandler());
    node.createChild("delete").setAction(act).build().setSerializable(false);

    makeUpdateTZAction();

    act = new Action(Permission.READ, new CreateStationHandler());
    act.addParameter(new Parameter("Station name", ValueType.STRING));
    node.createChild("create station").setAction(act).build().setSerializable(false);
  }