From c836083bf6faf56b558b7f5d821f5305ba78c5c4 Mon Sep 17 00:00:00 2001 From: Kaveesha Mihirangi Date: Wed, 29 Apr 2020 04:20:30 +0000 Subject: [PATCH] Update policy UI bean classes to get table element in policy-UI --- .../mgt/common/policy/mgt/ui/Column.java | 41 +++++++++++++++++++ .../common/policy/mgt/ui/RowValidation.java | 31 ++++++++++++++ .../mgt/common/policy/mgt/ui/Table.java | 14 +++++++ .../common/policy/mgt/ui/TableValidation.java | 31 ++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/RowValidation.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/TableValidation.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Column.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Column.java index 9c81780e6c9..6015d660445 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Column.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Column.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.common.policy.mgt.ui; import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "Column") @@ -25,6 +26,10 @@ public class Column { private String name; private String valueType; + private String key; + private String value; + private Select select; + private Input input; @XmlAttribute(name = "name", required = true) public String getName() { return name; } @@ -35,4 +40,40 @@ public class Column { public String getValueType() { return valueType; } public void setValueType(String valueType) { this.valueType = valueType; } + + @XmlElement(name = "Key") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @XmlElement(name = "Value") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @XmlElement(name = "Select") + public Select getSelect() { + return select; + } + + public void setSelect(Select select) { + this.select = select; + } + + @XmlElement(name = "Input") + public Input getInput() { + return input; + } + + public void setInput(Input input) { + this.input = input; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/RowValidation.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/RowValidation.java new file mode 100644 index 00000000000..f0d465bb8ec --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/RowValidation.java @@ -0,0 +1,31 @@ +/* Copyright (c) 2020, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you 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 org.wso2.carbon.device.mgt.common.policy.mgt.ui; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "RowValidation") +public class RowValidation { + private String functionName; + + @XmlAttribute(name = "functionName", required = true) + public String getName() { return functionName; } + + public void setName(String functionName) { this.functionName = functionName; } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Table.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Table.java index 4083b845a26..9da05eb3449 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Table.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Table.java @@ -26,10 +26,24 @@ import java.util.List; public class Table { List columns; + TableValidation tableValidation; + RowValidation rowValidation; @XmlElementWrapper(name = "Columns") @XmlElement(name = "Column") public List getColumns() { return columns; } public void setColumns(List columns) { this.columns = columns; } + + @XmlElement(name = "TableValidation") + public TableValidation getTableValidation() { return tableValidation; } + + public void setTableValidation(TableValidation tableValidation) { this.tableValidation = tableValidation; } + + @XmlElement(name = "RowValidation") + public RowValidation getRowValidation() { return rowValidation; } + + public void setRowValidation(RowValidation rowValidation) { this.rowValidation = rowValidation; } + + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/TableValidation.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/TableValidation.java new file mode 100644 index 00000000000..89677d5c217 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/TableValidation.java @@ -0,0 +1,31 @@ +/* Copyright (c) 2020, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you 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 org.wso2.carbon.device.mgt.common.policy.mgt.ui; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "TableValidation") +public class TableValidation { + private String functionName; + + @XmlAttribute(name = "functionName", required = true) + public String getFunctionName() { return functionName; } + + public void setFunctionName(String functionName) { this.functionName = functionName; } +}