diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScript.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScript.java new file mode 100644 index 0000000000000000000000000000000000000000..2e95bd171240f49bdd8f5d0cce5cc86742b12382 --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScript.java @@ -0,0 +1,40 @@ +/* + * Copyright 2012 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.server.jython.api.v1; + +/** + * @author Manuel Kohler + */ +public interface IScript extends IScriptImmutable +{ + + /** + * Set the description of the script + */ + void setDescription(String description); + + /** + * Set the name of the script + */ + void setName(String name); + + /** + * Set the script content + */ + void setScript(String script); + +} \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScriptImmutable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScriptImmutable.java index 3ba01bc382f1925834c558118c5c58ebb1169e91..428dc8fe9bf4887e0662d4fd910f95f957b72007 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScriptImmutable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/IScriptImmutable.java @@ -17,7 +17,9 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1; /** - * @author kohleman + * Read-only interface to an existing Script. + * + * @author Manuel Kohler */ public interface IScriptImmutable extends IEntityType { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java index ac0c9227ecba9ae8efdcd12951f31091abbca587..93fb9568961a3dc28ec00af69fbb57eb48ea415c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/Script.java @@ -16,13 +16,33 @@ package ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl; +import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IScript; + /** * @author kohleman */ -public class Script extends ScriptImmutable +public class Script extends ScriptImmutable implements IScript { public Script(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Script script) { super(script); } + + @Override + public void setDescription(String description) + { + script.setDescription(description); + } + + @Override + public void setName(String name) + { + script.setName(name); + } + + @Override + public void setScript(String script) + { + this.script.setScript(script); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptImmutable.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptImmutable.java index 205db988eb767e2e894b38b4638ec1597cd60fa3..7eb9da84becd1c2300ae7801ff5d1e12190ee4f8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptImmutable.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptImmutable.java @@ -27,9 +27,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ScriptType; */ public class ScriptImmutable implements IScriptImmutable { - private Script script; + protected Script script; - public ScriptImmutable(Script script) + ScriptImmutable(ch.systemsx.cisd.openbis.generic.shared.basic.dto.Script script) { this.script = script; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptWrapper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptWrapper.java new file mode 100644 index 0000000000000000000000000000000000000000..fbb6eec9eb4b3fa375b2885883f7cb40ad8e091d --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/jython/api/v1/impl/ScriptWrapper.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl; + +import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.IScript; + +/** + * Adapter adapting {@link ScriptImmutable} to {@link IScript}. Setter methods do nothing. + * + * @author kohleman + */ +class ScriptWrapper extends ScriptImmutable implements IScript +{ + ScriptWrapper(ScriptImmutable script) + { + super(script.script); + } + + @Override + public void setDescription(String description) + { + } + + @Override + public void setName(String name) + { + } + + @Override + public void setScript(String script) + { + } +} \ No newline at end of file