Merge branch 'Development' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into Development
# Conflicts: # dmp-admin/src/app/testModel/testModel.ts
This commit is contained in:
commit
4cd7d39279
|
@ -6,8 +6,6 @@ export const TestModel = {
|
|||
"page": "1",
|
||||
"title": "1 Data Summary",
|
||||
"description": " Fill in the fields to describe your data model ",
|
||||
"ordinal": "1",
|
||||
"extendedDescription": "",
|
||||
"sections": [],
|
||||
"fieldGroups":
|
||||
[
|
||||
|
@ -18,15 +16,11 @@ export const TestModel = {
|
|||
"title": "Data Summary",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"compositeFields": [
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
"min":0,
|
||||
"max":3
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
|
@ -36,46 +30,33 @@ export const TestModel = {
|
|||
"title": "",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "checkBox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"metadataStandarsA211",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
},
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"freeOfChargeGroupCommentA213",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
},
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"standardisedVocabulariesA212",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "radioChoices",
|
||||
"defaultVisibility": "true",
|
||||
"title": "",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "radiobox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
"options": [
|
||||
{ "label": "Over 18", "value": "over18" },
|
||||
{ "label": "Under 15", "value": "under15" },
|
||||
{ "label": "Between 15 - 18", "value": "between15and18" }
|
||||
]
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -89,14 +70,12 @@ export const TestModel = {
|
|||
"ordinal": "2",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"extendedDescription": "",
|
||||
"title": "2 Fair Data",
|
||||
"sections": [
|
||||
{
|
||||
"id": "dataMetadata",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"ordinal": 1,
|
||||
"title": "2.1 Making data findable, including provisions for metadata",
|
||||
"sections": [],
|
||||
"fieldGroups": [
|
||||
|
@ -108,16 +87,8 @@ export const TestModel = {
|
|||
"title": "Making data findable, including provisions for metadata",
|
||||
"description": "Making data findable, including provisions for metadata",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"compositeFields": [
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
|
@ -126,60 +97,41 @@ export const TestModel = {
|
|||
"title": "Q2.1.1 Will you use metadata to describe the data?",
|
||||
"description": "User can select from a list of metadata standards. If they cannot find the standard in the list provided then they should choose \"not listed\". Selecting this will result in a field in which the user can insert the URL to the description of the metadata scheme used. A \"comments\" box should exist to allow users to add comments. They may select more than one metadata standard. They may specify more than one URL when selecting \"not listed\". They are also presented with a field in which to specify the location of the metadata service. Users can select the \"no metadata\" button to specify no metadata will be used to describe the data.",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"viewStyle": {
|
||||
"renderStyle": "booleanDecision",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "booleanDesicion",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"noMetadata",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"true",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
"id": "metadataStandarsA211",
|
||||
"defaultVisibility": "true",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Metadata standards",
|
||||
"description": "The data will be described by metadata that follows the metadata standards described in <url1>, <url2>, ? The data will be described by metadata that follows the metadata schema described in <not-listed-url1>, <not-listed-url2>. The metadata will be stored in the service located at <metadata-repo-url>",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "combobox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "combobox",
|
||||
"rules":[],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
"type": "autocomplete",
|
||||
"url": "http://dionysus.di.uoa.gr:8080/dmp-backend/rest/external/datarepos?query=gree"
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
|
@ -188,29 +140,23 @@ export const TestModel = {
|
|||
"title": "Not listed",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "checkBox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
|
@ -219,28 +165,23 @@ export const TestModel = {
|
|||
"title": "Url",
|
||||
"description": "URL to the description of the metadata scheme used",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "freetext",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "freetext",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
|
@ -249,28 +190,23 @@ export const TestModel = {
|
|||
"title": "Comments",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "freetext",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "freetext",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields":
|
||||
[
|
||||
{
|
||||
|
@ -279,295 +215,26 @@ export const TestModel = {
|
|||
"title": "The data will not be described by any metadata.",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "checkBox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"viewStyle": "checkBox",
|
||||
"rules":[
|
||||
{
|
||||
"ruleType":"fieldValue",
|
||||
"target":"",
|
||||
"ruleStyle":"boolean",
|
||||
"value":"",
|
||||
"valueType":"boolean"
|
||||
}
|
||||
],
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "VocabulariesGroup",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"ordinal": 1,
|
||||
"title": "Vocabularies",
|
||||
"description": "Vocabularies",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"compositeFields": [
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "useVocabulariesQ212",
|
||||
"defaultVisibility": "true",
|
||||
"title": "Q2.1.2 Will your metadata use standardised vocabularies?",
|
||||
"description": "User selects from a drop-down list of existing standardised vocabularies or \"not listed\" or \"none\". There should be a \"comments\" fields for additional information. If \"not listed\" is selected the user is presented with two additional fields in which the user can put the URL to the new vocabulary along with a short description. The user should be allowed to select more than one option.",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"viewStyle": {
|
||||
"renderStyle": "booleanDesicion",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "standardisedVocabulariesA212",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Existing standardised vocabularies",
|
||||
"description": "The metadata will make use of the standardised vocabulary <url>",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "combobox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
"type": "wordlist",
|
||||
"values": [
|
||||
{ "label": "Mitsos", "value": "mitsakos" },
|
||||
{ "label": "Kitsos", "value": "kitsakos" },
|
||||
{ "label": "Panagiotis", "value": "mpotis" }
|
||||
]
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "notlistedVocabularyA212",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Not listed vocabulary",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "checkBox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "notlistedVocUrlA212",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Vocabulary Url",
|
||||
"description": "The user can put the URL to the new vocabulary",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "freetext",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "notlistedVocCommentA212",
|
||||
"defaultVisibility": "false",
|
||||
"title": "Comments",
|
||||
"description": "Vocabulary short description",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "freetext",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "noMetadataVocabularyA212",
|
||||
"defaultVisibility": "false",
|
||||
"title": "The metadata will not make use of any vocabulary",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "checkBox",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "FreeOfChargeGroup",
|
||||
"defaultVisibility": "true",
|
||||
"page": "1",
|
||||
"ordinal": 1,
|
||||
"title": "Metadata Available",
|
||||
"description": "Metadata Available",
|
||||
"extendedDescription": "FieldGroup Description",
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"compositeFields": [
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "freeOfChargeGroupQ213",
|
||||
"defaultVisibility": "true",
|
||||
"title": "Q2.1.3 Will you use standardised formats for some or all of your data.",
|
||||
"description": "User is presented with a choice of ?yes?, ?no?. There should be a ?comments? field for additional information.",
|
||||
"extendedDescription": "Field Description",
|
||||
"viewStyle": {
|
||||
"renderStyle": "booleanDesicion",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"id": "freeOfChargeGroupCommentA213",
|
||||
"defaultVisibility": "true",
|
||||
"title": "Comments",
|
||||
"description": "",
|
||||
"extendedDescription": "",
|
||||
"viewStyle": {
|
||||
"renderStyle": "freetext",
|
||||
"cssClass": ""
|
||||
},
|
||||
"defaultValue":{
|
||||
"type":"any",
|
||||
"value":""
|
||||
},
|
||||
"multiplicity":{
|
||||
"min":"1",
|
||||
"max":"1"
|
||||
},
|
||||
"data": {
|
||||
|
||||
"min":0,
|
||||
"max":1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.w3c.dom.NodeList;
|
|||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
|
||||
import models.components.commons.Multiplicity;
|
||||
import utilities.XmlSerializable;
|
||||
import utilities.builders.XmlBuilder;
|
||||
|
||||
|
@ -19,6 +20,7 @@ public class FieldSet implements DatabaseModelDefinition,XmlSerializable<FieldSe
|
|||
private String id;
|
||||
|
||||
private int ordinal;
|
||||
private Multiplicity multiplicity;
|
||||
|
||||
private List<Field> fields;
|
||||
|
||||
|
@ -41,6 +43,12 @@ public class FieldSet implements DatabaseModelDefinition,XmlSerializable<FieldSe
|
|||
this.fields = fields;
|
||||
}
|
||||
|
||||
public Multiplicity getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
public void setMultiplicity(Multiplicity multiplicity) {
|
||||
this.multiplicity = multiplicity;
|
||||
}
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
|
||||
|
@ -53,6 +61,11 @@ public class FieldSet implements DatabaseModelDefinition,XmlSerializable<FieldSe
|
|||
fieldsElement.appendChild(field.toXml(doc));
|
||||
}
|
||||
rootElement.appendChild(fieldsElement);
|
||||
Element multiplicity = doc.createElement("multiplicity");
|
||||
multiplicity.setAttribute("min", ""+this.multiplicity.getMin());
|
||||
multiplicity.setAttribute("max", ""+this.multiplicity.getMax());
|
||||
rootElement.appendChild(multiplicity);
|
||||
rootElement.appendChild(multiplicity);
|
||||
return rootElement;
|
||||
}
|
||||
@Override
|
||||
|
@ -71,6 +84,11 @@ public class FieldSet implements DatabaseModelDefinition,XmlSerializable<FieldSe
|
|||
}
|
||||
}
|
||||
}
|
||||
this.multiplicity = new Multiplicity();
|
||||
Element multiplicity = (Element)element.getElementsByTagName("multiplicity").item(0);
|
||||
this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min")));
|
||||
this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.w3c.dom.Element;
|
|||
|
||||
import entities.xmlmodels.modeldefinition.DatabaseModelDefinition;
|
||||
import models.components.commons.ViewStyle;
|
||||
import models.components.commons.Visibility;
|
||||
import models.components.commons.datafield.FieldData;
|
||||
import utilities.XmlSerializable;
|
||||
import utilities.builders.ModelBuilder;
|
||||
|
@ -17,6 +18,7 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable<Field>
|
|||
private String description;
|
||||
private String extendedDescription;
|
||||
private ViewStyle viewStyle;
|
||||
private Visibility visible;
|
||||
private FieldData data;
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -67,6 +69,13 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable<Field>
|
|||
public void setData(FieldData data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Visibility getVisible() {
|
||||
return visible;
|
||||
}
|
||||
public void setVisible(Visibility visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element rootElement = doc.createElement("field");
|
||||
|
@ -84,6 +93,9 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable<Field>
|
|||
viewStyle.setAttribute("renderstyle", this.viewStyle.getRenderStyle());
|
||||
viewStyle.setAttribute("cssClass", this.viewStyle.getCssClass());
|
||||
|
||||
Element visibility = this.visible.toXml(doc);
|
||||
|
||||
rootElement.appendChild(visibility);
|
||||
rootElement.appendChild(extendedDescription);
|
||||
rootElement.appendChild(viewStyle);
|
||||
rootElement.appendChild(description);
|
||||
|
@ -107,6 +119,9 @@ public class Field implements DatabaseViewStyleDefinition,XmlSerializable<Field>
|
|||
this.viewStyle.setRenderStyle(viewStyle.getAttribute("renderstyle"));
|
||||
this.viewStyle.setCssClass(viewStyle.getAttribute("cssClass"));
|
||||
|
||||
Element visibility = (Element)element.getElementsByTagName("visible").item(0);
|
||||
this.visible = new Visibility().fromXml(visibility);
|
||||
|
||||
Element dataElement = (Element)element.getElementsByTagName("data").item(0);
|
||||
this.data = new ModelBuilder().toFieldData(null, this.viewStyle.getRenderStyle());
|
||||
if(this.data!=null)this.data.fromXml(dataElement);
|
||||
|
|
|
@ -22,6 +22,22 @@ public class FieldSet implements DatabaseViewStyleDefinition,XmlSerializable<Fie
|
|||
|
||||
public void setFields(List<Field> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package models.components.commons;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import utilities.XmlSerializable;
|
||||
|
||||
public class Rule implements XmlSerializable<Rule>{
|
||||
private String ruleType;
|
||||
private String target;
|
||||
private String ruleStyle;
|
||||
private String value;
|
||||
private String valueType;
|
||||
public String getRuleType() {
|
||||
return ruleType;
|
||||
}
|
||||
public void setRuleType(String ruleType) {
|
||||
this.ruleType = ruleType;
|
||||
}
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
public String getRuleStyle() {
|
||||
return ruleStyle;
|
||||
}
|
||||
public void setRuleStyle(String ruleStyle) {
|
||||
this.ruleStyle = ruleStyle;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public String getValueType() {
|
||||
return valueType;
|
||||
}
|
||||
public void setValueType(String valueType) {
|
||||
this.valueType = valueType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element rule = doc.createElement("rule");
|
||||
rule.setAttribute("type",this.ruleType);
|
||||
rule.setAttribute("target", this.target);
|
||||
rule.setAttribute("ruleStyle", this.ruleStyle);
|
||||
|
||||
Element value = doc.createElement("value");
|
||||
value.setAttribute("type", this.valueType);
|
||||
value.setTextContent(this.value);
|
||||
|
||||
rule.appendChild(value);
|
||||
return rule;
|
||||
}
|
||||
@Override
|
||||
public Rule fromXml(Element item) {
|
||||
this.ruleType = item.getAttribute("type");
|
||||
this.target = item.getAttribute("target");
|
||||
this.ruleStyle = item.getAttribute("ruleStyle");
|
||||
|
||||
Element value = (Element)item.getElementsByTagName("value").item(0);
|
||||
if(value!=null){
|
||||
this.valueType = value.getAttribute("type");
|
||||
this.value = value.getTextContent();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package models.components.commons;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import entities.xmlmodels.viewstyledefinition.Field;
|
||||
import utilities.XmlSerializable;
|
||||
|
||||
public class Visibility implements XmlSerializable<Visibility>{
|
||||
private List<Rule> rules;
|
||||
private String style;
|
||||
public List<Rule> getRules() {
|
||||
return rules;
|
||||
}
|
||||
|
||||
public void setRules(List<Rule> rules) {
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
public String getStyle() {
|
||||
return style;
|
||||
}
|
||||
|
||||
public void setStyle(String style) {
|
||||
this.style = style;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = doc.createElement("visible");
|
||||
root.setAttribute("style", this.style);
|
||||
if(rules!=null&&!rules.isEmpty()){
|
||||
for(Rule rule:rules){
|
||||
root.appendChild(rule.toXml(doc));
|
||||
}
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Visibility fromXml(Element item) {
|
||||
this.style = item.getAttribute("style");
|
||||
this.rules = new LinkedList();
|
||||
NodeList rulesElements = item.getChildNodes();
|
||||
for (int temp = 0; temp < rulesElements.getLength(); temp++) {
|
||||
Node ruleElement = rulesElements.item(temp);
|
||||
if (ruleElement .getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.rules.add(new Rule().fromXml((Element)ruleElement));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
|||
import models.components.commons.DefaultValue;
|
||||
import models.components.commons.Multiplicity;
|
||||
import models.components.commons.ViewStyle;
|
||||
import models.components.commons.Visibility;
|
||||
import utilities.ModelDefinition;
|
||||
import utilities.ViewStyleDefinition;
|
||||
import utilities.builders.ModelBuilder;
|
||||
|
@ -26,7 +27,7 @@ public class Field implements ModelDefinition<entities.xmlmodels.modeldefinition
|
|||
private DefaultValue defaultValue;
|
||||
private Multiplicity multiplicity;
|
||||
private Object data;
|
||||
|
||||
private Visibility visible;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -111,6 +112,14 @@ public class Field implements ModelDefinition<entities.xmlmodels.modeldefinition
|
|||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
public Visibility getVisible() {
|
||||
return visible;
|
||||
}
|
||||
public void setVisible(Visibility visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
@Override
|
||||
public entities.xmlmodels.modeldefinition.Field toDatabaseDefinition(entities.xmlmodels.modeldefinition.Field field) {
|
||||
field.setDatatype(this.datatype);
|
||||
|
@ -136,6 +145,7 @@ public class Field implements ModelDefinition<entities.xmlmodels.modeldefinition
|
|||
field.setTitle(this.title);
|
||||
field.setViewStyle(this.viewStyle);
|
||||
field.setData(new ModelBuilder().toFieldData(data, this.viewStyle.getRenderStyle()));
|
||||
field.setVisible(this.visible);
|
||||
return field;
|
||||
}
|
||||
@Override
|
||||
|
@ -148,6 +158,7 @@ public class Field implements ModelDefinition<entities.xmlmodels.modeldefinition
|
|||
this.title = item.getTitle();
|
||||
this.viewStyle = item.getViewStyle();
|
||||
this.data = item.getData();
|
||||
this.visible = item.getVisible();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
|
||||
import models.components.commons.Multiplicity;
|
||||
import utilities.ModelDefinition;
|
||||
import utilities.ViewStyleDefinition;
|
||||
import utilities.builders.ModelBuilder;
|
||||
|
@ -12,7 +13,7 @@ import utilities.builders.ModelBuilder;
|
|||
public class FieldSet implements ModelDefinition<entities.xmlmodels.modeldefinition.FieldSet>,ViewStyleDefinition<entities.xmlmodels.viewstyledefinition.FieldSet>{
|
||||
private String id;
|
||||
private int ordinal;
|
||||
|
||||
private Multiplicity multiplicity;
|
||||
private List<Field> fields;
|
||||
|
||||
public List<Field> getFields() {
|
||||
|
@ -39,12 +40,21 @@ public class FieldSet implements ModelDefinition<entities.xmlmodels.modeldefinit
|
|||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public Multiplicity getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
|
||||
public void setMultiplicity(Multiplicity multiplicity) {
|
||||
this.multiplicity = multiplicity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public entities.xmlmodels.modeldefinition.FieldSet toDatabaseDefinition(entities.xmlmodels.modeldefinition.FieldSet fieldSet) {
|
||||
fieldSet.setId(this.id);
|
||||
fieldSet.setOrdinal(this.ordinal);
|
||||
List<entities.xmlmodels.modeldefinition.Field> modelfields = new ModelBuilder().toModelDefinition(this.fields, entities.xmlmodels.modeldefinition.Field.class);
|
||||
fieldSet.setFields(modelfields);
|
||||
fieldSet.setMultiplicity(this.multiplicity);
|
||||
return fieldSet;
|
||||
}
|
||||
|
||||
|
@ -52,18 +62,23 @@ public class FieldSet implements ModelDefinition<entities.xmlmodels.modeldefinit
|
|||
public void fromDatabaseDefinition(entities.xmlmodels.modeldefinition.FieldSet item) {
|
||||
this.id = item.getId();
|
||||
this.ordinal = item.getOrdinal();
|
||||
this.multiplicity = item.getMultiplicity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public entities.xmlmodels.viewstyledefinition.FieldSet toDatabaseDefinition(entities.xmlmodels.viewstyledefinition.FieldSet item) {
|
||||
List<entities.xmlmodels.viewstyledefinition.Field> viewStylefields = new ModelBuilder().toViewStyleDefinition(this.fields, entities.xmlmodels.viewstyledefinition.Field.class);
|
||||
item.setFields(viewStylefields);
|
||||
item.setId(this.id);
|
||||
item.setOrdinal(this.ordinal);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromDatabaseDefinition(entities.xmlmodels.viewstyledefinition.FieldSet item) {
|
||||
this.fields = new ModelBuilder().fromViewStyleDefinition(item.getFields(), Field.class);
|
||||
this.id = item.getId();
|
||||
this.ordinal = item.getOrdinal();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="this.visibilityRulesService.isElementVisible(pathName,field.id)" [formGroup]="form" class="form-group" [ngSwitch]="field.viewStyle">
|
||||
<div *ngIf="this.visibilityRulesService.isElementVisible(pathName,field.id)" [formGroup]="form" class="form-group" [ngSwitch]="field.viewStyle.renderStyle">
|
||||
<div [ngClass]="{true:'show', false:'hide'}[field.visible]">
|
||||
|
||||
<label>{{field.description}}</label>
|
||||
|
|
Loading…
Reference in New Issue