Upgraded to 2.9.0
Implemented Task #16471 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@178894 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e3ad60fe41
commit
dec8bf5652
|
@ -1,49 +1,73 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE xml>
|
<!DOCTYPE xml>
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-8-1" date="${buildDate}">
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-9-0"
|
||||||
|
date="${buildDate}">
|
||||||
|
<Change>[Task #16471] Migrate to new Catalogue Resolver</Change>
|
||||||
|
</Changeset>
|
||||||
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-8-1"
|
||||||
|
date="${buildDate}">
|
||||||
<Change>Added title on updated of records refs #16395</Change>
|
<Change>Added title on updated of records refs #16395</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-8-1" date="2019-02-26">
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-8-1"
|
||||||
|
date="2019-02-26">
|
||||||
<Change>Fixed Bug on social post publishing</Change>
|
<Change>Fixed Bug on social post publishing</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-8-0" date="2018-11-20">
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-8-0"
|
||||||
|
date="2018-11-20">
|
||||||
<Change>Patched method DataCatalogueImpl#getPortletURL</Change>
|
<Change>Patched method DataCatalogueImpl#getPortletURL</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-7-0" date="2018-10-10">
|
<Changeset
|
||||||
<Change>Added the possibility to deny social post on catalogue-ws #12514</Change>
|
component="org.gcube.data-catalogue.ckan-util-library.2-7-0"
|
||||||
|
date="2018-10-10">
|
||||||
|
<Change>Added the possibility to deny social post on catalogue-ws
|
||||||
|
#12514</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-6-0" date="2018-07-18">
|
<Changeset
|
||||||
<Change>Enhance timeout in requests to CKAN in ckan-util-library #12050</Change>
|
component="org.gcube.data-catalogue.ckan-util-library.2-6-0"
|
||||||
|
date="2018-07-18">
|
||||||
|
<Change>Enhance timeout in requests to CKAN in ckan-util-library
|
||||||
|
#12050</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-5-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-5-0"
|
||||||
date="2018-02-28">
|
date="2018-02-28">
|
||||||
<Change>Code cleanup</Change>
|
<Change>Code cleanup</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-4-2"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-4-2"
|
||||||
date="2018-02-28">
|
date="2018-02-28">
|
||||||
<Change>Portlet url is built on the fly (#11294)</Change>
|
<Change>Portlet url is built on the fly (#11294)</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-4-1"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-4-1"
|
||||||
date="2018-01-10">
|
date="2018-01-10">
|
||||||
<Change>Minor fix for delegates</Change>
|
<Change>Minor fix for delegates</Change>
|
||||||
<Change>Added support for statistics (requires solrj)</Change>
|
<Change>Added support for statistics (requires solrj)</Change>
|
||||||
<Change>Added method for retrieving main landing pages</Change>
|
<Change>Added method for retrieving main landing pages</Change>
|
||||||
</Changeset>
|
</Changeset>Added title on updated of records refs #16395
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-4-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-4-0"
|
||||||
date="2017-11-01">
|
date="2017-11-01">
|
||||||
<Change>Added delegate roles method</Change>
|
<Change>Added delegate roles method</Change>
|
||||||
<Change>Added search methods for datasets</Change>
|
<Change>Added search methods for datasets</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-3-2"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-3-2"
|
||||||
date="2017-08-01">
|
date="2017-08-01">
|
||||||
<Change>Minor fixes</Change>
|
<Change>Minor fixes</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-3-1"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-3-1"
|
||||||
date="2017-07-01">
|
date="2017-07-01">
|
||||||
<Change>Mime type fix for resources</Change>
|
<Change>Mime type fix for resources</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-3-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-3-0"
|
||||||
date="2017-05-01">
|
date="2017-05-01">
|
||||||
<Change>Pom fixes</Change>
|
<Change>Pom fixes</Change>
|
||||||
<Change>Moved to java 8</Change>
|
<Change>Moved to java 8</Change>
|
||||||
|
@ -51,25 +75,29 @@
|
||||||
any)
|
any)
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-2-1"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-2-1"
|
||||||
date="2017-04-01">
|
date="2017-04-01">
|
||||||
<Change>Some minor changes</Change>
|
<Change>Some minor changes</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-2-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-2-0"
|
||||||
date="2017-02-01">
|
date="2017-02-01">
|
||||||
<Change>Added method to delete/purge group</Change>
|
<Change>Added method to delete/purge group</Change>
|
||||||
<Change>Project structure and so packages are changed (gwt-widget like
|
<Change>Project structure and so packages are changed (gwt-widget like
|
||||||
structure)
|
structure)
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-1-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-1-0"
|
||||||
date="2016-12-01">
|
date="2016-12-01">
|
||||||
<Change>Product creation methods improved</Change>
|
<Change>Product creation methods improved</Change>
|
||||||
<Change>Added method to get the group list</Change>
|
<Change>Added method to get the group list</Change>
|
||||||
<Change>Added methods to manage groups</Change>
|
<Change>Added methods to manage groups</Change>
|
||||||
<Change>Added method to patch product/resource</Change>
|
<Change>Added method to patch product/resource</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-0-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.2-0-0"
|
||||||
date="2016-11-01">
|
date="2016-11-01">
|
||||||
<Change>Added support for datasets's relationships (create, delete,
|
<Change>Added support for datasets's relationships (create, delete,
|
||||||
retrieve methods)
|
retrieve methods)
|
||||||
|
@ -84,7 +112,8 @@
|
||||||
to a group
|
to a group
|
||||||
</Change>
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.data-catalogue.ckan-util-library.1-0-0"
|
<Changeset
|
||||||
|
component="org.gcube.data-catalogue.ckan-util-library.1-0-0"
|
||||||
date="2016-06-01">
|
date="2016-06-01">
|
||||||
<Change>First Release</Change>
|
<Change>First Release</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.data-catalogue</groupId>
|
<groupId>org.gcube.data-catalogue</groupId>
|
||||||
<artifactId>ckan-util-library</artifactId>
|
<artifactId>ckan-util-library</artifactId>
|
||||||
<version>2.8.2-SNAPSHOT</version>
|
<version>2.9.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CKan utility library</name>
|
<name>CKan utility library</name>
|
||||||
|
|
|
@ -24,10 +24,6 @@ import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import net.htmlparser.jericho.Renderer;
|
|
||||||
import net.htmlparser.jericho.Segment;
|
|
||||||
import net.htmlparser.jericho.Source;
|
|
||||||
|
|
||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
||||||
import org.apache.solr.client.solrj.response.FacetField;
|
import org.apache.solr.client.solrj.response.FacetField;
|
||||||
|
@ -73,6 +69,9 @@ import eu.trentorise.opendata.jackan.model.CkanPair;
|
||||||
import eu.trentorise.opendata.jackan.model.CkanResource;
|
import eu.trentorise.opendata.jackan.model.CkanResource;
|
||||||
import eu.trentorise.opendata.jackan.model.CkanTag;
|
import eu.trentorise.opendata.jackan.model.CkanTag;
|
||||||
import eu.trentorise.opendata.jackan.model.CkanUser;
|
import eu.trentorise.opendata.jackan.model.CkanUser;
|
||||||
|
import net.htmlparser.jericho.Renderer;
|
||||||
|
import net.htmlparser.jericho.Segment;
|
||||||
|
import net.htmlparser.jericho.Source;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the Ckan Utils implementation class.
|
* This is the Ckan Utils implementation class.
|
||||||
|
@ -1062,7 +1061,7 @@ public class DataCatalogueImpl implements DataCatalogue{
|
||||||
if(dataset != null){
|
if(dataset != null){
|
||||||
|
|
||||||
if(getUriResolverUrl() != null)
|
if(getUriResolverUrl() != null)
|
||||||
url = getUrlForProduct(CONTEXT, EntityContext.PRODUCT, name, false);
|
url = getUrlForProduct(CONTEXT, EntityContext.PRODUCT, name);
|
||||||
|
|
||||||
if(url == null || url.isEmpty())
|
if(url == null || url.isEmpty())
|
||||||
url = getPortletUrl() + "?" + URLEncoder.encode("path=/dataset/" + name, "UTF-8");
|
url = getPortletUrl() + "?" + URLEncoder.encode("path=/dataset/" + name, "UTF-8");
|
||||||
|
@ -1092,7 +1091,7 @@ public class DataCatalogueImpl implements DataCatalogue{
|
||||||
if(dataset != null){
|
if(dataset != null){
|
||||||
|
|
||||||
if(getUriResolverUrl() != null)
|
if(getUriResolverUrl() != null)
|
||||||
url = getUrlForProduct(CONTEXT, EntityContext.PRODUCT, name, true);
|
url = getUrlForProduct(CONTEXT, EntityContext.PRODUCT, name);
|
||||||
|
|
||||||
if(url == null || url.isEmpty())
|
if(url == null || url.isEmpty())
|
||||||
url = getPortletUrl() + "?" + URLEncoder.encode("path=/dataset/" + name, "UTF-8");
|
url = getPortletUrl() + "?" + URLEncoder.encode("path=/dataset/" + name, "UTF-8");
|
||||||
|
@ -1100,7 +1099,7 @@ public class DataCatalogueImpl implements DataCatalogue{
|
||||||
}
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Error while retrieving dataset with id/name=" + datasetIdOrName, e);
|
logger.error("Error while retrieving dataset with id/name=" + datasetIdOrName, e);
|
||||||
}
|
} //requestEntity.put("clear_url", Boolean.toString(unencrypted));
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1109,9 +1108,8 @@ public class DataCatalogueImpl implements DataCatalogue{
|
||||||
* @param context
|
* @param context
|
||||||
* @param entityContext
|
* @param entityContext
|
||||||
* @param entityName
|
* @param entityName
|
||||||
* @return the url for the product
|
|
||||||
*/
|
*/
|
||||||
private String getUrlForProduct(String context, EntityContext entityContext, String entityName, boolean unencrypted){
|
private String getUrlForProduct(String context, EntityContext entityContext, String entityName){
|
||||||
|
|
||||||
String toReturn = null;
|
String toReturn = null;
|
||||||
|
|
||||||
|
@ -1123,7 +1121,6 @@ public class DataCatalogueImpl implements DataCatalogue{
|
||||||
requestEntity.put("gcube_scope", context);
|
requestEntity.put("gcube_scope", context);
|
||||||
requestEntity.put("entity_context", entityContext.toString());
|
requestEntity.put("entity_context", entityContext.toString());
|
||||||
requestEntity.put("entity_name", entityName);
|
requestEntity.put("entity_name", entityName);
|
||||||
requestEntity.put("clear_url", Boolean.toString(unencrypted));
|
|
||||||
|
|
||||||
StringEntity params = new StringEntity(requestEntity.toJSONString(), ContentType.APPLICATION_JSON);
|
StringEntity params = new StringEntity(requestEntity.toJSONString(), ContentType.APPLICATION_JSON);
|
||||||
httpPostRequest.setEntity(params);
|
httpPostRequest.setEntity(params);
|
||||||
|
|
Loading…
Reference in New Issue