@Override public void onGET(OgemaHttpRequest req) { if (config.xmpp().exists()) { setText(config.xmpp().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.remoteMessageUser().exists()) { this.setValue(config.remoteMessageUser().getValue(), req); } else { this.setValue("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.sms().exists()) { setText(config.sms().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.remoteMessagePassword().exists()) { this.setValue(config.remoteMessagePassword().getValue(), req); } else { this.setValue("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.email().exists()) { setText(config.email().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.remoteMessageRestUrl().exists()) { setText(config.remoteMessageRestUrl().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.email().exists()) { this.setValue(config.email().getValue(), req); } else { this.setValue("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.sms().exists()) { this.setValue(config.sms().getValue(), req); } else { this.setValue("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.xmpp().exists()) { this.setValue(config.xmpp().getValue(), req); } else { this.setValue("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.remoteMessageUser().exists()) { setText(config.remoteMessageUser().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.xmpp().exists()) { setText(config.remoteMessagePassword().getValue(), req); } else { setText("", req); } }
@Override public void onGET(OgemaHttpRequest req) { if (config.remoteMessageRestUrl().exists()) { this.setValue(config.remoteMessageRestUrl().getValue(), req); } else { this.setValue("", req); } }
public static void addRooms(SimulationProvider<Room> roomSimProvider, ApplicationManager appMan) { List<Room> roomList = appMan.getResourceAccess().getToplevelResources(Room.class); for(Room room: roomList) { if(!room.name().exists()) continue; String name = room.name().getValue().toLowerCase(); if(name.contains("removed")) continue; ResourceList<SimulationConfigurationModel> simConfigGlobal = appMan.getResourceAccess().getResource("OGEMASimulationConfiguration"); //List<Room> existing = roomSimProvider.getSimulatedObjects(); boolean found = false; if(simConfigGlobal != null) for(SimulationConfigurationModel exr: simConfigGlobal.getAllElements()) { if(exr.target().equalsLocation(room)) { found = true; break; } } if(found) continue; roomSimProvider.createSimulatedObject(room.getLocation()); logger.debug("CreateSimulatedObject(Room): "+room.getLocation()); } } /*@SuppressWarnings("unchecked")
final String value = (resource.exists()) ? resource.getValue() : null; final RwPair<String> pair = m_stringMap.get(path); pair.read = value;
@Override public void onPOSTComplete(String data, OgemaHttpRequest req) { StringResource source = getResource(sva, req, StringResource.class); String val = myField.getValue(req); /*String value; try { value = Float.parseFloat(val); } catch (NumberFormatException | NullPointerException e) { if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req); return; } if (value < minimumAllowed) { if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req); return; } if (value > maximumAllowed) { if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req); return; }*/ if(!source.exists()) { source.create(); source.setValue(val); source.activate(true); } else { source.setValue(val); } if(alert != null) alert.showAlert("New value: " + val, true, req); }
final RwPair<String> pair = m_stringMap.get(path); final String value = pair.write; if (!resource.exists()) { pair.read = null; } else if (value == null) {
private String getDeviceLocation(String resLoc) { Resource res = ra.getResource(resLoc); if (res instanceof PhysicalElement) { PhysicalElement device = (PhysicalElement) res; // two possible ways to determine location of a device if (device.location().exists() && device.location().room().exists() && device.location().room().name().exists()) { return device.location().room().name().getValue(); } Resource parent = device.getParent(); if (parent != null && parent.getSubResource("name") != null && (parent.getSubResource("name") instanceof StringResource)) { return ((StringResource) parent.getSubResource("name")).getValue(); } } else if (res instanceof SingleValueResource) { // check whether parent has a location if (!res.isTopLevel()) { return getDeviceLocation(res.getParent().getLocation()); } } return null; // FIXME }