product type (i.e., "Fishery" and "Stock") is added as field and tag
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@133307 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e4f6b708fa
commit
a03399fd53
|
@ -45,6 +45,7 @@ import eu.trentorise.opendata.jackan.model.CkanDataset;
|
||||||
public class GrsfPublisherFisheryService {
|
public class GrsfPublisherFisheryService {
|
||||||
|
|
||||||
private static final String DEFAULT_FISHERY_LICENSE = "CC-BY-SA-4.0";
|
private static final String DEFAULT_FISHERY_LICENSE = "CC-BY-SA-4.0";
|
||||||
|
private static final String THIS_TYPE = "Fishery";
|
||||||
|
|
||||||
// the context
|
// the context
|
||||||
@Context
|
@Context
|
||||||
|
@ -179,6 +180,7 @@ public class GrsfPublisherFisheryService {
|
||||||
// evaluate the tags of the product
|
// evaluate the tags of the product
|
||||||
List<String> tags = new ArrayList<String>();
|
List<String> tags = new ArrayList<String>();
|
||||||
HelperMethods.getTags(tags, record);
|
HelperMethods.getTags(tags, record);
|
||||||
|
tags.add(THIS_TYPE);
|
||||||
|
|
||||||
// evaluate the groups
|
// evaluate the groups
|
||||||
List<String> groups = new ArrayList<String>();
|
List<String> groups = new ArrayList<String>();
|
||||||
|
@ -193,6 +195,9 @@ public class GrsfPublisherFisheryService {
|
||||||
// automatically retrieve the other ones
|
// automatically retrieve the other ones
|
||||||
HelperMethods.getExtras(customFields, record);
|
HelperMethods.getExtras(customFields, record);
|
||||||
|
|
||||||
|
// add the type
|
||||||
|
customFields.put(HelperMethods.PRODUCT_TYPE, THIS_TYPE);
|
||||||
|
|
||||||
// retrieve the user's email and fullname
|
// retrieve the user's email and fullname
|
||||||
String authorMail = HelperMethods.getUserEmail(context, SecurityTokenProvider.instance.get());
|
String authorMail = HelperMethods.getUserEmail(context, SecurityTokenProvider.instance.get());
|
||||||
String authorFullname = HelperMethods.getUserFullname(context, SecurityTokenProvider.instance.get());
|
String authorFullname = HelperMethods.getUserFullname(context, SecurityTokenProvider.instance.get());
|
||||||
|
|
|
@ -45,6 +45,7 @@ import eu.trentorise.opendata.jackan.model.CkanDataset;
|
||||||
public class GrsfPublisherStockService {
|
public class GrsfPublisherStockService {
|
||||||
|
|
||||||
private static final String DEFAULT_STOCK_LICENSE = "CC-BY-SA-4.0";
|
private static final String DEFAULT_STOCK_LICENSE = "CC-BY-SA-4.0";
|
||||||
|
private static final String THIS_TYPE = "Stock";
|
||||||
|
|
||||||
// the context
|
// the context
|
||||||
@Context
|
@Context
|
||||||
|
@ -171,7 +172,8 @@ public class GrsfPublisherStockService {
|
||||||
// evaluate the tags of the product
|
// evaluate the tags of the product
|
||||||
List<String> tags = new ArrayList<String>();
|
List<String> tags = new ArrayList<String>();
|
||||||
HelperMethods.getTags(tags, record);
|
HelperMethods.getTags(tags, record);
|
||||||
|
tags.add(THIS_TYPE);
|
||||||
|
|
||||||
// evaluate the groups
|
// evaluate the groups
|
||||||
List<String> groups = new ArrayList<String>();
|
List<String> groups = new ArrayList<String>();
|
||||||
HelperMethods.getGroups(groups, record);
|
HelperMethods.getGroups(groups, record);
|
||||||
|
@ -184,6 +186,9 @@ public class GrsfPublisherStockService {
|
||||||
|
|
||||||
// automatically retrieve the other ones
|
// automatically retrieve the other ones
|
||||||
HelperMethods.getExtras(customFields, record);
|
HelperMethods.getExtras(customFields, record);
|
||||||
|
|
||||||
|
// add the type
|
||||||
|
customFields.put(HelperMethods.PRODUCT_TYPE, THIS_TYPE);
|
||||||
|
|
||||||
// retrieve the user's email and fullname
|
// retrieve the user's email and fullname
|
||||||
String authorMail = HelperMethods.getUserEmail(context, SecurityTokenProvider.instance.get());
|
String authorMail = HelperMethods.getUserEmail(context, SecurityTokenProvider.instance.get());
|
||||||
|
|
|
@ -44,6 +44,7 @@ public abstract class HelperMethods {
|
||||||
// to be retrieved from the web.xml
|
// to be retrieved from the web.xml
|
||||||
private static final String PENDING_CONTEX_KEY = "PendingContext";
|
private static final String PENDING_CONTEX_KEY = "PendingContext";
|
||||||
private static final String CONFIRMED_CONTEX_KEY = "ConfirmedContext";
|
private static final String CONFIRMED_CONTEX_KEY = "ConfirmedContext";
|
||||||
|
public static final String PRODUCT_TYPE = "Product type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a group name to its id on ckan
|
* Convert a group name to its id on ckan
|
||||||
|
|
Loading…
Reference in New Issue