Moves parameter expression class to commands package
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Sun, 14 Apr 2013 13:11:43 +0000 (09:11 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Sun, 14 Apr 2013 13:11:43 +0000 (09:11 -0400)
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Expression.java [deleted file]
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Bean.java
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2ProxyBean.java
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/commands/CommandParameter.java
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/commands/Expression.java [new file with mode: 0644]
src/main/java/com/indexdata/pz2utils4jsf/pazpar2/commands/SearchCommand.java

diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Expression.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Expression.java
deleted file mode 100644 (file)
index 3b5260a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.indexdata.pz2utils4jsf.pazpar2;\r
-\r
-import com.indexdata.pz2utils4jsf.pazpar2.Expression;\r
-\r
-public class Expression {\r
-  \r
-  String leftEntity;\r
-  String operator;\r
-  String rightEntity;\r
-  public Expression (String leftEntity, String operator, String rightEntity) {\r
-    this.leftEntity = leftEntity;\r
-    this.operator = operator;\r
-    this.rightEntity = rightEntity;    \r
-  }\r
-  \r
-  public Expression copy() {\r
-    return new Expression(leftEntity,operator,rightEntity);\r
-  }\r
-  \r
-  public String toString() {\r
-    return leftEntity + operator + rightEntity;\r
-  }\r
-  \r
-\r
-}\r
index d942a4a..9864e06 100644 (file)
@@ -94,6 +94,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Serializable {
   public void doSearch() { \r
     stateMgr.hasPendingStateChange("search",false);\r
     data.reset();\r
+    // TODO: avoid state proliferation here:\r
     req.getRecord().removeParameters();\r
     req.getShow().setParameter(new CommandParameter("start","=",0));    \r
     logger.debug(Utils.objectId(this) + " is searching using "+req.getCommandReadOnly("search").getUrlEncodedParameterValue("query"));\r
@@ -236,8 +237,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Serializable {
       stateMgr.hasPendingStateChange("record",false);\r
       if (req.getCommandReadOnly("record").hasParameters()) {\r
         update("record");\r
-      } else {\r
-        req.getRecord().removeParameters();  \r
+      } else {         \r
         data.put("record", new RecordResponse());\r
       }\r
     }\r
index 7651860..b585485 100644 (file)
@@ -41,7 +41,7 @@ public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
                             + Utils.objectId(configurator) + "]" );    \r
       configureClient(searchClient,configurator);\r
     } else {\r
-      logger.info("Pz2ProxyBean:postConstruct: searchClient already instantiated " +\r
+      logger.debug("Pz2ProxyBean:postConstruct: searchClient already instantiated " +\r
                        "during construction of parent object Pz2Bean.");\r
     }\r
   }\r
index c899251..c8f2201 100644 (file)
@@ -8,7 +8,6 @@ import java.util.Map;
 \r
 import org.apache.log4j.Logger;\r
 \r
-import com.indexdata.pz2utils4jsf.pazpar2.Expression;\r
 import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandParameter;\r
 \r
 public class CommandParameter implements Serializable {\r
diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/commands/Expression.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/commands/Expression.java
new file mode 100644 (file)
index 0000000..d412ac9
--- /dev/null
@@ -0,0 +1,25 @@
+package com.indexdata.pz2utils4jsf.pazpar2.commands;\r
+\r
+import com.indexdata.pz2utils4jsf.pazpar2.commands.Expression;\r
+\r
+public class Expression {\r
+  \r
+  String leftEntity;\r
+  String operator;\r
+  String rightEntity;\r
+  public Expression (String leftEntity, String operator, String rightEntity) {\r
+    this.leftEntity = leftEntity;\r
+    this.operator = operator;\r
+    this.rightEntity = rightEntity;    \r
+  }\r
+  \r
+  public Expression copy() {\r
+    return new Expression(leftEntity,operator,rightEntity);\r
+  }\r
+  \r
+  public String toString() {\r
+    return leftEntity + operator + rightEntity;\r
+  }\r
+  \r
+\r
+}\r
index 7e0d361..1d2cb2b 100644 (file)
@@ -4,7 +4,6 @@ import javax.enterprise.context.SessionScoped;
 \r
 import org.apache.log4j.Logger;\r
 \r
-import com.indexdata.pz2utils4jsf.pazpar2.Expression;\r
 import com.indexdata.pz2utils4jsf.pazpar2.state.StateManager;\r
 \r
 @SessionScoped\r