projects
/
mkjsf-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds windowid parameter to applicable commands
[mkjsf-moved-to-github.git]
/
src
/
main
/
java
/
com
/
indexdata
/
mkjsf
/
pazpar2
/
commands
/
InitCommand.java
diff --git
a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
index
144a1a7
..
890e4ab
100644
(file)
--- a/
src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
+++ b/
src/main/java/com/indexdata/mkjsf/pazpar2/commands/InitCommand.java
@@
-1,44
+1,96
@@
package com.indexdata.mkjsf.pazpar2.commands;
\r
\r
package com.indexdata.mkjsf.pazpar2.commands;
\r
\r
+import org.apache.log4j.Logger;
\r
+
\r
+import com.indexdata.mkjsf.pazpar2.commands.sp.InitCommandSp;
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
\r
import com.indexdata.mkjsf.pazpar2.commands.sp.ServiceProxyCommand;
\r
-import com.indexdata.mkjsf.pazpar2.state.StateManager;
\r
\r
\r
+/**
\r
+ * Represents a Pazpar2 <code>init</code> command, can be accessed by <code>pzreq.init</code>
\r
+ *
\r
+ * @author Niels Erik
\r
+ *
\r
+ */
\r
public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
\r
\r
private static final long serialVersionUID = -4915976465898889987L;
\r
public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
\r
\r
private static final long serialVersionUID = -4915976465898889987L;
\r
-
\r
- public InitCommand(StateManager stateMgr) {
\r
- super("init",stateMgr);
\r
+ private static Logger logger = Logger.getLogger(InitCommand.class);
\r
+ private InitCommandSp spCommand = null;
\r
+
\r
+ public InitCommand() {
\r
+ super("init");
\r
}
\r
\r
}
\r
\r
+ /**
\r
+ * Sets the <code>clear</code> parameter. See Pazpar2 documentation for details.
\r
+ *
\r
+ * @param clear
\r
+ */
\r
public void setClear(String clear) {
\r
setParameterInState(new CommandParameter("clear","=",clear));
\r
}
\r
public void setClear(String clear) {
\r
setParameterInState(new CommandParameter("clear","=",clear));
\r
}
\r
+
\r
+ /**
\r
+ * Returns the <code>clear</code> parameter value.
\r
+ */
\r
+ public String getClear() {
\r
+ return getParameterValue("clear");
\r
+ }
\r
\r
\r
+ /**
\r
+ * Sets the <code>service</code> parameter. See Pazpar2 documentation for details.
\r
+ * @param serviceId
\r
+ */
\r
public void setService(String serviceId) {
\r
setParameterInState(new CommandParameter("service","=",serviceId));
\r
}
\r
\r
public void setService(String serviceId) {
\r
setParameterInState(new CommandParameter("service","=",serviceId));
\r
}
\r
\r
+ /**
\r
+ * Returns the <code>service</code> parameter value.
\r
+ */
\r
+ public String getService() {
\r
+ return getParameterValue("service");
\r
+ }
\r
+
\r
+ /**
\r
+ * Disabled, not supported for <code>init</code>
\r
+ */
\r
@Override
\r
public void setSession (String sessionId) {
\r
throw new UnsupportedOperationException("Cannot set session id on init command");
\r
}
\r
@Override
\r
public void setSession (String sessionId) {
\r
throw new UnsupportedOperationException("Cannot set session id on init command");
\r
}
\r
-
\r
+
\r
+ /**
\r
+ * Disabled, not supported for <code>init</code>
\r
+ */
\r
@Override
\r
public String getSession () {
\r
throw new UnsupportedOperationException("Cannot set or get session id on init command");
\r
@Override
\r
public String getSession () {
\r
throw new UnsupportedOperationException("Cannot set or get session id on init command");
\r
- }
\r
+ }
\r
\r
public InitCommand copy () {
\r
\r
public InitCommand copy () {
\r
- InitCommand newCommand = new InitCommand(stateMgr);
\r
+ logger.info("Copying init command");
\r
+ InitCommand newCommand = new InitCommand();
\r
for (String parameterName : parameters.keySet()) {
\r
newCommand.setParameterInState(parameters.get(parameterName).copy());
\r
for (String parameterName : parameters.keySet()) {
\r
newCommand.setParameterInState(parameters.get(parameterName).copy());
\r
- }
\r
+ }
\r
+ newCommand.spCommand = new InitCommandSp(this);
\r
+ if (spCommand.getUploadedInitDoc()!=null) {
\r
+ newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc());
\r
+ }
\r
return newCommand;
\r
}
\r
\r
public ServiceProxyCommand getSp() {
\r
return newCommand;
\r
}
\r
\r
public ServiceProxyCommand getSp() {
\r
- return this;
\r
+ if (spCommand==null) {
\r
+ spCommand = new InitCommandSp(this);
\r
+ }
\r
+ return spCommand;
\r
+ }
\r
+
\r
+ @Override
\r
+ public boolean spOnly() {
\r
+ return false;
\r
}
\r
\r
\r
}
\r
\r
\r