Changed structure of the library (which is now a gwt widget basically).

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@141741 82a268e6-3cf1-43bd-a215-b396298e98cf
feature/18039
Costantino Perciante 7 years ago
parent 67cf760cbb
commit c99954c9d5

@ -18,6 +18,11 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -20,6 +20,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
@ -32,5 +42,6 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
</natures>
</projectDescription>

@ -0,0 +1,2 @@
eclipse.preferences.version=1
entryPointModules=

@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.8

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>

@ -1,7 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-1-1"
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-2-0"
date="2017-02-01">
<Change>Added method to delete/purge group</Change>
<Change>Project structure and so packages are changed (gwt-widget like structure)</Change>
</Changeset>
<Changeset component="org.gcube.data-catalogue.ckan-util-library.2-1-0"
date="2016-12-01">

@ -10,7 +10,7 @@
</parent>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>ckan-util-library</artifactId>
<version>2.1.1-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CKan utility library</name>
@ -27,12 +27,13 @@
<properties>
<serviceClass>data-catalogue</serviceClass>
<distroDirectory>distro</distroDirectory>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jackanVersion>0.4.2</jackanVersion>
<postgresVersion>9.4.1208.jre7</postgresVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<gwtVersion>2.7.0</gwtVersion>
</properties>
<dependencyManagement>
<dependencies>
@ -47,6 +48,12 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
@ -140,8 +147,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ckanutilitylibrary'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.datacatalogue.ckanutillibrary.client.CkanUtilLibrary' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

@ -0,0 +1,16 @@
package org.gcube.datacatalogue.ckanutillibrary.client;
import com.google.gwt.core.client.EntryPoint;
/**
* Empty entry point module
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class CkanUtilLibrary implements EntryPoint {
@Override
public void onModuleLoad() {
}
}

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import static org.gcube.resources.discovery.icclient.ICFactory.client;
@ -11,7 +11,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.resources.gcore.utils.XPathHelper;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.exceptions.ApplicationProfileNotFoundException;
import org.gcube.datacatalogue.ckanutillibrary.server.exceptions.ApplicationProfileNotFoundException;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.Query;
import org.gcube.resources.discovery.client.queries.impl.QueryBox;

@ -1,15 +1,15 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import java.io.File;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.gcube.datacatalogue.ckanutillibrary.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.models.ResourceBean;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.server.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.server.models.ResourceBean;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.json.simple.JSONObject;
import eu.trentorise.opendata.jackan.model.CkanDataset;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import java.util.concurrent.ConcurrentHashMap;
@ -12,7 +12,7 @@ import org.slf4j.LoggerFactory;
public class DataCatalogueFactory {
private static final Logger logger = LoggerFactory.getLogger(DataCatalogueFactory.class);
private static final long MAX_LIFETIME = 1000 * 60 * 2; // 2 MINUTES
private static final long MAX_LIFETIME = 1000 * 60 * 30; // 30 MINUTES
private static DataCatalogueFactory instance = new DataCatalogueFactory();
private static ConcurrentHashMap<String, CacheBean> cache;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@ -30,14 +30,14 @@ import net.htmlparser.jericho.Renderer;
import net.htmlparser.jericho.Segment;
import net.htmlparser.jericho.Source;
import org.gcube.datacatalogue.ckanutillibrary.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.models.ResourceBean;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.ckanutillibrary.models.State;
import org.gcube.datacatalogue.ckanutillibrary.utils.UtilMethods;
import org.gcube.datacatalogue.ckanutillibrary.utils.url.EntityContext;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.server.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.server.models.ResourceBean;
import org.gcube.datacatalogue.ckanutillibrary.server.models.State;
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
import org.gcube.datacatalogue.ckanutillibrary.server.utils.url.EntityContext;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import static org.gcube.resources.discovery.icclient.ICFactory.client;
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
@ -18,10 +18,10 @@ import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
import org.gcube.common.resources.gcore.ServiceEndpoint.Property;
import org.gcube.common.resources.gcore.utils.XPathHelper;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.exceptions.ApplicationProfileNotFoundException;
import org.gcube.datacatalogue.ckanutillibrary.exceptions.NoApplicationProfileMasterException;
import org.gcube.datacatalogue.ckanutillibrary.exceptions.NoDataCatalogueRuntimeResourceException;
import org.gcube.datacatalogue.ckanutillibrary.exceptions.ServiceEndPointException;
import org.gcube.datacatalogue.ckanutillibrary.server.exceptions.ApplicationProfileNotFoundException;
import org.gcube.datacatalogue.ckanutillibrary.server.exceptions.NoApplicationProfileMasterException;
import org.gcube.datacatalogue.ckanutillibrary.server.exceptions.NoDataCatalogueRuntimeResourceException;
import org.gcube.datacatalogue.ckanutillibrary.server.exceptions.ServiceEndPointException;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.Query;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.exceptions;
package org.gcube.datacatalogue.ckanutillibrary.server.exceptions;
@SuppressWarnings("serial")
/**

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.exceptions;
package org.gcube.datacatalogue.ckanutillibrary.server.exceptions;
/**
* Thrown when there are more than one application profile, but none of them was set as master

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.exceptions;
package org.gcube.datacatalogue.ckanutillibrary.server.exceptions;
/**
* No Data Catalogue node found.

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.exceptions;
package org.gcube.datacatalogue.ckanutillibrary.server.exceptions;
/**
* Exception thrown when it is not possible retrieve information from the ServiceEndpoint

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.exceptions;
package org.gcube.datacatalogue.ckanutillibrary.server.exceptions;
/**
* Too many clusters in this scope exception.

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.server.models;
import java.io.Serializable;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.server.models;
import static com.google.common.base.Preconditions.checkNotNull;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.server.models;
/**
* Allowed relationships between packages(datasets). Some of them are not supported yet due to the problem

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.server.models;
import java.io.Serializable;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.server.models;
/**
* The current state of this group/user

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.utils;
package org.gcube.datacatalogue.ckanutillibrary.server.utils;
/**
* A list of attributes that are saved into http session.

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.utils;
package org.gcube.datacatalogue.ckanutillibrary.server.utils;
import java.net.HttpURLConnection;
import java.net.URL;

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.utils.url;
package org.gcube.datacatalogue.ckanutillibrary.server.utils.url;
/**
* Entity context for uri resolver

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary.models;
package org.gcube.datacatalogue.ckanutillibrary.shared;
/**
* Roles that user can have into organizations/groups.

@ -1,4 +1,4 @@
package org.gcube.datacatalogue.ckanutillibrary;
package org.gcube.datacatalogue.ckanutillibrary.server;
import java.util.ArrayList;
import java.util.Arrays;
@ -10,11 +10,14 @@ import java.util.Map.Entry;
import java.util.UUID;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.ckanutillibrary.utils.UtilMethods;
import org.gcube.datacatalogue.ckanutillibrary.server.ApplicationProfileScopePerUrlReader;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogueFactory;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogueImpl;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CKanUserWrapper;
import org.gcube.datacatalogue.ckanutillibrary.server.models.CkanDatasetRelationship;
import org.gcube.datacatalogue.ckanutillibrary.server.models.DatasetRelationships;
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.slf4j.LoggerFactory;
import eu.trentorise.opendata.jackan.CheckedCkanClient;
@ -193,7 +196,7 @@ public class TestDataCatalogueLib {
Iterator<Entry<String, List<RolesCkanGroupOrOrg>>> iterator = orgs.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<java.lang.String, java.util.List<org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg>> entry = (Map.Entry<java.lang.String, java.util.List<org.gcube.datacatalogue.ckanutillibrary.models.RolesCkanGroupOrOrg>>) iterator
Map.Entry<java.lang.String, java.util.List<org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg>> entry = (Map.Entry<java.lang.String, java.util.List<org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg>>) iterator
.next();
logger.debug("Org is " + entry.getKey() + " and role is " + entry.getValue().get(0));
Loading…
Cancel
Save