merged with "task_20699"

This commit is contained in:
Francesco Mangiacrapa 2021-04-09 15:39:48 +02:00
parent 8b69d1f6fd
commit d45f7e87a8
19 changed files with 71 additions and 69 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.9.3-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -13,7 +13,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.9.3-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -36,5 +36,5 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.9.3-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-2.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,6 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.9.3-SNAPSHOT
lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.0.0-SNAPSHOT
>>>>>>> refs/heads/task_20699
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,20 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="gcube-ckan-datacatalog-1.9.3-SNAPSHOT">
<wb-module deploy-name="gcube-ckan-datacatalog-2.0.0-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="context-root" value="gcube-ckan-datacatalog"/>
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</wb-module>
</project-modules>

View File

@ -4,11 +4,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.0.0-SNAPSHOT] - 2021-02-12
#### Enhancements
[#20699] Migrate the gcube-ckan-datacatalog to catalogue-util-library
## [v1.9.3] - 2021-03-09
Just to include the ckan2zenodo-library 1.x
## [v1.9.2] - 2021-02-08
#### Bug fixes

26
pom.xml
View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.gcubeckan</groupId>
<artifactId>gcube-ckan-datacatalog</artifactId>
<packaging>war</packaging>
<version>1.9.3</version>
<version>2.0.0-SNAPSHOT</version>
<name>gCube CKAN Data Catalog</name>
<description>The gCube CKAN Data Catalog portlet</description>
@ -101,22 +101,17 @@
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
</dependency>
<!-- Metadata publisher widget -->
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>grsf-manage-widget</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>ckan-util-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan-metadata-publisher-widget</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
<version>[2.0.0-SNAPSHOT,3.0.0)</version>
<scope>compile</scope>
</dependency>
@ -125,15 +120,14 @@
<artifactId>ckan2zenodo-publisher-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.gcube.data-publishing</groupId>
<artifactId>gcat-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.gcube.portlets.widgets</groupId> -->
<!-- <artifactId>session-checker</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- <scope>provided</scope> -->
<!-- </dependency> -->
<dependency>
<groupId>org.gcube.resources</groupId>
<artifactId>registry-publisher</artifactId>

View File

@ -23,7 +23,7 @@
<inherits
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
<inherits name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.datacatalogue.utillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />

View File

@ -95,7 +95,7 @@ public class CkanEventHandlerManager {
@Override
public void onInsertMetadata(InsertMetadataEvent loadSelecteReleaseEvent) {
GWT.log("loadSelecteReleaseEvent: "+loadSelecteReleaseEvent);
final Modal modal = new Modal(true, true);
modal.setTitle(WIDGET_CREATE_TITLE);
@ -104,16 +104,19 @@ public class CkanEventHandlerManager {
((Element)modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
modal.add(new CreateDatasetForm(eventBus));
modal.setCloseVisible(true);
modal.show();
// hide any popup panel opened
modal.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent hideEvent) {
GWT.log("HideEvent on modal fired");
eventBus.fireEvent(new CloseCreationFormEvent());
}
});
GWT.log("show");
modal.show();
}
});
// bind on edit (TODO)

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
import java.util.List;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGroupRole;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;

View File

@ -5,7 +5,7 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
import java.util.List;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGroupRole;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;

View File

@ -8,7 +8,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowRevertOperationWidgetEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.resource.CkanPortletResources;

View File

@ -17,11 +17,13 @@ import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogueFactory;
import org.gcube.datacatalogue.ckanutillibrary.server.utils.CatalogueUtilMethods;
import org.gcube.datacatalogue.ckanutillibrary.server.utils.SessionCatalogueAttributes;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.utillibrary.server.DataCatalogueFactory;
import org.gcube.datacatalogue.utillibrary.server.utils.CatalogueUtilMethods;
import org.gcube.datacatalogue.utillibrary.server.utils.SessionCatalogueAttributes;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanGroup;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanOrganization;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.thread.UpdateItemCatalogueResource;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGroupRole;
@ -34,8 +36,6 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import eu.trentorise.opendata.jackan.model.CkanGroup;
import eu.trentorise.opendata.jackan.model.CkanOrganization;
/**
* The server side implementation of the RPC service.
*
@ -305,9 +305,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
try{
DataCatalogue catalogue = getCatalogue(context);
String apiKey = catalogue.getApiKeyFromUsername(username);
toReturn = new ArrayList<OrganizationBean>();
Map<String, Map<CkanGroup, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByGroup(username, apiKey);
Map<String, Map<CkanGroup, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByGroup(username);
Set<Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>>> set = mapRoleGroup.entrySet();
for (Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>> entry : set) {
Set<Entry<CkanGroup, RolesCkanGroupOrOrg>> subSet = entry.getValue().entrySet();
@ -411,8 +410,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
}else{
logger.debug("Organizations list wasn't into session, retrieving them");
DataCatalogue catalogue = getCatalogue(scopePerCurrentUrl);
String apiKey = catalogue.getApiKeyFromUsername(username);
Map<String, Map<CkanOrganization, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByOrganization(username, apiKey);
Map<String, Map<CkanOrganization, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByOrganization(username);
Set<Entry<String, Map<CkanOrganization, RolesCkanGroupOrOrg>>> set = mapRoleGroup.entrySet();
for (Entry<String, Map<CkanOrganization, RolesCkanGroupOrOrg>> entry : set) {
Set<Entry<CkanOrganization, RolesCkanGroupOrOrg>> subSet = entry.getValue().entrySet();
@ -458,9 +456,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
}else{
logger.debug("Groups list wasn't into session, retrieving them");
DataCatalogue catalogue = getCatalogue(scopePerCurrentUrl);
String apiKey = catalogue.getApiKeyFromUsername(username);
Map<String, Map<CkanGroup, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByGroup(username, apiKey);
Map<String, Map<CkanGroup, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByGroup(username);
Set<Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>>> set = mapRoleGroup.entrySet();
for (Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>> entry : set) {
Set<Entry<CkanGroup, RolesCkanGroupOrOrg>> subSet = entry.getValue().entrySet();

View File

@ -8,7 +8,7 @@ import javax.servlet.http.HttpSession;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.server.ApplicationProfileScopePerUrlReader;
import org.gcube.datacatalogue.utillibrary.server.ApplicationProfileScopePerUrlReader;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;

View File

@ -9,8 +9,9 @@ import java.util.Map;
import javax.servlet.http.HttpSession;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanOrganization;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.thread.AddUserToOrganizationThread;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
import org.gcube.vomanagement.usermanagement.GroupManager;
@ -30,7 +31,7 @@ import org.gcube.vomanagement.usermanagement.model.GatewayRolesNames;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import eu.trentorise.opendata.jackan.model.CkanOrganization;
/**

View File

@ -7,8 +7,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.server.DataCatalogue;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.UserUtil;
import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.RoleManager;

View File

@ -16,7 +16,6 @@ import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.informationsystem.publisher.RegistryPublisher;
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
import org.gcube.portlets.widgets.ckandatapublisherwidget.server.threads.WritePostCatalogueManagerThread;
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;
@ -36,6 +35,8 @@ public class UpdateItemCatalogueResource extends Thread{
private String currentScope;
private String cleanUrl;
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(UpdateItemCatalogueResource.class);
public static final String APPLICATION_ID_CATALOGUE_MANAGER = "org.gcube.datacatalogue.ProductCatalogue";
/**
@ -71,7 +72,7 @@ public class UpdateItemCatalogueResource extends Thread{
// check if the resource is present
Query q = new QueryBox("for $profile in collection('/db/Profiles/GenericResource')//Resource " +
"where $profile/Profile/SecondaryType/string() eq 'ApplicationProfile' and $profile/Profile/Body/AppId/string() " +
" eq '" + WritePostCatalogueManagerThread.APPLICATION_ID_CATALOGUE_MANAGER + "'" +
" eq '" + APPLICATION_ID_CATALOGUE_MANAGER + "'" +
"return $profile");
DiscoveryClient<String> client = client();

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared;
import java.io.Serializable;
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
import org.gcube.datacatalogue.utillibrary.shared.RolesCkanGroupOrOrg;
/**
* A bean that contains the tuple:

View File

@ -23,7 +23,7 @@
<inherits
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
<inherits name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.datacatalogue.utillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />

View File

@ -48,7 +48,7 @@ h1 {
}
}
@media(min-height: 800px) {
@media(min-height: 500px) {
.modal-body-custom {
max-height: 500px !important;
}
@ -58,6 +58,10 @@ h1 {
top: 2% !important;
}
.modal-body-custom {
max-height: 700px !important;
}
/** My Organizations panel **/
.my-organizations-container-style {
background-attachment: scroll !important;
@ -90,7 +94,7 @@ h1 {
box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05) !important;
position: relative !important;
background-color: #fff !important;
padding-left: 5% !important !important;
padding-left: 5% !important;
}
.list-panel-organizations-style {

View File

@ -2,14 +2,18 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript"
src="gCubeCkanDataCatalog/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript"
src="gCubeCkanDataCatalog/js/bootstrap.min.js"></script>
<link type="text/css" rel="stylesheet" href="GCubeCkanDataCatalog.css">
<link type="text/css" rel="stylesheet"
href="gCubeCkanDataCatalog/css/ol.css">
<script type="text/javascript"
src=gCubeCkanDataCatalog/js/jquery-1.10.1.min.js></script>
<script type="text/javascript"
src=gCubeCkanDataCatalog/js/bootstrap.min.js></script>
<script type="text/javascript" src=gCubeCkanDataCatalog/js/ol.js></script>
<script type="text/javascript" src="gCubeCkanDataCatalog/js/ol.js"></script>
<script type="text/javascript"
src="gCubeCkanDataCatalog/gCubeCkanDataCatalog.nocache.js"></script>