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=99b330e9bbdaf8a8f718c09b30fa13f3a7ec2ae7;hpb=464c86e1706170a0be7be81d239d8c16fad78ec4;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 99b330e..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. * @@ -334,10 +357,10 @@ public abstract class Pazpar2Command implements Serializable { public abstract ServiceProxyCommand getSp(); /** - * Implementing commands publishes whether they only - * apply to the Service Proxy - or can be executed - * against straight Pazpar2 as well. Convenient for a - * UI that switches between service types - whether + * Here implementing commands publish whether they only + * apply to the Service Proxy or can be executed + * against straight Pazpar2 as well. This is convenient for a + * UI that switches between service types either * deployment time or run time. * * @return false if the command applies to straight Pazpar2