From 754d902e7281b5ab6343e28add38b49302ed918d Mon Sep 17 00:00:00 2001 From: Shamalka Navod Date: Wed, 27 May 2020 05:21:58 +0000 Subject: [PATCH] Add bean classes for API Table in policy UI --- .../mgt/common/policy/mgt/ui/APITable.java | 97 +++++++++++++++++++ .../mgt/common/policy/mgt/ui/Attribute.java | 76 +++++++++++++++ .../device/mgt/common/policy/mgt/ui/Item.java | 20 ++++ .../mgt/common/policy/mgt/ui/Modal.java | 51 ++++++++++ .../device/mgt/common/policy/mgt/ui/Text.java | 24 +++++ 5 files changed, 268 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/APITable.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/Attribute.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/Modal.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/Text.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/APITable.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/APITable.java new file mode 100644 index 0000000000..3a808f60c2 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/APITable.java @@ -0,0 +1,97 @@ +/* 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.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; + +@XmlRootElement(name = "APITable") +public class APITable { + private String requestMethod; + private String url; + private String payload; + private String mainAttribute; + private String cardTitle; + private String cardKey; + private Modal modal; + + @XmlElement(name = "RequestMethod") + public String getRequestMethod() { + return requestMethod; + } + + public void setRequestMethod(String requestMethod) { + this.requestMethod = requestMethod; + } + + @XmlElement(name = "Url") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @XmlElement(name = "Payload") + public String getPayload() { + return payload; + } + + public void setPayload(String payload) { + this.payload = payload; + } + + @XmlElement(name = "Modal") + public Modal getModal() { + return modal; + } + + public void setModal(Modal modal) { + this.modal = modal; + } + + @XmlElement(name = "MainAttribute") + public String getMainAttribute() { + return mainAttribute; + } + + public void setMainAttribute(String mainAttribute) { + this.mainAttribute = mainAttribute; + } + + @XmlElement(name = "CardTitle") + public String getCardTitle() { + return cardTitle; + } + + public void setCardTitle(String cardTitle) { + this.cardTitle = cardTitle; + } + + @XmlElement(name = "CardKey") + public String getCardKey() { + return cardKey; + } + + public void setCardKey(String cardKey) { + this.cardKey = cardKey; + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Attribute.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Attribute.java new file mode 100644 index 0000000000..e916490e3e --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Attribute.java @@ -0,0 +1,76 @@ +/* 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.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "Attribute") +public class Attribute { + + private String key; + private String subAttribute; + private String arrayName; + private int arrayIndex; + private Item item; + + @XmlElement(name = "Key") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @XmlElement(name = "SubAttribute") + public String getSubAttribute() { + return subAttribute; + } + + public void setSubAttribute(String subAttribute) { + this.subAttribute = subAttribute; + } + + @XmlElement(name = "ArrayName") + public String getArrayName() { + return arrayName; + } + + public void setArrayName(String arrayName) { + this.arrayName = arrayName; + } + + @XmlElement(name = "ArrayIndex") + public int getArrayIndex() { + return arrayIndex; + } + + public void setArrayIndex(int arrayIndex) { + this.arrayIndex = arrayIndex; + } + + @XmlElement(name = "Item") + public Item getItem() { + return item; + } + + public void setItem(Item item) { + this.item = item; + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Item.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Item.java index 3efb62f8e9..df9d48c562 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Item.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Item.java @@ -40,6 +40,8 @@ public class Item { private RadioGroup radioGroup; private List notifications; private Upload upload; + private APITable apiTable; + private Text text; @XmlElement(name = "Label") public String getLabel() { @@ -157,4 +159,22 @@ public class Item { public void setUpload(Upload upload) { this.upload = upload; } + + @XmlElement(name = "APITable") + public APITable getApiTable() { + return apiTable; + } + + public void setApiTable(APITable apiTable) { + this.apiTable = apiTable; + } + + @XmlElement(name = "Text") + public Text getText() { + return text; + } + + public void setText(Text text) { + this.text = text; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Modal.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Modal.java new file mode 100644 index 0000000000..10bb654bbf --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Modal.java @@ -0,0 +1,51 @@ +/* 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.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; + +@XmlRootElement(name = "Modal") +public class Modal { + + private List attributes; + private List subContents; + + @XmlElementWrapper(name = "Attributes") + @XmlElement(name = "Attribute") + public List getAttributes() { + return attributes; + } + + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + @XmlElementWrapper(name = "SubContents") + @XmlElement(name = "SubContent") + public List getSubContents() { + return subContents; + } + + public void setSubContents(List subContents) { + this.subContents = subContents; + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Text.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Text.java new file mode 100644 index 0000000000..f605ceea25 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/ui/Text.java @@ -0,0 +1,24 @@ +/* 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.XmlRootElement; + +@XmlRootElement(name = "Text") +public class Text { +}