fixing metadata tagging and grouping
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/gcubedatacatalogue-metadata-discovery@146270 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ec53a4028e
commit
8b2b2e6d2f
|
@ -25,6 +25,9 @@ import org.gcube.datacatalogue.metadatadiscovery.adapter.TaggingGroupingAdapter;
|
|||
@XmlAccessorType (XmlAccessType.FIELD)
|
||||
public class MetadataTagging implements Serializable{
|
||||
|
||||
|
||||
public static final String DEFAULT_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -34,7 +37,7 @@ public class MetadataTagging implements Serializable{
|
|||
private Boolean create = false;
|
||||
|
||||
@XmlAttribute
|
||||
private String separator = ":";
|
||||
private String separator = DEFAULT_SEPARATOR;
|
||||
|
||||
@XmlJavaTypeAdapter(TaggingGroupingAdapter.class)
|
||||
@XmlValue
|
||||
|
@ -48,13 +51,15 @@ public class MetadataTagging implements Serializable{
|
|||
public MetadataTagging() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param create
|
||||
* @param separator
|
||||
* @param taggingValue
|
||||
* Instantiates a new metadata tagging.
|
||||
*
|
||||
* @param create the create
|
||||
* @param separator the separator
|
||||
* @param taggingValue the tagging value
|
||||
*/
|
||||
public MetadataTagging(
|
||||
Boolean create, String separator, TaggingGroupingValue taggingValue) {
|
||||
public MetadataTagging(Boolean create, String separator, TaggingGroupingValue taggingValue) {
|
||||
|
||||
super();
|
||||
this.create = create;
|
||||
|
|
|
@ -17,8 +17,8 @@ public enum TaggingGroupingValue {
|
|||
|
||||
onFieldName("onFieldName"),
|
||||
onValue("onValue"),
|
||||
onFieldName_onValue("onFieldName onValue"),
|
||||
onValue_onFieldName("onValue onFieldName");
|
||||
onFieldName_onValue("onFieldName_onValue"),
|
||||
onValue_onFieldName("onValue_onFieldName");
|
||||
|
||||
private String value;
|
||||
|
||||
|
@ -53,6 +53,7 @@ public enum TaggingGroupingValue {
|
|||
|
||||
try{
|
||||
for (TaggingGroupingValue tgv : TaggingGroupingValue.values()) {
|
||||
System.out.println("Comparing input value: "+value +" with "+tgv.value );
|
||||
if(tgv.value.equals(value))
|
||||
return tgv;
|
||||
}
|
||||
|
|
|
@ -5,23 +5,15 @@ package org.gcube.datacatalogue.metadatadiscovery;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.DataType;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataCategory;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataField;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataFormat;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataGrouping;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataTagging;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataValidator;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataVocabulary;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.TaggingGroupingValue;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
|
@ -45,7 +37,7 @@ public class TestJaxbMetadataMarshUnmarsh {
|
|||
@Test
|
||||
public void test() {
|
||||
|
||||
metadatas = new MetadataFormat();
|
||||
/*metadatas = new MetadataFormat();
|
||||
|
||||
ckanCategories = new ArrayList<MetadataCategory>();
|
||||
|
||||
|
@ -96,11 +88,11 @@ public class TestJaxbMetadataMarshUnmarsh {
|
|||
MetadataValidator validator2 = new MetadataValidator("a regular expression for validating values");
|
||||
ckanMetadata.setValidator(validator2);
|
||||
|
||||
metadatas.addMetadata(ckanMetadata);
|
||||
metadatas.addMetadata(ckanMetadata);*/
|
||||
|
||||
try {
|
||||
|
||||
marshalingExample();
|
||||
//marshalingExample();
|
||||
unMarshalingExample();
|
||||
}
|
||||
catch (JAXBException e) {
|
||||
|
|
Loading…
Reference in New Issue