Merged branch develop at revision 037118a04d73 into stable

Changesets merged:

  Branch f/201712-module-recordings-freqtype
  * 6157f1f84165: Allow freqType parameter in order to facility to new
    web form [DRP]
  * f0f6e4d62e19: Implement experimental hzFreq feature [DRP]
  * e512ba149be7: Missing breaks [DRP]
  * d0586dabba7a: Close branch f/201712-module-recordings-freqtype
    [DP]

  Branch develop
  * c1bf653d3308: Typo (in comment only): NO_SUCH_COMMANND ->
    NO_SUCH_COMMAND No need for review; simple [DRP]
M src/org/overchat/overham/module/ExitCodes.java +1 -1
@@ 108,7 108,7 @@ public enum ExitCodes {
 	},
 
 	/**
-	 * NO_SUCH_COMMANND
+	 * NO_SUCH_COMMAND
 	 * The module does not support this command.  This is different from
 	 * $UNIMPLEMENTED, which means the command is recognized but not
 	 * supported.  This is most likey a user-error.

          
M src/org/overchat/overham/modules/Recordings.java +34 -0
@@ 214,17 214,22 @@ public class Recordings extends Base imp
 	public ReturnData userSearch(JSONObject output, Map<String, String> methodParams) {
 		List<String> implemented = new ArrayList<String>(2);
 		List<Object> boundParams = new ArrayList<Object>();
+
 		String hzFreq = methodParams.get("hzFreq"); // A string in the form "lowest-highest"
 		String when = methodParams.get("when"); // A string in the form "earliest-latest"
+		String freqType = methodParams.get("freqType"); // A string which is an optional multiplier (ie. MHz)
+
 		Map<String, Object> data = new HashMap<String, Object>();
 		List<Object> resultList = new ArrayList<Object>(); // Size depends on result list size
 		ExitCodes exitCode = ExitCodes.FAILURE;
+
 		final String baseQ = "SELECT id, whenStart, msLength, hzFreq FROM ic7100voiceExtra WHERE ";
 		StringBuilder q = new StringBuilder();
 		Response implementedResponse;
 
 		implemented.add("hzFreq");
 		implemented.add("when");
+		implemented.add("freqType");
 		implementedResponse = this.checkUnimplemented(methodParams, implemented);
 		if (!implementedResponse.success) {
 			java.lang.System.out.println(String.format("'%s' is not implemented", implementedResponse.what));

          
@@ 259,10 264,39 @@ public class Recordings extends Base imp
 					);
 				}
 
+				if (freqType != null) { // Implement freqType (optional, default Hz)
+					switch(freqType) {
+						case "MHz" : {
+							lowest *= 1000000;
+							highest *= 1000000;
+							break;
+						}
+						case "kHz" : {
+							lowest *= 1000;
+							highest *= 1000;
+							break;
+						}
+						case "Hz" : {
+							break; // No action but totally legal
+						}
+						default : {
+							return new ReturnData(
+								this.buildErrorForUser(output, ExitCodes.UNIMPLEMENTED),
+								new HTTPStatus(400, ExitCodes.UNIMPLEMENTED)
+							);
+						}
+					}
+				}
+
 				q.append("hzFreq BETWEEN ? AND ? ");
 				boundParams.add(lowest);
 				boundParams.add(highest);
 			}
+		} else if (freqType != null) { // You can't specify freqType without hzFreq
+			return new ReturnData(
+				this.buildErrorForUser(output, ExitCodes.UNIMPLEMENTED),
+				new HTTPStatus(400, ExitCodes.UNIMPLEMENTED)
+			);
 		}
 
 		if (boundParams.size() > 0) {