Working on Task #7616
Increased pom version at 3.0.0 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/gcubedatacatalogue-metadata-discovery@146248 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0072222f36
commit
608181fb64
|
@ -1,4 +1,10 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.gcubedatacatalogue-metadata-discovery.3-0-0"
|
||||||
|
date="2017-03-21">
|
||||||
|
<Change>[Task #7616] Porting library to Metadata Profile model v3.0
|
||||||
|
</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset
|
<Changeset
|
||||||
component="org.gcube.data-catalogue.gcubedatacatalogue-metadata-discovery.2-0-0"
|
component="org.gcube.data-catalogue.gcubedatacatalogue-metadata-discovery.2-0-0"
|
||||||
date="2016-10-03">
|
date="2016-10-03">
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<groupId>org.gcube.data-catalogue</groupId>
|
<groupId>org.gcube.data-catalogue</groupId>
|
||||||
<artifactId>gcubedatacatalogue-metadata-discovery</artifactId>
|
<artifactId>gcubedatacatalogue-metadata-discovery</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
<name>The gCube data catalogue metadata discovery library</name>
|
<name>The gCube data catalogue metadata discovery library</name>
|
||||||
<description>The gCube data catalogue metadata discovery library</description>
|
<description>The gCube data catalogue metadata discovery library</description>
|
||||||
<scm>
|
<scm>
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gcube.datacatalogue.metadatadiscovery.adapter;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||||
|
|
||||||
|
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.TaggingGroupingValue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class TaggingGroupingAdapter.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 21, 2017
|
||||||
|
*/
|
||||||
|
public class TaggingGroupingAdapter extends XmlAdapter<String, TaggingGroupingValue> {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
|
||||||
|
*/
|
||||||
|
public String marshal(TaggingGroupingValue dt) {
|
||||||
|
|
||||||
|
return dt.name();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
|
||||||
|
*/
|
||||||
|
public TaggingGroupingValue unmarshal(String dt) {
|
||||||
|
|
||||||
|
return TaggingGroupingValue.fromValue(dt);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,8 @@ public enum DataType {
|
||||||
Times_ListOf,
|
Times_ListOf,
|
||||||
Text,
|
Text,
|
||||||
Boolean,
|
Boolean,
|
||||||
Number;
|
Number,
|
||||||
|
GeoJSON;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value.
|
* Value.
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.datacatalogue.metadatadiscovery.bean.jaxb;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 21, 2017
|
||||||
|
*/
|
||||||
|
@XmlRootElement(name = "metadatacategory")
|
||||||
|
@XmlAccessorType (XmlAccessType.FIELD)
|
||||||
|
public class MetadataCategory implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -7282676787740920115L;
|
||||||
|
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
private String id = null;
|
||||||
|
|
||||||
|
@XmlElement(required = true)
|
||||||
|
private String title = "";
|
||||||
|
|
||||||
|
private String description = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public MetadataCategory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the id
|
||||||
|
*/
|
||||||
|
public String getId() {
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the title
|
||||||
|
*/
|
||||||
|
public String getTitle() {
|
||||||
|
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the description
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param id the id to set
|
||||||
|
*/
|
||||||
|
public void setId(String id) {
|
||||||
|
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param title the title to set
|
||||||
|
*/
|
||||||
|
public void setTitle(String title) {
|
||||||
|
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param description the description to set
|
||||||
|
*/
|
||||||
|
public void setDescription(String description) {
|
||||||
|
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.lang.Object#toString()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("MetadataCategory [id=");
|
||||||
|
builder.append(id);
|
||||||
|
builder.append(", title=");
|
||||||
|
builder.append(title);
|
||||||
|
builder.append(", description=");
|
||||||
|
builder.append(description);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -47,6 +47,13 @@ public class MetadataField implements Serializable{
|
||||||
@XmlElement(name = "validator")
|
@XmlElement(name = "validator")
|
||||||
private MetadataValidator validator;
|
private MetadataValidator validator;
|
||||||
|
|
||||||
|
@XmlElement(name = "tagging")
|
||||||
|
private MetadataTagging tagging;
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "grouping")
|
||||||
|
private MetadataGrouping grouping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new metadata field.
|
* Instantiates a new metadata field.
|
||||||
*/
|
*/
|
||||||
|
@ -128,6 +135,24 @@ public class MetadataField implements Serializable{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the tagging
|
||||||
|
*/
|
||||||
|
public MetadataTagging getTagging() {
|
||||||
|
|
||||||
|
return tagging;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the grouping
|
||||||
|
*/
|
||||||
|
public MetadataGrouping getGrouping() {
|
||||||
|
|
||||||
|
return grouping;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param fieldName the fieldName to set
|
* @param fieldName the fieldName to set
|
||||||
*/
|
*/
|
||||||
|
@ -190,6 +215,24 @@ public class MetadataField implements Serializable{
|
||||||
this.validator = validator;
|
this.validator = validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tagging the tagging to set
|
||||||
|
*/
|
||||||
|
public void setTagging(MetadataTagging tagging) {
|
||||||
|
|
||||||
|
this.tagging = tagging;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param grouping the grouping to set
|
||||||
|
*/
|
||||||
|
public void setGrouping(MetadataGrouping grouping) {
|
||||||
|
|
||||||
|
this.grouping = grouping;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#toString()
|
* @see java.lang.Object#toString()
|
||||||
*/
|
*/
|
||||||
|
@ -211,6 +254,10 @@ public class MetadataField implements Serializable{
|
||||||
builder.append(vocabulary);
|
builder.append(vocabulary);
|
||||||
builder.append(", validator=");
|
builder.append(", validator=");
|
||||||
builder.append(validator);
|
builder.append(validator);
|
||||||
|
builder.append(", tagging=");
|
||||||
|
builder.append(tagging);
|
||||||
|
builder.append(", grouping=");
|
||||||
|
builder.append(grouping);
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.datacatalogue.metadatadiscovery.bean.jaxb;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
|
||||||
|
import org.gcube.datacatalogue.metadatadiscovery.adapter.TaggingGroupingAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 21, 2017
|
||||||
|
*/
|
||||||
|
@XmlRootElement(name = "grouping")
|
||||||
|
@XmlAccessorType (XmlAccessType.FIELD)
|
||||||
|
public class MetadataGrouping implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 4684835556193102991L;
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
private Boolean create = false;
|
||||||
|
|
||||||
|
@XmlJavaTypeAdapter(TaggingGroupingAdapter.class)
|
||||||
|
private TaggingGroupingValue groupingValue = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public MetadataGrouping() {
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.datacatalogue.metadatadiscovery.bean.jaxb;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
|
||||||
|
import org.gcube.datacatalogue.metadatadiscovery.adapter.TaggingGroupingAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 21, 2017
|
||||||
|
*/
|
||||||
|
@XmlRootElement(name = "tagging")
|
||||||
|
@XmlAccessorType (XmlAccessType.FIELD)
|
||||||
|
public class MetadataTagging implements Serializable{
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
private Boolean create = false;
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
private String separator = ":";
|
||||||
|
|
||||||
|
@XmlJavaTypeAdapter(TaggingGroupingAdapter.class)
|
||||||
|
private TaggingGroupingValue taggingValue = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 3853551415977545419L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public MetadataTagging() {
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.gcube.datacatalogue.metadatadiscovery.bean.jaxb;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Enum TaggingGroupingValue.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
* Mar 21, 2017
|
||||||
|
*/
|
||||||
|
public enum TaggingGroupingValue {
|
||||||
|
|
||||||
|
onFieldName,
|
||||||
|
onValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
|
public String value() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* From value.
|
||||||
|
*
|
||||||
|
* @param v the v
|
||||||
|
* @return the tagging grouping value
|
||||||
|
*/
|
||||||
|
public static TaggingGroupingValue fromValue(String v) {
|
||||||
|
TaggingGroupingValue vv;
|
||||||
|
try{
|
||||||
|
vv = valueOf(v);
|
||||||
|
}catch(Exception e){
|
||||||
|
return TaggingGroupingValue.onValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vv;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue