Browse Source

Renamed property defaultValue

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/gcubedatacatalogue-metadata-discovery@131458 82a268e6-3cf1-43bd-a215-b396298e98cf
feature/17423
Francesco Mangiacrapa 6 years ago
parent
commit
044928bcda
  1. 2
      META-INF/CkanMetadatas.xml
  2. 18
      src/main/java/org/gcube/datacatalogue/metadatadiscovery/bean/jaxb/MetadataField.java
  3. 2
      src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestDataCatalogueMetadataFormatReader.java
  4. 6
      src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestJaxbMetadataMarshUnmarsh.java
  5. 9
      src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestMetadataFormatDiscovery.java

2
META-INF/CkanMetadatas.xml

@ -3,7 +3,7 @@
<metadatafield>
<fieldName>Name</fieldName>
<mandatory>true</mandatory>
<dataType>Date</dataType>
<dataType>Time</dataType>
<defaulValue>default value</defaulValue>
<note>shown as suggestions in the insert/update metadata form of CKAN</note>
<vocabulary isMultiSelection="true">

18
src/main/java/org/gcube/datacatalogue/metadatadiscovery/bean/jaxb/MetadataField.java

@ -37,7 +37,7 @@ public class MetadataField implements Serializable{
// private Boolean isBoolean = false;
@XmlJavaTypeAdapter(DataTypeAdapter.class)
private DataType dataType = DataType.String;
private String defaulValue;
private String defaultValue;
private String note;
//It's the list of eligible values;
@ -93,11 +93,11 @@ public class MetadataField implements Serializable{
/**
* @return the defaulValue
* @return the defaultValue
*/
public String getDefaulValue() {
public String getDefaultValue() {
return defaulValue;
return defaultValue;
}
@ -156,11 +156,11 @@ public class MetadataField implements Serializable{
/**
* @param defaulValue the defaulValue to set
* @param defaultValue the defaultValue to set
*/
public void setDefaulValue(String defaulValue) {
public void setDefaultValue(String defaultValue) {
this.defaulValue = defaulValue;
this.defaultValue = defaultValue;
}
@ -203,8 +203,8 @@ public class MetadataField implements Serializable{
builder.append(mandatory);
builder.append(", dataType=");
builder.append(dataType);
builder.append(", defaulValue=");
builder.append(defaulValue);
builder.append(", defaultValue=");
builder.append(defaultValue);
builder.append(", note=");
builder.append(note);
builder.append(", vocabulary=");

2
src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestDataCatalogueMetadataFormatReader.java

@ -26,7 +26,7 @@ public class TestDataCatalogueMetadataFormatReader {
@Test
public void test() {
try {
String scopeString = "/gcube/devsec/devVRE";
String scopeString = "/gcube/devNext/NextNext";
ScopeProvider.instance.set(scopeString);
DataCalogueMetadataFormatReader reader = new DataCalogueMetadataFormatReader();
logger.trace(""+reader.getListOfMetadataTypes());

6
src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestJaxbMetadataMarshUnmarsh.java

@ -43,7 +43,7 @@ public class TestJaxbMetadataMarshUnmarsh {
ckanMetadata = new MetadataField();
ckanMetadata.setFieldName("Name");
ckanMetadata.setMandatory(true);
ckanMetadata.setDefaulValue("default value");
ckanMetadata.setDefaultValue("default value");
ckanMetadata.setDataType(DataType.Time);
List<String> vocabulary = new ArrayList<String>();
vocabulary.add("field1");
@ -60,7 +60,7 @@ public class TestJaxbMetadataMarshUnmarsh {
ckanMetadata = new MetadataField();
ckanMetadata.setFieldName("Accessibility");
ckanMetadata.setMandatory(true);
ckanMetadata.setDefaulValue("virtual/public");
ckanMetadata.setDefaultValue("virtual/public");
List<String> vocabulary2 = new ArrayList<String>();
vocabulary2.add("virtual/public");
vocabulary2.add("virtual/private");
@ -75,7 +75,7 @@ public class TestJaxbMetadataMarshUnmarsh {
try {
marshalingExample();
// marshalingExample();
unMarshalingExample();
}
catch (JAXBException e) {

9
src/test/java/org/gcube/datacatalogue/metadatadiscovery/TestMetadataFormatDiscovery.java

@ -3,7 +3,9 @@
*/
package org.gcube.datacatalogue.metadatadiscovery;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.datacatalogue.metadatadiscovery.bean.MetadataType;
import org.gcube.datacatalogue.metadatadiscovery.reader.MedataFormatDiscovery;
import org.junit.Test;
@ -22,13 +24,18 @@ public class TestMetadataFormatDiscovery {
@Test
public void test() {
String scopeString = "/gcube/devsec/devVRE";
String scopeString = "/gcube/devNext/NextNext";
final ScopeBean scope = new ScopeBean(scopeString);
MedataFormatDiscovery reader;
try {
ScopeProvider.instance.set(scopeString);
reader = new MedataFormatDiscovery(scope);
System.out.println(reader.getMetadataTypes());
for (MetadataType type : reader.getMetadataTypes()) {
System.out.println(type);
}
} catch (Exception e) {
e.printStackTrace();
}

Loading…
Cancel
Save