3 | 3 | 1. Alarm numbering. Currently, when numbering of alarms have been needed, the numbers have been generated locally from an alarm list. It might be advantageous to have a unique number associated with each alarm, so data access object class/file `LabSensorAlarmConfig.java` in `src/net/sf/basedb/labenv/dao/` should be updated with a private instance variable `int no` with public accessor methods. To ensure that the numbers are unique and consecutive, they will not be set in the configuration file, but be assigned by class/file `LabEnvironmentConfiguraton.java` in `src/net/sf/basedb/labenv/` when parsing alarm entries in the configuration file in private method `List<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)`. Only an alarm entry with some non-null value will result in an alarm item, and get a number. Java servlet `LabEnvironmentServlet.java` in `src/net/sf/basedb/labenv/servlet/` will be updated in private method `JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc)` to include the number in the JSON object for the alarm in the JSON array. JSP file `labenvironmentalarms.jsp` in `resources/reports/` will be updated to use the intrinsic alarm numbers instead of locally generated ones. |
4 | 4 | 2. User entry for an alarm. Currently, it only consists of a user log-in id string. It should be updated to allow more attributes, starting with an email address string. The `labenv-config.xml` configuration file will be updated by making the "user" tag a block, that can contain other tags, starting with an "id" tag (the former contents of the "user" tag) and an "emailaddress" tag. A new data access object class/file `LabSensorAlarmUserConfig.java` in `src/net/sf/basedb/labenv/dao/` will be added to store the user entries for an alarm. Class/file `LabEnvironmentConfiguraton.java` in `src/net/sf/basedb/labenv/` will be updated when parsing alarm entries in the configuration file in private method `List<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)` to call new private method `List<LabSensorAlarmUserConfig> fetchLabSensorAlarmUserList(Element alarmTag, Namespace ns)` to obtain the user list. |