Merge branch 'master' into 'master'

Add new classes to get rules in UI params

See merge request entgra/carbon-device-mgt!568
revert-70ac1926
Dharmakeerthi Lasantha 4 years ago
commit b021509e94

@ -26,8 +26,8 @@ import java.util.List;
@XmlRootElement(name = "Condition") @XmlRootElement(name = "Condition")
public class Condition { public class Condition {
String id; private String id;
List<String> values; private List<String> values;
@XmlElement(name = "Id") @XmlElement(name = "Id")
public String getId() { public String getId() {

@ -0,0 +1,58 @@
/*
* Copyright (c) 2019, 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.extensions.device.type.template.config;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "conditionLabel")
public class ConditionLabel {
@XmlAttribute(name = "id")
private String conditionID;
@XmlAttribute(name = "value")
private String conditionValue;
@XmlAttribute(name = "label")
private String conditionLabel;
public String getId() {
return conditionID;
}
public void setId(String conditionID) {
this.conditionID = conditionID;
}
public String getValue() {
return conditionValue;
}
public void setValue(String conditionValue) {
this.conditionValue = conditionValue;
}
public String getLabel() {
return conditionLabel;
}
public void setLabel(String conditionLabel) {
this.conditionLabel = conditionLabel;
}
}

@ -0,0 +1,69 @@
/*
* Copyright (c) 2019, 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.extensions.device.type.template.config;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "Rule")
public class Rule {
@XmlElement(name = "required")
private boolean isRequired;
@XmlElement(name = "regex")
private String regexPattern;
@XmlElement(name = "validationMessage")
private String errorMessage;
@XmlElement(name = "customFunction")
private String customValidation;
public boolean isRequired() {
return isRequired;
}
public void setRequired(boolean isRequired) {
this.isRequired = isRequired;
}
public String getRegex() {
return regexPattern;
}
public void setRegex(String regexPattern) {
this.regexPattern = regexPattern;
}
public String getValidationMessage() {
return errorMessage;
}
public void setValidationMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getCustomFunction() {
return customValidation;
}
public void setCustomFunction(String customValidation) {
this.customValidation = customValidation;
}
}

@ -1,158 +1,228 @@
/* /*
* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
* *
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License, * Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. * in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.wso2.carbon.device.mgt.extensions.device.type.template.config; package org.wso2.carbon.device.mgt.extensions.device.type.template.config;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
/** /**
* Java class for uiParams complex type. * Java class for uiParams complex type.
* *
* The following schema fragment specifies the expected content contained within this class. * The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* <xs:element name="uiParam" maxOccurs="unbounded"> * <xs:element name="uiParam" maxOccurs="unbounded">
* <xs:complexType> * <xs:complexType>
* <xs:sequence> * <xs:sequence>
* <xs:element name="type" type="xs:string" /> * <xs:element name="type" type="xs:string" />
* <xs:element name="name" type="xs:string" /> * <xs:element name="name" type="xs:string" />
* <xs:element name="id" type="xs:string" /> * <xs:element name="id" type="xs:string" />
* <xs:element name="values"> * <xs:element name="values">
* <xs:complexType> * <xs:complexType>
* <xs:sequence> * <xs:sequence>
* <xs:element name="value" type="xs:string" /> * <xs:element name="value" type="xs:string" />
* </xs:sequence> * </xs:sequence>
* </xs:complexType> * </xs:complexType>
* </xs:element> * </xs:element>
* </xs:sequence> * </xs:sequence>
* <xs:attribute name="optional" type="xs:string" /> * <xs:attribute name="optional" type="xs:string" />
* </xs:complexType> * </xs:complexType>
* </xs:element> * </xs:element>
* </pre> * </pre>
* *
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class UIParameter { public class UIParameter {
@XmlElement(name = "id", required = true) @XmlElement(name = "id", required = true)
protected String id; protected String id;
@XmlAttribute(name = "optional", required = true) @XmlAttribute(name = "optional", required = true)
private boolean optional; private boolean optional;
@XmlElement(name = "type", required = true) @XmlElement(name = "type", required = true)
protected String type; protected String type;
@XmlElement(name = "name") @XmlElement(name = "name")
protected String name; protected String name;
@XmlElement(name = "label") @XmlElement(name = "label")
private String label; private String label;
@XmlElement(name = "helper") @XmlElement(name = "helper")
private String helper; private String helper;
@XmlElementWrapper(name = "values") @XmlElementWrapper(name = "values")
@XmlElement(name = "value") @XmlElement(name = "value")
protected List<String> value; protected List<String> value;
@XmlElement(name = "key") @XmlElementWrapper(name = "payloadValues")
protected String key; @XmlElement(name = "value")
protected List<String> payloadValue;
@XmlElementWrapper(name = "Conditions")
@XmlElement(name = "Condition") @XmlElement(name = "key")
private List<Condition> conditions; protected String key;
public String getId() { @XmlElementWrapper(name = "Conditions")
return id; @XmlElement(name = "Condition")
} private List<Condition> conditions;
public void setId(String id) { @XmlElement(name = "defaultValue")
this.id = id; private String defaultValue;
}
@XmlElementWrapper(name = "conditionLabels")
public String getType() { @XmlElement(name = "conditionLabel")
return type; private List<ConditionLabel> conditionLabels;
}
@XmlElementWrapper(name = "rules")
public void setType(String type) { @XmlElement(name = "rule")
this.type = type; private List<Rule> rules;
}
@XmlElement(name = "isDisplay")
public String getName() { private boolean display;
return name;
} @XmlElement(name = "payloadKey")
private String payloadKey;
public void setName(String name) {
this.name = name; public String getId() {
} return id;
}
public String getLabel() {
return label; public void setId(String id) {
} this.id = id;
}
public void setLabel(String label) {
this.label = label; public String getType() {
} return type;
}
public String getHelper() {
return helper; public void setType(String type) {
} this.type = type;
}
public void setHelper(String helper) {
this.helper = helper; public String getName() {
} return name;
}
public List<String> getValue() {
return value; public void setName(String name) {
} this.name = name;
}
public void setValue(List<String> value) {
this.value = value; public String getLabel() {
} return label;
}
public boolean isOptional() {
return optional; public void setLabel(String label) {
} this.label = label;
}
public void setOptional(boolean optional) {
this.optional = optional; public String getHelper() {
} return helper;
}
public String getKey() {
return key; public void setHelper(String helper) {
} this.helper = helper;
}
public void setKey(String key) {
this.key = key; public List<String> getValue() {
} return value;
}
public List<Condition> getConditions() {
return conditions; public void setValue(List<String> value) {
} this.value = value;
}
public void setConditions(
List<Condition> conditions) { public boolean isOptional() {
this.conditions = conditions; return optional;
} }
}
public void setOptional(boolean optional) {
this.optional = optional;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public List<Condition> getConditions() {
return conditions;
}
public void setConditions(
List<Condition> conditions) {
this.conditions = conditions;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public List<ConditionLabel> getConditionLabels() {
return conditionLabels;
}
public void setConditionLabels(
List<ConditionLabel> conditionLabels) {
this.conditionLabels = conditionLabels;
}
public List<String> getPayloadValue() {
return payloadValue;
}
public void setPayloadValue(List<String> payloadValue) {
this.payloadValue = payloadValue;
}
public List<Rule> getRules() {
return rules;
}
public void setRules(List<Rule> rules) {
this.rules = rules;
}
public boolean isDisplay() {
return display;
}
public void setDisplay(boolean display) {
this.display = display;
}
public String getPayloadKey() {
return payloadKey;
}
public void setPayloadKey(String payloadKey) {
this.payloadKey = payloadKey;
}
}

Loading…
Cancel
Save