Compare commits
144 Commits
Feature_#1
...
master
15
.classpath
15
.classpath
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/gcube-ckan-datacatalog-2.3.3/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -25,16 +25,15 @@
|
|||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<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="output" path="target/gcube-ckan-datacatalog-1.8.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/gcube-ckan-datacatalog-2.3.3/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.3/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=/home/francesco-mangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.8.0-SNAPSHOT
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-2.3.3
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
|
|
@ -1,13 +1,883 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="gcube-ckan-datacatalog-1.8.0-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="gcube-ckan-datacatalog-2.3.3">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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"/>
|
||||
<dependent-module archiveName="ckan2zenodo-publisher-widget-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan2zenodo-publisher-widget/ckan2zenodo-publisher-widget">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
<installed facet="liferay.portlet" version="6.0"/>
|
||||
<installed facet="com.gwtplugins.gwt.facet" version="1.0"/>
|
||||
<installed facet="jst.jaxrs" version="2.0"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
|
|
|
@ -0,0 +1,222 @@
|
|||
|
||||
# Changelog
|
||||
|
||||
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.4] - 2024-10-15
|
||||
|
||||
- Moved to maven-portal-bom 4.0.0{-SNAPSHOT} [#28026]
|
||||
|
||||
## [v2.3.3] - 2024-10-01
|
||||
|
||||
- Patched `Time_Interval` type via widget [#28111]
|
||||
|
||||
## [v2.3.2] - 2024-07-03
|
||||
|
||||
- Includes the `metadata-profile-form-builder-widget` enhancement [#27488]
|
||||
|
||||
## [v2.3.1] - 2024-05-14
|
||||
|
||||
- Includes `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]
|
||||
|
||||
## [v2.2.6] - 2023-07-25
|
||||
|
||||
- Just rebuilt the Portlet, fixing issue [#25275]
|
||||
- Moved to GWT 2.10.0
|
||||
|
||||
## [v2.2.5] - 2023-03-02
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#23903] Catalogue Moderation: allow to send a message to the moderators
|
||||
- [#24309] Inform the VRE users that the catalogue is controlled/moderated
|
||||
|
||||
## [v2.2.4] - 2022-10-27
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#24038] Moved to GWT 2.9
|
||||
- [#23811] Just to release the grsf-manage-widget
|
||||
|
||||
|
||||
## [v2.2.3] - 2022-08-01
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- Just to release the optimization implemented for the Moderation Panel [#23692]
|
||||
|
||||
## [v2.2.2] - 2022-06-27
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- Just to release the Publishing Widget enhancement [#23491]
|
||||
- [#23525] Removed the scope of xml-apis dependency
|
||||
- Moved to maven-portal-bom v3.6.4
|
||||
|
||||
#### Bug fixes
|
||||
|
||||
- Just to release the GRSF Manage Widget bug fixes [#23549], [#23561]
|
||||
|
||||
## [v2.2.1] - 2022-05-26
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#23406] Including grsf-manage-widget enhancement/bug fixing
|
||||
|
||||
## [v2.2.0] - 2022-05-18
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#20650] Data Catalogue: integrate the Content Moderator System
|
||||
- [#22872] Updated the AppId (to 'service-account-gcat') used in the "Catalogue" GR
|
||||
- [#23259] Implemented the requirement described in #23156
|
||||
|
||||
## [v2.1.1] - 2022-01-21
|
||||
|
||||
- Just to release the fix #22691
|
||||
|
||||
## [v2.1.0] - 2021-10-05
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#19988] Integrated with `checkEnvironment` to show or not the "Upload to Zenodo" facility
|
||||
|
||||
|
||||
## [v2.0.1] - 2021-05-04
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#21188] Avoiding the catalogue widget window close if the user clicks outside it
|
||||
- [#21470] Bug fixed publishing widget uses the orgTitle instead of orgName
|
||||
- [#20193] Switching to GR "Catalogue" with <AppId>gCat</AppId>. They will be updated by UpdateItemCatalogueResource class.
|
||||
- Moved to maven-portal-bom 3.6.3
|
||||
|
||||
|
||||
## [v2.0.0] - 2021-04-12
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#21153] Upgrade the maven-portal-bom to 3.6.1 version
|
||||
- [#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
|
||||
|
||||
- Just to include the fix reported at [#20446]
|
||||
|
||||
|
||||
## [v1.9.1] - 2020-07-08
|
||||
|
||||
- Just to include the dependency [#19528]
|
||||
|
||||
|
||||
## [v1.9.0] - 2020-07-03
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#19559] Check and try to avoid the view per VRE configuration for Public and Gateway Catalogue
|
||||
- Just to include the dependencies [#18700] and [#19479]
|
||||
|
||||
|
||||
## [v1.8.0] - 2019-12-09
|
||||
|
||||
- [Feature #18226]: Develop Ckan extension GUI for Zenodo interactive linking
|
||||
|
||||
|
||||
## [v1.7.0] - 2019-12-04
|
||||
|
||||
- [Bug #18212]: Guest users are able to access to whole catalogue even if the view per organization is enabled
|
||||
|
||||
|
||||
## [v1.6.1] - 2019-04-17
|
||||
|
||||
- [SW Test #16580#note-6]: bug fixing
|
||||
|
||||
|
||||
## [v1.6.0] - 2018-30-08
|
||||
|
||||
- [Task #12286]: Align portlet container labels to the new CKAN mapping
|
||||
|
||||
|
||||
## [v1.5.3] - 2018-03-22
|
||||
|
||||
- Minor fix
|
||||
|
||||
|
||||
## [v1.5.2] - 2017-10-10
|
||||
|
||||
- Minor fix #11210
|
||||
|
||||
|
||||
## [v1.5.2] - 2017-10-10
|
||||
|
||||
- Css fix and media rules added for management panels
|
||||
- Ckan Connector discovering fixed #11094
|
||||
|
||||
|
||||
## [v1.5.1] - 2017-10-10
|
||||
|
||||
- Minor improvements
|
||||
- Removed logout handler
|
||||
- Added view per VRE (managed with portal custmo fields)
|
||||
|
||||
|
||||
## [v1.5.0] - 2017-05-10
|
||||
|
||||
- Metadata model v.3 supported
|
||||
|
||||
- Minor fixes
|
||||
|
||||
|
||||
## [v1.4.0] - 2017-04-10
|
||||
|
||||
- Added share link facility
|
||||
|
||||
|
||||
## [v1.3.0] - 2017-02-28
|
||||
|
||||
- Some optimizations improvements
|
||||
|
||||
- Manage button style modified
|
||||
|
||||
|
||||
## [v1.2.1] - 2017-02-01
|
||||
|
||||
- Some optimizations improvements
|
||||
|
||||
|
||||
## [v1.2.0] - 2016-12-01
|
||||
|
||||
- Groups tab changed
|
||||
- [Task #5615] Logout is performed before browser tab is closed
|
||||
- Portlet's borders are removed by default
|
||||
- Removed asl session
|
||||
|
||||
|
||||
## [v1.1.0] - 2016-10-10
|
||||
|
||||
- Version update due to changes at underneath libraries
|
||||
|
||||
|
||||
## [v1.0.0] - 2016-07-12
|
||||
|
||||
First release
|
37
README.md
37
README.md
|
@ -1,16 +1,51 @@
|
|||
# gCube D4Science Data Catalog
|
||||
|
||||
The gCube Data Catalog Portlet powered by CKAN
|
||||
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
|
||||
|
||||
* [OpenJDK](https://openjdk.java.net/) - The JDK used
|
||||
* [Maven](https://maven.apache.org/) - Dependency Management
|
||||
|
||||
**Uses**
|
||||
|
||||
* GWT v.2.9.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html)
|
||||
* GWT-Bootstrap v.2.3.2.0. [GWT-Bootstrap](https://github.com/gwtbootstrap) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
||||
* CKAN v.2.6.x. [CKAN](https://ckan.org/) is licensed under [Creative Commons Attribution ShareAlike 3.0](https://creativecommons.org/licenses/by-sa/3.0/)
|
||||
|
||||
**Related Components**
|
||||
|
||||
* [Catalogue Sharing Widget](https://code-repo.d4science.org/gCubeSystem/catalogue-sharing-widget)
|
||||
* [Catalogue Content Moderator Widget](https://code-repo.d4science.org/gCubeSystem/ckan-content-moderator-widget)
|
||||
* [GRSF Manage Widget](https://code-repo.d4science.org/gCubeSystem/grsf-manage-widget)
|
||||
* [Catalogue Metadata Publisher Widget](https://code-repo.d4science.org/gCubeSystem/ckan-metadata-publisher-widget)
|
||||
* [Ckan2Zenodo Publisher Widget](https://code-repo.d4science.org/gCubeSystem/ckan2zenodo-publisher-widget)
|
||||
|
||||
and others. You can discovery all dependencies via dependency hierarchy (e.g. use [dependency:tree](https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html))
|
||||
|
||||
## Showcase
|
||||
|
||||
**SoBigData Catalogue**
|
||||
|
||||
see at [SoBigData Catalogue](https://sobigdata.d4science.org/catalogue-sobigdata)
|
||||
|
||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/0/0e/Catalogue-SBG-Gateway.png" style="max-width:800px;" alt="SoBigData Catalogue" />
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
**Ecosystem Approach to Fisheries Catalogue**
|
||||
|
||||
see at [Ecosystem Approach to Fisheries Catalogue](https://i-marine.d4science.org/catalogue-imarine)
|
||||
|
||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/3/30/Catalogue-I-Marine-Gateway.png" style="max-width:800px;" alt="Ecosystem Approach to Fisheries Catalogue" />
|
||||
|
||||
## Documentation
|
||||
|
||||
You can find the D4Science Catalogue documentation at [GCat Background Wiki Page](https://wiki.gcube-system.org/GCat_Background)
|
||||
|
||||
Technical note (ITA) [D4Science_Catalogue_Service](https://gcube.wiki.gcube-system.org/images_gcube/4/4f/D4Science_Catalogue_Service.pdf)
|
||||
|
||||
## Change log
|
||||
|
||||
See the [Releases](https://code-repo.d4science.org/gCubeSystem/gcube-ckan-datacatalog/releases)
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-8-0"
|
||||
date="2019-12-09">
|
||||
<Change>[Feature #18226]: Develop Ckan extension GUI for Zenodo
|
||||
interactive linking
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-7-0"
|
||||
date="2019-12-04">
|
||||
<Change>[Bug #18212]: Guest users are able to access to whole
|
||||
catalogue even if the view per organization is enabled
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-6-1"
|
||||
date="2019-04-17">
|
||||
<Change>[SW Test #16580#note-6]: bug fixing
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-6-0"
|
||||
date="2018-30-08">
|
||||
<Change>[Task #12286]: Align portlet container labels to the new CKAN
|
||||
mapping
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-3"
|
||||
date="2018-03-22">
|
||||
<Change>Minor fix</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-2"
|
||||
date="2017-10-10">
|
||||
<Change>Minor fix #11210</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-2"
|
||||
date="2017-10-10">
|
||||
<Change>Css fix and media rules added for management panels</Change>
|
||||
<Change>Ckan Connector discovering fixed #11094</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-1"
|
||||
date="2017-10-10">
|
||||
<Change>Minor improvements</Change>
|
||||
<Change>Removed logout handler</Change>
|
||||
<Change>Added view per VRE (managed with portal custmo fields)
|
||||
</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-5-0"
|
||||
date="2017-05-10">
|
||||
<Change>Metadata model v.3 supported</Change>
|
||||
<Change>Minor fixes</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-4-0"
|
||||
date="2017-04-10">
|
||||
<Change>Added share link facility</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-3-0"
|
||||
date="2017-02-28">
|
||||
<Change>Some optimizations improvements</Change>
|
||||
<Change>Manage button style modified</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-2-1"
|
||||
date="2017-02-01">
|
||||
<Change>Some optimizations improvements</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-2-0"
|
||||
date="2016-12-01">
|
||||
<Change>Groups tab changed</Change>
|
||||
<Change>[Task #5615] Logout is performed before browser tab is closed
|
||||
</Change>
|
||||
<Change>Portlet's borders are removed by default</Change>
|
||||
<Change>Removed asl session</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-1-0"
|
||||
date="2016-10-10">
|
||||
<Change>Version update due to changes at underneath libraries</Change>
|
||||
</Changeset>
|
||||
<Changeset
|
||||
component="org.gcube.portlets.gcubeckan.gcube-ckan-datacatalog.1-0-0"
|
||||
date="2016-07-12">
|
||||
<Change>First release</Change>
|
||||
</Changeset>
|
||||
</ReleaseNotes>
|
|
@ -15,7 +15,7 @@
|
|||
<include>README.md</include>
|
||||
<include>LICENSE.md</include>
|
||||
<include>profile.xml</include>
|
||||
<include>changelog.xml</include>
|
||||
<include>CHANGELOG.md</include>
|
||||
</includes>
|
||||
<fileMode>755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
|
|
104
pom.xml
104
pom.xml
|
@ -7,26 +7,27 @@
|
|||
<parent>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.2.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.portlets.gcubeckan</groupId>
|
||||
<artifactId>gcube-ckan-datacatalog</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.8.0-SNAPSHOT</version>
|
||||
<version>2.3.4</version>
|
||||
<name>gCube CKAN Data Catalog</name>
|
||||
<description>The gCube CKAN Data Catalog portlet</description>
|
||||
|
||||
<properties>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwtVersion>2.7.0</gwtVersion>
|
||||
<gwtVersion>2.10.0</gwtVersion>
|
||||
<!-- GWT needs at least java 1.6 -->
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<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>
|
||||
|
@ -35,12 +36,39 @@
|
|||
<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>
|
||||
<maven-portal-bom-version>4.0.0</maven-portal-bom-version>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- DEV profile -->
|
||||
<profile>
|
||||
<id>catalogue-snapshot-profile</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>!Release</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<maven-portal-bom-version>4.0.0-SNAPSHOT</maven-portal-bom-version>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>${maven-portal-bom-version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
<exclusions>
|
||||
|
@ -55,21 +83,32 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>xerces</groupId> -->
|
||||
<!-- <artifactId>xercesImpl</artifactId> -->
|
||||
<!-- <version>2.9.1</version> -->
|
||||
<!-- </dependency> -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<scope>provided</scope>
|
||||
<!-- <scope>compile</scope> -->
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-dev</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gwtbootstrap</groupId>
|
||||
|
@ -101,33 +140,44 @@
|
|||
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Metadata publisher widget -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>ckan-content-moderator-widget</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>grsf-manage-widget</artifactId>
|
||||
<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>
|
||||
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
||||
<version>[2.1.0,3.0.0)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>ckan2zenodo-publisher-widget</artifactId>
|
||||
<version>[0.0.1-SNAPSHOT,1.0.0-SNAPSHOT)</version>
|
||||
<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>
|
||||
|
@ -183,6 +233,14 @@
|
|||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- REQUIRED FOR JDK_11 -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- LOGGER -->
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
|
|
|
@ -14,24 +14,38 @@
|
|||
<!-- Other module inherits -->
|
||||
<inherits name="com.google.gwt.json.JSON" />
|
||||
<!-- Inherits widget -->
|
||||
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
||||
|
||||
|
||||
<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 name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
|
||||
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
|
||||
<inherits name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
|
||||
<inherits
|
||||
name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
|
||||
<inherits
|
||||
name='org.gcube.datacatalogue.utillibrary.CkanUtilLibrary' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckancontentmoderator.CkanContentModeratorWidget' />
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point
|
||||
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
|
|
|
@ -4,6 +4,11 @@ package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
|||
import org.gcube.datacatalogue.grsf_manage_widget.client.events.HideManagementPanelEvent;
|
||||
import org.gcube.datacatalogue.grsf_manage_widget.client.events.HideManagementPanelEventHandler;
|
||||
import org.gcube.datacatalogue.grsf_manage_widget.client.view.ManageProductWidget;
|
||||
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;
|
||||
|
@ -32,13 +37,18 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view.GCubeCkanDa
|
|||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.CkanToZendoPublisherWidget;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.shared.CatalogueItem;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEvent;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorCheckConfigs;
|
||||
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;
|
||||
import com.github.gwtbootstrap.client.ui.event.HideEvent;
|
||||
import com.github.gwtbootstrap.client.ui.event.HideHandler;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
|
@ -54,7 +64,7 @@ public class CkanEventHandlerManager {
|
|||
|
||||
protected static final String WIDGET_CREATE_TITLE = "Publish Item";
|
||||
private HandlerManager eventBus = new HandlerManager(null);
|
||||
private GCubeCkanDataCatalogPanel panel;
|
||||
private GCubeCkanDataCatalogPanel gcubeCkanDataCatalogue;
|
||||
private String logoutFromCKANURL;
|
||||
|
||||
/**
|
||||
|
@ -65,13 +75,13 @@ public class CkanEventHandlerManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the panel.
|
||||
* Sets the gcubeCkanDataCatalogue.
|
||||
*
|
||||
* @param panel the panel to set
|
||||
* @param gcubeCkanDataCatalogue the gcubeCkanDataCatalogue to set
|
||||
*/
|
||||
public void setPanel(GCubeCkanDataCatalogPanel panel) {
|
||||
|
||||
this.panel = panel;
|
||||
this.gcubeCkanDataCatalogue = panel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,138 +94,133 @@ public class CkanEventHandlerManager {
|
|||
|
||||
@Override
|
||||
public void onShowHome(ShowHomeEvent showHomeEvent) {
|
||||
String pathToUse = panel.isViewPerVREEnabled() ? panel.getPathInfo() : null;
|
||||
String pathToUse = gcubeCkanDataCatalogue.isViewPerVREEnabled() ? gcubeCkanDataCatalogue.getPathInfo()
|
||||
: null;
|
||||
String request = getCkanRequest(pathToUse, null);
|
||||
panel.instanceCkanFrame(request);
|
||||
gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// bind on insert metadata
|
||||
eventBus.addHandler(InsertMetadataEvent.TYPE, new InsertMetadataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onInsertMetadata(InsertMetadataEvent loadSelecteReleaseEvent) {
|
||||
|
||||
final Modal modal = new Modal(true, true);
|
||||
public void onInsertMetadata(InsertMetadataEvent loadSelectedItemEvent) {
|
||||
GWT.log("onInsertMetadata: " + loadSelectedItemEvent);
|
||||
final Modal modal = new ExtModal(true, true);
|
||||
|
||||
modal.setTitle(WIDGET_CREATE_TITLE);
|
||||
modal.addStyleName("insert-metadata-modal-style");
|
||||
modal.addStyleName("modal-top-custom");
|
||||
((Element)modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
|
||||
((Element) modal.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
|
||||
modal.add(new CreateDatasetForm(eventBus));
|
||||
modal.setCloseVisible(true);
|
||||
|
||||
// // hide any popup gcubeCkanDataCatalogue opened
|
||||
// modal.addHideHandler(new HideHandler() {
|
||||
//
|
||||
// @Override
|
||||
// public void onHide(HideEvent hideEvent) {
|
||||
// GWT.log("HideEvent on modal fired");
|
||||
// GWT.log(hideEvent.toDebugString());
|
||||
// eventBus.fireEvent(new CloseCreationFormProfileEvent());
|
||||
//
|
||||
// hideEvent.preventDefault();
|
||||
// hideEvent.stopPropagation();
|
||||
// return;
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
GWT.log("show");
|
||||
modal.show();
|
||||
|
||||
// hide any popup panel opened
|
||||
modal.addHideHandler(new HideHandler() {
|
||||
|
||||
@Override
|
||||
public void onHide(HideEvent hideEvent) {
|
||||
eventBus.fireEvent(new CloseCreationFormEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// 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() {
|
||||
|
||||
@Override
|
||||
public void onShowDatasets(
|
||||
ShowDatasetsEvent showUserDatasetsEvent) {
|
||||
String request = null;
|
||||
if(showUserDatasetsEvent.isOwnOnly())
|
||||
request = getCkanRequest("/dashboard/datasets", null);
|
||||
else
|
||||
request = getCkanRequest("/dataset", null);
|
||||
panel.instanceCkanFrame(request);
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(ShowTypesEvent.TYPE,
|
||||
new ShowTypesEventHandler() {
|
||||
eventBus.addHandler(ShowDatasetsEvent.TYPE, new ShowDatasetsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowTypes(ShowTypesEvent showTypes) {
|
||||
String request = getCkanRequest("/type", null);
|
||||
panel.instanceCkanFrame(request);
|
||||
public void onShowDatasets(ShowDatasetsEvent showUserDatasetsEvent) {
|
||||
String request = 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(
|
||||
ShowOrganizationsEvent.TYPE,
|
||||
new ShowOrganizationsEventHandler() {
|
||||
eventBus.addHandler(ShowTypesEvent.TYPE, new ShowTypesEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowOrganizations(
|
||||
ShowOrganizationsEvent showUserDatasetsEvent) {
|
||||
@Override
|
||||
public void onShowTypes(ShowTypesEvent showTypes) {
|
||||
String request = getCkanRequest("/type", null);
|
||||
gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
|
||||
if(showUserDatasetsEvent.isOwnOnly())
|
||||
panel.showOrganizations();
|
||||
else{
|
||||
String request = getCkanRequest("/organization", null);
|
||||
panel.instanceCkanFrame(request);
|
||||
}
|
||||
}
|
||||
});
|
||||
eventBus.addHandler(
|
||||
ShowGroupsEvent.TYPE, new ShowGroupsEventHandler() {
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onShowGroups(ShowGroupsEvent showGroupsEvent) {
|
||||
//panel.instanceCkanFrame(request);
|
||||
if(showGroupsEvent.isOwnOnly())
|
||||
panel.showGroups();
|
||||
else{
|
||||
String request = getCkanRequest("/group", null);
|
||||
panel.instanceCkanFrame(request);
|
||||
}
|
||||
}
|
||||
});
|
||||
eventBus.addHandler(ShowOrganizationsEvent.TYPE, new ShowOrganizationsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowOrganizations(ShowOrganizationsEvent showUserDatasetsEvent) {
|
||||
|
||||
if (showUserDatasetsEvent.isOwnOnly())
|
||||
gcubeCkanDataCatalogue.showOrganizations();
|
||||
else {
|
||||
String request = getCkanRequest("/organization", null);
|
||||
gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
}
|
||||
}
|
||||
});
|
||||
eventBus.addHandler(ShowGroupsEvent.TYPE, new ShowGroupsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowGroups(ShowGroupsEvent showGroupsEvent) {
|
||||
// gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
if (showGroupsEvent.isOwnOnly())
|
||||
gcubeCkanDataCatalogue.showGroups();
|
||||
else {
|
||||
String request = getCkanRequest("/group", null);
|
||||
gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// show statistics event
|
||||
eventBus.addHandler(
|
||||
ShowStatisticsEvent.TYPE, new ShowStatisticsEventHandler() {
|
||||
eventBus.addHandler(ShowStatisticsEvent.TYPE, new ShowStatisticsEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onShowStatistics(
|
||||
ShowStatisticsEvent showStatisticsEvent) {
|
||||
String request = getCkanRequest("/stats", null);
|
||||
panel.instanceCkanFrame(request);
|
||||
}
|
||||
});
|
||||
|
||||
// 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) {
|
||||
//
|
||||
// panel.updateSize();
|
||||
// if(logoutFromCKANURL==null)
|
||||
// instanceLogoutSystem();
|
||||
// }
|
||||
// });
|
||||
@Override
|
||||
public void onShowStatistics(ShowStatisticsEvent showStatisticsEvent) {
|
||||
String request = getCkanRequest("/stats", null);
|
||||
gcubeCkanDataCatalogue.instanceCkanFrame(request);
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(ShowManageProductWidgetEvent.TYPE, new ShowManageProductWidgetEventHandler() {
|
||||
|
||||
|
@ -224,14 +229,40 @@ public class CkanEventHandlerManager {
|
|||
new ManageProductWidget(event.getProductIdentifier(), eventBus);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(ClickedCMSManageProductButtonEvent.TYPE, new ClickedCMSManageProductButtonEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onClickedManageProduct(ClickedCMSManageProductButtonEvent showManageProductWidgetEvent) {
|
||||
|
||||
CkanContentModeratorCheckConfigs config = gcubeCkanDataCatalogue.getCkanModeratorConfig();
|
||||
|
||||
DISPLAY_FIELD[] sortByFields = null;
|
||||
|
||||
try {
|
||||
if (config.isModeratorRoleAssigned()) {
|
||||
sortByFields = DISPLAY_FIELD.values();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
if (sortByFields == null) {
|
||||
sortByFields = ContentModeratorWidgetConstants.DEFAULT_SORT_BY_FIELDS;
|
||||
}
|
||||
|
||||
final CkanContentModeratorWidgetTrusted cmsTrusted = new CkanContentModeratorWidgetTrusted(
|
||||
ItemStatus.PENDING, DISPLAY_FIELD.values(), sortByFields, config);
|
||||
|
||||
cmsTrusted.showAsModal(null);
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(ShowRevertOperationWidgetEvent.TYPE, new ShowRevertOperationWidgetEventHandler() {
|
||||
@Override
|
||||
public void onShowRevertOperationWidgetEvent(
|
||||
ShowRevertOperationWidgetEvent event) {
|
||||
|
||||
public void onShowRevertOperationWidgetEvent(ShowRevertOperationWidgetEvent event) {
|
||||
|
||||
new ManageProductWidget(event.getEncryptedUrl(), eventBus);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -245,31 +276,81 @@ public class CkanEventHandlerManager {
|
|||
}
|
||||
});
|
||||
|
||||
// hide management panel if user is not allowed to manage
|
||||
// hide management gcubeCkanDataCatalogue if user is not allowed to manage
|
||||
eventBus.addHandler(HideManagementPanelEvent.TYPE, new HideManagementPanelEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onEvent(HideManagementPanelEvent hideEvent) {
|
||||
|
||||
panel.showManagementPanel(false);
|
||||
gcubeCkanDataCatalogue.showManagementPanel(false);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(PublishOnZenodoEvent.TYPE, new PublishOnZenodoEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onPublishOnZenodo(PublishOnZenodoEvent publishOnZenodoEvent) {
|
||||
|
||||
if(publishOnZenodoEvent.getUuidItem()!=null) {
|
||||
|
||||
|
||||
if (publishOnZenodoEvent.getItemId() != null) {
|
||||
|
||||
CkanToZendoPublisherWidget publisherWidget = new CkanToZendoPublisherWidget();
|
||||
CatalogueItem ci = new CatalogueItem(publishOnZenodoEvent.getUuidItem(), null, CatalogueItem.ITEM_TYPE.DATASET);
|
||||
CatalogueItem ci = new CatalogueItem(publishOnZenodoEvent.getItemId(), null, null,
|
||||
CatalogueItem.ITEM_TYPE.DATASET);
|
||||
publisherWidget.publishOnZenodo(ci);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -277,13 +358,14 @@ public class CkanEventHandlerManager {
|
|||
* Gets the ckan request.
|
||||
*
|
||||
* @param pathInfo the path info
|
||||
* @param query the query
|
||||
* @param query the query
|
||||
* @return the ckan request
|
||||
*/
|
||||
private String getCkanRequest(String pathInfo, String query){
|
||||
CkanConnectorAccessPoint ckan = new CkanConnectorAccessPoint(panel.getBaseURLCKANConnector(),"");
|
||||
if(panel.getGcubeTokenValueToCKANConnector() != null)
|
||||
ckan.addGubeToken(panel.getGcubeTokenValueToCKANConnector());
|
||||
private String getCkanRequest(String pathInfo, String query) {
|
||||
CkanConnectorAccessPoint ckan = new CkanConnectorAccessPoint(gcubeCkanDataCatalogue.getBaseURLCKANConnector(),
|
||||
"");
|
||||
if (gcubeCkanDataCatalogue.getGcubeTokenValueToCKANConnector() != null)
|
||||
ckan.addGubeToken(gcubeCkanDataCatalogue.getGcubeTokenValueToCKANConnector());
|
||||
pathInfo = CkanConnectorAccessPoint.checkNullString(pathInfo);
|
||||
query = CkanConnectorAccessPoint.checkNullString(query);
|
||||
ckan.addPathInfo(pathInfo);
|
||||
|
@ -301,7 +383,7 @@ public class CkanEventHandlerManager {
|
|||
@Override
|
||||
public void onSuccess(String result) {
|
||||
logoutFromCKANURL = result;
|
||||
GWT.log("Loaded logout url: "+logoutFromCKANURL);
|
||||
GWT.log("Loaded logout url: " + logoutFromCKANURL);
|
||||
performLogoutOnBrowserClosedEvent(logoutFromCKANURL);
|
||||
}
|
||||
|
||||
|
@ -346,7 +428,8 @@ public class CkanEventHandlerManager {
|
|||
function sleep(milliseconds) {
|
||||
var start = new Date().getTime();
|
||||
for (var i = 0; i < 1e7; i++) {
|
||||
if ((new Date().getTime() - start) > milliseconds || logoutPerformed) {
|
||||
if ((new Date().getTime() - start) > milliseconds
|
||||
|| logoutPerformed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +493,6 @@ public class CkanEventHandlerManager {
|
|||
|
||||
}-*/;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the event bus.
|
||||
*
|
||||
|
@ -421,7 +503,6 @@ public class CkanEventHandlerManager {
|
|||
return eventBus;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the logout from ckanurl.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.github.gwtbootstrap.client.ui.event.HideEvent;
|
||||
import com.github.gwtbootstrap.client.ui.event.HideHandler;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.EventListener;
|
||||
import com.google.gwt.user.client.Random;
|
||||
|
||||
/**
|
||||
* The Class ExtModal.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Apr 29, 2021
|
||||
*
|
||||
* This Class extends the {{@link Modal} preventing the default close of
|
||||
* the Modal Bootstrap when clicking outside of the modal Window
|
||||
*/
|
||||
public class ExtModal extends Modal {
|
||||
|
||||
private String elementId;
|
||||
private String closeElementId;
|
||||
private Boolean closeButtoClicked = false;
|
||||
final private ExtModal INSTANCE = this;
|
||||
|
||||
/**
|
||||
* Instantiates a new ext modal.
|
||||
*/
|
||||
public ExtModal() {
|
||||
super();
|
||||
setElementIds();
|
||||
addDeferredCommandToPreventModalClose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an empty, hidden widget with specified show behavior.
|
||||
*
|
||||
* @param animated <code>true</code> if the widget should be animated.
|
||||
*/
|
||||
public ExtModal(boolean animated) {
|
||||
super(animated, false);
|
||||
setElementIds();
|
||||
addDeferredCommandToPreventModalClose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an empty, hidden widget with specified show behavior.
|
||||
*
|
||||
* @param animated <code>true</code> if the widget should be animated.
|
||||
* @param dynamicSafe <code>true</code> removes from RootPanel when hidden
|
||||
*/
|
||||
public ExtModal(boolean animated, boolean dynamicSafe) {
|
||||
super(animated, dynamicSafe);
|
||||
setElementIds();
|
||||
addDeferredCommandToPreventModalClose();
|
||||
}
|
||||
|
||||
private void addDeferredCommandToPreventModalClose() {
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
((Element) INSTANCE.getElement().getChildNodes().getItem(0)).getFirstChildElement()
|
||||
.setId(closeElementId);
|
||||
preventModalCloseWhenClickingOutside();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the element id.
|
||||
*/
|
||||
private void setElementIds() {
|
||||
this.elementId = "my-modal-publish-meta" + Random.nextInt();
|
||||
this.getElement().setId(elementId);
|
||||
|
||||
this.closeElementId = "my-modal-close-button" + Random.nextInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modal close when clicking outside.
|
||||
*/
|
||||
private void preventModalCloseWhenClickingOutside() {
|
||||
|
||||
com.google.gwt.user.client.Element buttonCloseElement = DOM.getElementById(this.closeElementId);
|
||||
|
||||
if (buttonCloseElement != null) {
|
||||
|
||||
Event.sinkEvents(buttonCloseElement, Event.ONCLICK);
|
||||
Event.setEventListener(buttonCloseElement, new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
System.out.println("ok");
|
||||
if (Event.ONCLICK == event.getTypeInt()) {
|
||||
GWT.log("close event clicked");
|
||||
closeButtoClicked = true;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GWT.log("button close element not found");
|
||||
closeButtoClicked = true;
|
||||
}
|
||||
|
||||
// hide any popup panel opened
|
||||
this.addHideHandler(new HideHandler() {
|
||||
|
||||
@Override
|
||||
public void onHide(HideEvent hideEvent) {
|
||||
GWT.log("HideEvent on modal fired");
|
||||
GWT.log(hideEvent.toDebugString());
|
||||
GWT.log("CloseButtonClicked is: " + closeButtoClicked);
|
||||
|
||||
if (!closeButtoClicked) {
|
||||
hideEvent.preventDefault();
|
||||
hideEvent.stopPropagation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -7,35 +7,39 @@ import com.google.gwt.core.client.EntryPoint;
|
|||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
|
||||
|
||||
/**
|
||||
* The Class GCubeCkanDataCatalog.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Nov 4, 2016
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Nov 4, 2016
|
||||
*/
|
||||
public class GCubeCkanDataCatalog implements EntryPoint {
|
||||
|
||||
/**
|
||||
* Create a remote service proxy to talk to the server-side Greeting
|
||||
* service.
|
||||
* Create a remote service proxy to talk to the server-side Greeting service.
|
||||
*/
|
||||
public static final GcubeCkanDataCatalogServiceAsync service = GWT.create(GcubeCkanDataCatalogService.class);
|
||||
public static final String CKAN_LOGUT_SERVICE = GWT.getModuleBaseURL() +"gcubeckanlogout";
|
||||
public static final String CKAN_LOGUT_SERVICE = GWT.getModuleBaseURL() + "gcubeckanlogout";
|
||||
private final String DIV_PORTLET_ID = "gCubeCkanDataCatalog";
|
||||
private CkanEventHandlerManager eventManager = new CkanEventHandlerManager();
|
||||
public static final String GET_PATH_PARAMETER = "path";
|
||||
public static final String GET_QUERY_PARAMETER = "query";
|
||||
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.
|
||||
*/
|
||||
public void onModuleLoad() {
|
||||
|
||||
GCubeCkanDataCatalogPanel panel = new GCubeCkanDataCatalogPanel(RootPanel.get(DIV_PORTLET_ID), eventManager.getEventBus());
|
||||
GCubeCkanDataCatalogPanel panel = new GCubeCkanDataCatalogPanel(RootPanel.get(DIV_PORTLET_ID),
|
||||
eventManager.getEventBus());
|
||||
eventManager.setPanel(panel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,34 +2,33 @@ 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;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.ManageProductResponse;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
||||
|
||||
/**
|
||||
* The Interface GcubeCkanDataCatalogService.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Nov 4, 2016
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Nov 4, 2016
|
||||
*/
|
||||
@RemoteServiceRelativePath("ckandatacatalogue")
|
||||
public interface GcubeCkanDataCatalogService extends RemoteService {
|
||||
|
||||
|
||||
/**
|
||||
* Get the ckan connector access point.
|
||||
*
|
||||
* @param pathInfoParameters the path info parameters
|
||||
* @param browserLocationURL the browser location URL
|
||||
* @param pathInfoParameters the path info parameters
|
||||
* @param queryStringParameters the query string parameters
|
||||
* @return the c kan connector
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
CkanConnectorAccessPoint getCKanConnector(
|
||||
String pathInfoParameters, String queryStringParameters) throws Exception;
|
||||
CkanConnectorAccessPoint getCKanConnector(String browserLocationURL, String pathInfoParameters,
|
||||
String queryStringParameters) throws Exception;
|
||||
|
||||
/**
|
||||
* Get the current role in CKAN for this user.
|
||||
|
@ -60,30 +59,41 @@ public interface GcubeCkanDataCatalogService extends RemoteService {
|
|||
*/
|
||||
String logoutFromCkanURL();
|
||||
|
||||
// /**
|
||||
// * Remove auth cookie for ckan of this user.
|
||||
// *
|
||||
// * @return the string
|
||||
// */
|
||||
// String logoutURIFromCkan();
|
||||
|
||||
// /**
|
||||
// * Remove auth cookie for ckan of this user.
|
||||
// *
|
||||
// * @return the string
|
||||
// */
|
||||
// String logoutURIFromCkan();
|
||||
|
||||
/**
|
||||
* Check if the manage product needs to be shown (e.g., for GRSF products)
|
||||
* @return
|
||||
*
|
||||
* @return the manage product response
|
||||
*/
|
||||
boolean isManageProductEnabled();
|
||||
|
||||
/**
|
||||
* Check if the management panels but publish/share link must be removed
|
||||
*/
|
||||
String isViewPerVREEnabled();
|
||||
ManageProductResponse isManageProductEnabled();
|
||||
|
||||
/**
|
||||
* Check if the view per VRE is enabled, so the management panels but
|
||||
* publish/share link must be removed.
|
||||
*
|
||||
* @param browserLocationURL the browser location URL
|
||||
* @return the string
|
||||
*/
|
||||
String isViewPerVREEnabled(String browserLocationURL);
|
||||
|
||||
|
||||
/**
|
||||
* Outside login portal.
|
||||
*
|
||||
* @return true, if successful
|
||||
*/
|
||||
boolean outsideLoginPortal();
|
||||
|
||||
/**
|
||||
* Check moderation enabled.
|
||||
*
|
||||
* @param reloadConfig the reload config
|
||||
* @return the manage product response
|
||||
*/
|
||||
ManageProductResponse checkModerationEnabled(boolean reloadConfig);
|
||||
}
|
||||
|
|
|
@ -5,19 +5,17 @@ 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;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.ManageProductResponse;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Interface GcubeCkanDataCatalogServiceAsync.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Nov 4, 2016
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Nov 4, 2016
|
||||
*/
|
||||
public interface GcubeCkanDataCatalogServiceAsync {
|
||||
|
||||
|
@ -30,15 +28,15 @@ public interface GcubeCkanDataCatalogServiceAsync {
|
|||
void getMyRole(AsyncCallback<RolesCkanGroupOrOrg> callback);
|
||||
|
||||
/**
|
||||
* Gets the c kan connector.
|
||||
* Gets the CKAN connector.
|
||||
*
|
||||
* @param pathInfoParameters the path info parameters
|
||||
* @param browserLocationURL the browser location URL that performs the call
|
||||
* @param pathInfoParameters the path info parameters
|
||||
* @param queryStringParameters the query string parameters
|
||||
* @param callback the callback
|
||||
* @param callback the callback
|
||||
* @return the c kan connector
|
||||
*/
|
||||
void getCKanConnector(
|
||||
String pathInfoParameters, String queryStringParameters,
|
||||
void getCKanConnector(String browserLocationURL, String pathInfoParameters, String queryStringParameters,
|
||||
AsyncCallback<CkanConnectorAccessPoint> callback);
|
||||
|
||||
/**
|
||||
|
@ -54,8 +52,7 @@ public interface GcubeCkanDataCatalogServiceAsync {
|
|||
* @param callback the callback
|
||||
* @return the ckan organizations names and urls for user
|
||||
*/
|
||||
void getCkanOrganizationsNamesAndUrlsForUser(
|
||||
AsyncCallback<List<BeanUserInOrgGroupRole>> callback);
|
||||
void getCkanOrganizationsNamesAndUrlsForUser(AsyncCallback<List<BeanUserInOrgGroupRole>> callback);
|
||||
|
||||
/**
|
||||
* Retrieve the list of groups to whom the user belongs and their urls.
|
||||
|
@ -63,28 +60,35 @@ public interface GcubeCkanDataCatalogServiceAsync {
|
|||
* @param callback the callback
|
||||
* @return the ckan groups names and urls for user
|
||||
*/
|
||||
void getCkanGroupsNamesAndUrlsForUser(
|
||||
AsyncCallback<List<BeanUserInOrgGroupRole>> callback);
|
||||
void getCkanGroupsNamesAndUrlsForUser(AsyncCallback<List<BeanUserInOrgGroupRole>> callback);
|
||||
|
||||
/**
|
||||
* Check if the manage product needs to be shown (e.g., for GRSF products)
|
||||
* Checks if is manage product enabled.
|
||||
*
|
||||
* @param callback the callback
|
||||
*/
|
||||
void isManageProductEnabled(AsyncCallback<Boolean> callback);
|
||||
void isManageProductEnabled(AsyncCallback<ManageProductResponse> callback);
|
||||
|
||||
/**
|
||||
* check if the view per vre is enabled.
|
||||
* Checks if is view per VRE enabled.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param browserLocationURL the browser location URL
|
||||
* @param callback the callback
|
||||
*/
|
||||
void isViewPerVREEnabled(AsyncCallback<String> callback);
|
||||
void isViewPerVREEnabled(String browserLocationURL, AsyncCallback<String> callback);
|
||||
|
||||
|
||||
/**
|
||||
* Outside login portal.
|
||||
*
|
||||
* @param callback the callback
|
||||
*/
|
||||
void outsideLoginPortal(AsyncCallback<Boolean> callback);
|
||||
|
||||
/**
|
||||
* Check moderation enabled.
|
||||
*
|
||||
* @param reloadConfig the reload config
|
||||
* @param callback the callback
|
||||
*/
|
||||
void checkModerationEnabled(boolean reloadConfig, AsyncCallback<ManageProductResponse> callback);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
/**
|
||||
* The Class ClickedCMSManageProductButtonEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Jun 15, 2021
|
||||
*/
|
||||
public class ClickedCMSManageProductButtonEvent extends GwtEvent<ClickedCMSManageProductButtonEventHandler> {
|
||||
|
||||
public static Type<ClickedCMSManageProductButtonEventHandler> TYPE = new Type<ClickedCMSManageProductButtonEventHandler>();
|
||||
|
||||
/**
|
||||
* Instantiates a new clicked Content Moderation System (CMS) manage product button event.
|
||||
*/
|
||||
public ClickedCMSManageProductButtonEvent() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the associated type.
|
||||
*
|
||||
* @return the associated type
|
||||
*/
|
||||
@Override
|
||||
public com.google.gwt.event.shared.GwtEvent.Type<ClickedCMSManageProductButtonEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch.
|
||||
*
|
||||
* @param handler the handler
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(ClickedCMSManageProductButtonEventHandler handler) {
|
||||
handler.onClickedManageProduct(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* The Interface ClickedCMSManageProductButtonEventHandler.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Jun 15, 2021
|
||||
*/
|
||||
public interface ClickedCMSManageProductButtonEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* On clicked manage product.
|
||||
*
|
||||
* @param showManageProductWidgetEvent the show manage product widget event
|
||||
*/
|
||||
void onClickedManageProduct(ClickedCMSManageProductButtonEvent showManageProductWidgetEvent);
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -13,24 +13,20 @@ import com.google.gwt.event.shared.GwtEvent;
|
|||
public class PublishOnZenodoEvent extends GwtEvent<PublishOnZenodoEventHandler>{
|
||||
|
||||
public static Type<PublishOnZenodoEventHandler> TYPE = new Type<PublishOnZenodoEventHandler>();
|
||||
private String uuidItem;
|
||||
private String itemId;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new insert metadata event.
|
||||
* Instantiates a new publish on zenodo event.
|
||||
*
|
||||
* @param uuidItem the uuid item
|
||||
* @param itemId the item id
|
||||
*/
|
||||
public PublishOnZenodoEvent(String uuidItem) {
|
||||
this.uuidItem = uuidItem;
|
||||
public PublishOnZenodoEvent(String itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the uuid item.
|
||||
*
|
||||
* @return the uuid item
|
||||
*/
|
||||
public String getUuidItem() {
|
||||
return uuidItem;
|
||||
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,17 +19,17 @@ import com.google.gwt.user.client.ui.Frame;
|
|||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.NamedFrame;
|
||||
|
||||
|
||||
/**
|
||||
* The Class CkanFramePanel.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Jun 9, 2016
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Feb 25, 2022
|
||||
*/
|
||||
public class CkanFramePanel extends FlowPanel{
|
||||
public class CkanFramePanel extends FlowPanel {
|
||||
|
||||
private NamedFrame frame;
|
||||
//private static final String FRAME_NAME = "ckan-content-frame";
|
||||
// private static final String FRAME_NAME = "ckan-content-frame";
|
||||
private HandlerManager eventBus;
|
||||
private Image loading = new Image(CkanPortletResources.ICONS.loading());
|
||||
private String messageToSend;
|
||||
|
@ -47,19 +47,17 @@ public class CkanFramePanel extends FlowPanel{
|
|||
/**
|
||||
* Post message.
|
||||
*
|
||||
* @param msg the msg (as json)
|
||||
* @param javaScriptObject
|
||||
* @param
|
||||
* @param
|
||||
* @param msg the msg (as json)
|
||||
* @param frameName the frame name
|
||||
*/
|
||||
protected native void sendMessage(String msg, String frameName) /*-{
|
||||
console.log("Sending message " + msg);
|
||||
// $wnd.parent.postMessage(msg,'*');
|
||||
//var f = $wnd.frames[frameName];
|
||||
//console.log(f);
|
||||
//f.contentWindow.postMessage(msg, "*");
|
||||
$wnd.frames[frameName].postMessage(msg,"*")
|
||||
console.log("Message sent");
|
||||
console.log("Sending message " + msg);
|
||||
// $wnd.parent.postMessage(msg,'*');
|
||||
//var f = $wnd.frames[frameName];
|
||||
//console.log(f);
|
||||
//f.contentWindow.postMessage(msg, "*");
|
||||
$wnd.frames[frameName].postMessage(msg, "*")
|
||||
console.log("Message sent");
|
||||
}-*/;
|
||||
|
||||
/**
|
||||
|
@ -68,36 +66,38 @@ public class CkanFramePanel extends FlowPanel{
|
|||
* @param msg the msg
|
||||
*/
|
||||
private static native void print(String msg)/*-{
|
||||
console.log(msg);
|
||||
console.log(msg);
|
||||
}-*/;
|
||||
|
||||
/**
|
||||
* Instance frame.
|
||||
*
|
||||
* @param ckanUrlConnector the ckan url connector
|
||||
* @param messageToSend the message to send
|
||||
* @param ckanUrl the ckan url
|
||||
* @return the frame
|
||||
*/
|
||||
public Frame instanceFrame(String ckanUrlConnector, final String messageToSend,final String ckanUrl) {
|
||||
GWT.log("Instancing new IFRAME with uri: "+ckanUrlConnector);
|
||||
try{
|
||||
if(frame != null)
|
||||
public Frame instanceFrame(String ckanUrlConnector, final String messageToSend, final String ckanUrl) {
|
||||
GWT.log("Instancing new IFRAME with uri: " + ckanUrlConnector);
|
||||
try {
|
||||
if (frame != null)
|
||||
remove(frame);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
print("Error " + e);
|
||||
}
|
||||
|
||||
addLoading();
|
||||
String urlEncoded = URL.encode(ckanUrlConnector);
|
||||
GWT.log("Encoded url for instanciating frame is " + urlEncoded);
|
||||
|
||||
|
||||
frame = new NamedFrame(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
|
||||
frame.setUrl(urlEncoded);
|
||||
|
||||
frame.getElement().setId(GCubeCkanDataCatalog.GCUBE_CKAN_IFRAME);
|
||||
frame.setWidth("100%");
|
||||
// frame.setHeight("100%");
|
||||
// frame.getElement().getStyle().setOverflow(Overflow.HIDDEN);
|
||||
// frame.getElement().setAttribute("scrolling", "no");
|
||||
// frame.setHeight("100%");
|
||||
// frame.getElement().getStyle().setOverflow(Overflow.HIDDEN);
|
||||
// frame.getElement().setAttribute("scrolling", "no");
|
||||
frame.getElement().getStyle().setBorderWidth(0, Unit.PX);
|
||||
frame.addLoadHandler(new LoadHandler() {
|
||||
|
||||
|
@ -125,9 +125,9 @@ public class CkanFramePanel extends FlowPanel{
|
|||
}
|
||||
|
||||
/**
|
||||
* add loading image
|
||||
* add loading image.
|
||||
*/
|
||||
private void addLoading(){
|
||||
private void addLoading() {
|
||||
this.add(loading);
|
||||
loading.getElement().getStyle().setProperty("margin", "auto");
|
||||
loading.getElement().getStyle().setDisplay(Display.BLOCK);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
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;
|
||||
|
@ -15,11 +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.constants.AlertType;
|
||||
import com.github.gwtbootstrap.client.ui.DropdownButton;
|
||||
import com.github.gwtbootstrap.client.ui.Label;
|
||||
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;
|
||||
|
@ -29,25 +34,28 @@ import com.google.gwt.event.shared.HandlerManager;
|
|||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.InlineHTML;
|
||||
|
||||
|
||||
/**
|
||||
* The Class CkanMetadataManagementPanel.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @author Costantino Perciante costantino.perciante@isti.cnr.it
|
||||
* Jun 9, 2016
|
||||
* @author Costantino Perciante costantino.perciante@isti.cnr.it Jun 9, 2016
|
||||
*
|
||||
*/
|
||||
public class CkanMetadataManagementPanel extends FlowPanel{
|
||||
public class CkanMetadataManagementPanel extends FlowPanel {
|
||||
|
||||
private static final String MESSAGE_MODERATED_CATALOGUE = "Moderation Enabled";
|
||||
|
||||
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_ITEM_TOOLTIP = "By pushing on this button, you will be able to manage the item you are viewing."
|
||||
private static final String MANAGE_GRSF_ITEM_TOOLTIP = "By pushing on this button, you will be able to manage the item you are viewing."
|
||||
+ " Manageable items are the GRSF ones.";
|
||||
|
||||
private AlertBlock nav = new AlertBlock();
|
||||
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 Navbar nav = new Navbar();
|
||||
|
||||
// generic
|
||||
private Button home = new Button("Home");
|
||||
|
@ -57,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");
|
||||
|
@ -70,8 +81,13 @@ 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 manageProduct = new Button("Manage 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
|
||||
|
||||
private Label messageModerationEnanbled = new Label(); // Moderation message
|
||||
|
||||
private HandlerManager eventBus;
|
||||
|
||||
/**
|
||||
|
@ -79,10 +95,10 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*
|
||||
* @param eventBus the event bus
|
||||
*/
|
||||
public CkanMetadataManagementPanel(HandlerManager eventBus){
|
||||
public CkanMetadataManagementPanel(HandlerManager eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
// this.getElement().getStyle().setPaddingTop(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingTop(H_OFFSET, Unit.PX);
|
||||
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
|
||||
|
||||
// set link style buttons
|
||||
home.setType(ButtonType.LINK);
|
||||
|
@ -91,18 +107,23 @@ 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);
|
||||
manageProduct.setType(ButtonType.PRIMARY);
|
||||
manageProduct.getElement().getStyle().setFloat(Float.RIGHT);
|
||||
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.setTitle(MESSAGE_MODERATED_CATALOGUE);
|
||||
messageModerationEnanbled.getElement().setInnerHTML("<i class='icon-user'></i> " + MESSAGE_MODERATED_CATALOGUE);
|
||||
messageModerationEnanbled.addStyleName("moderation-enabled-flag");
|
||||
|
||||
// set icons
|
||||
home.setIcon(IconType.HOME);
|
||||
|
@ -117,21 +138,42 @@ 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);
|
||||
manageProduct.setIcon(IconType.CHECK_SIGN);
|
||||
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);
|
||||
manageProduct.setVisible(false);
|
||||
manageProduct.setEnabled(false);
|
||||
|
||||
// manage item info
|
||||
manageProduct.setTitle(MANAGE_ITEM_TOOLTIP);
|
||||
manageProduct.getElement().getStyle().setFontWeight(FontWeight.BOLD);
|
||||
// hide manage GRSF product and Moderation
|
||||
manageGRSFProduct.setVisible(false);
|
||||
manageGRSFProduct.setEnabled(false);
|
||||
manageCModS.setVisible(false);
|
||||
manageCModS.setEnabled(false);
|
||||
messageModerationEnanbled.setVisible(false);
|
||||
|
||||
// manage GRSF item info
|
||||
manageGRSFProduct.setTitle(MANAGE_GRSF_ITEM_TOOLTIP);
|
||||
manageGRSFProduct.getElement().getStyle().setFontWeight(FontWeight.BOLD);
|
||||
|
||||
// manage CMS item info
|
||||
manageCModS.setTitle(MANAGE_CMS_ITEMS_TOOLTIP);
|
||||
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);
|
||||
|
@ -139,24 +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(manageProduct);
|
||||
nav.setClose(false);
|
||||
nav.setType(AlertType.INFO);
|
||||
nav.getElement().getStyle().setMarginBottom(0, Unit.PX);
|
||||
nav.getElement().getStyle().setBackgroundColor("#FFF");
|
||||
|
||||
nav.add(manageGRSFProduct);
|
||||
nav.add(manageCModS);
|
||||
|
||||
addHandlers();
|
||||
add(nav);
|
||||
}
|
||||
|
@ -229,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()));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -254,7 +319,6 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
myGroups.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
|
@ -275,12 +339,23 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
}
|
||||
});
|
||||
|
||||
manageProduct.addClickHandler(new ClickHandler() {
|
||||
manageGRSFProduct.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new ShowManageProductWidgetEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
|
||||
eventBus.fireEvent(new ShowManageProductWidgetEvent(
|
||||
GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
manageCModS.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new ClickedCMSManageProductButtonEvent());
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -294,13 +369,14 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
uploadToZenodo.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
eventBus.fireEvent(new PublishOnZenodoEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
|
||||
|
||||
eventBus.fireEvent(
|
||||
new PublishOnZenodoEvent(GCubeCkanDataCatalogPanel.getLatestSelectedProductIdentifier()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -310,30 +386,26 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*
|
||||
* @return the current height
|
||||
*/
|
||||
public int getCurrentHeight(){
|
||||
public int getCurrentHeight() {
|
||||
return this.getOffsetHeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Button to manage the product.. for example in grsf case
|
||||
* Button to manage the GRSF product.. for example in grsf case
|
||||
*
|
||||
* @param value true or false
|
||||
*/
|
||||
public void showManageProductButton(boolean value){
|
||||
manageProduct.setVisible(value);
|
||||
public void showManageGRSFProductButton(boolean value) {
|
||||
manageGRSFProduct.setVisible(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -341,8 +413,37 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*
|
||||
* @param value the value
|
||||
*/
|
||||
public void enableManageProductButton(boolean value){
|
||||
manageProduct.setEnabled(value);
|
||||
public void enableManageGRSFProductButton(boolean value) {
|
||||
manageGRSFProduct.setEnabled(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Button to manage the products under moderation via Content Moderation System
|
||||
* (CMS).
|
||||
*
|
||||
* @param value true or false
|
||||
*/
|
||||
public void showManageCMSProductsButton(boolean value) {
|
||||
manageCModS.setVisible(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show message catalogue is moderated.
|
||||
*
|
||||
* @param isContentModerationEnabled the is content moderation enabled
|
||||
*/
|
||||
public void showMessageCatalogueIsModerated(boolean isContentModerationEnabled) {
|
||||
messageModerationEnanbled.setVisible(isContentModerationEnabled);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable manage CMS products button.
|
||||
*
|
||||
* @param value the value
|
||||
*/
|
||||
public void enableManageCMSProductsButton(boolean value) {
|
||||
manageCModS.setEnabled(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -350,7 +451,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*
|
||||
* @param value the value
|
||||
*/
|
||||
public void enableShareItemButton(boolean value){
|
||||
public void enableShareItemButton(boolean value) {
|
||||
shareLink.setEnabled(value);
|
||||
}
|
||||
|
||||
|
@ -359,26 +460,88 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
*
|
||||
* @param value the value
|
||||
*/
|
||||
public void enablePublishOnZenodoButton(boolean value){
|
||||
public void enablePublishOnZenodoButton(boolean value) {
|
||||
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.
|
||||
*
|
||||
* @param value the value
|
||||
*/
|
||||
public void visibilityPublishOnZenodoButton(boolean value) {
|
||||
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(){
|
||||
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);
|
||||
manageProduct.setVisible(false);
|
||||
deleteItem.setVisible(false);
|
||||
dropMyOptionButtons.setVisible(false);
|
||||
// myDatasets.setVisible(false);
|
||||
// myOrganizations.setVisible(false);
|
||||
// myGroups.setVisible(false);
|
||||
manageGRSFProduct.setVisible(false);
|
||||
manageCModS.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -392,73 +555,72 @@ 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);
|
||||
manageProduct.setVisible(false);
|
||||
manageGRSFProduct.setVisible(false);
|
||||
manageCModS.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Customize label according translate.
|
||||
*
|
||||
* @param labelName the label name
|
||||
* @param labelName the label name
|
||||
* @param translateValue the translate value
|
||||
*/
|
||||
public void customizeLabelAccordingTranslate(String labelName, String translateValue){
|
||||
public void customizeLabelAccordingTranslate(String labelName, String translateValue) {
|
||||
|
||||
|
||||
if(labelName==null || labelName.isEmpty() || translateValue==null || translateValue.isEmpty())
|
||||
if (labelName == null || labelName.isEmpty() || translateValue == null || translateValue.isEmpty())
|
||||
return;
|
||||
|
||||
// GWT.log("labelName "+labelName);
|
||||
// GWT.log("translateValue "+translateValue);
|
||||
// GWT.log("organizations "+organizations.getText());
|
||||
|
||||
if(labelName.compareToIgnoreCase(organizations.getText().trim())==0){
|
||||
if (labelName.compareToIgnoreCase(organizations.getText().trim()) == 0) {
|
||||
organizations.setText(translateValue);
|
||||
//return;
|
||||
}else if(labelName.compareToIgnoreCase(groups.getText().trim())==0){
|
||||
// return;
|
||||
} else if (labelName.compareToIgnoreCase(groups.getText().trim()) == 0) {
|
||||
groups.setText(translateValue);
|
||||
//return;
|
||||
}else if(labelName.compareToIgnoreCase(items.getText().trim())==0){
|
||||
// return;
|
||||
} else if (labelName.compareToIgnoreCase(items.getText().trim()) == 0) {
|
||||
items.setText(translateValue);
|
||||
//return;
|
||||
}else if(labelName.compareToIgnoreCase(types.getText().trim())==0){
|
||||
// return;
|
||||
} else if (labelName.compareToIgnoreCase(types.getText().trim()) == 0) {
|
||||
types.setText(translateValue);
|
||||
//return;
|
||||
// return;
|
||||
}
|
||||
|
||||
String mylabelName = MY_PREFIX+labelName;
|
||||
String mylabelName = MY_PREFIX + labelName;
|
||||
// GWT.log("mylabelName "+mylabelName);
|
||||
// GWT.log("myDatasets.getText() "+myDatasets.getText());
|
||||
|
||||
if(mylabelName.compareToIgnoreCase(myDatasets.getText().trim())==0){
|
||||
myDatasets.setText(MY_PREFIX+translateValue);
|
||||
//return;
|
||||
}else if(mylabelName.compareToIgnoreCase(myOrganizations.getText().trim())==0){
|
||||
myOrganizations.setText(MY_PREFIX+translateValue);
|
||||
//return;
|
||||
}else if(mylabelName.compareToIgnoreCase(myGroups.getText().trim())==0){
|
||||
myGroups.setText(MY_PREFIX+translateValue);
|
||||
//return;
|
||||
if (mylabelName.compareToIgnoreCase(myDatasets.getText().trim()) == 0) {
|
||||
myDatasets.setText(MY_PREFIX + translateValue);
|
||||
// return;
|
||||
} else if (mylabelName.compareToIgnoreCase(myOrganizations.getText().trim()) == 0) {
|
||||
myOrganizations.setText(MY_PREFIX + translateValue);
|
||||
// return;
|
||||
} else if (mylabelName.compareToIgnoreCase(myGroups.getText().trim()) == 0) {
|
||||
myGroups.setText(MY_PREFIX + translateValue);
|
||||
// return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Capitalize.
|
||||
*
|
||||
* @param stringValue the translate value
|
||||
* @return the string
|
||||
*/
|
||||
public static String capitalize(String stringValue){
|
||||
return stringValue.substring(0,1).toUpperCase()+stringValue.substring(1, stringValue.length());
|
||||
public static String capitalize(String stringValue) {
|
||||
return stringValue.substring(0, 1).toUpperCase() + stringValue.substring(1, stringValue.length());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,12 +8,19 @@ 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;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGroupRole;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.ManageProductResponse;
|
||||
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.CkanToZenodoPublisherServiceAsync;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorCheckConfigs;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorWidget;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.util.ModerationQueryStringUtil;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.util.ModerationQueryStringUtil.ModerationBuilder;
|
||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.util.QueryStringUtil;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.logical.shared.ResizeEvent;
|
||||
|
@ -24,6 +31,7 @@ import com.google.gwt.json.client.JSONObject;
|
|||
import com.google.gwt.json.client.JSONParser;
|
||||
import com.google.gwt.json.client.JSONString;
|
||||
import com.google.gwt.json.client.JSONValue;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.Cookies;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
@ -49,27 +57,27 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
private RootPanel rootPanel;
|
||||
private HandlerManager eventBus;
|
||||
private CkanConnectorAccessPoint ckanAccessPoint;
|
||||
private boolean isManageProductToShow = false;
|
||||
private ManageProductResponse manageProductResponse = null;
|
||||
private ManageProductResponse moderationProductResponse = null;
|
||||
private String viewPerVREPath = null;
|
||||
private static String latestSelectedProductIdentifier;
|
||||
public static final int IFRAME_FIX_HEIGHT = 1800;
|
||||
private JSONObject obj;
|
||||
private boolean reloadCatServiceConfig = false;
|
||||
private CkanContentModeratorCheckConfigs ckanModeratorCheckConfig;
|
||||
|
||||
/**
|
||||
* Instantiates a new g cube ckan data catalog panel.
|
||||
*
|
||||
* @param rootPanel
|
||||
* the root panel
|
||||
* @param eventManager
|
||||
* the event manager
|
||||
* @param rootPanel the root panel
|
||||
* @param eventManager the event manager
|
||||
*/
|
||||
public GCubeCkanDataCatalogPanel(
|
||||
RootPanel rootPanel, HandlerManager eventManager) {
|
||||
public GCubeCkanDataCatalogPanel(RootPanel rootPanel, HandlerManager eventManager) {
|
||||
|
||||
this.rootPanel = rootPanel;
|
||||
this.eventBus = eventManager;
|
||||
|
||||
//postMessage(obj.toString(), ckanFramePanel.getFrame());
|
||||
// postMessage(obj.toString(), ckanFramePanel.getFrame());
|
||||
// send message about gateway url
|
||||
obj = new JSONObject();
|
||||
String landingPageVREs = Window.Location.getProtocol() + "//" + Window.Location.getHostName() + "/explore";
|
||||
|
@ -84,9 +92,9 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
setTopPanelVisible(true);
|
||||
|
||||
// decode parameters (they could have been encoded)
|
||||
final Map<String, String> paramsMap = new HashMap<String, String>(2);
|
||||
final Map<String, String> paramsMap = new HashMap<String, String>(3);
|
||||
String queryParameters = Window.Location.getQueryString();
|
||||
if(queryParameters != null && !queryParameters.isEmpty()){
|
||||
if (queryParameters != null && !queryParameters.isEmpty()) {
|
||||
String decoded = URL.decodeQueryString(queryParameters); // equals should be encoded too (%3D)
|
||||
String[] params = decoded.substring(decoded.indexOf("?") + 1).split("&");
|
||||
for (int i = 0; i < params.length; i++) {
|
||||
|
@ -96,17 +104,32 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
GWT.log("Extracted parameters are " + paramsMap);
|
||||
}
|
||||
|
||||
String pathParameter = paramsMap.get(GCubeCkanDataCatalog.GET_PATH_PARAMETER); //Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
String pathParameter = paramsMap.get(GCubeCkanDataCatalog.GET_PATH_PARAMETER); // Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
|
||||
String queryParameter = paramsMap.get(GCubeCkanDataCatalog.GET_QUERY_PARAMETER);// Window.Location.getParameter(GCubeCkanDataCatalog.GET_QUERY_PARAMETER);
|
||||
String queryStringParameter = paramsMap.get(GCubeCkanDataCatalog.GET_QUERY_STRING_PARAMETER);
|
||||
|
||||
GCubeCkanDataCatalog.service.getCKanConnector(
|
||||
pathParameter, queryParameter,
|
||||
if (queryStringParameter != null) {
|
||||
GWT.log("Read " + GCubeCkanDataCatalog.GET_QUERY_STRING_PARAMETER + " as: " + queryStringParameter);
|
||||
String base64DecodeQueryString = QueryStringUtil.base64DecodeQueryString(queryStringParameter);
|
||||
|
||||
ModerationBuilder moderationBuilder = new ModerationQueryStringUtil()
|
||||
.toModerationBuilder(base64DecodeQueryString);
|
||||
if (moderationBuilder != null) {
|
||||
GWT.log("Moderation Builder is: " + moderationBuilder);
|
||||
CkanContentModeratorWidget ccmw = new CkanContentModeratorWidget(moderationBuilder);
|
||||
ccmw.showAsModal("Manage Items");
|
||||
}
|
||||
}
|
||||
|
||||
String browserLocationURL = getBrowserLocationURL();
|
||||
|
||||
GCubeCkanDataCatalog.service.getCKanConnector(browserLocationURL, pathParameter, queryParameter,
|
||||
new AsyncCallback<CkanConnectorAccessPoint>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(CkanConnectorAccessPoint ckan) {
|
||||
|
||||
if(ckan.isOutsideLoginOnPortal()){
|
||||
if (ckan.isOutsideLoginOnPortal()) {
|
||||
|
||||
// the portlet is outside the portal and no user is logged
|
||||
// in show only home and statistics
|
||||
|
@ -121,119 +144,217 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
ckanAccessPoint = ckan;
|
||||
instanceCkanFrame(ckan.buildURI());
|
||||
GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading);
|
||||
|
||||
|
||||
// check if view per organisation is enabled
|
||||
//and performing some actions in this case (e.g. removed the management buttons, etc.)
|
||||
GCubeCkanDataCatalog.service.isViewPerVREEnabled(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
GWT.log("isViewPerVREEnabled?: "+result);
|
||||
if(result != null && !result.isEmpty()){
|
||||
// hide all management buttons
|
||||
managementPanel.removeGenericManagementButtons();
|
||||
// set real relative path
|
||||
ckanAccessPoint.addPathInfo(result);
|
||||
// save this information
|
||||
viewPerVREPath = result;
|
||||
}
|
||||
}
|
||||
String browserLocationURL = getBrowserLocationURL();
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// check if view per organisation is enabled
|
||||
// and performing some actions in this case (e.g. removed the management
|
||||
// buttons, etc.)
|
||||
GCubeCkanDataCatalog.service.isViewPerVREEnabled(browserLocationURL,
|
||||
new AsyncCallback<String>() {
|
||||
|
||||
// ?
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
GWT.log("isViewPerVREEnabled?: " + result);
|
||||
if (result != null && !result.isEmpty()) {
|
||||
// hide all management buttons
|
||||
managementPanel.removeGenericManagementButtons();
|
||||
// set real relative path
|
||||
ckanAccessPoint.addPathInfo(result);
|
||||
// save this information
|
||||
viewPerVREPath = result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
// ?
|
||||
|
||||
if(!ckan.isOutsideLoginOnPortal()){
|
||||
}
|
||||
});
|
||||
|
||||
if (!ckan.isOutsideLoginOnPortal()) {
|
||||
|
||||
// MANAGE CKAN MANAGEMENT PANEL ACCORDING TO MY ROLE
|
||||
GCubeCkanDataCatalog.service.getMyRole(new AsyncCallback<RolesCkanGroupOrOrg>() {
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// retrieve organizations
|
||||
GCubeCkanDataCatalog.service.getCkanOrganizationsNamesAndUrlsForUser(new AsyncCallback<List<BeanUserInOrgGroupRole>>() {
|
||||
GCubeCkanDataCatalog.service.getCkanOrganizationsNamesAndUrlsForUser(
|
||||
new AsyncCallback<List<BeanUserInOrgGroupRole>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<BeanUserInOrgGroupRole> result) {
|
||||
ckanOrganizationsPanel.setOrganizations(result);
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(List<BeanUserInOrgGroupRole> result) {
|
||||
ckanOrganizationsPanel.setOrganizations(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// an error message will be displayed
|
||||
ckanOrganizationsPanel.setOrganizations(null);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// an error message will be displayed
|
||||
ckanOrganizationsPanel.setOrganizations(null);
|
||||
}
|
||||
});
|
||||
|
||||
// retrieve groups
|
||||
GCubeCkanDataCatalog.service.getCkanGroupsNamesAndUrlsForUser(new AsyncCallback<List<BeanUserInOrgGroupRole>>() {
|
||||
GCubeCkanDataCatalog.service.getCkanGroupsNamesAndUrlsForUser(
|
||||
new AsyncCallback<List<BeanUserInOrgGroupRole>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<BeanUserInOrgGroupRole> result) {
|
||||
ckanGroupsPanel.setGroups(result);
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(List<BeanUserInOrgGroupRole> result) {
|
||||
ckanGroupsPanel.setGroups(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
ckanGroupsPanel.setGroups(null);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
ckanGroupsPanel.setGroups(null);
|
||||
}
|
||||
});
|
||||
|
||||
// check if the url encodes a revert operation to be performed
|
||||
if(paramsMap.containsKey(GCubeCkanDataCatalog.REVERT_QUERY_PARAM) &&
|
||||
paramsMap.get(GCubeCkanDataCatalog.REVERT_QUERY_PARAM).equals("true")){
|
||||
if (paramsMap.containsKey(GCubeCkanDataCatalog.REVERT_QUERY_PARAM)
|
||||
&& paramsMap.get(GCubeCkanDataCatalog.REVERT_QUERY_PARAM).equals("true")) {
|
||||
|
||||
eventBus.fireEvent(new ShowRevertOperationWidgetEvent(Window.Location.getHref()));
|
||||
|
||||
}
|
||||
|
||||
final CkanContentModeratorCheckConfigs moderatorcheckConfig = new CkanContentModeratorCheckConfigs();
|
||||
|
||||
final Command whenDone = new Command() {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
GWT.log("onConfigurationLoaded executed");
|
||||
boolean isContentModerationEnabled = false;
|
||||
boolean isModeratorRoleAssingned = false;
|
||||
boolean isExistsMyItemInModeration = false;
|
||||
|
||||
try {
|
||||
isContentModerationEnabled = moderatorcheckConfig.isContentModerationEnabled();
|
||||
isModeratorRoleAssingned = moderatorcheckConfig.isModeratorRoleAssigned();
|
||||
isExistsMyItemInModeration = moderatorcheckConfig.isExistsMyItemInModeration();
|
||||
} catch (Exception e) {
|
||||
GWT.log("Command - Check configs error: " + e.getMessage());
|
||||
}
|
||||
|
||||
ckanModeratorCheckConfig = moderatorcheckConfig;
|
||||
|
||||
GWT.log("Moderation is enabled? " + isContentModerationEnabled);
|
||||
GWT.log("Moderator role is assigned? " + isModeratorRoleAssingned);
|
||||
GWT.log("isExistsMyItemInModeration? " + isExistsMyItemInModeration);
|
||||
|
||||
if (isContentModerationEnabled) {
|
||||
managementPanel.showMessageCatalogueIsModerated(isContentModerationEnabled);
|
||||
}
|
||||
|
||||
// Enabling moderation if the moderation is active in the context and
|
||||
// the user has the role of MODERATOR in the context
|
||||
if (isContentModerationEnabled && isModeratorRoleAssingned) {
|
||||
GWT.log("The moderator role is assigned to user and the moderation is enabled in the context");
|
||||
managementPanel.showManageCMSProductsButton(isContentModerationEnabled);
|
||||
managementPanel.enableManageCMSProductsButton(isContentModerationEnabled);
|
||||
|
||||
}
|
||||
|
||||
// Enabling moderation if the moderation is active in the context and
|
||||
// the user has at least one item under moderation or already moderated
|
||||
if (isContentModerationEnabled && isExistsMyItemInModeration) {
|
||||
GWT.log("The user has at least one item moderated or under moderation, and the moderation is enabled in the context");
|
||||
managementPanel.showManageCMSProductsButton(isContentModerationEnabled);
|
||||
managementPanel.enableManageCMSProductsButton(isContentModerationEnabled);
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
moderatorcheckConfig.checkConfigs(whenDone, reloadCatServiceConfig);
|
||||
// reloadCatServiceConfig = false;
|
||||
} catch (Exception e) {
|
||||
GWT.log("Check configs error: " + e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Just check if it is enabled.. then we need to listen for dom events coming
|
||||
* (GRSF) Just check if it is enabled.. then we need to listen for dom events
|
||||
* coming
|
||||
*/
|
||||
GCubeCkanDataCatalog.service.isManageProductEnabled(new AsyncCallback<Boolean>() {
|
||||
GCubeCkanDataCatalog.service
|
||||
.isManageProductEnabled(new AsyncCallback<ManageProductResponse>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Boolean result) {
|
||||
isManageProductToShow = result;
|
||||
managementPanel.showManageProductButton(isManageProductToShow);
|
||||
@Override
|
||||
public void onSuccess(ManageProductResponse manageResponse) {
|
||||
manageProductResponse = manageResponse;
|
||||
if (manageProductResponse != null) {
|
||||
managementPanel.showManageGRSFProductButton(
|
||||
manageProductResponse.isManageEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
isManageProductToShow = false;
|
||||
managementPanel.showManageProductButton(isManageProductToShow);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
managementPanel.showManageGRSFProductButton(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -247,14 +368,12 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
Window.addResizeHandler(new ResizeHandler() {
|
||||
|
||||
@Override
|
||||
public void onResize(ResizeEvent event) {
|
||||
|
||||
GWT.log("onWindowResized width: " + event.getWidth() +
|
||||
" height: " + event.getHeight());
|
||||
GWT.log("onWindowResized width: " + event.getWidth() + " height: " + event.getHeight());
|
||||
updateSize();
|
||||
}
|
||||
});
|
||||
|
@ -266,9 +385,44 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
// listen for DOM messages
|
||||
listenForPostMessage();
|
||||
|
||||
CkanToZenodoPublisherServiceAsync.Util.getInstance().checkZenodoEnvironment(new AsyncCallback<Boolean>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
managementPanel.visibilityPublishOnZenodoButton(false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Boolean result) {
|
||||
GWT.log("checkZenodoEnvironment result: " + result);
|
||||
managementPanel.visibilityPublishOnZenodoButton(result);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static String getLatestSelectedProductIdentifier(){
|
||||
/**
|
||||
* Gets the browser location URL.
|
||||
*
|
||||
* @return the browser location URL
|
||||
*/
|
||||
public String getBrowserLocationURL() {
|
||||
|
||||
String browserLocationURL = null;
|
||||
|
||||
try {
|
||||
browserLocationURL = Window.Location.getHref();
|
||||
} catch (Exception e) {
|
||||
// silent
|
||||
}
|
||||
|
||||
GWT.log("Returning browserLocationURL: " + browserLocationURL);
|
||||
return browserLocationURL;
|
||||
}
|
||||
|
||||
public static String getLatestSelectedProductIdentifier() {
|
||||
return latestSelectedProductIdentifier;
|
||||
}
|
||||
|
||||
|
@ -287,8 +441,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
/**
|
||||
* Sets the top panel visible.
|
||||
*
|
||||
* @param bool
|
||||
* the new top panel visible
|
||||
* @param bool the new top panel visible
|
||||
*/
|
||||
public void setTopPanelVisible(boolean bool) {
|
||||
|
||||
|
@ -296,22 +449,20 @@ 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.
|
||||
*
|
||||
* @param ckanUrlConnector
|
||||
* the ckan url connector
|
||||
* @param ckanUrlConnector the ckan url connector
|
||||
* @return the frame
|
||||
*/
|
||||
public Frame instanceCkanFrame(String ckanUrlConnector) {
|
||||
|
@ -343,16 +494,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
* Update window size.
|
||||
*/
|
||||
public void updateSize() {
|
||||
/*RootPanel workspace = rootPanel;
|
||||
int topBorder = workspace.getAbsoluteTop();
|
||||
GWT.log("top: "+topBorder);
|
||||
int footer = 30; // 85 footer is bottombar + sponsor
|
||||
int rootHeight = Window.getClientHeight() - topBorder - 5 - footer;
|
||||
int height = rootHeight - getTopPanelHeight();
|
||||
if (ckanFramePanel.getFrame() != null) {
|
||||
int newH =managementPanel != null && managementPanel.getCurrentHeight() > 0 ? managementPanel.getOffsetHeight() + height : height;
|
||||
ckanFramePanel.getFrame().setHeight(2000+"px");
|
||||
}*/
|
||||
/*
|
||||
* RootPanel workspace = rootPanel; int topBorder = workspace.getAbsoluteTop();
|
||||
* GWT.log("top: "+topBorder); int footer = 30; // 85 footer is bottombar +
|
||||
* sponsor int rootHeight = Window.getClientHeight() - topBorder - 5 - footer;
|
||||
* int height = rootHeight - getTopPanelHeight(); if (ckanFramePanel.getFrame()
|
||||
* != null) { int newH =managementPanel != null &&
|
||||
* managementPanel.getCurrentHeight() > 0 ? managementPanel.getOffsetHeight() +
|
||||
* height : height; ckanFramePanel.getFrame().setHeight(2000+"px"); }
|
||||
*/
|
||||
|
||||
RootPanel workspace = this.rootPanel;
|
||||
int topBorder = workspace.getAbsoluteTop();
|
||||
|
@ -360,14 +510,17 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
int rootHeight = Window.getClientHeight() - topBorder - 5 - footer;
|
||||
int height = rootHeight - getTopPanelHeight();
|
||||
if (this.ckanFramePanel.getFrame() != null) {
|
||||
int newH = this.managementPanel != null &&this.managementPanel.getCurrentHeight() > 0? this.managementPanel.getOffsetHeight() + height : height;
|
||||
int newH = this.managementPanel != null && this.managementPanel.getCurrentHeight() > 0
|
||||
? this.managementPanel.getOffsetHeight() + height
|
||||
: height;
|
||||
this.ckanFramePanel.getFrame().setHeight(newH + "px");
|
||||
}
|
||||
// workspace.setHeight(height+"px");
|
||||
// workspace.setHeight(height+"px");
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a message
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
protected native void printString(String string) /*-{
|
||||
|
@ -378,71 +531,80 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
* Listen for post message.
|
||||
*/
|
||||
private final native void listenForPostMessage() /*-{
|
||||
var that = this;
|
||||
$wnd.addEventListener("message", function(msg) {
|
||||
console.log("read message...");
|
||||
that.@org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view.GCubeCkanDataCatalogPanel::onPostMessage(Ljava/lang/String;Ljava/lang/String;)(msg.data, msg.origin);
|
||||
});
|
||||
var that = this;
|
||||
$wnd
|
||||
.addEventListener(
|
||||
"message",
|
||||
function(msg) {
|
||||
console.log("read message...");
|
||||
that.@org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view.GCubeCkanDataCatalogPanel::onPostMessage(Ljava/lang/String;Ljava/lang/String;)(msg.data, msg.origin);
|
||||
});
|
||||
}-*/;
|
||||
|
||||
/**
|
||||
* On post message.
|
||||
*
|
||||
* @param data the data
|
||||
* @param data the data
|
||||
* @param origin the origin
|
||||
*/
|
||||
private void onPostMessage(String data, String origin) {
|
||||
printString("Read data: "+data+", from origin: "+origin);
|
||||
printString("Ckan base url: "+ckanAccessPoint.getBaseUrl());
|
||||
printString("Read data: " + data + ", from origin: " + origin);
|
||||
printString("Ckan base url: " + ckanAccessPoint.getBaseUrl());
|
||||
|
||||
// parsing data.. it is a json bean of the type
|
||||
printString("Incoming message is " + data + " from " + origin);
|
||||
|
||||
if (ckanAccessPoint.getBaseUrl().indexOf(origin)>=0) {
|
||||
if (ckanAccessPoint.getBaseUrl().indexOf(origin) >= 0) {
|
||||
// The data has been sent from your site
|
||||
// The data sent with postMessage is stored in event.data
|
||||
String height = null;
|
||||
String productId = null;
|
||||
boolean isProductKeyMissing = false;
|
||||
|
||||
try{
|
||||
try {
|
||||
JSONValue parsedJSON = JSONParser.parseStrict(data);
|
||||
JSONObject object = parsedJSON.isObject();
|
||||
GWT.log("Object is " + object);
|
||||
if(object != null){
|
||||
//Supporting Task #12286: parsing the translate values for 'dataset', 'organization' and so on
|
||||
if(object.containsKey("translate")){
|
||||
if (object != null) {
|
||||
// Supporting Task #12286: parsing the translate values for 'dataset',
|
||||
// 'organization' and so on
|
||||
if (object.containsKey("translate")) {
|
||||
JSONObject theTranslate = (JSONObject) object.get("translate");
|
||||
GWT.log("theTranslate is " + object);
|
||||
for (String key : theTranslate.keySet()) {
|
||||
//GWT.log("theTranslate key " + key);
|
||||
// GWT.log("theTranslate key " + key);
|
||||
String value = theTranslate.get(key).isString().stringValue();
|
||||
printString("Customizing navigation link '" + key +"' with translate: "+value);
|
||||
managementPanel.customizeLabelAccordingTranslate(key,value);
|
||||
printString("Customizing navigation link '" + key + "' with translate: " + value);
|
||||
managementPanel.customizeLabelAccordingTranslate(key, value);
|
||||
}
|
||||
|
||||
}else if(object.containsKey("height")){
|
||||
} else if (object.containsKey("height")) {
|
||||
|
||||
height = object.get("height").isString().stringValue();
|
||||
if(object.containsKey("product"))
|
||||
if (object.containsKey("product"))
|
||||
productId = object.get("product").isString().stringValue();
|
||||
else
|
||||
isProductKeyMissing = true;
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
GWT.log("Exception is " + e);
|
||||
}
|
||||
|
||||
if(height != null)
|
||||
if (height != null)
|
||||
setIFrameHeight(height.toString());
|
||||
|
||||
// show or hide the manage product button
|
||||
if(!isProductKeyMissing){
|
||||
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.enableManageProductButton(productId != null && !productId.isEmpty() && isManageProductToShow);
|
||||
managementPanel.enableManageGRSFProductButton(
|
||||
productId != null && !productId.isEmpty() && manageProductResponse.isManageEnabled());
|
||||
// managementPanel.enableManageCMSProductsButton(productId != null &&
|
||||
// !productId.isEmpty() && moderationProductResponse.isManageEnabled());
|
||||
}
|
||||
} else {
|
||||
// The data hasn't been sent from your site!
|
||||
|
@ -452,30 +614,43 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the i frame height.
|
||||
*
|
||||
* @param height the new i frame height
|
||||
*/
|
||||
private void setIFrameHeight(String height){
|
||||
private void setIFrameHeight(String height) {
|
||||
String parsedHeight = null;
|
||||
if(height==null || height.isEmpty())
|
||||
if (height == null || height.isEmpty())
|
||||
return;
|
||||
|
||||
if(height.contains("px")){
|
||||
if (height.contains("px")) {
|
||||
parsedHeight = height;
|
||||
}else{
|
||||
try{
|
||||
|
||||
// Setting parsedHeight to null if the height is 0px
|
||||
String checkHeight = height;
|
||||
checkHeight = checkHeight.replaceAll("px", "");
|
||||
try {
|
||||
int intH = Integer.parseInt(checkHeight);
|
||||
if (intH == 0) {
|
||||
parsedHeight = null;
|
||||
printString("height is 0px so setting parsedHeight = null");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
int intH = Integer.parseInt(height);
|
||||
parsedHeight = intH + " px";
|
||||
}catch(Exception e ){
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(parsedHeight!=null){
|
||||
GWT.log("Setting new height for ckan iFrame: "+height);
|
||||
if (parsedHeight != null) {
|
||||
GWT.log("Setting new height for ckan iFrame: " + height);
|
||||
this.ckanFramePanel.getFrame().setHeight(height);
|
||||
}
|
||||
}
|
||||
|
@ -492,9 +667,10 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
/**
|
||||
* Return the catalogue url (e.g. http://ckan-d-d4s.d4science.org:443/)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCatalogueUrl(){
|
||||
public String getCatalogueUrl() {
|
||||
|
||||
printString("Base url for iframe is " + ckanAccessPoint.getCatalogueBaseUrl());
|
||||
return ckanAccessPoint.getCatalogueBaseUrl();
|
||||
|
@ -542,11 +718,12 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
|
||||
/**
|
||||
* Show management panel
|
||||
*
|
||||
* @param show
|
||||
*/
|
||||
public void showManagementPanel(boolean show){
|
||||
public void showManagementPanel(boolean show) {
|
||||
|
||||
managementPanel.showManageProductButton(show);
|
||||
managementPanel.showManageGRSFProductButton(show);
|
||||
|
||||
}
|
||||
|
||||
|
@ -557,4 +734,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
|
|||
return viewPerVREPath != null;
|
||||
}
|
||||
|
||||
public CkanContentModeratorCheckConfigs getCkanModeratorConfig() {
|
||||
return ckanModeratorCheckConfig;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,15 +17,18 @@ 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;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.ManageProductResponse;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
|
@ -34,8 +37,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.
|
||||
*
|
||||
|
@ -81,12 +82,13 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
* @see org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService#getCKanConnector(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public CkanConnectorAccessPoint getCKanConnector(String pathInfoParameter, String queryStringParameters) throws Exception {
|
||||
public CkanConnectorAccessPoint getCKanConnector(String browserLocationURL, String pathInfoParameter, String queryStringParameters) throws Exception {
|
||||
logger.info("getCKanConnector [browserLocationURL: "+browserLocationURL+ " ]");
|
||||
logger.info("getCKanConnector [pathInfo: "+pathInfoParameter + ", query: "+queryStringParameters+"]");
|
||||
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());
|
||||
|
@ -106,10 +108,19 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
}
|
||||
|
||||
if(pathInfoParameter == null || pathInfoParameter.isEmpty()){
|
||||
pathInfoParameter = isViewPerVREEnabled();
|
||||
//pathInfoParameter is null or empty, in this case we are pointing to the Catalogue Home
|
||||
pathInfoParameter = isViewPerVREEnabled(browserLocationURL);
|
||||
}
|
||||
|
||||
CkanConnectorAccessPoint ckAP = getCkanConnectorAccessPoint(pathInfoParameter, queryStringParameters, scopePerCurrentUrl);
|
||||
//#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);
|
||||
|
@ -125,13 +136,14 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
/**
|
||||
* Gets the ckan connector access point.
|
||||
*
|
||||
* @param browserLocationURL the browser location URL
|
||||
* @param pathInfoParameter the path info parameter
|
||||
* @param queryStringParameters the query string parameters
|
||||
* @param scopePerCurrentUrl the scope per current url
|
||||
* @return the ckan connector access point
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
private CkanConnectorAccessPoint getCkanConnectorAccessPoint(String pathInfoParameter, String queryStringParameters, String scopePerCurrentUrl) throws Exception {
|
||||
private CkanConnectorAccessPoint getCkanConnectorAccessPoint(String browserLocationURL, String pathInfoParameter, String queryStringParameters, String scopePerCurrentUrl) throws Exception {
|
||||
|
||||
if(outsideLoginPortal()){
|
||||
CkanConnectorAccessPoint ckan = new CkanConnectorAccessPoint(getCatalogue(scopePerCurrentUrl).getCatalogueUrl(),"");
|
||||
|
@ -186,7 +198,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
getThreadLocalRequest()).getEmail(),
|
||||
scopePerCurrentUrl,
|
||||
getCatalogue(scopePerCurrentUrl),
|
||||
isViewPerVREEnabled() != null,
|
||||
isViewPerVREEnabled(browserLocationURL) != null,
|
||||
getThreadLocalRequest().getSession());
|
||||
ckan.addListOfVREs(roleForVre);
|
||||
|
||||
|
@ -234,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();
|
||||
|
@ -302,9 +314,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();
|
||||
|
@ -330,10 +341,10 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
// String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
//
|
||||
// CkanConnectorAccessPoint ckanAP = SessionUtil.getCkanAccessPoint(this.getThreadLocalRequest().getSession(), scopePerCurrentUrl);
|
||||
// logger.info("Logout from CKAN for: "+username +" by token: "+ckanAP.getGcubeTokenValue());
|
||||
// LOG.info("Logout from CKAN for: "+username +" by token: "+ckanAP.getGcubeTokenValue());
|
||||
//
|
||||
// String ckanConnectorLogut = getServletContext().getInitParameter(CKANCONNECTORLOGOUT);
|
||||
// logger.debug(CKANCONNECTORLOGOUT + " is: "+ckanConnectorLogut);
|
||||
// LOG.debug(CKANCONNECTORLOGOUT + " is: "+ckanConnectorLogut);
|
||||
//
|
||||
// CkanConnectorAccessPoint ckan = new CkanConnectorAccessPoint(ckanAP.getBaseUrl(), ckanConnectorLogut);
|
||||
// ckan.addGubeToken(ckanAP.getGcubeTokenValue());
|
||||
|
@ -408,8 +419,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();
|
||||
|
@ -455,9 +465,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();
|
||||
|
@ -506,33 +515,64 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
* @see org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService#isManageProductEnabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isManageProductEnabled() {
|
||||
public ManageProductResponse isManageProductEnabled() {
|
||||
logger.info("Checking if the manage product button needs to be shown or not for the current context");
|
||||
String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
DataCatalogue catalogue = getCatalogue(scopePerCurrentUrl);
|
||||
if(catalogue == null){
|
||||
logger.warn("There is no catalogue instance here..., returning false");
|
||||
return false;
|
||||
return new ManageProductResponse(false, scopePerCurrentUrl);
|
||||
}
|
||||
else{
|
||||
try{
|
||||
boolean toReturn = catalogue.isManageProductEnabled();
|
||||
logger.info("Will manage product be enabled for this user? " + Boolean.toString(toReturn));
|
||||
return toReturn;
|
||||
boolean isManageProductEnabled = catalogue.isManageProductEnabled();
|
||||
logger.info("isManageProductEnabled: "+isManageProductEnabled);
|
||||
|
||||
//TO BE SURE THAT THE CURRENT CONTEXT IS A GRSF SCOPE FOR ENABLING THE "MANAGE GRSF ITEM"
|
||||
boolean isGRSFContext = false;
|
||||
if (scopePerCurrentUrl != null) {
|
||||
if (scopePerCurrentUrl.toLowerCase().contains("grsf")) {
|
||||
isGRSFContext = true;
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("isGRSFContext: "+isGRSFContext);
|
||||
|
||||
boolean toReturn = false;
|
||||
if(isGRSFContext && isManageProductEnabled) {
|
||||
toReturn = true;
|
||||
}
|
||||
|
||||
logger.info("returning manage enabled: "+toReturn);
|
||||
ManageProductResponse mpr = new ManageProductResponse(toReturn, scopePerCurrentUrl);
|
||||
logger.info("Will manage product be enabled for this user? " + mpr);
|
||||
return mpr;
|
||||
}catch(Exception e){
|
||||
logger.error("Unable to determine if the manage product needs to be shown or not", e);
|
||||
return false;
|
||||
return new ManageProductResponse(false, scopePerCurrentUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManageProductResponse checkModerationEnabled(boolean reloadConfig) {
|
||||
logger.info("Checking if the moderation is enabled in the current context, reload config? "+reloadConfig);
|
||||
String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
DataCatalogue catalogue = getCatalogue(scopePerCurrentUrl);
|
||||
boolean moderationEnabled = catalogue.isModerationEnabled(reloadConfig);
|
||||
logger.info("moderation Enabled? "+moderationEnabled);
|
||||
return new ManageProductResponse(moderationEnabled, scopePerCurrentUrl);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask to liferay.
|
||||
*
|
||||
* @param browserLocationURL the browser location URL
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String isViewPerVREEnabled(){
|
||||
public String isViewPerVREEnabled(String browserLocationURL){
|
||||
|
||||
String toReturn = null;
|
||||
String scopePerCurrentUrl = SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());// the view per vre can be managed independently for each context SessionUtil.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
|
@ -552,11 +592,22 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
GroupManager gm = new LiferayGroupManager();
|
||||
enabled = (boolean) gm.readCustomAttr(gm.getGroupIdFromInfrastructureScope(scopePerCurrentUrl), VIEW_PER_ORGANIZATION_LIFERAY_CUSTOM_FIELD);
|
||||
|
||||
if(enabled){
|
||||
String groupName = gm.getGroup(gm.getGroupIdFromInfrastructureScope(scopePerCurrentUrl)).getGroupName().toLowerCase();
|
||||
toReturn = "/organization_vre/" + groupName;
|
||||
logger.info("VRE name (toLowerCase) read by LF GroupManager is: "+groupName);
|
||||
String secureVREName = "/"+groupName+"/";
|
||||
if(browserLocationURL.toLowerCase().contains(secureVREName)){
|
||||
//this should mean the caller (the location URL) is from VRE environment
|
||||
logger.info("The browserLocationURL: "+browserLocationURL+ " contains the string /VRE name/ '"+secureVREName+"'. The Catalogue Portlet should be at VRE level, reading configuration isViewPerVREEnabled");
|
||||
toReturn = "/organization_vre/" + groupName;
|
||||
}else {
|
||||
//this should mean the caller is out from VRE environment,so should be a public or gateway catalogue
|
||||
logger.info("The browserLocationURL: "+browserLocationURL+ " DOES NOT contain the string /VRE name/ '"+secureVREName+"'. The Catalogue Portlet should NOT be at VRE level. Ignoring configuration isViewPerVREEnabled");
|
||||
}
|
||||
}
|
||||
logger.debug("Read value for " + VIEW_PER_ORGANIZATION_LIFERAY_CUSTOM_FIELD + " is " + enabled + " and path is " + toReturn);
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("Failed to parse custom field value", e);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -33,7 +33,7 @@ public class SessionUtil {
|
|||
public static final String CKAN_END_POINT = "CKAN_END_POINT";
|
||||
public static final String CKAN_ACCESS_POINT = "CKAN_ACCESS_POINT";
|
||||
public static final String GCUBE_REQUEST_URL = "gcube-request-url";
|
||||
//private static Logger logger = LoggerFactory.getLogger(SessionUtil.class);
|
||||
//private static Logger LOG = LoggerFactory.getLogger(SessionUtil.class);
|
||||
private static final Log logger = LogFactoryUtil.getLog(SessionUtil.class);
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,11 +6,13 @@ 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;
|
||||
|
||||
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,32 +32,30 @@ 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;
|
||||
|
||||
|
||||
/**
|
||||
* 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 logger = 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();
|
||||
|
@ -65,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();
|
||||
|
@ -134,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
|
||||
|
@ -221,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
@ -25,18 +24,20 @@ import org.w3c.dom.Element;
|
|||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
|
||||
/**
|
||||
* This thread is scheduled to update the resource related to org.gcube.datacatalogue.ProductCatalogue
|
||||
* This thread is scheduled to update the resource related to
|
||||
* org.gcube.datacatalogue.ProductCatalogue
|
||||
* {org.gcube.portlets.widgets.ckandatapublisherwidget.server.threads}
|
||||
*
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public class UpdateItemCatalogueResource extends Thread{
|
||||
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 APP_ID_CATALOGUE_APPLICATION_PROFILE = "service-account-gcat";
|
||||
|
||||
/**
|
||||
* @param currentScope
|
||||
|
@ -51,55 +52,57 @@ public class UpdateItemCatalogueResource extends Thread{
|
|||
@Override
|
||||
public void run() {
|
||||
|
||||
try{
|
||||
try {
|
||||
|
||||
if(cleanUrl == null || cleanUrl.isEmpty() || currentScope==null || currentScope.isEmpty()){
|
||||
if (cleanUrl == null || cleanUrl.isEmpty() || currentScope == null || currentScope.isEmpty()) {
|
||||
logger.warn("One or more arguments {}{} is wrong. Exiting", currentScope, cleanUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
ScopeBean scope = new ScopeBean(currentScope);
|
||||
if(!scope.is(Type.VRE)){
|
||||
ScopeBean scope = new ScopeBean(currentScope);
|
||||
if (!scope.is(Type.VRE)) {
|
||||
logger.warn("{} is not a VRE scope", currentScope);
|
||||
return;
|
||||
}
|
||||
|
||||
// set the scope of the root infrastructure
|
||||
String rootInfrastructure = getRootScope();
|
||||
ScopeProvider.instance.set("/"+rootInfrastructure);
|
||||
ScopeProvider.instance.set("/" + rootInfrastructure);
|
||||
|
||||
// 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 + "'" +
|
||||
"return $profile");
|
||||
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 '" + APP_ID_CATALOGUE_APPLICATION_PROFILE + "'" + "return $profile");
|
||||
|
||||
DiscoveryClient<String> client = client();
|
||||
List<String> appProfile = client.submit(q);
|
||||
|
||||
if (appProfile == null || appProfile.size() == 0)
|
||||
if (appProfile == null || appProfile.size() == 0)
|
||||
throw new Exception("this applicationProfile is not registered in the infrastructure");
|
||||
else{
|
||||
else {
|
||||
|
||||
String elem = appProfile.get(0);
|
||||
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Node node = docBuilder.parse(new InputSource(new StringReader(elem))).getDocumentElement();
|
||||
XPathHelper helper = new XPathHelper(node);
|
||||
|
||||
// look for the scope
|
||||
List<String> currValue = null;
|
||||
currValue = helper.evaluate(String.format("/Resource/Profile/Body/EndPoint/Scope/text()[.='%s']", scope));
|
||||
currValue = helper
|
||||
.evaluate(String.format("/Resource/Profile/Body/EndPoint/Scope/text()[.='%s']", scope));
|
||||
logger.debug("Result is " + currValue);
|
||||
|
||||
if (currValue == null || currValue.isEmpty()) {
|
||||
logger.info("Adding the following url " + cleanUrl);
|
||||
|
||||
String endpoint2Add = "<EndPoint><Scope>"+currentScope+"</Scope><URL>"+cleanUrl+"</URL></EndPoint>";
|
||||
String endpoint2Add = "<EndPoint><Scope>" + currentScope + "</Scope><URL>" + cleanUrl
|
||||
+ "</URL></EndPoint>";
|
||||
GenericResource toUpdate = clientFor(GenericResource.class).submit(q).get(0);
|
||||
try {
|
||||
docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Element body = toUpdate.profile().body();
|
||||
Node fragmentNode = docBuilder.parse(new InputSource(new StringReader(endpoint2Add))).getDocumentElement();
|
||||
Node fragmentNode = docBuilder.parse(new InputSource(new StringReader(endpoint2Add)))
|
||||
.getDocumentElement();
|
||||
fragmentNode = body.getOwnerDocument().importNode(fragmentNode, true);
|
||||
body.appendChild(fragmentNode);
|
||||
} catch (Exception e) {
|
||||
|
@ -110,20 +113,21 @@ public class UpdateItemCatalogueResource extends Thread{
|
|||
logger.info("Resource updated!");
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to execute this check", e);
|
||||
}finally{
|
||||
} finally {
|
||||
ScopeProvider.instance.reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getRootScope() throws Exception{
|
||||
private String getRootScope() throws Exception {
|
||||
|
||||
if(currentScope == null || currentScope.isEmpty())
|
||||
if (currentScope == null || currentScope.isEmpty())
|
||||
throw new Exception("Scope was not specified");
|
||||
|
||||
return currentScope.split("/")[1];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* The Class ManageProductResponse.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Feb 17, 2022
|
||||
*/
|
||||
public class ManageProductResponse implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4042294108868246495L;
|
||||
// Is GRSF MANAGE in the GRSF context, Is gCat moderation in the other contexts
|
||||
private boolean isManageEnabled = false;
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* Instantiates a new manage product response.
|
||||
*/
|
||||
public ManageProductResponse() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new manage product response.
|
||||
*
|
||||
* @param isManageEnabled the is manage enabled
|
||||
* @param scope the scope
|
||||
*/
|
||||
public ManageProductResponse(boolean isManageEnabled, String scope) {
|
||||
this.isManageEnabled = isManageEnabled;
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is manage enabled.
|
||||
*
|
||||
* @return true, if is manage enabled
|
||||
*/
|
||||
public boolean isManageEnabled() {
|
||||
return isManageEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the scope.
|
||||
*
|
||||
* @return the scope
|
||||
*/
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the manage enabled.
|
||||
*
|
||||
* @param isManageEnabled the new manage enabled
|
||||
*/
|
||||
public void setManageEnabled(boolean isManageEnabled) {
|
||||
this.isManageEnabled = isManageEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scope.
|
||||
*
|
||||
* @param scope the new scope
|
||||
*/
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("ManageProductResponse [isManageEnabled=");
|
||||
builder.append(isManageEnabled);
|
||||
builder.append(", scope=");
|
||||
builder.append(scope);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -14,24 +14,38 @@
|
|||
<!-- Other module inherits -->
|
||||
<inherits name="com.google.gwt.json.JSON" />
|
||||
<!-- Inherits widget -->
|
||||
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.openlayerbasicwidgets.olbasicwidgets' />
|
||||
|
||||
|
||||
<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 name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
|
||||
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
<inherits
|
||||
name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
|
||||
<inherits
|
||||
name='org.gcube.datacatalogue.utillibrary.CkanUtilLibrary' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
|
||||
<inherits name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
||||
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckancontentmoderator.CkanContentModeratorWidget' />
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point
|
||||
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
|
|
|
@ -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 {
|
||||
|
@ -144,4 +148,42 @@ h1 {
|
|||
.button-as-role-style {
|
||||
padding-left: 0px !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.modal-content-moderator {
|
||||
width: 1200px;
|
||||
min-height: 720px;
|
||||
}
|
||||
|
||||
.modal-content-moderator .modal-body {
|
||||
min-height: 720px;
|
||||
}
|
||||
|
||||
.moderation-enabled-flag {
|
||||
float: right;
|
||||
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;
|
||||
}
|
|
@ -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>
|
||||
|
||||
|
@ -33,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>
|
||||
|
|
|
@ -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>
|
|
@ -11,13 +11,6 @@
|
|||
<param-value>/gcube/service/connect</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- <context-param> -->
|
||||
<!-- <description>Used like GET parameter in order to hide header section
|
||||
of CKAN template from gCube Portal</description> -->
|
||||
<!-- <param-name>CkanHideHeader</param-name> -->
|
||||
<!-- <param-value>hh</param-value> -->
|
||||
<!-- </context-param> -->
|
||||
|
||||
<context-param>
|
||||
<description>ckan connector logout from CKAN</description>
|
||||
<param-name>CkanConnectorLogout</param-name>
|
||||
|
@ -30,16 +23,6 @@
|
|||
<servlet-class>org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.GcubeCkanDataCatalogServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<!-- <servlet> -->
|
||||
<!-- <servlet-name>gcubeckanlogout</servlet-name> -->
|
||||
<!-- <servlet-class>org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.CkanLogout</servlet-class> -->
|
||||
<!-- </servlet> -->
|
||||
|
||||
<!-- <servlet> -->
|
||||
<!-- <servlet-name>checkServlet</servlet-name> -->
|
||||
<!-- <servlet-class>org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl</servlet-class> -->
|
||||
<!-- </servlet> -->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>ckanpublisherservices</servlet-name>
|
||||
<servlet-class>org.gcube.portlets.widgets.ckandatapublisherwidget.server.CKANPublisherServicesImpl</servlet-class>
|
||||
|
@ -55,12 +38,39 @@
|
|||
<servlet-class>org.gcube.portlets_widgets.catalogue_sharing_widget.server.ShareServicesImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<!-- Servlets -->
|
||||
<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>
|
||||
<servlet-class>org.gcube.portlets.widgets.ckan2zenodopublisher.server.CkanToZenodoPublisherServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>ckanContentModeratorServlet</servlet-name>
|
||||
<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>
|
||||
|
@ -86,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> -->
|
||||
|
|
|
@ -1,26 +1,30 @@
|
|||
//package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
||||
//
|
||||
//import com.google.gwt.junit.client.GWTTestCase;
|
||||
//
|
||||
///**
|
||||
// * GWT JUnit <b>integration</b> tests must extend GWTTestCase.
|
||||
// * Using <code>"GwtTest*"</code> naming pattern exclude them from running with
|
||||
// * surefire during the test phase.
|
||||
// *
|
||||
// * If you run the tests using the Maven command line, you will have to
|
||||
// * navigate with your browser to a specific url given by Maven.
|
||||
// * See https://gwt-maven-plugin.github.io/gwt-maven-plugin/user-guide/testing.html
|
||||
// * for details.
|
||||
// */
|
||||
//public class GwtTestGCubeCkanDataCatalog extends GWTTestCase {
|
||||
//
|
||||
// /**
|
||||
// * Must refer to a valid module that sources this class.
|
||||
// */
|
||||
// public String getModuleName() {
|
||||
// return "org.gcube.portlets.gcubeckan.gcubeckandatacatalog.GCubeCkanDataCatalogJUnit";
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
||||
|
||||
|
||||
public class GwtTestGCubeCkanDataCatalog {
|
||||
|
||||
private static String groupName = "sobigdatalab";
|
||||
private static String browserLocationURL = "https://sobigdata.d4science.org/group/sobigdata-gateway/data-catalogue";
|
||||
/*
|
||||
public static void main(String[] args) {
|
||||
|
||||
String toReturn = null;
|
||||
|
||||
String secureVREName = "/" + groupName + "/";
|
||||
if (browserLocationURL.toLowerCase().contains(secureVREName)) {
|
||||
System.out.println("The browserLocationURL: " + browserLocationURL + " contains the VRE name '"
|
||||
+ secureVREName
|
||||
+ "' read by LF GroupManager. The Catalogue Portlet should be at VRE level, reading configuration isViewPerVREEnabled");
|
||||
toReturn = "/organization_vre/" + groupName;
|
||||
} else {
|
||||
// this should mean the caller is out from VRE environment,so should be a public
|
||||
// or gateway catalogue
|
||||
System.out.println("The browserLocationURL: " + browserLocationURL + " DOES NOT contain the VRE name '"
|
||||
+ secureVREName
|
||||
+ "' read by LF GroupManager. The Catalogue Portlet should NOT be at VRE level. Ignoring configuration isViewPerVREEnabled");
|
||||
}
|
||||
|
||||
System.out.println("To return is: "+toReturn);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue