From 41f7dd7b424bc4d46a5a0919514f397bbd9799e7 Mon Sep 17 00:00:00 2001 From: hmm Date: Thu, 21 Aug 2014 13:20:21 +0800 Subject: [PATCH] PageModel add id --- .../models/agent/scriptrecord/PageModel.java | 15 ++++++++++++++- .../models/agent/scriptrecord/UsePluginModel.java | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/PageModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/PageModel.java index 2265e27a..13b25d29 100644 --- a/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/PageModel.java +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/PageModel.java @@ -9,6 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "page") public class PageModel { + private String id; private List batches; @XmlElementWrapper(name = "batches") @@ -20,8 +21,20 @@ public class PageModel { public void setBatches(List batches) { this.batches = batches; } + + @XmlElement + public String getId() { + return id; + } - public PageModel() { + public void setId(String id) { + this.id = id; + } + public PageModel(){ + this.setBatches(new ArrayList()); + } + public PageModel(String id) { + this.id = id; this.setBatches(new ArrayList()); } } diff --git a/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/UsePluginModel.java b/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/UsePluginModel.java index 5abc7ec3..30e54511 100644 --- a/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/UsePluginModel.java +++ b/Bench4Q-Share/src/main/java/org/bench4q/share/models/agent/scriptrecord/UsePluginModel.java @@ -56,20 +56,29 @@ public class UsePluginModel { public UsePluginModel() { } - public static UsePluginModel createUsePlugin(String id, String name, + public static UsePluginModel createUsePlugin(String id, String name,String nickName, List initParameters) { UsePluginModel result = new UsePluginModel(); result.setId(id); result.setName(name); - result.setNickName(id); + result.setNickName(nickName); result.setParameters(initParameters); return result; } - public UsePluginModel(String id, String name, List parameters) { this.setId(id); this.setName(name); + this.setNickName(name+"_"+id); + if (parameters == null) { + parameters = new LinkedList(); + } + this.setParameters(parameters); + } + public UsePluginModel(String id, String name,String nickName, + List parameters) { + this.setId(id); + this.setName(name); this.setNickName(id); if (parameters == null) { parameters = new LinkedList();