Compare commits

..

13 Commits

25 changed files with 1111 additions and 312 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.2.6-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.3.1/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -30,5 +30,10 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-2.2.6-SNAPSHOT/WEB-INF/classes"/>
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-2.3.1/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-2.3.1/WEB-INF/classes"/>
</classpath>

View File

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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -53,8 +53,72 @@
<wb-module deploy-name="gcube-ckan-datacatalog-2.2.6-SNAPSHOT">
<wb-module deploy-name="gcube-ckan-datacatalog-2.3.1">
@ -109,7 +173,39 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -164,7 +260,39 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -219,7 +347,57 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="metadata-profile-form-builder-widget-2.1.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -274,7 +452,39 @@
<property name="context-root" value="gcube-ckan-datacatalog"/>
@ -329,7 +539,39 @@
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -384,7 +626,39 @@
</wb-module>

View File

@ -4,6 +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.3.1] - 2024-05-14
- Included `ckan-metadata-publisher-widget` with bug fix [#27455] and new feature [#27467]
## [v2.3.0] - 2024-02-02
- Supported the Edit facility [#26639]
- Supported the Delete facility [#26793]
- Revisited the Navigation Bar
- Revisited the "Select Item Resources" step when publishing from Workspace [#26874]
- Catalogue at root VO or VO level works in read only mode [#26854]
## [v2.2.7] - 2023-12-21
- Including "Upload to Zenodo" fix [#26166]

View File

@ -1,6 +1,6 @@
# gCube D4Science Data Catalog
The "gCube Data Catalogue" or "Catalogue" is a system that provides facilities for: a) (meta)data publishing and management based on roles; b) vres' products publishing; c) making data products publicly available; d) enriching products of metadata to maximise their potential reuse and making them searchable (via title, tags etc) are based on the CKAN technology. The Catalogue application allows to show all the metadata available in the CKAN instance, as well as publish a new product, retrieve the list of organizations (i.e. Virtual Research Environments) to which the user belongs and his/her already published products. Moreover, the "Catalgoue" application (via configuration) provides moderation of its content enabling the user/s with the Moderator role to approve/reject the products under review.
The "gCube Data Catalogue" or "Catalogue" is a system that provides facilities for: a) (meta)data publishing and management based on roles; b) vres' products publishing; c) making data products publicly available; d) enriching products of metadata to maximise their potential reuse and making them searchable (via title, tags etc) are based on the CKAN technology. The Catalogue application allows to show all the metadata available in the CKAN instance, as well as publish a new product, retrieve the list of organizations (i.e. Virtual Research Environments) to which the user belongs and his/her already published products. Moreover, the "Catalogue" application (via configuration) provides moderation of its content enabling the user/s with the Moderator role to approve/reject the products under review.
## Built With

43
pom.xml
View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.gcubeckan</groupId>
<artifactId>gcube-ckan-datacatalog</artifactId>
<packaging>war</packaging>
<version>2.2.7</version>
<version>2.3.1</version>
<name>gCube CKAN Data Catalog</name>
<description>The gCube CKAN Data Catalog portlet</description>
@ -27,6 +27,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<gcube-portal-bom-version>3.7.0</gcube-portal-bom-version>
</properties>
<scm>
@ -34,13 +35,42 @@
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm>
<profiles>
<!-- PROD profile -->
<!-- <profile> -->
<!-- <id>catalogue-release-profile</id> -->
<!-- <activation> -->
<!-- <property> -->
<!-- <name>Release</name> -->
<!-- </property> -->
<!-- </activation> -->
<!-- <properties> -->
<!-- <gcube-portal-bom-version>3.7.0</gcube-portal-bom-version> -->
<!-- <storagehub-version-range>[1.0.0,2.0.0-SNAPSHOT)</storagehub-version-range> -->
<!-- </properties> -->
<!-- </profile> -->
<!-- DEV profile -->
<!-- <profile> -->
<!-- <id>catalogue-snapshot-profile</id> -->
<!-- <activation> -->
<!-- <property> -->
<!-- <name>!Release</name> -->
<!-- </property> -->
<!-- </activation> -->
<!-- <properties> -->
<!-- <gcube-portal-bom-version>3.8.0-SNAPSHOT</gcube-portal-bom-version> -->
<!-- <storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range> -->
<!-- </properties> -->
<!-- </profile> -->
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.4</version>
<version>${gcube-portal-bom-version}</version>
<type>pom</type>
<scope>import</scope>
<exclusions>
@ -55,7 +85,6 @@
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
@ -125,6 +154,12 @@
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>metadata-profile-form-builder-widget</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan-metadata-publisher-widget</artifactId>

View File

@ -20,6 +20,10 @@
<inherits
name='org.gcube.portlets_widgets.catalogue_sharing_widget.ShareCatalogue' />
<inherits
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
<inherits
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
<inherits
@ -29,6 +33,9 @@
<inherits
name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits
name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<inherits
name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
<inherits
@ -36,7 +43,6 @@
<inherits
name='org.gcube.portlets.widgets.ckancontentmoderator.CkanContentModeratorWidget' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />

View File

@ -7,6 +7,8 @@ import org.gcube.datacatalogue.grsf_manage_widget.client.view.ManageProductWidge
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ClickedCMSManageProductButtonEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ClickedCMSManageProductButtonEventHandler;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.DeleteItemEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.DeleteItemEventHandler;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEventHandler;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent;
@ -39,7 +41,11 @@ import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModerat
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorWidgetTrusted;
import org.gcube.portlets.widgets.ckancontentmoderator.client.ContentModeratorWidgetConstants;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.DISPLAY_FIELD;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEvent;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEventHandler;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.action.DeleteItemPanel;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.form.CreateDatasetForm;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.form.UpdateDatasetForm;
import org.gcube.portlets_widgets.catalogue_sharing_widget.client.ShareCatalogueWidget;
import com.github.gwtbootstrap.client.ui.Modal;
@ -95,6 +101,7 @@ public class CkanEventHandlerManager {
}
});
// bind on insert metadata
eventBus.addHandler(InsertMetadataEvent.TYPE, new InsertMetadataEventHandler() {
@ -117,7 +124,7 @@ public class CkanEventHandlerManager {
// public void onHide(HideEvent hideEvent) {
// GWT.log("HideEvent on modal fired");
// GWT.log(hideEvent.toDebugString());
// eventBus.fireEvent(new CloseCreationFormEvent());
// eventBus.fireEvent(new CloseCreationFormProfileEvent());
//
// hideEvent.preventDefault();
// hideEvent.stopPropagation();
@ -130,15 +137,6 @@ public class CkanEventHandlerManager {
modal.show();
}
});
// bind on edit (TODO)
eventBus.addHandler(EditMetadataEvent.TYPE, new EditMetadataEventHandler() {
@Override
public void onEditMetadata(EditMetadataEvent editMetadataEvent) {
// TODO Auto-generated method stub
}
});
// show datasets event
eventBus.addHandler(ShowDatasetsEvent.TYPE, new ShowDatasetsEventHandler() {
@ -146,14 +144,37 @@ public class CkanEventHandlerManager {
@Override
public void onShowDatasets(ShowDatasetsEvent showUserDatasetsEvent) {
String request = null;
if (showUserDatasetsEvent.isOwnOnly())
request = getCkanRequest("/dashboard/datasets", null);
else
request = getCkanRequest("/dataset", null);
if (showUserDatasetsEvent.getDatasetId() == null) {
if (showUserDatasetsEvent.isOwnOnly()) {
request = getCkanRequest("/dashboard/datasets", null);
} else {
request = getCkanRequest("/dataset", null);
}
} else {
String datasetId = showUserDatasetsEvent.getDatasetId();
request = getCkanRequest("/dataset/" + datasetId, null);
}
gcubeCkanDataCatalogue.instanceCkanFrame(request);
}
});
// ReloadDatasetPageEvent is declared in the Publisher Widget
eventBus.addHandler(ReloadDatasetPageEvent.TYPE, new ReloadDatasetPageEventHandler() {
@Override
public void onReloadDatasetPage(ReloadDatasetPageEvent addResourceEvent) {
if (addResourceEvent.getDatasetIDorName() != null) {
eventBus.fireEvent(new ShowDatasetsEvent(false, addResourceEvent.getDatasetIDorName()));
} else {
eventBus.fireEvent(new ShowDatasetsEvent(false));
}
}
});
eventBus.addHandler(ShowTypesEvent.TYPE, new ShowTypesEventHandler() {
@Override
@ -201,29 +222,6 @@ public class CkanEventHandlerManager {
}
});
// eventBus.addHandler(NotifyLogoutEvent.TYPE, new NotifyLogoutEventHandler() {
//
// @Override
// public void onLogout(NotifyLogoutEvent editMetadataEvent) {
//
// // CKanLeaveFrame frame = new
// CKanLeaveFrame(GCubeCkanDataCatalog.CKAN_LOGUT_SERVICE);
// // DOM.appendChild(RootPanel.getBodyElement(), frame.getElement());
// }
// });
//
// eventBus.addHandler(IFrameInstanciedEvent.TYPE, new
// IFrameInstanciedEventHandler() {
//
// @Override
// public void onNewInstance(IFrameInstanciedEvent iFrameInstanciedEvent) {
//
// gcubeCkanDataCatalogue.updateSize();
// if(logoutFromCKANURL==null)
// instanceLogoutSystem();
// }
// });
eventBus.addHandler(ShowManageProductWidgetEvent.TYPE, new ShowManageProductWidgetEventHandler() {
@Override
@ -305,6 +303,55 @@ public class CkanEventHandlerManager {
}
});
eventBus.addHandler(EditMetadataEvent.TYPE, new EditMetadataEventHandler() {
@Override
public void onEditMetadata(EditMetadataEvent editMetadataEvent) {
GWT.log("editMetadataEvent: " + editMetadataEvent);
if (editMetadataEvent.getItemID() != null) {
final Modal modal = new ExtModal(true, true);
modal.setTitle("Update Item");
modal.addStyleName("insert-metadata-modal-style");
modal.addStyleName("modal-top-custom");
((Element) modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
modal.add(new UpdateDatasetForm(eventBus, editMetadataEvent.getItemID()));
modal.setCloseVisible(true);
GWT.log("show");
modal.show();
}
}
});
eventBus.addHandler(DeleteItemEvent.TYPE, new DeleteItemEventHandler() {
@Override
public void onDeleteItem(DeleteItemEvent deleteItemEvent) {
GWT.log("deleteItemEvent: " + deleteItemEvent);
if (deleteItemEvent.getItemID() != null) {
GWT.log("deleteItemEvent: " + deleteItemEvent);
final Modal modal = new ExtModal(true, true);
modal.setTitle("Delete Item");
modal.addStyleName("modal-top-custom");
((Element) modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
modal.add(new DeleteItemPanel(eventBus, deleteItemEvent.getItemID()));
modal.setCloseVisible(true);
GWT.log("show");
modal.show();
}
}
});
}
/**

View File

@ -26,6 +26,8 @@ public class GCubeCkanDataCatalog implements EntryPoint {
public static final String GET_QUERY_STRING_PARAMETER = "query_string";
public static final String REVERT_QUERY_PARAM = "manage";
public static final String GCUBE_CKAN_IFRAME = "gcube-ckan-iframe";
//public static final String LOGGED_IN_DIV = "logged_in";
/**
* This is the entry point method.
@ -36,5 +38,8 @@ public class GCubeCkanDataCatalog implements EntryPoint {
eventManager.getEventBus());
eventManager.setPanel(panel);
}
}

View File

@ -0,0 +1,66 @@
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class DeleteItemEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 19, 2024
*/
public class DeleteItemEvent extends GwtEvent<DeleteItemEventHandler> {
public static Type<DeleteItemEventHandler> TYPE = new Type<DeleteItemEventHandler>();
private String itemID;
/**
* Instantiates a new delete item event.
*
* @param itemID the item ID
*/
public DeleteItemEvent(String itemID) {
this.itemID = itemID;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
/*
* (non-Javadoc)
*
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<DeleteItemEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
/*
* (non-Javadoc)
*
* @see
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
* EventHandler)
*/
@Override
protected void dispatch(DeleteItemEventHandler handler) {
handler.onDeleteItem(this);
}
/**
* Gets the item ID.
*
* @return the item ID
*/
public String getItemID() {
return itemID;
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface DeleteItemEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 19, 2024
*/
public interface DeleteItemEventHandler extends EventHandler {
/**
* On delete item.
*
* @param deleteItemEvent the delete item event
*/
void onDeleteItem(DeleteItemEvent deleteItemEvent);
}

View File

@ -11,14 +11,22 @@ import com.google.gwt.event.shared.GwtEvent;
*/
public class EditMetadataEvent extends GwtEvent<EditMetadataEventHandler> {
public static Type<EditMetadataEventHandler> TYPE = new Type<EditMetadataEventHandler>();
private String itemID;
/**
* Instantiates a new insert metadata event.
* Instantiates a new edits the metadata event.
*
* @param itemID the item ID
*/
public EditMetadataEvent() {
public EditMetadataEvent(String itemID) {
this.itemID = itemID;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@ -27,6 +35,11 @@ public class EditMetadataEvent extends GwtEvent<EditMetadataEventHandler> {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
*/
@ -34,5 +47,9 @@ public class EditMetadataEvent extends GwtEvent<EditMetadataEventHandler> {
protected void dispatch(EditMetadataEventHandler handler) {
handler.onEditMetadata(this);
}
public String getItemID() {
return itemID;
}
}

View File

@ -2,25 +2,28 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class NotifyLogoutEvent.
* The Class IFrameInstanciedEvent.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 23, 2016
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jun 23, 2016
*/
public class IFrameInstanciedEvent extends GwtEvent<IFrameInstanciedEventHandler> {
public static Type<IFrameInstanciedEventHandler> TYPE = new Type<IFrameInstanciedEventHandler>();
/**
* Instantiates a new insert metadata event.
*/
public IFrameInstanciedEvent() {
}
/* (non-Javadoc)
/**
* Gets the associated type.
*
* @return the associated type
*/
/*
* (non-Javadoc)
*
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
@ -28,8 +31,17 @@ public class IFrameInstanciedEvent extends GwtEvent<IFrameInstanciedEventHandler
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
/**
* Dispatch.
*
* @param handler the handler
*/
/*
* (non-Javadoc)
*
* @see
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
* EventHandler)
*/
@Override
protected void dispatch(IFrameInstanciedEventHandler handler) {

View File

@ -2,17 +2,15 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface IFrameInstanciedEentHandler.
* The Interface IFrameInstanciedEventHandler.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 23, 2016
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 13, 2024
*/
public interface IFrameInstanciedEventHandler extends EventHandler {
/**
* On new instance.
*

View File

@ -3,29 +3,57 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
import com.google.gwt.event.shared.GwtEvent;
/**
* Raised when the user wants to see his datasets.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
* The Class ShowDatasetsEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Feb 13, 2024
*/
public class ShowDatasetsEvent extends GwtEvent<ShowDatasetsEventHandler>{
public class ShowDatasetsEvent extends GwtEvent<ShowDatasetsEventHandler> {
public static Type<ShowDatasetsEventHandler> TYPE = new Type<ShowDatasetsEventHandler>();
private boolean ownOnly;
private String datasetId;
/**
* Instantiates a new show user datasets event.
*
* @param ownOnly the own only
*/
public ShowDatasetsEvent(boolean ownOnly) {
this.ownOnly = ownOnly;
}
/**
* Instantiates a new show user datasets event.
*
* @param ownOnly the own only
* @param datasetId the dataset id
*/
public ShowDatasetsEvent(boolean ownOnly, String datasetId) {
this.ownOnly = ownOnly;
this.datasetId = datasetId;
}
/**
* Checks if is own only.
*
* @return true, if is own only
*/
public boolean isOwnOnly() {
return ownOnly;
}
/* (non-Javadoc)
/**
* Gets the associated type.
*
* @return the associated type
*/
/*
* (non-Javadoc)
*
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
@ -33,12 +61,25 @@ public class ShowDatasetsEvent extends GwtEvent<ShowDatasetsEventHandler>{
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
/**
* Dispatch.
*
* @param handler the handler
*/
/*
* (non-Javadoc)
*
* @see
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
* EventHandler)
*/
@Override
protected void dispatch(ShowDatasetsEventHandler handler) {
handler.onShowDatasets(this);
}
public String getDatasetId() {
return datasetId;
}
}

View File

@ -4,6 +4,7 @@
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ClickedCMSManageProductButtonEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.DeleteItemEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.PublishOnZenodoEvent;
@ -16,12 +17,14 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowOrgani
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowStatisticsEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowTypesEvent;
import com.github.gwtbootstrap.client.ui.AlertBlock;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.DropdownButton;
import com.github.gwtbootstrap.client.ui.Label;
import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.github.gwtbootstrap.client.ui.NavLink;
import com.github.gwtbootstrap.client.ui.Navbar;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.FontWeight;
import com.google.gwt.dom.client.Style.Unit;
@ -44,9 +47,6 @@ public class CkanMetadataManagementPanel extends FlowPanel {
public static final String CATALOGUE_ITEMS_WERE_APPROVED_BY_CATALOGUE_MODERATOR_S = "Catalogue items were approved by Catalogue Moderator(s).";
/**
*
*/
private static final String MY_PREFIX = "My ";
private static final String MANAGE_GRSF_ITEM_TOOLTIP = "By pushing on this button, you will be able to manage the item you are viewing."
@ -55,7 +55,7 @@ public class CkanMetadataManagementPanel extends FlowPanel {
private static final String MANAGE_CMS_ITEMS_TOOLTIP = "By pushing on this button, you will be able to manage (APPROVING or REJECTING) the item under approval."
+ " Manageable items are not APPROVED and NOT PUBLISHED in the Catalogue.";
private AlertBlock nav = new AlertBlock();
private Navbar nav = new Navbar();
// generic
private Button home = new Button("Home");
@ -65,11 +65,14 @@ public class CkanMetadataManagementPanel extends FlowPanel {
private Button types = new Button("Types");
// user's own
private InlineHTML separatorMyInfo = null;
private InlineHTML separatorAdminButtons = null;
private Button myDatasets = new Button("My Items");
private Button myOrganizations = new Button("My Organizations");
private Button myGroups = new Button("My Groups");
private InlineHTML pipe_MyInfo_start = null;
private InlineHTML pipe_PublishItem_start = null;
private InlineHTML pipe_SelectedItemOptions_start = null;
private DropdownButton dropMyOptionButtons = new DropdownButton("My...");
private NavLink myDatasets = new NavLink("My Items");
private NavLink myOrganizations = new NavLink("My Organizations");
private NavLink myGroups = new NavLink("My Groups");
// statistics
private Button statistics = new Button("Statistics");
@ -78,7 +81,8 @@ public class CkanMetadataManagementPanel extends FlowPanel {
private Button shareLink = new Button("Share Link");
private Button uploadToZenodo = new Button("Upload to Zenodo");
private Button insertMeta = new Button("Publish Item");
private Button editMeta = new Button("Edit Item");
private Button editMeta = new Button("Update Item");
private Button deleteItem = new Button("Delete Item");
private Button manageGRSFProduct = new Button("Manage GRSF Item"); // GRSF Manage
private Button manageCModS = new Button("Manage Items"); // Moderation
@ -103,25 +107,20 @@ public class CkanMetadataManagementPanel extends FlowPanel {
items.setType(ButtonType.LINK);
types.setType(ButtonType.LINK);
myDatasets.setType(ButtonType.LINK);
myOrganizations.setType(ButtonType.LINK);
myGroups.setType(ButtonType.LINK);
statistics.setType(ButtonType.LINK);
shareLink.setType(ButtonType.LINK);
uploadToZenodo.setType(ButtonType.LINK);
insertMeta.setType(ButtonType.LINK);
editMeta.setType(ButtonType.LINK);
deleteItem.setType(ButtonType.LINK);
manageGRSFProduct.setType(ButtonType.PRIMARY);
manageGRSFProduct.getElement().getStyle().setFloat(Float.RIGHT);
manageCModS.setType(ButtonType.PRIMARY);
manageCModS.getElement().getStyle().setFloat(Float.RIGHT);
manageCModS.getElement().getStyle().setMarginRight(20, Unit.PX);
// messageModerationEnanbled.setType(AlertType.INFO);
// messageModerationEnanbled.setClose(false);
// messageModerationEnanbled.addStyleName("moderation-message");
messageModerationEnanbled.setTitle(MESSAGE_MODERATED_CATALOGUE);
messageModerationEnanbled.getElement().setInnerHTML("<i class='icon-user'></i> " + MESSAGE_MODERATED_CATALOGUE);
messageModerationEnanbled.addStyleName("moderation-enabled-flag");
@ -139,15 +138,24 @@ public class CkanMetadataManagementPanel extends FlowPanel {
myGroups.setIcon(IconType.GROUP);
insertMeta.setIcon(IconType.FILE);
editMeta.setIcon(IconType.EDIT_SIGN);
deleteItem.setIcon(IconType.REMOVE_CIRCLE);
statistics.setIcon(IconType.BAR_CHART);
manageGRSFProduct.setIcon(IconType.CHECK_SIGN);
manageCModS.setIcon(IconType.CHECK_SIGN);
// hide edit and insert
// disabling share and upload
shareLink.setEnabled(false);
uploadToZenodo.setEnabled(false);
// hide upload to zenodo
uploadToZenodo.setVisible(false);
// hide publish/update/delete
editMeta.setVisible(false);
deleteItem.setVisible(false);
insertMeta.setVisible(false);
// hide manage GRSF product and Moderation
manageGRSFProduct.setVisible(false);
manageGRSFProduct.setEnabled(false);
manageCModS.setVisible(false);
@ -163,6 +171,9 @@ public class CkanMetadataManagementPanel extends FlowPanel {
manageCModS.getElement().getStyle().setFontWeight(FontWeight.BOLD);
nav.add(messageModerationEnanbled);
nav.setId("the_catalogue_nav_bar");
nav.addStyleName("nav_bar_catalogue");
// add to navigation bar
nav.add(home);
nav.add(organizations);
@ -170,25 +181,37 @@ public class CkanMetadataManagementPanel extends FlowPanel {
nav.add(items);
nav.add(types);
nav.add(statistics);
separatorMyInfo = new InlineHTML("<span style=\"font-weight:bold;vertical-alignment:middle;\">|</span>");
separatorMyInfo.setVisible(true);
nav.add(separatorMyInfo);
nav.add(myOrganizations);
nav.add(myGroups);
nav.add(myDatasets);
separatorAdminButtons = new InlineHTML("<span style=\"font-weight:bold;vertical-alignment:middle;\">|</span>");
separatorAdminButtons.setVisible(true);
nav.add(separatorAdminButtons);
pipe_MyInfo_start = new InlineHTML(
"<span style=\"font-weight:bold;vertical-alignment:middle;margin:0 5px;\">|</span>");
pipe_MyInfo_start.setVisible(true);
nav.add(pipe_MyInfo_start);
dropMyOptionButtons.setBaseIcon(IconType.USER);
dropMyOptionButtons.add(myOrganizations);
dropMyOptionButtons.add(myGroups);
dropMyOptionButtons.add(myDatasets);
dropMyOptionButtons.setType(ButtonType.LINK);
nav.add(dropMyOptionButtons);
pipe_PublishItem_start = new InlineHTML(
"<span style=\"font-weight:bold;vertical-alignment:middle;margin:0 5px;\">|</span>");
pipe_PublishItem_start.setVisible(false);
nav.add(pipe_PublishItem_start);
nav.add(insertMeta);
pipe_SelectedItemOptions_start = new InlineHTML(
"<span style=\"font-weight:bold;vertical-alignment:middle;margin:0 5px;\">|</span>");
pipe_SelectedItemOptions_start.setVisible(true);
nav.add(pipe_SelectedItemOptions_start);
nav.add(editMeta);
nav.add(deleteItem);
nav.add(shareLink);
nav.add(uploadToZenodo);
nav.add(insertMeta);
nav.add(editMeta);
nav.add(manageGRSFProduct);
nav.add(manageCModS);
nav.setClose(false);
nav.setType(AlertType.INFO);
nav.getElement().getStyle().setMarginBottom(0, Unit.PX);
nav.getElement().getStyle().setBackgroundColor("#FFF");
addHandlers();
add(nav);
}
@ -261,8 +284,18 @@ public class CkanMetadataManagementPanel extends FlowPanel {
@Override
public void onClick(ClickEvent event) {
GWT.log("Edit Meta clicked");
eventBus.fireEvent(
new EditMetadataEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
}
});
eventBus.fireEvent(new EditMetadataEvent());
deleteItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GWT.log("Delete item clicked");
eventBus.fireEvent(new DeleteItemEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
}
});
@ -358,17 +391,12 @@ public class CkanMetadataManagementPanel extends FlowPanel {
}
/**
* Those buttons can be only visible when the logged user has role
* edit/admin/sysadmin.
* Enable publish button.
*
* @param show the show
* @param enable the enable
*/
public void showInsertAndEditProductButtons(boolean show) {
// editMeta.setVisible(show); TODO
// separatorAdminButtons.setVisible(show);
insertMeta.setVisible(show);
public void enablePublishItemButton(boolean enable) {
insertMeta.setEnabled(enable);
}
/**
@ -391,7 +419,7 @@ public class CkanMetadataManagementPanel extends FlowPanel {
/**
* Button to manage the products under moderation via Content Moderation System
* (CMS)
* (CMS).
*
* @param value true or false
*/
@ -436,6 +464,24 @@ public class CkanMetadataManagementPanel extends FlowPanel {
uploadToZenodo.setEnabled(value);
}
/**
* Enable edit item button.
*
* @param value the value
*/
public void enableEditItemButton(boolean value) {
editMeta.setEnabled(value);
}
/**
* Enable delete item button.
*
* @param value the value
*/
public void enableDeleteItemButton(boolean value) {
deleteItem.setEnabled(value);
}
/**
* Visibility publish on zenodo button.
*
@ -445,20 +491,55 @@ public class CkanMetadataManagementPanel extends FlowPanel {
uploadToZenodo.setVisible(value);
}
/**
* Visibility publish item button.
*
* @param value the value
* @param alsoThePipe the also the pipe. If true set bool value also the related
* pipe 'pipe_PublishItem_start'
*/
public void visibilityPublishItemButton(boolean bool, boolean alsoThePipe) {
insertMeta.setVisible(bool);
if (alsoThePipe) {
pipe_PublishItem_start.setVisible(bool);
}
}
/**
* Visibility edit item button.
*
* @param value the value
*/
public void visibilityEditItemButton(boolean value) {
editMeta.setVisible(value);
}
/**
* Visibility delete item button.
*
* @param value the value
*/
public void visibilityDeleteItemButton(boolean value) {
deleteItem.setVisible(value);
}
/**
* Show only home/statistics buttons.
*/
public void doNotShowUserRelatedInfo() {
separatorMyInfo.setVisible(false);
separatorAdminButtons.setVisible(false);
pipe_MyInfo_start.setVisible(false);
pipe_PublishItem_start.setVisible(false);
pipe_SelectedItemOptions_start.setVisible(false);
shareLink.setVisible(false);
uploadToZenodo.setVisible(false);
insertMeta.setVisible(false);
editMeta.setVisible(false);
myDatasets.setVisible(false);
myOrganizations.setVisible(false);
myGroups.setVisible(false);
deleteItem.setVisible(false);
dropMyOptionButtons.setVisible(false);
// myDatasets.setVisible(false);
// myOrganizations.setVisible(false);
// myGroups.setVisible(false);
manageGRSFProduct.setVisible(false);
manageCModS.setVisible(false);
@ -474,11 +555,12 @@ public class CkanMetadataManagementPanel extends FlowPanel {
groups.setVisible(false);
items.setVisible(false);
types.setVisible(false);
separatorMyInfo.setVisible(false);
separatorAdminButtons.setVisible(false);
myDatasets.setVisible(false);
myOrganizations.setVisible(false);
myGroups.setVisible(false);
pipe_MyInfo_start.setVisible(false);
pipe_PublishItem_start.setVisible(false);
dropMyOptionButtons.setVisible(false);
// myDatasets.setVisible(false);
// myOrganizations.setVisible(false);
// myGroups.setVisible(false);
statistics.setVisible(false);
manageGRSFProduct.setVisible(false);
manageCModS.setVisible(false);

View File

@ -181,24 +181,59 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
@Override
public void onFailure(Throwable caught) {
showEditInsertButtons(false);
managementPanel.visibilityEditItemButton(false);
managementPanel.visibilityDeleteItemButton(false);
managementPanel.visibilityPublishItemButton(false, true);
}
@Override
public void onSuccess(RolesCkanGroupOrOrg result) {
switch (result) {
case ADMIN:
showEditInsertButtons(true);
break;
case EDITOR:
showEditInsertButtons(true);
break;
case MEMBER:
showEditInsertButtons(false);
break;
default:
showEditInsertButtons(false);
break;
GWT.log("isUserLoggedInVRE: "+ckanAccessPoint.isUserLoggedInVRE());
GWT.log("getLoggedInScope: "+ckanAccessPoint.getLoggedInScope());
if (ckanAccessPoint.isUserLoggedInVRE()) {
switch (result) {
case ADMIN: {
managementPanel.visibilityPublishItemButton(true, true);
managementPanel.visibilityEditItemButton(true);
managementPanel.visibilityDeleteItemButton(true);
managementPanel.enablePublishItemButton(true);
//RootPanel.get(GCubeCkanDataCatalog.LOGGED_IN_DIV).add(new HTML("Logged in as "+RolesCkanGroupOrOrg.ADMIN));
break;
}
case EDITOR: {
managementPanel.visibilityPublishItemButton(true, true);
managementPanel.visibilityEditItemButton(true);
managementPanel.visibilityDeleteItemButton(true);
managementPanel.enablePublishItemButton(true);
//RootPanel.get(GCubeCkanDataCatalog.LOGGED_IN_DIV).add(new HTML("Logged in as "+RolesCkanGroupOrOrg.EDITOR));
break;
}
case MEMBER: {
managementPanel.visibilityEditItemButton(false);
managementPanel.visibilityDeleteItemButton(false);
// Disable the button "Publish Item" is to inform the user that he/she has
// not the rights to publish
managementPanel.visibilityPublishItemButton(true, true);
managementPanel.enablePublishItemButton(false);
//RootPanel.get(GCubeCkanDataCatalog.LOGGED_IN_DIV).add(new HTML("Logged in as "+RolesCkanGroupOrOrg.MEMBER));
break;
}
default: {
managementPanel.visibilityEditItemButton(false);
managementPanel.visibilityDeleteItemButton(false);
// Disable the button "Publish Item" is to inform the user that he/she has
// not the rights to publish
managementPanel.visibilityPublishItemButton(true, true);
managementPanel.enablePublishItemButton(false);
break;
}
}
} else {
managementPanel.visibilityPublishItemButton(false, true);
managementPanel.visibilityEditItemButton(false);
managementPanel.visibilityDeleteItemButton(false);
}
}
@ -414,15 +449,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
updateSize();
}
/**
* show or hide edit/insert buttons according to the role.
*
* @param show the show
*/
public void showEditInsertButtons(boolean show) {
managementPanel.showInsertAndEditProductButtons(show);
}
// /**
// * show or hide the Publish/Update/Delete buttons according to the role.
// *
// * @param show the show
// */
// public void showPublishUpdateDeleteButtons(boolean show) {
//
// managementPanel.visibilityUpdateDeleteButtons(show);
// }
/**
* Instance ckan frame.
@ -563,6 +598,8 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
if (!isProductKeyMissing) {
latestSelectedProductIdentifier = productId.toString();
managementPanel.enableShareItemButton(productId != null && !productId.isEmpty());
managementPanel.enableEditItemButton(productId != null && !productId.isEmpty());
managementPanel.enableDeleteItemButton(productId != null && !productId.isEmpty());
managementPanel.enablePublishOnZenodoButton(productId != null && !productId.isEmpty());
managementPanel.enableManageGRSFProductButton(
productId != null && !productId.isEmpty() && manageProductResponse.isManageEnabled());

View File

@ -88,7 +88,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
try{
// just get the current scope and set it into ScopeProvider...
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
String loggedInScope = SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
// retrieve scope per current portlet url
String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());
@ -112,7 +112,15 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
pathInfoParameter = isViewPerVREEnabled(browserLocationURL);
}
//#26854
CkanConnectorAccessPoint ckAP = getCkanConnectorAccessPoint(browserLocationURL, pathInfoParameter, queryStringParameters, scopePerCurrentUrl);
ckAP.setLoggedInScope(loggedInScope);
ckAP.setOperativeScope(scopePerCurrentUrl);
if(loggedInScope!=null) {
ScopeBean scopeBeanLS = new ScopeBean(loggedInScope);
boolean loggedInVRE = scopeBeanLS.is(Type.VRE);
ckAP.setUserLoggedInVRE(loggedInVRE);
}
SessionUtil.saveCkanAccessPoint(this.getThreadLocalRequest().getSession(), scopePerCurrentUrl, ckAP);
logger.info("Built the URI to CKAN (connector in case of user logged): "+ckAP.buildURI());
logger.debug("returning ckanConnectorUri: "+ckAP);
@ -238,8 +246,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
RolesCkanGroupOrOrg toReturn = RolesCkanGroupOrOrg.MEMBER;
if(!SessionUtil.isIntoPortal()){
logger.warn("OUT FROM PORTAL DETECTED RETURNING ROLE: "+RolesCkanGroupOrOrg.ADMIN);
toReturn = RolesCkanGroupOrOrg.ADMIN;
logger.warn("OUT FROM PORTAL DETECTED RETURNING ROLE: "+toReturn);
}else{
HttpSession httpSession = this.getThreadLocalRequest().getSession();

View File

@ -6,6 +6,7 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpSession;
@ -31,32 +32,30 @@ import org.gcube.vomanagement.usermanagement.model.GatewayRolesNames;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
/**
* The Class UserUtil.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @author Costantino Perciante costantino.perciante@isti.cnr.it
* Jun 21, 2016
* @author Costantino Perciante costantino.perciante@isti.cnr.it Jun 21, 2016
*/
public class UserUtil {
//private static Logger LOG = LoggerFactory.getLogger(UserUtil.class);
// private static Logger LOG = LoggerFactory.getLogger(UserUtil.class);
private static final Log logger = LogFactoryUtil.getLog(UserUtil.class);
private static final String ADD_USER_TO_OTHER_ORG_KEY = "ADD_USER_TO_OTHER_ORG_KEY";
/**
* Gets the list vre for user and the role the user has in them.
* retrieve the groups to whom a given user belongs (given the user EMail)
* @param userEMail the user e mail
* @param httpSession
* @param pathVre
* Gets the list vre for user and the role the user has in them. retrieve the
* groups to whom a given user belongs (given the user EMail)
*
* @param userEMail the user e mail
* @param httpSession
* @param pathVre
* @return the list vre for user
*/
public static Map<String, String> getVreRoleForUser(String userEMail, String context, DataCatalogue instance, boolean isViewPerVREEnabled,
HttpSession httpSession){
public static Map<String, String> getVreRoleForUser(String userEMail, String context, DataCatalogue instance,
boolean isViewPerVREEnabled, HttpSession httpSession) {
GroupManager groupManager = new LiferayGroupManager();
UserManager userManager = new LiferayUserManager();
@ -66,58 +65,55 @@ public class UserUtil {
try {
user = userManager.getUserByEmail(userEMail);
// filter according the current context: if it is a VO/VRE, we send all the VRES under the VO. If it is the root vo, we send all user's vres.
// filter according the current context: if it is a VO/VRE, we send all the VRES
// under the VO. If it is the root vo, we send all user's vres.
long groupIdContext = groupManager.getGroupIdFromInfrastructureScope(context);
GCubeGroup currentVRE = groupManager.getGroup(groupIdContext);
String localRoleInThisVre = RolesCkanGroupOrOrg.convertToCkanCapacity(getLiferayHighestRoleInOrg(roleManager.listRolesByUserAndGroup(user.getUserId(), currentVRE.getGroupId())));
String localRoleInThisVre = RolesCkanGroupOrOrg.convertToCkanCapacity(getLiferayHighestRoleInOrg(
roleManager.listRolesByUserAndGroup(user.getUserId(), currentVRE.getGroupId())));
// ckan-connector will do it
mapRoleByGroupSingleVre.put(currentVRE.getGroupName().toLowerCase(),
localRoleInThisVre);
mapRoleByGroupSingleVre.put(currentVRE.getGroupName().toLowerCase(), localRoleInThisVre);
// perform further checks
if(!isViewPerVREEnabled){
if (!isViewPerVREEnabled) {
String keyPerScope = context + ADD_USER_TO_OTHER_ORG_KEY;
Boolean alreadyAdded = (Boolean)httpSession.getAttribute(keyPerScope);
Boolean alreadyAdded = (Boolean) httpSession.getAttribute(keyPerScope);
if(alreadyAdded == null || !alreadyAdded){
new AddUserToOrganizationThread(
instance,
user,
groupManager.listGroupsByUser(user.getUserId()),
isViewPerVREEnabled,
groupIdContext,
roleManager,
groupManager,
localRoleInThisVre).
start();
if (alreadyAdded == null || !alreadyAdded) {
new AddUserToOrganizationThread(instance, user, groupManager.listGroupsByUser(user.getUserId()),
isViewPerVREEnabled, groupIdContext, roleManager, groupManager, localRoleInThisVre).start();
httpSession.setAttribute(keyPerScope, true);
}
}
logger.debug("Returning Map to the ckan connector : " + mapRoleByGroupSingleVre);
return mapRoleByGroupSingleVre;
}catch (UserManagementSystemException | UserRetrievalFault | GroupRetrievalFault e) {
logger.error("An error occurred during get list of VREs for user: "+userEMail, e);
} catch (UserManagementSystemException | UserRetrievalFault | GroupRetrievalFault e) {
logger.error("An error occurred during get list of VREs for user: " + userEMail, e);
return null;
}
}
/**
* Retrieve the highest ckan role the user has and also retrieve the list of organizations (scopes) in which the user has the ckan-admin or ckan-editor role
* @param currentScope the current scope
* @param username the current username
* @param groupName the current groupName
* @param gcubeCkanDataCatalogServiceImpl
* @param orgsInWhichAdminRole
* @param ckanUtils ckanUtils
* Retrieve the highest ckan role the user has and also retrieve the list of
* organizations (scopes) in which the user has the ckan-admin or ckan-editor
* role
*
* @param currentScope the current scope
* @param username the current username
* @param groupName the current groupName
* @param gcubeCkanDataCatalogServiceImpl
* @param orgsInWhichAdminRole
* @param ckanUtils ckanUtils
*/
public static RolesCkanGroupOrOrg getHighestRole(String currentScope, String username, String groupName, GcubeCkanDataCatalogServiceImpl gcubeCkanDataCatalogServiceImpl, List<OrganizationBean> orgsInWhichAtLeastEditorRole){
public static RolesCkanGroupOrOrg getHighestRole(String currentScope, String username, String groupName,
GcubeCkanDataCatalogServiceImpl gcubeCkanDataCatalogServiceImpl,
List<OrganizationBean> orgsInWhichAtLeastEditorRole) {
// base role as default value
RolesCkanGroupOrOrg toReturn = RolesCkanGroupOrOrg.MEMBER;
try{
try {
UserManager userManager = new LiferayUserManager();
RoleManager roleManager = new LiferayRoleManager();
@ -135,83 +131,92 @@ public class UserUtil {
List<GCubeGroup> groups = groupManager.listGroupsByUser(userid);
// root (so check into the root, the VOs and the VRES)
if(groupManager.isRootVO(currentGroupId)){
if (groupManager.isRootVO(currentGroupId)) {
logger.info("The current scope is the Root Vo, so the list of organizations of the user " + username + " is " + groups);
logger.info("The current scope is the Root Vo, so the list of organizations of the user " + username
+ " is " + groups);
for (GCubeGroup gCubeGroup : groups) {
if(!groupManager.isVRE(gCubeGroup.getGroupId()))
if (!groupManager.isVRE(gCubeGroup.getGroupId()))
continue;
// get the name of this group
String gCubeGroupName = gCubeGroup.getGroupName();
// get the role of the users in this group
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userid, groupManager.getGroupId(gCubeGroupName));
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userid,
groupManager.getGroupId(gCubeGroupName));
// get highest role
RolesCkanGroupOrOrg correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
// be sure it is so
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl,
orgsInWhichAtLeastEditorRole);
toReturn = RolesCkanGroupOrOrg.getHigher(toReturn, correspondentRoleToCheck);
}
}else if(groupManager.isVO(currentGroupId)){
} else if (groupManager.isVO(currentGroupId)) {
logger.debug("The list of organizations of the user " + username + " to scan is the one under the VO " + groupName);
logger.debug("The list of organizations of the user " + username + " to scan is the one under the VO "
+ groupName);
for (GCubeGroup gCubeGroup : groups) {
// if the gCubeGroup is not under the VO or it is not the VO continue
if(currentGroupId != gCubeGroup.getParentGroupId() || currentGroupId != gCubeGroup.getGroupId())
if (currentGroupId != gCubeGroup.getParentGroupId() || currentGroupId != gCubeGroup.getGroupId())
continue;
String gCubeGroupName = gCubeGroup.getGroupName();
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userid, groupManager.getGroupId(gCubeGroupName));
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userid,
groupManager.getGroupId(gCubeGroupName));
// get highest role
RolesCkanGroupOrOrg correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
// be sure it is so
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl,
orgsInWhichAtLeastEditorRole);
toReturn = RolesCkanGroupOrOrg.getHigher(toReturn, correspondentRoleToCheck);
}
}else if(groupManager.isVRE(currentGroupId)){
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userManager.getUserId(username), groupManager.getGroupId(groupName));
} else if (groupManager.isVRE(currentGroupId)) {
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userManager.getUserId(username),
groupManager.getGroupId(groupName));
logger.debug("The current scope is the vre " + groupName);
// get highest role
RolesCkanGroupOrOrg correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
// the ckan connector already did the job for us but we need name and title
checkIfRoleIsSetInCkanInstance(username, groupName, currentGroupId,
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
// the ckan connector already did the job for us but we need name and title
checkIfRoleIsSetInCkanInstance(username, groupName, currentGroupId, correspondentRoleToCheck,
groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
toReturn = correspondentRoleToCheck;
}
}catch(Exception e){
} catch (Exception e) {
logger.error("Unable to retrieve the role information for this user. Returning member role", e);
return RolesCkanGroupOrOrg.MEMBER;
}
// return the role
logger.debug("Returning role " + toReturn + " for user " + username);
logger.debug("Returning role " + toReturn + " for user " + username);
return toReturn;
}
/**
* Check if the role admin/editor is set or must be set into the ckan instance at this scope
* Check if the role admin/editor is set or must be set into the ckan instance
* at this scope
*
* @param username
* @param gCubeGroupName
* @param groupId
@ -222,47 +227,72 @@ public class UserUtil {
* @throws UserManagementSystemException
* @throws GroupRetrievalFault
*/
private static void checkIfRoleIsSetInCkanInstance(String username,
String gCubeGroupName, long groupId,
RolesCkanGroupOrOrg correspondentRoleToCheck,
GroupManager groupManager,
GcubeCkanDataCatalogServiceImpl gcubeCkanDataCatalogServiceImpl, List<OrganizationBean> orgsInWhichAtLeastEditorRole) throws UserManagementSystemException, GroupRetrievalFault {
private static void checkIfRoleIsSetInCkanInstance(String username, String gCubeGroupName, long groupId,
RolesCkanGroupOrOrg correspondentRoleToCheck, GroupManager groupManager,
GcubeCkanDataCatalogServiceImpl gcubeCkanDataCatalogServiceImpl,
List<OrganizationBean> orgsInWhichAtLeastEditorRole)
throws UserManagementSystemException, GroupRetrievalFault {
// with this invocation, we check if the role is present in ckan and if it is not it will be added
DataCatalogue catalogue = gcubeCkanDataCatalogServiceImpl.getCatalogue(groupManager.getInfrastructureScope(groupId));
// with this invocation, we check if the role is present in ckan and if it is
// not it will be added
DataCatalogue catalogue = gcubeCkanDataCatalogServiceImpl
.getCatalogue(groupManager.getInfrastructureScope(groupId));
// if there is an instance of ckan in this scope..
if(catalogue != null){
if (catalogue != null) {
boolean res = catalogue.checkRoleIntoOrganization(username, gCubeGroupName, correspondentRoleToCheck);
if(res && !correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.MEMBER)){
if (res && !correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.MEMBER)) {
// get the orgs of the user and retrieve its title and name
CkanOrganization organization = catalogue.getOrganizationByName(gCubeGroupName.toLowerCase());
orgsInWhichAtLeastEditorRole.add(new OrganizationBean(organization.getTitle(), organization.getName(), true));
orgsInWhichAtLeastEditorRole
.add(new OrganizationBean(organization.getTitle(), organization.getName(), true));
}
}
else
logger.warn("It seems there is no ckan instance into scope " + groupManager.getInfrastructureScope(groupId));
} else
logger.warn(
"It seems there is no ckan instance into scope " + groupManager.getInfrastructureScope(groupId));
}
/**
* Retrieve the ckan role among a list of liferay roles
*
* @param roles
* @return MEMBER/EDITOR/ADMIN role
*/
public static RolesCkanGroupOrOrg getLiferayHighestRoleInOrg(
List<GCubeRole> roles) {
public static RolesCkanGroupOrOrg getLiferayHighestRoleInOrg(List<GCubeRole> roles) {
logger.info("getLiferayHighestRoleInOrg in: " + roles);
// NOTE: it is supposed that there is just one role for this person correspondent to the one in the catalog
for (GCubeRole gCubeRole : roles) {
if(gCubeRole.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_ADMIN.getRoleName())){
return RolesCkanGroupOrOrg.ADMIN;
}
if(gCubeRole.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_EDITOR.getRoleName())){
return RolesCkanGroupOrOrg.EDITOR;
}
RolesCkanGroupOrOrg highestRoleFound = null;
if(roles==null || roles.isEmpty()) {
highestRoleFound = RolesCkanGroupOrOrg.MEMBER;
logger.info("getLiferayHighestRoleInOrg returns: " + highestRoleFound +", as default");
return highestRoleFound;
}
return RolesCkanGroupOrOrg.MEMBER;
List<GCubeRole> adminList = roles.stream()
.filter(a -> a.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_ADMIN.getRoleName()))
.collect(Collectors.toList());
if (adminList.size() > 0) {
highestRoleFound = RolesCkanGroupOrOrg.ADMIN;
logger.info("getLiferayHighestRoleInOrg returns: " + highestRoleFound);
return highestRoleFound;
}
List<GCubeRole> editorList = roles.stream()
.filter(a -> a.getRoleName().equalsIgnoreCase(GatewayRolesNames.CATALOGUE_EDITOR.getRoleName()))
.collect(Collectors.toList());
if (editorList.size() > 0) {
highestRoleFound = RolesCkanGroupOrOrg.EDITOR;
logger.info("getLiferayHighestRoleInOrg returns: " + highestRoleFound);
return highestRoleFound;
}
highestRoleFound = RolesCkanGroupOrOrg.MEMBER;
logger.info("getLiferayHighestRoleInOrg returns: " + highestRoleFound);
return highestRoleFound;
}
}

View File

@ -10,14 +10,12 @@ import java.util.Set;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.GcubeCkanDataCatalogServiceImpl;
/**
* The Class CkanConnectorAccessPoint.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 23, 2016
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jun 23, 2016
*/
public class CkanConnectorAccessPoint implements Serializable{
public class CkanConnectorAccessPoint implements Serializable {
/**
*
@ -37,6 +35,10 @@ public class CkanConnectorAccessPoint implements Serializable{
private boolean outsideLoginOnPortal = false;
private String catalogueBaseUrl = null;
private String operativeScope = null;
private String loggedInScope = null;
private boolean isUserLoggedInVRE = false;
/**
* Instantiates a new ckan connector access point.
*/
@ -46,10 +48,10 @@ public class CkanConnectorAccessPoint implements Serializable{
/**
* Instantiates a new ckan connector access point.
*
* @param baseUrl the base url
* @param baseUrl the base url
* @param serviceContext the service context
*/
public CkanConnectorAccessPoint(String baseUrl, String serviceContext){
public CkanConnectorAccessPoint(String baseUrl, String serviceContext) {
this.baseUrl = baseUrl;
this.catalogueBaseUrl = baseUrl.split("ckan-connector")[0];
this.serviceContext = serviceContext;
@ -58,29 +60,29 @@ public class CkanConnectorAccessPoint implements Serializable{
/**
* Adds the generic parameter.
*
* @param key the key
* @param key the key
* @param value the value
*/
public void addGenericParameter(String key, String value){
queryStringParameters=queryStringParameters==null?key+"="+value:queryStringParameters+"&"+key+"="+value;
public void addGenericParameter(String key, String value) {
queryStringParameters = queryStringParameters == null ? key + "=" + value
: queryStringParameters + "&" + key + "=" + value;
}
/**
* Adds the query string.
*
* @param queryString the query string
*/
public void addQueryString(String queryString){
public void addQueryString(String queryString) {
if(queryString==null || queryString.isEmpty())
if (queryString == null || queryString.isEmpty())
return;
if(queryString.startsWith("&") || queryString.startsWith("?")){
queryString = queryString.substring(1, queryString.length()); //removes '&' or '?'
if (queryString.startsWith("&") || queryString.startsWith("?")) {
queryString = queryString.substring(1, queryString.length()); // removes '&' or '?'
}
queryStringParameters=queryStringParameters==null?queryString:queryStringParameters+"&"+queryString;
queryStringParameters = queryStringParameters == null ? queryString : queryStringParameters + "&" + queryString;
}
/**
@ -88,8 +90,8 @@ public class CkanConnectorAccessPoint implements Serializable{
*
* @param value the value
*/
public void addGubeToken(String value){
if(!outsideLoginOnPortal){
public void addGubeToken(String value) {
if (!outsideLoginOnPortal) {
this.gcubeTokenValue = value;
addGenericParameter(GCUBE_TOKEN_PARAMETER, value);
}
@ -100,18 +102,19 @@ public class CkanConnectorAccessPoint implements Serializable{
*
* @param listVREs the list vr es
*/
public void addListOfVREs(Map<String, String> listVREs){
public void addListOfVREs(Map<String, String> listVREs) {
this.mapVresRoles = listVREs;
String vres = "";
if(listVREs!=null && listVREs.size()>0){
if (listVREs != null && listVREs.size() > 0) {
Set<Entry<String, String>> set = listVREs.entrySet();
for (Entry<String, String> entry : set) {
vres += entry.getKey().toLowerCase() + "|" + entry.getValue() + ",";
}
vres = vres.substring(0, vres.length()-1); //remove last "," and to lower case. A CKAN Organization ID must be lower case
vres = vres.substring(0, vres.length() - 1); // remove last "," and to lower case. A CKAN Organization ID
// must be lower case
}
if(vres.length()>0){
if (vres.length() > 0) {
addGenericParameter(LIST_OF_VRES_PARAMETER, vres);
}
}
@ -121,27 +124,75 @@ public class CkanConnectorAccessPoint implements Serializable{
*
* @param pathInfo the path info
*/
public void addPathInfo(String pathInfo){
public void addPathInfo(String pathInfo) {
pathInfoParameter = pathInfo;
}
/**
* Builds the URI to contact the CKAN (connector in case of user logged)
* Builds the URI to contact the CKAN (connector in case of user logged).
*
* @return the string
*/
public String buildURI(){
public String buildURI() {
String path = "";
String query = "";
String path = "";
String query = "";
path = checkURLPathSeparator(pathInfoParameter, true, false);
query = checkNullString(queryStringParameters);
String url = getBaseUrlWithContext()+path;
url+= !query.isEmpty()?"?"+query:"";
String url = getBaseUrlWithContext() + path;
url += !query.isEmpty() ? "?" + query : "";
return url;
}
/**
* Gets the operative scope.
*
* @return the operative scope
*/
public String getOperativeScope() {
return operativeScope;
}
/**
* Gets the logged in scope.
*
* @return the logged in scope
*/
public String getLoggedInScope() {
return loggedInScope;
}
public boolean isUserLoggedInVRE() {
return isUserLoggedInVRE;
}
/**
* Sets the user logged in VRE.
*
* @param isUserLoggedInVRE the new user logged in VRE
*/
public void setUserLoggedInVRE(boolean isUserLoggedInVRE) {
this.isUserLoggedInVRE = isUserLoggedInVRE;
}
/**
* Sets the operative scope.
*
* @param operativeScope the new operative scope
*/
public void setOperativeScope(String operativeScope) {
this.operativeScope = operativeScope;
}
/**
* Sets the logged in scope.
*
* @param loggedInScope the new logged in scope
*/
public void setLoggedInScope(String loggedInScope) {
this.loggedInScope = loggedInScope;
}
/**
* Gets the base url with context.
*
@ -149,10 +200,9 @@ public class CkanConnectorAccessPoint implements Serializable{
*/
public String getBaseUrlWithContext() {
return baseUrl+serviceContext;
return baseUrl + serviceContext;
}
/**
* Gets the path info parameter.
*
@ -163,7 +213,6 @@ public class CkanConnectorAccessPoint implements Serializable{
return pathInfoParameter;
}
/**
* Gets the query string parameters.
*
@ -174,7 +223,6 @@ public class CkanConnectorAccessPoint implements Serializable{
return queryStringParameters;
}
/**
* Gets the gcube token value.
*
@ -185,7 +233,6 @@ public class CkanConnectorAccessPoint implements Serializable{
return gcubeTokenValue;
}
/**
* Gets the list of v res.
*
@ -199,25 +246,29 @@ public class CkanConnectorAccessPoint implements Serializable{
/**
* Check url path separator.
*
* @param url the url
* @param head - checks the {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR} in head adding if do not exist
* @param tail - checks the {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR} in tail adding if do not exist
* @return the string - if null return an empty string otherwise a string with {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR}
* @param url the url
* @param head - checks the
* {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR} in
* head adding if do not exist
* @param tail - checks the
* {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR} in
* tail adding if do not exist
* @return the string - if null return an empty string otherwise a string with
* {@link GcubeCkanDataCatalogServiceImpl.URL_PATH_SEPARATOR}
*/
public static String checkURLPathSeparator(String url, boolean head, boolean tail){
public static String checkURLPathSeparator(String url, boolean head, boolean tail) {
if(url!=null && url.length()>0){
if(head)
url=url.startsWith(URL_PATH_SEPARATOR)?url:URL_PATH_SEPARATOR+url;
if(tail)
url=url.endsWith(URL_PATH_SEPARATOR)?url:url+URL_PATH_SEPARATOR;
}else
if (url != null && url.length() > 0) {
if (head)
url = url.startsWith(URL_PATH_SEPARATOR) ? url : URL_PATH_SEPARATOR + url;
if (tail)
url = url.endsWith(URL_PATH_SEPARATOR) ? url : url + URL_PATH_SEPARATOR;
} else
url = "";
return url;
}
/**
* Gets the base url.
*
@ -228,23 +279,20 @@ public class CkanConnectorAccessPoint implements Serializable{
return baseUrl;
}
/**
* Check null string.
*
* @param value the value
* @return the string if is not null otherwise an empty string
*/
public static String checkNullString(String value){
public static String checkNullString(String value) {
if(value==null)
if (value == null)
return "";
else
return value;
}
/**
* Checks if is outside login on portal.
*
@ -255,7 +303,6 @@ public class CkanConnectorAccessPoint implements Serializable{
return outsideLoginOnPortal;
}
/**
* Sets the outside login on portal.
*
@ -275,8 +322,14 @@ public class CkanConnectorAccessPoint implements Serializable{
return catalogueBaseUrl;
}
/* (non-Javadoc)
/**
* To string.
*
* @return the string
*/
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override

View File

@ -20,6 +20,10 @@
<inherits
name='org.gcube.portlets_widgets.catalogue_sharing_widget.ShareCatalogue' />
<inherits
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
<inherits
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
<inherits
@ -29,6 +33,9 @@
<inherits
name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits
name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<inherits
name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
<inherits
@ -36,7 +43,6 @@
<inherits
name='org.gcube.portlets.widgets.ckancontentmoderator.CkanContentModeratorWidget' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />

View File

@ -164,4 +164,26 @@ h1 {
margin-right: 10px;
padding: 8px !important;
border-radius: 12px !important;
margin-top: 5px;
}
.nav_bar_catalogue {
background-color: none !important;
margin-bottom: 0px !important;
margin-left: 10px;
margin-right: 5px;
padding: 5px;
}
.nav_bar_catalogue .navbar-inner {
background-image: none !important;
padding: 10px 5px;
background-color: #FAFAFA;
}
.logged_in_label {
float: right;
margin-right: 20px;
font-size: 12px;
padding-top: 5px;
}

View File

@ -37,6 +37,7 @@
Your web browser must have JavaScript enabled in order for this
application to display correctly.</div>
</noscript>
<div id="logged_in" class="logged_in_label"></div>
<div id="gCubeCkanDataCatalog"></div>
</body>
</html>

View File

@ -28,9 +28,9 @@
<!-- <script type="text/javascript" -->
<%-- src='<%=request.getContextPath()%>/js/jquery.min.js'></script> --%>
<script type="text/javascript"
src='<%=request.getContextPath()%>/js/jquery.autosize.js'></script>
<div id="logged_in" class="logged_in_label"></div>
<div id="gCubeCkanDataCatalog"></div>

View File

@ -38,6 +38,11 @@
<servlet-class>org.gcube.portlets_widgets.catalogue_sharing_widget.server.ShareServicesImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>workspaceExplorer</servlet-name>
<servlet-class>org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl</servlet-class>
</servlet>
<!-- Servlets -->
<servlet>
<servlet-name>ckanToZenodoServlet</servlet-name>
@ -49,12 +54,23 @@
<servlet-class>org.gcube.portlets.widgets.ckancontentmoderator.server.CkanContentModeratorServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>metadataProfileFormBuilderUploadServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderUploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>metadataProfileFormBuilderUploadServlet</servlet-name>
<url-pattern>/gCubeCkanDataCatalog/metadataProfileFormBuilderUploadServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ckanContentModeratorServlet</servlet-name>
<url-pattern>/gCubeCkanDataCatalog/ckanContentModeratorService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ckanToZenodoServlet</servlet-name>
<url-pattern>/gCubeCkanDataCatalog/ckantozenodo</url-pattern>
@ -80,6 +96,12 @@
<url-pattern>/gCubeCkanDataCatalog/grsfmanageservice</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>workspaceExplorer</servlet-name>
<url-pattern>/gCubeCkanDataCatalog/WorkspaceExplorerService</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>gcubeckanlogout</servlet-name> -->
<!-- <url-pattern>/gCubeCkanDataCatalog/gcubeckanlogout</url-pattern> -->