Javadoc
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / commands / Pazpar2Command.java
index 99b330e..82ac066 100644 (file)
@@ -50,7 +50,7 @@ public abstract class Pazpar2Command implements Serializable  {
   }\r
       \r
   /**\r
-   * Commands must implement this method to provide an completely detached, deep clone of \r
+   * Commands must implement this method to provide a completely detached, deep clone of \r
    * themselves.\r
    * \r
    * The clone is needed by the state manager to transfer commands with current setting \r
@@ -80,7 +80,7 @@ public abstract class Pazpar2Command implements Serializable  {
   \r
   /**\r
    * Executes the commands with the currently selected parameters, while adding\r
-   * the parameters provided\r
+   * the parameters provided in the vararg\r
    * @param parameters A list of parameters on the form [key=value]\r
    * \r
    * @return Response data object based on the Pazpar2 service response\r
@@ -95,7 +95,30 @@ public abstract class Pazpar2Command implements Serializable  {
     }\r
     return run();\r
   }\r
-  \r
+\r
+  /**\r
+   * Executes the commands with the currently selected parameters, while adding\r
+   * the parameters provided in the 'delimiter'-separated String.\r
+   * \r
+   * Note: This is for Glassfish/JBoss support. With Tomcat7 the method \r
+   *       runWith(String... parameters) can be used directly from EL \r
+   *       with a vararg \r
+   *  \r
+   * @param parameters A list of parameters separated by 'delimiter'\r
+   * @param delimiter The separator character of the String 'parameters' \r
+   * \r
+   * @return Response data object based on the Pazpar2 service response\r
+   */\r
+  public ResponseDataObject runWith2(String parameters, String delimiter) {    \r
+    StringTokenizer params = new StringTokenizer(parameters,delimiter);\r
+    String[] vararg = new String[params.countTokens()];\r
+    int i=0;\r
+    while (params.hasMoreTokens()) {\r
+      vararg[i++] = params.nextToken();\r
+    }\r
+    return runWith(vararg);\r
+  }\r
+    \r
   /**\r
    * Executes the command in a thread.  \r
    * \r
@@ -334,10 +357,10 @@ public abstract class Pazpar2Command implements Serializable  {
   public abstract ServiceProxyCommand getSp();\r
      \r
   /**\r
-   * Implementing commands publishes whether they only \r
-   * apply to the Service Proxy - or can be executed \r
-   * against straight Pazpar2 as well. Convenient for a \r
-   * UI that switches between service types - whether \r
+   * Here implementing commands publish whether they only \r
+   * apply to the Service Proxy or can be executed \r
+   * against straight Pazpar2 as well. This is convenient for a \r
+   * UI that switches between service types either \r
    * deployment time or run time.\r
    *   \r
    * @return false if the command applies to straight Pazpar2\r