X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2Fcommands%2FPazpar2Command.java;h=82ac06640a8d9478deef5ed6e0b6fcbc4f95c720;hb=0c500bea459cf05157e0f753755466ce1b46604c;hp=a4fa51f11f2168c0575affd6a295cb9ae9e79ae3;hpb=8f451e761c251dcb4b01a2a11ee759e2ec3c1105;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/Pazpar2Command.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/Pazpar2Command.java index a4fa51f..82ac066 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/Pazpar2Command.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/Pazpar2Command.java @@ -50,7 +50,7 @@ public abstract class Pazpar2Command implements Serializable { } /** - * Commands must implement this method to provide an completely detached, deep clone of + * Commands must implement this method to provide a completely detached, deep clone of * themselves. * * The clone is needed by the state manager to transfer commands with current setting @@ -80,7 +80,7 @@ public abstract class Pazpar2Command implements Serializable { /** * Executes the commands with the currently selected parameters, while adding - * the parameters provided + * the parameters provided in the vararg * @param parameters A list of parameters on the form [key=value] * * @return Response data object based on the Pazpar2 service response @@ -95,7 +95,30 @@ public abstract class Pazpar2Command implements Serializable { } return run(); } - + + /** + * Executes the commands with the currently selected parameters, while adding + * the parameters provided in the 'delimiter'-separated String. + * + * Note: This is for Glassfish/JBoss support. With Tomcat7 the method + * runWith(String... parameters) can be used directly from EL + * with a vararg + * + * @param parameters A list of parameters separated by 'delimiter' + * @param delimiter The separator character of the String 'parameters' + * + * @return Response data object based on the Pazpar2 service response + */ + public ResponseDataObject runWith2(String parameters, String delimiter) { + StringTokenizer params = new StringTokenizer(parameters,delimiter); + String[] vararg = new String[params.countTokens()]; + int i=0; + while (params.hasMoreTokens()) { + vararg[i++] = params.nextToken(); + } + return runWith(vararg); + } + /** * Executes the command in a thread. *