This commit is contained in:
Fabio Sinibaldi 2019-06-07 15:00:47 +00:00
parent a768d4576a
commit b78a7fdec0
6 changed files with 45 additions and 11 deletions

View File

@ -93,7 +93,7 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
desc.setAuthor(parseUser(getAuthor(opDescription)));
desc.setMaintainer(parseUser(getAuthor(opDescription)));
// Parameters info
for(org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter param:op.getOperatorParameters()) {
@ -115,7 +115,7 @@ public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorith
if(wpsbaseUrl!=null) {
// desc.setWpsLink(wpsLink);
desc.setWpsLink(wpsbaseUrl+"?Request=DescribeProcess&Version=1.0.0&Service=WPS"+"&Identifier="+opID);
}
desc.setPrivateFlag(Boolean.parseBoolean(env.get(Constants.PRIVATE)));

View File

@ -16,4 +16,13 @@ public class UserIdentity {
private String email;
private String orcid;
public String asStringValue() {
StringBuilder b=new StringBuilder();
b.append(lastName +",");
if(firstName!=null)b.append(firstName +",");
if(email!=null)b.append(email +",");
if(orcid!=null)b.append(orcid+",");
return b.substring(0, b.lastIndexOf(","));
}
}

View File

@ -31,8 +31,7 @@ public class CkanItem {
}
private String name;
private String title;
private String description;
private String title;
private String version;
@JsonProperty("private")
private Boolean privateFlag;

View File

@ -13,7 +13,7 @@ public class CkanResource {
private String name;
private String url;
private String format;
private String description;
}

View File

@ -35,7 +35,7 @@ public class GCatModel implements CatalogueFormatData {
public GCatModel(InternalAlgorithmDescriptor desc) {
item=new CkanItem();
// item.setAuthor(desc.getAuthor());
item.setDescription(desc.getDescription());
item.setTitle(desc.getName()+" in "+ContextUtils.getCurrentScopeName());
item.setLicense_id("CC-BY-NC-SA-4.0");
// item.setMaintainer(desc.getMaintainer());
@ -58,16 +58,21 @@ public class GCatModel implements CatalogueFormatData {
((param.getValue()!=null&&!param.getValue().isEmpty())?"default : "+param.getValue():""),
param.getDescription())));
UserIdentity author=desc.getAuthor();
// item.getExtras().add(new CKanExtraField(profileID+":Process Author",
// String.format("%1$s, %2$s ", args)))
//Algorithm Description
item.getExtras().add(new CKanExtraField(profileID+":Process Description", desc.getDescription()));
// Algorithm Users
item.getExtras().add(new CKanExtraField(profileID+":Process Author",desc.getAuthor().asStringValue()));
item.getExtras().add(new CKanExtraField(profileID+":Process Maintainer",desc.getAuthor().asStringValue()));
// TODO ADD RESOURCES
if(desc.getGuiLink()!=null)
resources.add(new CkanResource("Gateway Link",desc.getGuiLink(),"Link to the GUI designed to operate with DataMiner"));
resources.add(new CkanResource("Gateway Link",desc.getGuiLink(),"HTTP","Link to the GUI designed to operate with DataMiner"));
if(desc.getWpsLink()!=null)
resources.add(new CkanResource("WPS Link", desc.getWpsLink(), "WPS Link to the "+DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.CKAN_RESOURCE_TYPE)));
resources.add(new CkanResource("WPS Link", desc.getWpsLink(), "WPS","WPS Link to the "+DataMinerCollectorProperties.getProperty(DataMinerCollectorProperties.CKAN_RESOURCE_TYPE)));
}

View File

@ -5,6 +5,12 @@
<dataType>String</dataType>
<note>Input parameter expected for the execution of the process</note>
</metadatafield>
<metadatafield>
<fieldName>Algorithm Description</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<note>Input parameter expected for the execution of the process</note>
</metadatafield>
<metadatafield>
<fieldName>Output Parameter</fieldName>
<mandatory>false</mandatory>
@ -27,4 +33,19 @@
]*(orcid.org\/0000-000(1-[5-9]|2-[0-9]|3-[0-4])\d\d\d-\d\d\d[\dX])?$</regularExpression>
</validator>
</metadatafield>
<metadatafield>
<fieldName>Process Maintainer</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<defaultValue />
<note>The name of the author, with email and ORCID. The format should
be: family, given[, email][, ORCID]. Example: Smith, John,
js@acme.org, orcid.org/0000-0002-1825-0097</note>
<validator>
<regularExpression>^[a-zA-ZÀ-ÿ .'-]+, [a-zA-ZÀ-ÿ .'-]+[,
]*([a-zA-Z0-9_!#$%*+=?`{|}~^.-]+@[a-zA-Z0-9À-ÿ.-]+)?[,
]*(orcid.org\/0000-000(1-[5-9]|2-[0-9]|3-[0-4])\d\d\d-\d\d\d[\dX])?$</regularExpression>
</validator>
</metadatafield>
</metadataformat>