Compare commits
No commits in common. "master" and "task_24567" have entirely different histories.
master
...
task_24567
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
@ -31,5 +31,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.3.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
jarsExcludedFromWebInfLib=
|
jarsExcludedFromWebInfLib=
|
||||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.3.0-SNAPSHOT
|
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.1.0-SNAPSHOT
|
||||||
warSrcDir=src/main/webapp
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
|
@ -85,167 +85,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<wb-module deploy-name="geoportal-data-entry-app-3.1.0-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="geoportal-data-entry-app-3.3.0-SNAPSHOT">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,86 +238,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -565,86 +325,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -684,86 +364,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -786,89 +386,6 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="metadata-profile-form-builder-widget-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1021,86 +538,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1188,86 +625,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1355,86 +712,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
28
CHANGELOG.md
28
CHANGELOG.md
|
@ -4,32 +4,7 @@
|
||||||
All notable changes to this project will be documented in this file.
|
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).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [v3.3.0] - 2024-06-28
|
## [v3.1.0-SNAPSHOT] - 2023-02-09
|
||||||
|
|
||||||
- Implemented the init facility to resolve a public link on an item [#27120]
|
|
||||||
- Integrated new Uri-Resolver-Manager [#27160]
|
|
||||||
- Added Get Shareable Link facility [#27120]
|
|
||||||
- Added optional message when performing lifecycle step [#27192]
|
|
||||||
- Enforced deleteProject method/UX
|
|
||||||
|
|
||||||
## [v3.2.2] - 2024-01-11
|
|
||||||
|
|
||||||
- Improved display of results on multiple fields (in the table) [#26372]
|
|
||||||
|
|
||||||
## [v3.2.1] - 2023-06-16
|
|
||||||
|
|
||||||
- Fixed issue in the Search facility [#25265]
|
|
||||||
|
|
||||||
## [v3.2.0] - 2023-05-12
|
|
||||||
|
|
||||||
- Implemented the Update facility [#24166]
|
|
||||||
- Integrated with the geoportal-data-mapper library [#24244]
|
|
||||||
- Integrated the Geoportal Data-Viewer Widget [#25015]
|
|
||||||
- Passed to Geoportal_Resolver service [#25031]
|
|
||||||
- Provided the "View Document" and "View As JSON" facilities
|
|
||||||
- DELETE relation operation allowed only in DRAFT phase [#25104]
|
|
||||||
|
|
||||||
## [v3.1.0] - 2023-03-06
|
|
||||||
|
|
||||||
#### Enhancements
|
#### Enhancements
|
||||||
|
|
||||||
|
@ -67,7 +42,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
- [#24136] Integrated the temporal dimension on the front-end side
|
- [#24136] Integrated the temporal dimension on the front-end side
|
||||||
- [#24458] Published projects cannot be edited/updated
|
- [#24458] Published projects cannot be edited/updated
|
||||||
|
|
||||||
|
|
||||||
## [v2.2.1] - 2022-06-29
|
## [v2.2.1] - 2022-06-29
|
||||||
|
|
||||||
#### Enhancements
|
#### Enhancements
|
||||||
|
|
42
README.md
42
README.md
|
@ -1,6 +1,6 @@
|
||||||
# GeoPortal Data Entry App
|
# GeoPortal Data Entry App
|
||||||
|
|
||||||
Geoportal data-entry technology allows the actors who use it, the project management of spatio-temporal documents specified by meta-documents called "Use Case Descriptor" (UCD) which determine the document model, management, life cycle, etc. The system allows you to: (i) access and search for published projects by role for VRE, (ii) access the project publication report, view the publication status (SUCCESS, WARNING, ERROR), etc., (iii ) generate links for visualization on the map, (iv) update the contents of the registered projects through the workflow, (v) manage the relationships (quantity and quality temporal links) between the documents. In general, the technology allows the data entry of any document having spatio-temporal characteristics, whose metadata and payload are specified by one or more "gCube Profile" profiles which determine the structure of the resulting document (JSON).
|
The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service
|
||||||
|
|
||||||
## Built With
|
## Built With
|
||||||
|
|
||||||
|
@ -9,50 +9,14 @@ Geoportal data-entry technology allows the actors who use it, the project manage
|
||||||
|
|
||||||
**Uses**
|
**Uses**
|
||||||
|
|
||||||
* GWT v.2.10.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html)
|
* 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)
|
* 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)
|
||||||
* pretty-print-json v.1.1. [pretty-print-json](https://github.com/center-key/pretty-print-json) is licensed under [MIT](https://github.com/center-key/pretty-print-json/blob/main/LICENSE.txt)
|
* pretty-print-json v.1.1. [pretty-print-json](https://github.com/center-key/pretty-print-json) is licensed under [MIT](https://github.com/center-key/pretty-print-json/blob/main/LICENSE.txt)
|
||||||
* jsoneditor v.9.5.5. [jsoneditor](https://github.com/josdejong/jsoneditor) is licensed under [Apache License 2.0](https://github.com/josdejong/jsoneditor/blob/master/LICENSE)
|
* jsoneditor v.9.5.5. [jsoneditor](https://github.com/josdejong/jsoneditor) is licensed under [Apache License 2.0](https://github.com/josdejong/jsoneditor/blob/master/LICENSE)
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/8e/GeoPortalDataEntry_Architecture.png" style="max-width:800px;" alt="GeoPortal Data-Entry - Architecture" />
|
|
||||||
|
|
||||||
## Showcase
|
|
||||||
|
|
||||||
##### D4GNA instance of Geoportal D4Science
|
|
||||||
|
|
||||||
see at [Dataset per il Geoportale Nazionale per l’Archeologia (D4GNA)](https://gna.d4science.org/)
|
|
||||||
|
|
||||||
**New Project facility**
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/c/c0/D4GNA_New_Project.png" style="max-width:800px;" alt="Workspace Home" />
|
|
||||||
|
|
||||||
**List of Projects facility**
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/6/67/D4GNA_List_Of_Projects.png" style="max-width:800px;" alt="List of Projects" />
|
|
||||||
|
|
||||||
|
|
||||||
**UnPublish facility**
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/6/6a/D4GNA_Unpublish.png" style="max-width:800px;" alt="UnPublish" />
|
|
||||||
|
|
||||||
|
|
||||||
**View Relations facility**
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/7/76/D4GNA_ViewRelations.png" style="max-width:800px;" alt="View Relations" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html)
|
N/A
|
||||||
|
|
||||||
User Guide (DRAFT ITA) is available at [Guida al Sistema D4GNA (DRAFT-ITA)](https://gcube.wiki.gcube-system.org/images_gcube/b/b7/D4science_Guida_al_Sistema_D4GNA_bozza.pdf)
|
|
||||||
|
|
||||||
D4GNA Use Case - 3 Phase Lifecycle
|
|
||||||
|
|
||||||
<img src="https://gcube.wiki.gcube-system.org/images_gcube/4/46/D4GNA_Workflow_Phases_and_Operations.png" style="max-width:800px;" alt="GeoPortal Data-Entry - Workflow & Phases & Operations" />
|
|
||||||
|
|
||||||
## Change log
|
## Change log
|
||||||
|
|
||||||
|
|
53
pom.xml
53
pom.xml
|
@ -7,14 +7,14 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<version>1.2.0</version>
|
<version>1.1.0</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>geoportal-data-entry-app</artifactId>
|
<artifactId>geoportal-data-entry-app</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>3.3.0</version>
|
<version>3.1.0-SNAPSHOT</version>
|
||||||
<name>GeoPortal Data Entry App</name>
|
<name>GeoPortal Data Entry App</name>
|
||||||
<description>The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service</description>
|
<description>The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service</description>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -30,7 +30,6 @@
|
||||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -52,7 +51,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>maven-portal-bom</artifactId>
|
<artifactId>maven-portal-bom</artifactId>
|
||||||
<version>3.7.0</version>
|
<version>3.6.4</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -69,6 +68,22 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- needed to compile with gwt > 2.7 -->
|
||||||
|
<!-- <dependency> -->
|
||||||
|
<!-- <groupId>xml-apis</groupId> -->
|
||||||
|
<!-- <artifactId>xml-apis</artifactId> -->
|
||||||
|
<!-- <version>1.4.01</version> -->
|
||||||
|
<!-- <scope>provided</scope> -->
|
||||||
|
<!-- </dependency> -->
|
||||||
|
|
||||||
|
<!-- ASM required for GWT 2.9 -->
|
||||||
|
<!-- <dependency> -->
|
||||||
|
<!-- <groupId>org.ow2.asm</groupId> -->
|
||||||
|
<!-- <artifactId>asm</artifactId> -->
|
||||||
|
<!-- <scope>provided</scope> -->
|
||||||
|
<!-- <version>7.1</version> -->
|
||||||
|
<!-- </dependency> -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>com.google.gwt</groupId>
|
||||||
<artifactId>gwt-servlet</artifactId>
|
<artifactId>gwt-servlet</artifactId>
|
||||||
|
@ -92,21 +107,6 @@
|
||||||
<artifactId>gwt-bootstrap</artifactId>
|
<artifactId>gwt-bootstrap</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
|
||||||
<artifactId>geoportal-data-viewer-widget</artifactId>
|
|
||||||
<version>[1.0.1, 2.0.0-SNAPSHOT)</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.application</groupId>
|
|
||||||
<artifactId>geoportal-data-mapper</artifactId>
|
|
||||||
<version>[1.0.1, 2.0.0-SNAPSHOT)</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>metadata-profile-form-builder-widget</artifactId>
|
<artifactId>metadata-profile-form-builder-widget</artifactId>
|
||||||
|
@ -129,6 +129,12 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
|
<artifactId>openlayer-basic-widgets</artifactId>
|
||||||
|
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<!-- FWS -->
|
<!-- FWS -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
|
@ -225,8 +231,6 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- TESTS -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
@ -239,13 +243,6 @@
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.18.4</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -12,19 +12,11 @@
|
||||||
|
|
||||||
<inherits name="com.google.gwt.json.JSON" />
|
<inherits name="com.google.gwt.json.JSON" />
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.portlets.widgets.gdvw.geoportal_data_viewer_widget' />
|
|
||||||
|
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||||
|
|
||||||
|
<inherits name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||||
|
|
||||||
|
|
||||||
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||||
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
||||||
|
|
|
@ -26,12 +26,6 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
|
|
||||||
public static final String DIV_LOADERS_ID = "geoportal-loaders";
|
public static final String DIV_LOADERS_ID = "geoportal-loaders";
|
||||||
|
|
||||||
public static final String GET_PARAMETER_ITEM_TYPE = "git";
|
|
||||||
|
|
||||||
public static final String GET_PARAMETER_ITEM_ID = "gid";
|
|
||||||
|
|
||||||
public static final String GET_PARAMETER_ACTION = "act";
|
|
||||||
|
|
||||||
public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT;
|
public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT;
|
||||||
|
|
||||||
public static final String TIME_FORMAT = ConstantsMPFormBuilder.TIME_FORMAT;
|
public static final String TIME_FORMAT = ConstantsMPFormBuilder.TIME_FORMAT;
|
||||||
|
@ -56,9 +50,7 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
|
|
||||||
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
||||||
|
|
||||||
public static final String SHOW_ON_MAP_NOT_AVAILABLE_IN_DRAFT = "The 'Show on Map' facility is not available in DRAFT phase";
|
public static final String ALERT_MESSAGE_PROJECT_NOT_EDITABLE = "A Project can only be edited/updated in "
|
||||||
|
|
||||||
public static final String ALERT_MESSAGE_PROJECT_NOT_EDITABLE = "A Project can only be updated in "
|
|
||||||
+ WORKFLOW_PHASE.DRAFT.name()
|
+ WORKFLOW_PHASE.DRAFT.name()
|
||||||
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
@ -68,12 +60,6 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
|
||||||
|
|
||||||
public static final String ALERT_MESSAGE_DELETE_RELATION_FORBIDDEN = "The Delete Relation operation can be performed only in "
|
|
||||||
+ WORKFLOW_PHASE.DRAFT.name()
|
|
||||||
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
|
||||||
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum ACTION_PERFORMED_ON_ITEM.
|
* The Enum ACTION_PERFORMED_ON_ITEM.
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,6 +28,8 @@ public class GeoPortalClientCaches {
|
||||||
|
|
||||||
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType;
|
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType;
|
||||||
|
|
||||||
|
//private Map<String, List<HandlerDeclarationDV>> mapHandlersConfigurationsForProfileId;
|
||||||
|
|
||||||
private Map<String, UseCaseDescriptorDV> mapUseCaseDescriptor;
|
private Map<String, UseCaseDescriptorDV> mapUseCaseDescriptor;
|
||||||
|
|
||||||
private Map<String, CacheSearchingFilterParametersFromConfig> mapSearchingFilterParametersForProfileId;
|
private Map<String, CacheSearchingFilterParametersFromConfig> mapSearchingFilterParametersForProfileId;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,20 +3,15 @@ package org.gcube.portlets.user.geoportaldataentry.client;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences.SHARE_LINK_TO;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
|
@ -36,15 +31,6 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
@RemoteServiceRelativePath("geoportaldataentryservice")
|
@RemoteServiceRelativePath("geoportaldataentryservice")
|
||||||
public interface GeoportalDataEntryService extends RemoteService {
|
public interface GeoportalDataEntryService extends RemoteService {
|
||||||
|
|
||||||
/**
|
|
||||||
* Save geona data forms.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param tree_Node the tree node
|
|
||||||
* @param stepsOnPostCreation the steps on post creation
|
|
||||||
* @return the commit report
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
CommitReport saveGeonaDataForms(String profileID, Tree_Node<GeoNaFormDataObject> tree_Node,
|
CommitReport saveGeonaDataForms(String profileID, Tree_Node<GeoNaFormDataObject> tree_Node,
|
||||||
List<String> stepsOnPostCreation) throws Exception;
|
List<String> stepsOnPostCreation) throws Exception;
|
||||||
|
|
||||||
|
@ -58,13 +44,12 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
/**
|
/**
|
||||||
* Gets the links for.
|
* Gets the links for.
|
||||||
*
|
*
|
||||||
* @param itemId the item id is the mongoId
|
* @param itemId the item id
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param shareLinkTo the share link to
|
|
||||||
* @return the links for
|
* @return the links for
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
GeoportalItemReferences getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo) throws Exception;
|
GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list projects.
|
* Gets the list projects.
|
||||||
|
@ -107,7 +92,7 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
* @return the GNA data entry ext config profile
|
* @return the GNA data entry ext config profile
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception;
|
GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list use case descriptors.
|
* Gets the list use case descriptors.
|
||||||
|
@ -143,11 +128,11 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
*
|
*
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param projectID the project ID
|
* @param projectID the project ID
|
||||||
* @param optionalMessage the optional message
|
* @param action the action
|
||||||
* @param action the action
|
|
||||||
* @return the project DV
|
* @return the project DV
|
||||||
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception;
|
ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the relationships definition.
|
* Gets the relationships definition.
|
||||||
|
@ -199,7 +184,7 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
* @param id the id
|
* @param id the id
|
||||||
* @param toProfileID the to profile ID
|
* @param toProfileID the to profile ID
|
||||||
* @param toProjectID the to project ID
|
* @param toProjectID the to project ID
|
||||||
* @return the result document DV
|
* @return
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
ResultDocumentDV deleteRelationship(String fromProfileID, String fromProjectID, String id, String toProfileID,
|
ResultDocumentDV deleteRelationship(String fromProfileID, String fromProjectID, String id, String toProfileID,
|
||||||
|
@ -214,38 +199,4 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
TemporalReferenceDV temporalReferenceForProject(String profileID, String projectID);
|
TemporalReferenceDV temporalReferenceForProject(String profileID, String projectID);
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the project edit.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @return the project edit
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
ProjectEdit getProjectEdit(String profileID, String projectID) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update geportal data form.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @param section the section
|
|
||||||
* @param sectionPath the section path
|
|
||||||
* @param listFilePaths the list file paths
|
|
||||||
* @return the commit report
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
|
|
||||||
String sectionPath, List<FilePathDV> listFilePaths) throws Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the project view.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @return the project view
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
ProjectView getProjectView(String profileID, String projectID) throws Exception;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,15 @@ package org.gcube.portlets.user.geoportaldataentry.client;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences.SHARE_LINK_TO;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
|
@ -56,13 +51,9 @@ public interface GeoportalDataEntryServiceAsync {
|
||||||
void saveGeonaDataForms(String profileID, Tree_Node<GeoNaFormDataObject> tree_Node,
|
void saveGeonaDataForms(String profileID, Tree_Node<GeoNaFormDataObject> tree_Node,
|
||||||
List<String> stepsOnPostCreation, AsyncCallback<CommitReport> callback);
|
List<String> stepsOnPostCreation, AsyncCallback<CommitReport> callback);
|
||||||
|
|
||||||
void updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
|
|
||||||
String sectionPath, List<FilePathDV> listFilePaths, AsyncCallback<CommitReport> callback);
|
|
||||||
|
|
||||||
void getGeonaInitConfig(AsyncCallback<GeoportalISConfig> callback);
|
void getGeonaInitConfig(AsyncCallback<GeoportalISConfig> callback);
|
||||||
|
|
||||||
void getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo,
|
void getLinksFor(String itemId, String profileID, AsyncCallback<GeoportalItemReferences> callback);
|
||||||
AsyncCallback<GeoportalItemReferences> callback);
|
|
||||||
|
|
||||||
void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
|
void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
|
||||||
boolean reloadFromService, AsyncCallback<ResultSetPaginatedData> callback);
|
boolean reloadFromService, AsyncCallback<ResultSetPaginatedData> callback);
|
||||||
|
@ -73,15 +64,15 @@ public interface GeoportalDataEntryServiceAsync {
|
||||||
|
|
||||||
void updateRecord(String profileID, String projectID, String jsonUpdate, AsyncCallback<ProjectDV> callback);
|
void updateRecord(String profileID, String projectID, String jsonUpdate, AsyncCallback<ProjectDV> callback);
|
||||||
|
|
||||||
void readDataEntryPresentationConfig(AsyncCallback<GNADataEntryExtendedConfigProfile> asyncCallback);
|
void readDataViewerConfig(AsyncCallback<GNADataEntryExtendedConfigProfile> asyncCallback);
|
||||||
|
|
||||||
void getListUseCaseDescriptors(List<String> handlersIds, AsyncCallback<List<UseCaseDescriptorDV>> callback);
|
void getListUseCaseDescriptors(List<String> handlersIds, AsyncCallback<List<UseCaseDescriptorDV>> callback);
|
||||||
|
|
||||||
void getLifecycleInfoForProjectId(String profileID, String projectID,
|
void getLifecycleInfoForProjectId(String profileID, String projectID,
|
||||||
AsyncCallback<LifecycleInformationDV> callback);
|
AsyncCallback<LifecycleInformationDV> callback);
|
||||||
|
|
||||||
void performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action,
|
void performActionSteps(String profileID, String projectID, ActionDefinitionDV action,
|
||||||
AsyncCallback<StepPerformedResultDV> callback);
|
AsyncCallback<ProjectDV> callback);
|
||||||
|
|
||||||
void getRelationshipsDefinition(String profileID, AsyncCallback<List<RelationshipDefinitionDV>> callback);
|
void getRelationshipsDefinition(String profileID, AsyncCallback<List<RelationshipDefinitionDV>> callback);
|
||||||
|
|
||||||
|
@ -97,8 +88,4 @@ public interface GeoportalDataEntryServiceAsync {
|
||||||
|
|
||||||
void temporalReferenceForProject(String profileID, String projectID, AsyncCallback<TemporalReferenceDV> callback);
|
void temporalReferenceForProject(String profileID, String projectID, AsyncCallback<TemporalReferenceDV> callback);
|
||||||
|
|
||||||
void getProjectEdit(String profileID, String projectID, AsyncCallback<ProjectEdit> callback);
|
|
||||||
|
|
||||||
void getProjectView(String profileID, String projectID, AsyncCallback<ProjectView> callback);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
|
|
||||||
import com.google.gwt.user.client.Command;
|
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
|
|
||||||
public class InitExecutor {
|
|
||||||
|
|
||||||
private LinkedHashMap<Integer, Command> queueInitStage = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
public InitExecutor() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void putCommand(Command command) throws InterruptedException {
|
|
||||||
queueInitStage.put(queueInitStage.size(), command);
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized Command pollCommand() throws InterruptedException {
|
|
||||||
for (Integer key : queueInitStage.keySet()) {
|
|
||||||
Command command = queueInitStage.get(key);
|
|
||||||
if(command!=null) {
|
|
||||||
queueInitStage.put(key, null);
|
|
||||||
return command;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void execute() {
|
|
||||||
try {
|
|
||||||
Command command = pollCommand();
|
|
||||||
if (command != null)
|
|
||||||
command.execute();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Window.alert("An error occurred while initializing the application. Please contact the support. Error is: "
|
|
||||||
+ e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
|
|
||||||
/** The type. */
|
/** The type. */
|
||||||
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
|
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
|
||||||
private SearchingFilter searchingFilter;
|
private SearchingFilter sortFilter;
|
||||||
private String profileID;
|
private String profileID;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private Boolean reloadFilteringParameters = false;
|
private Boolean reloadFilteringParameters = false;
|
||||||
|
@ -26,13 +26,13 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
*
|
*
|
||||||
* @param onApplicationInit the on application init
|
* @param onApplicationInit the on application init
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param searchingFilter the searching filter
|
* @param sortFilter the sort filter
|
||||||
* @param reloadFilteringParameters the reload filtering parameters
|
* @param reloadFilteringParameters the reload filtering parameters
|
||||||
*/
|
*/
|
||||||
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter searchingFilter,
|
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter sortFilter,
|
||||||
Boolean reloadFilteringParameters) {
|
Boolean reloadFilteringParameters) {
|
||||||
this.onApplicationInit = onApplicationInit;
|
this.onApplicationInit = onApplicationInit;
|
||||||
this.searchingFilter = searchingFilter;
|
this.sortFilter = sortFilter;
|
||||||
this.profileID = profileID;
|
this.profileID = profileID;
|
||||||
this.reloadFilteringParameters = reloadFilteringParameters;
|
this.reloadFilteringParameters = reloadFilteringParameters;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
* @return the searching filter
|
* @return the searching filter
|
||||||
*/
|
*/
|
||||||
public SearchingFilter getSearchingFilter() {
|
public SearchingFilter getSearchingFilter() {
|
||||||
return searchingFilter;
|
return sortFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,19 +105,22 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
return reloadFilteringParameters;
|
return reloadFilteringParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("GetListOfRecordsEvent [searchingFilter=");
|
builder.append("GetListOfRecordsEvent [sortFilter=");
|
||||||
builder.append(searchingFilter);
|
builder.append(sortFilter);
|
||||||
builder.append(", profileID=");
|
builder.append(", profileID=");
|
||||||
builder.append(profileID);
|
builder.append(profileID);
|
||||||
builder.append(", projectName=");
|
builder.append(", projectName=");
|
||||||
builder.append(projectName);
|
builder.append(projectName);
|
||||||
builder.append(", reloadFilteringParameters=");
|
builder.append(", reloadFilteringParameters=");
|
||||||
builder.append(reloadFilteringParameters);
|
builder.append(reloadFilteringParameters);
|
||||||
builder.append(", onApplicationInit=");
|
|
||||||
builder.append(onApplicationInit);
|
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ public class OperationOnItemEvent<T extends DocumentDV> extends GwtEvent<Operati
|
||||||
private List<T> selectItems;
|
private List<T> selectItems;
|
||||||
private OPERATION_ON_ITEM action;
|
private OPERATION_ON_ITEM action;
|
||||||
private Element sourceElement;
|
private Element sourceElement;
|
||||||
private String ucdName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new action on item event.
|
* Instantiates a new action on item event.
|
||||||
|
@ -67,10 +66,6 @@ public class OperationOnItemEvent<T extends DocumentDV> extends GwtEvent<Operati
|
||||||
handler.onDoActionFired(this);
|
handler.onDoActionFired(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUcdName() {
|
|
||||||
return ucdName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the select items.
|
* Gets the select items.
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,10 +16,4 @@ public interface Images extends ClientBundle {
|
||||||
|
|
||||||
@Source("one-finger-icon.png")
|
@Source("one-finger-icon.png")
|
||||||
ImageResource oneFingerIcon();
|
ImageResource oneFingerIcon();
|
||||||
|
|
||||||
@Source("information_icon.png")
|
|
||||||
ImageResource info();
|
|
||||||
|
|
||||||
@Source("warning_error.png")
|
|
||||||
ImageResource warningError();
|
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
|
@ -98,18 +98,9 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Tab tabGetListOfProjects;
|
Tab tabGetListOfProjects;
|
||||||
|
|
||||||
@UiField
|
|
||||||
NavLink navViewAsDocument;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
NavLink navViewAsJSON;
|
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
NavLink navShowOnMap;
|
NavLink navShowOnMap;
|
||||||
|
|
||||||
@UiField
|
|
||||||
NavLink navShareLink;
|
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
NavLink navShowReport;
|
NavLink navShowReport;
|
||||||
|
|
||||||
|
@ -253,51 +244,6 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
navShareLink.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
List<DocumentDV> listDocuments = null;
|
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
|
||||||
listDocuments = grpw.getSelectItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
appManagerBus
|
|
||||||
.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.GET_SHAREABLE_LINK));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
navViewAsDocument.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
List<DocumentDV> listDocuments = null;
|
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
|
||||||
listDocuments = grpw.getSelectItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments,
|
|
||||||
OPERATION_ON_ITEM.VIEW_PROJECT_AS_DOCUMENT));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
navViewAsJSON.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
List<DocumentDV> listDocuments = null;
|
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
|
||||||
listDocuments = grpw.getSelectItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
appManagerBus.fireEvent(
|
|
||||||
new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.VIEW_PROJECT_AS_JSON));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
navShowReport.addClickHandler(new ClickHandler() {
|
navShowReport.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -450,7 +396,6 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
tabPanel.selectTab(index);
|
tabPanel.selectTab(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dirty solution. I created this one because I had problem on firing click
|
* Dirty solution. I created this one because I had problem on firing click
|
||||||
* event for Tab element
|
* event for Tab element
|
||||||
|
@ -511,7 +456,21 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
||||||
|
|
||||||
if (dataListHandler != null) {
|
if (dataListHandler != null) {
|
||||||
|
|
||||||
|
// NavLink link = new NavLink(ucd.getName());
|
||||||
|
// link.addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
//
|
||||||
|
// appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(),
|
||||||
|
// getCurrentProjectsSearchingFilter(), true));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
ucdProjectTypesForListingDataView.add(ucd);
|
ucdProjectTypesForListingDataView.add(ucd);
|
||||||
|
|
||||||
|
// listOfProjectTablePanel.addProjectType(link);
|
||||||
|
|
||||||
listOfProjectTablePanel.addProjectType(ucd);
|
listOfProjectTablePanel.addProjectType(ucd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -714,12 +673,4 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListOfProjectTablePanel getListOfProjectTablePanel() {
|
|
||||||
return listOfProjectTablePanel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<UseCaseDescriptorDV> getUcdProjectTypesForListingDataView() {
|
|
||||||
return ucdProjectTypesForListingDataView;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,7 @@
|
||||||
<g:HTMLPanel ui:field="introGNA">
|
<g:HTMLPanel ui:field="introGNA">
|
||||||
<b:Hero ui:field="introGNAHero">
|
<b:Hero ui:field="introGNAHero">
|
||||||
<b:Heading size="2" ui:field="welcomeTitle">Welcome
|
<b:Heading size="2" ui:field="welcomeTitle">Welcome
|
||||||
to GeoPortal Data
|
to GeoPortal Data Entry</b:Heading>
|
||||||
Entry</b:Heading>
|
|
||||||
<b:Paragraph ui:field="welcomeDescription"></b:Paragraph>
|
<b:Paragraph ui:field="welcomeDescription"></b:Paragraph>
|
||||||
<b:Paragraph>select "Create New Project"</b:Paragraph>
|
<b:Paragraph>select "Create New Project"</b:Paragraph>
|
||||||
</b:Hero>
|
</b:Hero>
|
||||||
|
@ -100,20 +99,12 @@
|
||||||
<g:FlowPanel>
|
<g:FlowPanel>
|
||||||
<g:FlowPanel addStyleNames="move-sticky">
|
<g:FlowPanel addStyleNames="move-sticky">
|
||||||
<b:NavPills>
|
<b:NavPills>
|
||||||
<b:NavLink ui:field="navViewAsDocument"
|
|
||||||
title="View Document" icon="FILE">View Document</b:NavLink>
|
|
||||||
<b:NavLink ui:field="navViewAsJSON"
|
|
||||||
title="View Document as JSON" icon="CODE">View as JSON</b:NavLink>
|
|
||||||
<b:Divider addStyleNames="{style.divider-border-right}" />
|
|
||||||
<b:NavLink ui:field="navShowOnMap" title="Show on Map"
|
<b:NavLink ui:field="navShowOnMap" title="Show on Map"
|
||||||
icon="MAP_MARKER">Show on Map</b:NavLink>
|
icon="MAP_MARKER">Show on Map</b:NavLink>
|
||||||
<b:NavLink ui:field="navShareLink" title="Get Shareable Link"
|
|
||||||
icon="SHARE">Get Shareable link</b:NavLink>
|
|
||||||
<b:Divider addStyleNames="{style.divider-border-right}" />
|
|
||||||
<b:NavLink ui:field="navShowReport"
|
<b:NavLink ui:field="navShowReport"
|
||||||
title="Show Publication Report" icon="FILE_TEXT_ALT">Publication Report</b:NavLink>
|
title="Show Publication Report" icon="FILE_TEXT_ALT">Publication Report</b:NavLink>
|
||||||
<b:NavLink ui:field="navEditMode" title="Edit"
|
<b:NavLink ui:field="navEditMode" title="Edit"
|
||||||
icon="PENCIL">Update</b:NavLink>
|
icon="PENCIL">Edit</b:NavLink>
|
||||||
<b:NavLink ui:field="navDelete" title="Delete Project"
|
<b:NavLink ui:field="navDelete" title="Delete Project"
|
||||||
icon="TRASH">Delete Project</b:NavLink>
|
icon="TRASH">Delete Project</b:NavLink>
|
||||||
<b:Divider addStyleNames="{style.divider-border-right}" />
|
<b:Divider addStyleNames="{style.divider-border-right}" />
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
private MyCustomDataProvider<DocumentDV> dataProvider = new MyCustomDataProvider<DocumentDV>();
|
private MyCustomDataProvider<DocumentDV> dataProvider = new MyCustomDataProvider<DocumentDV>();
|
||||||
protected Widget orginalLoadingIndicator = null;
|
protected Widget orginalLoadingIndicator = null;
|
||||||
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
|
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
|
||||||
|
// private int serverStartIndex;
|
||||||
private HandlerManager eventBus;
|
private HandlerManager eventBus;
|
||||||
private SearchingFilter currentSearchingFilter;
|
private SearchingFilter currentSearchingFilter;
|
||||||
private String profileID;
|
private String profileID;
|
||||||
|
@ -73,6 +74,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
|
|
||||||
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
|
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
|
||||||
initPagination(ITEMS_PER_PAGE);
|
initPagination(ITEMS_PER_PAGE);
|
||||||
|
// loadNewPage(ITEM_START_INDEX, ITEMS_PER_PAGE, false);
|
||||||
loadItemsForType(profileID);
|
loadItemsForType(profileID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,27 +117,31 @@ public class GeonaRecordsPaginatedView {
|
||||||
/**
|
/**
|
||||||
* Load new page.
|
* Load new page.
|
||||||
*
|
*
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param startIdx the start idx
|
* @param startIdx the start idx
|
||||||
* @param limit the limit
|
* @param limit the limit
|
||||||
* @param resetStore the reset store
|
* @param resetStore the reset store
|
||||||
* @param currentSearchFilter the current search filter
|
* @param currentSortFilter the current sort filter
|
||||||
* @param invalidCache the invalid cache
|
* @param invalidCache the invalid cache
|
||||||
*/
|
*/
|
||||||
private void loadNewPage(String profileID, final int startIdx, final int limit, final boolean resetStore,
|
private void loadNewPage(String profileID, final int startIdx, final int limit, final boolean resetStore,
|
||||||
final SearchingFilter currentSearchFilter, final boolean invalidCache) {
|
final SearchingFilter currentSortFilter, final boolean invalidCache) {
|
||||||
|
// initFirstRangeChanged = resetStore;
|
||||||
GWT.log("loadNewPage with parameters [startIdx: " + startIdx + ", limit: " + limit + ", resetStore:"
|
GWT.log("loadNewPage with parameters [startIdx: " + startIdx + ", limit: " + limit + ", resetStore:"
|
||||||
+ resetStore + "]");
|
+ resetStore + "]");
|
||||||
|
// showLoading(true);
|
||||||
|
|
||||||
int newStartIndex = startIdx;
|
int newStartIndex = startIdx;
|
||||||
|
|
||||||
if (resetStore) {
|
if (resetStore) {
|
||||||
GWT.log("Cleaning all data...");
|
GWT.log("Cleaning all data...");
|
||||||
newStartIndex = 0;
|
newStartIndex = 0;
|
||||||
|
// serverStartIndex = 0;
|
||||||
GWT.log("Store reset performed start index is: " + newStartIndex);
|
GWT.log("Store reset performed start index is: " + newStartIndex);
|
||||||
getTableDataProvider().updateRowCount(ITEMS_PER_PAGE, false);
|
getTableDataProvider().updateRowCount(ITEMS_PER_PAGE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadProjects(profileID, newStartIndex, limit, currentSearchFilter, invalidCache);
|
loadProjects(profileID, newStartIndex, limit, currentSortFilter, invalidCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,16 +194,6 @@ public class GeonaRecordsPaginatedView {
|
||||||
}
|
}
|
||||||
// initFirstRangeChanged = false;
|
// initFirstRangeChanged = false;
|
||||||
|
|
||||||
//printData((List<DocumentDV>) result.getData());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void printData(List<DocumentDV> data) {
|
|
||||||
GWT.log("printData");
|
|
||||||
int i = 0;
|
|
||||||
for (DocumentDV documentDV : data) {
|
|
||||||
GWT.log(++i + ") json: " + documentDV.getDocumentAsJSON());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,17 +221,17 @@ public class GeonaRecordsPaginatedView {
|
||||||
* @param theProfileID the the profile ID
|
* @param theProfileID the the profile ID
|
||||||
* @param newStartIndex the new start index
|
* @param newStartIndex the new start index
|
||||||
* @param limit the limit
|
* @param limit the limit
|
||||||
* @param searchFilter the search filter
|
* @param sortFilter the sort filter
|
||||||
* @param invalidCache the invalid cache
|
* @param invalidCache the invalid cache
|
||||||
*/
|
*/
|
||||||
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter searchFilter,
|
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter sortFilter,
|
||||||
boolean invalidCache) {
|
boolean invalidCache) {
|
||||||
showLoading(true);
|
showLoading(true);
|
||||||
|
|
||||||
GWT.log("calling loadItemsForStatus with parameters [theProfileID: " + theProfileID + ", startIndex: "
|
GWT.log("calling loadItemsForStatus with parameters [theProfileID: " + theProfileID + ", startIndex: "
|
||||||
+ newStartIndex + ", limit: " + limit + ", searchFilter: " + searchFilter + "]");
|
+ newStartIndex + ", limit: " + limit + ", sortFilter: " + sortFilter + "]");
|
||||||
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit,
|
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit, sortFilter,
|
||||||
searchFilter, invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
|
invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -270,15 +266,10 @@ public class GeonaRecordsPaginatedView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the column.
|
|
||||||
*
|
|
||||||
* @param columnName the column name
|
|
||||||
*/
|
|
||||||
public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) {
|
public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) {
|
||||||
try {
|
try {
|
||||||
itemsTable.removeColumn(columnName);
|
itemsTable.removeColumn(columnName);
|
||||||
} catch (Exception e) {
|
}catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,6 +283,9 @@ public class GeonaRecordsPaginatedView {
|
||||||
return itemsTable.getSelectedItems();
|
return itemsTable.getSelectedItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// int latestRangeStart = -1;
|
||||||
|
// int latestRangeLenght = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A custom {@link AsyncDataProvider}.
|
* A custom {@link AsyncDataProvider}.
|
||||||
*
|
*
|
||||||
|
@ -316,6 +310,15 @@ public class GeonaRecordsPaginatedView {
|
||||||
int start = range.getStart();
|
int start = range.getStart();
|
||||||
int length = range.getLength();
|
int length = range.getLength();
|
||||||
|
|
||||||
|
// if(latestRangeStart!=start || latestRangeLenght!=length) {
|
||||||
|
// GWT.log("ranges really changed");
|
||||||
|
// latestRangeStart = start;
|
||||||
|
// latestRangeLenght = length;
|
||||||
|
// }else {
|
||||||
|
// GWT.log("ranges DO NOT changed");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
if (initClassFirstRangeChanged) {
|
if (initClassFirstRangeChanged) {
|
||||||
GWT.log("initClassFirstRangeChanged is true.. returning");
|
GWT.log("initClassFirstRangeChanged is true.. returning");
|
||||||
initClassFirstRangeChanged = false;
|
initClassFirstRangeChanged = false;
|
||||||
|
@ -323,6 +326,8 @@ public class GeonaRecordsPaginatedView {
|
||||||
}
|
}
|
||||||
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
|
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
|
||||||
loadNewPage(profileID, start, length, false, currentSearchingFilter, false);
|
loadNewPage(profileID, start, length, false, currentSearchingFilter, false);
|
||||||
|
// eventBus.fireEvent(new TableRangeViewChangedEvent<T>(start, length));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class ActionListPanel extends Composite {
|
||||||
Button butt = new Button();
|
Button butt = new Button();
|
||||||
butt.setText(actionDefinitionDV.getTitle());
|
butt.setText(actionDefinitionDV.getTitle());
|
||||||
butt.setTitle(actionDefinitionDV.getDescription());
|
butt.setTitle(actionDefinitionDV.getDescription());
|
||||||
butt.setType(ButtonType.INFO);
|
butt.setType(ButtonType.LINK);
|
||||||
butt.addClickHandler(new ClickHandler() {
|
butt.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.action;
|
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.AccordionGroup;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
|
||||||
|
|
||||||
public class DeleteViewPanel extends Composite {
|
|
||||||
|
|
||||||
private static DeleteViewPanelUiBinder uiBinder = GWT.create(DeleteViewPanelUiBinder.class);
|
|
||||||
|
|
||||||
interface DeleteViewPanelUiBinder extends UiBinder<Widget, DeleteViewPanel> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
FlowPanel principalPanel;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
AccordionGroup accordionProjectDetails;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
FlowPanel confirmProceedPanel;
|
|
||||||
|
|
||||||
private ResultDocumentDV resultDocumentDV;
|
|
||||||
|
|
||||||
public DeleteViewPanel(ResultDocumentDV resultDocumentDV) {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
this.resultDocumentDV = resultDocumentDV;
|
|
||||||
builtUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void builtUI() {
|
|
||||||
String htmlMsg = "<p style='font-size: 18px'>Going to permanently delete the:</p>";
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
principalPanel.add(new HTML(htmlMsg));
|
|
||||||
ReportTemplateToHTML rt = new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false);
|
|
||||||
rt.showAsJSON(false);
|
|
||||||
principalPanel.add(rt);
|
|
||||||
|
|
||||||
String projectDetails = "<ul>";
|
|
||||||
projectDetails += "<li>id: " + resultDocumentDV.getId() + "</li>";
|
|
||||||
projectDetails += "<li>profile: " + resultDocumentDV.getProfileID() + "</li>";
|
|
||||||
projectDetails += "<li>" + resultDocumentDV.getFirstEntryOfMap().getKey() + ": "
|
|
||||||
+ resultDocumentDV.getFirstEntryOfMap().getValue() + "</li>";
|
|
||||||
projectDetails += "</ul>";
|
|
||||||
|
|
||||||
accordionProjectDetails.add(new HTML(projectDetails));
|
|
||||||
|
|
||||||
String confirmMessage = "<b>This operation cannot be undone. Would you like to proceed?</b>";
|
|
||||||
confirmProceedPanel.add(new HTML(confirmMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
|
||||||
|
|
||||||
<ui:style>
|
|
||||||
.important {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.accordion-no-border {
|
|
||||||
border: 0px !important;
|
|
||||||
}
|
|
||||||
.text-are-size {
|
|
||||||
width: 80%;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
</ui:style>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<g:FlowPanel ui:field="principalPanel">
|
|
||||||
</g:FlowPanel>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<b:Accordion>
|
|
||||||
<b:AccordionGroup icon="GEAR"
|
|
||||||
heading="Project details" ui:field="accordionProjectDetails"
|
|
||||||
addStyleNames="{style.accordion-no-border}">
|
|
||||||
</b:AccordionGroup>
|
|
||||||
</b:Accordion>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
<g:FlowPanel ui:field="confirmProceedPanel">
|
|
||||||
</g:FlowPanel>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
</ui:UiBinder>
|
|
|
@ -1,72 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.action;
|
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.AccordionGroup;
|
|
||||||
import com.github.gwtbootstrap.client.ui.TextArea;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
|
||||||
|
|
||||||
public class StepViewPanel extends Composite {
|
|
||||||
|
|
||||||
private static StepViewPanelUiBinder uiBinder = GWT.create(StepViewPanelUiBinder.class);
|
|
||||||
|
|
||||||
interface StepViewPanelUiBinder extends UiBinder<Widget, StepViewPanel> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
FlowPanel principalPanel;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
AccordionGroup accordionProjectDetails;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
FlowPanel confirmProceedPanel;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
TextArea txtOptionalMessage;
|
|
||||||
|
|
||||||
private ResultDocumentDV resultDocumentDV;
|
|
||||||
|
|
||||||
private ActionDefinitionDV actionDefinitionDV;
|
|
||||||
|
|
||||||
public StepViewPanel(ResultDocumentDV resultDocumentDV, ActionDefinitionDV actionDefinitionDV) {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
this.resultDocumentDV = resultDocumentDV;
|
|
||||||
this.actionDefinitionDV = actionDefinitionDV;
|
|
||||||
builtUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void builtUI() {
|
|
||||||
String htmlMsg = "<p style='font-size: 18px'>Going to perform the step/s <i><b>" + actionDefinitionDV.getCallSteps() + "</b></i> on the: </p>";
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
principalPanel.add(new HTML(htmlMsg));
|
|
||||||
ReportTemplateToHTML rt = new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false);
|
|
||||||
rt.showAsJSON(false);
|
|
||||||
principalPanel.add(rt);
|
|
||||||
|
|
||||||
String projectDetails = "<ul>";
|
|
||||||
projectDetails += "<li>id: " + resultDocumentDV.getId() + "</li>";
|
|
||||||
projectDetails += "<li>profile: " + resultDocumentDV.getProfileID() + "</li>";
|
|
||||||
projectDetails += "<li>" + resultDocumentDV.getFirstEntryOfMap().getKey() + ": "
|
|
||||||
+ resultDocumentDV.getFirstEntryOfMap().getValue() + "</li>";
|
|
||||||
projectDetails += "</ul>";
|
|
||||||
|
|
||||||
accordionProjectDetails.add(new HTML(projectDetails));
|
|
||||||
|
|
||||||
String confirmMessage = "<b>Would you like to proceed?</b>";
|
|
||||||
confirmProceedPanel.add(new HTML(confirmMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOptionalMessage() {
|
|
||||||
return txtOptionalMessage.getText();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
|
||||||
|
|
||||||
<ui:style>
|
|
||||||
.important {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.accordion-no-border {
|
|
||||||
border: 0px !important;
|
|
||||||
}
|
|
||||||
.text-are-size {
|
|
||||||
width: 80% !important;
|
|
||||||
height: 70px !important;
|
|
||||||
}
|
|
||||||
</ui:style>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<g:FlowPanel ui:field="principalPanel">
|
|
||||||
</g:FlowPanel>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<b:Accordion>
|
|
||||||
<b:AccordionGroup icon="GEAR"
|
|
||||||
heading="Project details" ui:field="accordionProjectDetails"
|
|
||||||
addStyleNames="{style.accordion-no-border}">
|
|
||||||
</b:AccordionGroup>
|
|
||||||
</b:Accordion>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
<g:FlowPanel ui:field="confirmProceedPanel">
|
|
||||||
<b:Form type="HORIZONTAL">
|
|
||||||
<b:Fieldset>
|
|
||||||
<b:ControlGroup>
|
|
||||||
<b:ControlLabel>Message</b:ControlLabel>
|
|
||||||
<b:Controls>
|
|
||||||
<!-- If you add id attribute to element,You should use b:id attribute. -->
|
|
||||||
<b:TextArea addStyleNames="{style.text-are-size}"
|
|
||||||
ui:field="txtOptionalMessage"></b:TextArea>
|
|
||||||
<b:HelpBlock>You can optionally add a message...</b:HelpBlock>
|
|
||||||
</b:Controls>
|
|
||||||
</b:ControlGroup>
|
|
||||||
</b:Fieldset>
|
|
||||||
</b:Form>
|
|
||||||
</g:FlowPanel>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
</ui:UiBinder>
|
|
|
@ -5,9 +5,9 @@ import org.gcube.portlets.user.geoportaldataentry.client.ProjectFormCard;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm;
|
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
||||||
|
|
||||||
public class GeoNaFormCardModel<T extends MetaDataProfileBean> {
|
public class GeoNaFormCardModel {
|
||||||
|
|
||||||
private T metadataProfileBean;
|
private MetaDataProfileBean metadataProfileBean;
|
||||||
private CreateMetadataForm metadataForm;
|
private CreateMetadataForm metadataForm;
|
||||||
private ProjectFormCard formCard; // matching with metadata profile
|
private ProjectFormCard formCard; // matching with metadata profile
|
||||||
private GcubeProfileDV gcubeProfile;
|
private GcubeProfileDV gcubeProfile;
|
||||||
|
@ -16,8 +16,8 @@ public class GeoNaFormCardModel<T extends MetaDataProfileBean> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeoNaFormCardModel(T metadataProfileBean, CreateMetadataForm metadataForm, ProjectFormCard formCard,
|
public GeoNaFormCardModel(MetaDataProfileBean metadataProfileBean, CreateMetadataForm metadataForm,
|
||||||
GcubeProfileDV gcubeProfile) {
|
ProjectFormCard formCard, GcubeProfileDV gcubeProfile) {
|
||||||
super();
|
super();
|
||||||
this.metadataProfileBean = metadataProfileBean;
|
this.metadataProfileBean = metadataProfileBean;
|
||||||
this.metadataForm = metadataForm;
|
this.metadataForm = metadataForm;
|
||||||
|
@ -25,11 +25,11 @@ public class GeoNaFormCardModel<T extends MetaDataProfileBean> {
|
||||||
this.gcubeProfile = gcubeProfile;
|
this.gcubeProfile = gcubeProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T getMetadataProfileBean() {
|
public MetaDataProfileBean getMetadataProfileBean() {
|
||||||
return metadataProfileBean;
|
return metadataProfileBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMetadataProfileBean(T metadataProfileBean) {
|
public void setMetadataProfileBean(MetaDataProfileBean metadataProfileBean) {
|
||||||
this.metadataProfileBean = metadataProfileBean;
|
this.metadataProfileBean = metadataProfileBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,8 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.jseditor.JSONEd
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.Tab;
|
import com.github.gwtbootstrap.client.ui.Tab;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
|
@ -29,11 +27,11 @@ import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.Random;
|
import com.google.gwt.user.client.Random;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,8 +68,6 @@ public class EditModeRecord extends Composite {
|
||||||
|
|
||||||
private final HandlerManager editorManagerBus = new HandlerManager(null);
|
private final HandlerManager editorManagerBus = new HandlerManager(null);
|
||||||
|
|
||||||
private int modalHeight;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Interface EditModeRecordUiBinder.
|
* The Interface EditModeRecordUiBinder.
|
||||||
*
|
*
|
||||||
|
@ -82,14 +78,12 @@ public class EditModeRecord extends Composite {
|
||||||
interface EditModeRecordUiBinder extends UiBinder<Widget, EditModeRecord> {
|
interface EditModeRecordUiBinder extends UiBinder<Widget, EditModeRecord> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditModeRecord(HandlerManager appManagerBus, ResultDocumentDV selectedProject, int modalHeight) {
|
public EditModeRecord(HandlerManager appManagerBus, ResultDocumentDV selectedProject) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.modalHeight = modalHeight;
|
|
||||||
this.selectedProject = selectedProject;
|
this.selectedProject = selectedProject;
|
||||||
this.appManagerBus = appManagerBus;
|
this.appManagerBus = appManagerBus;
|
||||||
this.filesUpdatePanel.setHeight((modalHeight - 50) + "px");
|
this.filesUpdatePanel.setHeight("490px");
|
||||||
// filesUpdatePanel.getElement().modalHeight().setProperty("maxHeight",
|
// filesUpdatePanel.getElement().getStyle().setProperty("maxHeight", "550px");
|
||||||
// "550px");
|
|
||||||
|
|
||||||
// TODO Must be instanceUpdateFilesetEditor
|
// TODO Must be instanceUpdateFilesetEditor
|
||||||
tabUploadFiles.asWidget().getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
tabUploadFiles.asWidget().getElement().getStyle().setVisibility(Visibility.HIDDEN);
|
||||||
|
@ -127,14 +121,9 @@ public class EditModeRecord extends Composite {
|
||||||
private void instanceJSONEditor() {
|
private void instanceJSONEditor() {
|
||||||
|
|
||||||
rawUpdatePanel.clear();
|
rawUpdatePanel.clear();
|
||||||
|
|
||||||
final HorizontalPanel hpLoader = new HorizontalPanel();
|
|
||||||
final LoaderIcon lc = new LoaderIcon("Loading Project... please wait");
|
|
||||||
hpLoader.add(lc);
|
|
||||||
rawUpdatePanel.add(hpLoader);
|
|
||||||
final FlowPanel fp = new FlowPanel();
|
final FlowPanel fp = new FlowPanel();
|
||||||
fp.getElement().setId("jsoneditor" + Random.nextInt());
|
fp.getElement().setId("jsoneditor" + Random.nextInt());
|
||||||
fp.setHeight((modalHeight - 160) + "px");
|
fp.setHeight("410px");
|
||||||
rawUpdatePanel.add(fp);
|
rawUpdatePanel.add(fp);
|
||||||
|
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
@ -145,7 +134,6 @@ public class EditModeRecord extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String jsonData) {
|
public void onSuccess(String jsonData) {
|
||||||
hpLoader.clear();
|
|
||||||
GWT.log("Instance JSON Editor with: " + jsonData);
|
GWT.log("Instance JSON Editor with: " + jsonData);
|
||||||
jsEditor = JSONEditorWrapper.init(fp.getElement().getId());
|
jsEditor = JSONEditorWrapper.init(fp.getElement().getId());
|
||||||
jsEditor.setName(selectedProject.getId());
|
jsEditor.setName(selectedProject.getId());
|
||||||
|
@ -164,13 +152,7 @@ public class EditModeRecord extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
rawUpdatePanel.clear();
|
Window.alert(caught.getMessage());
|
||||||
Alert alert = new Alert(
|
|
||||||
"Sorry, I cannot show the source Project with id '" + selectedProject.getId()
|
|
||||||
+ "' Refresh an try again. Error: " + caught.getMessage(),
|
|
||||||
AlertType.ERROR);
|
|
||||||
alert.setClose(false);
|
|
||||||
rawUpdatePanel.add(alert);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,13 +21,13 @@
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
|
|
||||||
<b:TabPanel tabPosition="left" ui:field="tabPanel">
|
<b:TabPanel tabPosition="left" ui:field="tabPanel">
|
||||||
<b:Tab icon="CODE" active="true" heading="Project"
|
<b:Tab icon="PENCIL" active="true" heading="Edit the Project"
|
||||||
ui:field="tabRawUpdate">
|
ui:field="tabRawUpdate">
|
||||||
<b:Heading size="3">Source Project as JSON</b:Heading>
|
<b:Heading size="3">Source Project Editor</b:Heading>
|
||||||
<b:Label type="INFO" visible="false">You can update the project by editing
|
<b:Label type="INFO">You can update the project by editing
|
||||||
the
|
the
|
||||||
model data displayed in the following editor.</b:Label>
|
model data displayed in the following editor.</b:Label>
|
||||||
<g:HTML visible="false" addStyleNames="{style.info-panel}">
|
<g:HTML addStyleNames="{style.info-panel}">
|
||||||
<p style='color: #585858'>
|
<p style='color: #585858'>
|
||||||
Be careful not to change the
|
Be careful not to change the
|
||||||
keys (e.g. nome, introduzione,
|
keys (e.g. nome, introduzione,
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
</g:FlowPanel>
|
</g:FlowPanel>
|
||||||
<b:Button icon="SAVE" type="INFO"
|
<b:Button icon="SAVE" type="INFO"
|
||||||
addStyleNames="{style.button-save-style}"
|
addStyleNames="{style.button-save-style}"
|
||||||
ui:field="buttonJSONUpdate" visible="false">UPDATE</b:Button>
|
ui:field="buttonJSONUpdate">UPDATE</b:Button>
|
||||||
</b:Tab>
|
</b:Tab>
|
||||||
<b:Tab icon="UPLOAD_ALT" heading="Manage File/s"
|
<b:Tab icon="UPLOAD_ALT" heading="Manage File/s"
|
||||||
ui:field="tabUploadFiles">
|
ui:field="tabUploadFiles">
|
||||||
|
|
|
@ -0,0 +1,550 @@
|
||||||
|
//package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
||||||
|
//
|
||||||
|
//import java.util.ArrayList;
|
||||||
|
//import java.util.Collection;
|
||||||
|
//import java.util.HashMap;
|
||||||
|
//import java.util.List;
|
||||||
|
//import java.util.Map;
|
||||||
|
//
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.model.AbstractRelazioneScavoDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.model.LayerConcessioneDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.model.RelazioneScavoDV;
|
||||||
|
//import org.gcube.application.geoportalcommon.shared.products.model.UploadedImageDV;
|
||||||
|
//import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
||||||
|
//import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
||||||
|
//import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.ModalConfirm;
|
||||||
|
//import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.StringUtil;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.client.form.MetaDataField;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.DialogUpload;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.DataTypeWrapper;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
||||||
|
//import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
||||||
|
//
|
||||||
|
//import com.github.gwtbootstrap.client.ui.Button;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.Controls;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.Label;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.ListBox;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
|
//import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
||||||
|
//import com.google.gwt.core.client.GWT;
|
||||||
|
//import com.google.gwt.dom.client.Document;
|
||||||
|
//import com.google.gwt.dom.client.Style.Unit;
|
||||||
|
//import com.google.gwt.event.dom.client.ChangeEvent;
|
||||||
|
//import com.google.gwt.event.dom.client.ChangeHandler;
|
||||||
|
//import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
//import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
//import com.google.gwt.event.dom.client.DomEvent;
|
||||||
|
//import com.google.gwt.event.shared.HandlerManager;
|
||||||
|
//import com.google.gwt.uibinder.client.UiBinder;
|
||||||
|
//import com.google.gwt.uibinder.client.UiField;
|
||||||
|
//import com.google.gwt.user.client.Window;
|
||||||
|
//import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
//import com.google.gwt.user.client.ui.Composite;
|
||||||
|
//import com.google.gwt.user.client.ui.FlexTable;
|
||||||
|
//import com.google.gwt.user.client.ui.HTML;
|
||||||
|
//import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
//import com.google.gwt.user.client.ui.Widget;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * The Class UpdateFileset.
|
||||||
|
// *
|
||||||
|
// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
// *
|
||||||
|
// * Sep 27, 2021
|
||||||
|
// */
|
||||||
|
//public class UpdateFileset extends Composite {
|
||||||
|
//
|
||||||
|
// private static final String SECTION_PIANTE = "piante";
|
||||||
|
//
|
||||||
|
// private static final String SECTION_POSIZIONAMENTO_SCAVO = "posizionamentoScavo";
|
||||||
|
//
|
||||||
|
// private static final String SECTION_RELAZIONE = "relazione";
|
||||||
|
//
|
||||||
|
// private static final String SECTION_IMMAGINI = "immagini";
|
||||||
|
//
|
||||||
|
// private static final String SECTION_ABSTRACT_RELAZIONE = "abstract_relazione";
|
||||||
|
//
|
||||||
|
// private static final String _FORM_WIDTH_FIELDS_SIZE = "730px";
|
||||||
|
//
|
||||||
|
// private static UpdateFilesetUiBinder uiBinder = GWT.create(UpdateFilesetUiBinder.class);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * The Interface UpdateFilesetUiBinder.
|
||||||
|
// *
|
||||||
|
// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
// *
|
||||||
|
// * Sep 27, 2021
|
||||||
|
// */
|
||||||
|
// interface UpdateFilesetUiBinder extends UiBinder<Widget, UpdateFileset> {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @UiField
|
||||||
|
// ListBox listBoxPaths;
|
||||||
|
//
|
||||||
|
// @UiField
|
||||||
|
// ControlGroup cgSelectFile;
|
||||||
|
//
|
||||||
|
// @UiField
|
||||||
|
// Controls controlsContent;
|
||||||
|
//
|
||||||
|
// @UiField
|
||||||
|
// HTMLPanel uploadFileContainer;
|
||||||
|
//
|
||||||
|
// @UiField
|
||||||
|
// Button buttonUpdate;
|
||||||
|
//
|
||||||
|
// private List<String> listFileSetPaths;
|
||||||
|
//
|
||||||
|
// private boolean placeholderListBoxPaths = true;
|
||||||
|
//
|
||||||
|
// private BaseConcessioneDV selectedConcessione;
|
||||||
|
//
|
||||||
|
// private ConcessioneDV fullConcessione;
|
||||||
|
//
|
||||||
|
// private boolean placeholderListBoxIndex = true;
|
||||||
|
//
|
||||||
|
// private HandlerManager uiBus = new HandlerManager(null);
|
||||||
|
//
|
||||||
|
// private MetaDataField fieldUploadWidget;
|
||||||
|
//
|
||||||
|
// private Integer pathIndex = null;
|
||||||
|
//
|
||||||
|
// private Map<Integer, WorkspaceContentDV> mapForCCUploading = null;
|
||||||
|
//
|
||||||
|
// private Map<Integer, List<WorkspaceContentDV>> mapWSContentListBox = null;
|
||||||
|
//
|
||||||
|
// private HandlerManager editorManagerBus;
|
||||||
|
//
|
||||||
|
// private String profileID;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Instantiates a new update fileset.
|
||||||
|
// *
|
||||||
|
// * @param editorManagerBus the editor manager bus
|
||||||
|
// * @param selectedConcessione the selected concessione
|
||||||
|
// * @param recordType the record type
|
||||||
|
// * @param listFileSetPaths the list file set paths
|
||||||
|
// */
|
||||||
|
// public UpdateFileset(HandlerManager editorManagerBus, BaseConcessioneDV selectedConcessione, String profileID, List<String> listFileSetPaths) {
|
||||||
|
// initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
// this.editorManagerBus = editorManagerBus;
|
||||||
|
// this.selectedConcessione = selectedConcessione;
|
||||||
|
// this.profileID = profileID;
|
||||||
|
// this.listFileSetPaths = listFileSetPaths;
|
||||||
|
// listBoxPaths.addItem("Select a section...");
|
||||||
|
// for (String path : listFileSetPaths) {
|
||||||
|
// listBoxPaths.addItem(path);
|
||||||
|
// }
|
||||||
|
// listBoxPaths.setWidth(_FORM_WIDTH_FIELDS_SIZE);
|
||||||
|
//
|
||||||
|
// // add handler on select
|
||||||
|
// listBoxPaths.addChangeHandler(new ChangeHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onChange(ChangeEvent event) {
|
||||||
|
// GWT.log("Profile type selection changed...");
|
||||||
|
// cgSelectFile.setVisible(false);
|
||||||
|
//
|
||||||
|
// if (placeholderListBoxPaths) {
|
||||||
|
// listBoxPaths.removeItem(0); // this is the placeholder, removing it once
|
||||||
|
// placeholderListBoxPaths = false;
|
||||||
|
// }
|
||||||
|
// showUploadFileGUI();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Window.alert("This part must be revisited");
|
||||||
|
//
|
||||||
|
//// GeoPortalDataEntryApp.geoportalDataEntryService.getRecord(selectedConcessione.getItemId(), recordType,
|
||||||
|
//// new AsyncCallback<ConcessioneDV>() {
|
||||||
|
////
|
||||||
|
//// @Override
|
||||||
|
//// public void onSuccess(ConcessioneDV theRecord) {
|
||||||
|
//// fullConcessione = theRecord;
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @Override
|
||||||
|
//// public void onFailure(Throwable caught) {
|
||||||
|
//// Window.alert(caught.getMessage());
|
||||||
|
//// }
|
||||||
|
//// });
|
||||||
|
//
|
||||||
|
// buttonUpdate.addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
//
|
||||||
|
// String errorMsg = checkValidUpload();
|
||||||
|
// if (errorMsg == null) {
|
||||||
|
// List<FileUploaded> listFilesUploaded = new ArrayList<FileUploaded>();
|
||||||
|
// List<MetaDataFieldSkeleton> listMetaDataFieldSkeleton = fieldUploadWidget.getListOfMetadataFields();
|
||||||
|
// for (MetaDataFieldSkeleton field : listMetaDataFieldSkeleton) {
|
||||||
|
// DialogUpload dUpload = (DialogUpload) field.getHolder();
|
||||||
|
// // adding it only if exists
|
||||||
|
// if (dUpload.getFileUploadingState() != null)
|
||||||
|
// listFilesUploaded.add(dUpload.getFileUploadingState().getFile());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// GenericDatasetBean gdb = new GenericDatasetBean();
|
||||||
|
// gdb.setFilesUploaded(listFilesUploaded);
|
||||||
|
// // adding it only if exists
|
||||||
|
//
|
||||||
|
// GWT.log("Section selected: " + listBoxPaths.getSelectedItemText());
|
||||||
|
// GWT.log("Content index selected: " + pathIndex);
|
||||||
|
// GWT.log("FileUploaded selected: " + gdb.getFilesUploaded());
|
||||||
|
//
|
||||||
|
// List<WorkspaceContentDV> listCurrentContent = new ArrayList<WorkspaceContentDV>();
|
||||||
|
// if (mapForCCUploading != null) {
|
||||||
|
// Collection<WorkspaceContentDV> currentContent = mapForCCUploading.values();
|
||||||
|
// if (currentContent != null)
|
||||||
|
// listCurrentContent.addAll(currentContent);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String htmlMsg = "Going to update the section " + listBoxPaths.getSelectedItemText() + ":";
|
||||||
|
// htmlMsg += "<ul>";
|
||||||
|
// htmlMsg += "<li>keeping " + listCurrentContent.size() + " current file/s </li>";
|
||||||
|
// htmlMsg += "<li>uploading " + listFilesUploaded.size() + " new file/s </li>";
|
||||||
|
// htmlMsg += "</ul>";
|
||||||
|
// htmlMsg += "<br>";
|
||||||
|
// htmlMsg += "This operation cannot be undone. Would you like to proceed?";
|
||||||
|
//
|
||||||
|
// GWT.log(htmlMsg);
|
||||||
|
//
|
||||||
|
// final ModalConfirm dialogConfirm = new ModalConfirm(null, "Update Confirm?", htmlMsg);
|
||||||
|
// dialogConfirm.getElement().getStyle().setZIndex(100000);
|
||||||
|
// dialogConfirm.getYesButton().addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
// dialogConfirm.hide();
|
||||||
|
// buttonUpdate.setEnabled(false);
|
||||||
|
//
|
||||||
|
// final DialogInform dialogInf = new DialogInform(null, "Updating Project...", "");
|
||||||
|
// dialogInf.setZIndex(100000);
|
||||||
|
// dialogInf.showLoader("Updating file/s for project: "+fullConcessione.getNome());
|
||||||
|
// //dialogInf.setWidth("400px");
|
||||||
|
//
|
||||||
|
// GeoportalDataEntryServiceAsync.Util.getInstance().updateSectionForRecord(
|
||||||
|
// fullConcessione.getItemId(), fullConcessione.getRecordType(),
|
||||||
|
// listBoxPaths.getSelectedItemText(), pathIndex, listCurrentContent, gdb,
|
||||||
|
// new AsyncCallback<ConcessioneDV>() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(Throwable caught) {
|
||||||
|
// dialogInf.hideLoader();
|
||||||
|
// dialogInf.setMsg(
|
||||||
|
// "Sorry error occurred during project update. Error reported: "
|
||||||
|
// + caught.getMessage());
|
||||||
|
// buttonUpdate.setEnabled(true);
|
||||||
|
// showUploadFileGUI();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(ConcessioneDV result) {
|
||||||
|
// dialogInf.hideLoader();
|
||||||
|
// dialogInf.setText("Project updated!");
|
||||||
|
// dialogInf.setMsg(result.getNome() + " updated correclty");
|
||||||
|
// dialogInf.center();
|
||||||
|
// fullConcessione = result;
|
||||||
|
// GWT.log("new concessione: "+fullConcessione);
|
||||||
|
// buttonUpdate.setEnabled(true);
|
||||||
|
// showUploadFileGUI();
|
||||||
|
//
|
||||||
|
// Window.alert("updateSectionForRecord must be revisited");
|
||||||
|
//
|
||||||
|
// /*
|
||||||
|
// editorManagerBus.fireEvent(
|
||||||
|
// new OperationPerformedOnItemEvent<ConcessioneDV>(Arrays.asList(fullConcessione), ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
|
||||||
|
//
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// dialogInf.center();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// dialogConfirm.show();
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// Window.alert(errorMsg);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Show upload file GUI.
|
||||||
|
// */
|
||||||
|
// private void showUploadFileGUI() {
|
||||||
|
// uploadFileContainer.setVisible(true);
|
||||||
|
// buttonUpdate.setVisible(false);
|
||||||
|
// uploadFileContainer.clear();
|
||||||
|
// controlsContent.clear();
|
||||||
|
// placeholderListBoxIndex = true;
|
||||||
|
// fieldUploadWidget = null;
|
||||||
|
// pathIndex = null;
|
||||||
|
// mapForCCUploading = null;
|
||||||
|
// mapWSContentListBox = null;
|
||||||
|
//
|
||||||
|
//// listBoxIndex.clear();
|
||||||
|
// cgSelectFile.setVisible(true);
|
||||||
|
//
|
||||||
|
// ListBox listBoxContentIndex = new ListBox();
|
||||||
|
// listBoxContentIndex.setWidth(_FORM_WIDTH_FIELDS_SIZE);
|
||||||
|
// listBoxContentIndex.addItem("Select a content...");
|
||||||
|
// String section = null;
|
||||||
|
// Integer posizIndex = 0;
|
||||||
|
// if (listBoxPaths.getSelectedItemText().contains(SECTION_ABSTRACT_RELAZIONE)) {
|
||||||
|
// section = SECTION_ABSTRACT_RELAZIONE;
|
||||||
|
// AbstractRelazioneScavoDV ar = fullConcessione.getAbstractRelazioneScavo();
|
||||||
|
//
|
||||||
|
// if (ar == null) {
|
||||||
|
// showMessage(SECTION_ABSTRACT_RELAZIONE + " NOT AVAILABLE", LabelType.WARNING);
|
||||||
|
//// pathIndex = 0;
|
||||||
|
//// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, ar.getTitolo(),
|
||||||
|
// ar.getListWsContent());
|
||||||
|
//
|
||||||
|
// } else if (listBoxPaths.getSelectedItemText().contains(SECTION_IMMAGINI)) {
|
||||||
|
// section = SECTION_IMMAGINI;
|
||||||
|
// List<UploadedImageDV> listImmagini = fullConcessione.getImmaginiRappresentative();
|
||||||
|
// if (listImmagini == null || listImmagini.isEmpty()) {
|
||||||
|
// showMessage(SECTION_IMMAGINI + " NOT AVAILABLE", LabelType.WARNING);
|
||||||
|
//// pathIndex = 0;
|
||||||
|
//// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (UploadedImageDV uploadedImageDV : listImmagini) {
|
||||||
|
// fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, StringUtil.ellipsize(uploadedImageDV.getDidascalia(),30),
|
||||||
|
// uploadedImageDV.getListWsContent());
|
||||||
|
// posizIndex++;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// } else if (listBoxPaths.getSelectedItemText().contains(SECTION_RELAZIONE)) {
|
||||||
|
// section = SECTION_RELAZIONE;
|
||||||
|
// RelazioneScavoDV relazioneScavo = fullConcessione.getRelazioneScavo();
|
||||||
|
// if (relazioneScavo == null) {
|
||||||
|
// showMessage(SECTION_RELAZIONE + " NOT AVAILABLE", LabelType.WARNING);
|
||||||
|
//// pathIndex = 0;
|
||||||
|
//// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, relazioneScavo.getTitolo(),
|
||||||
|
// relazioneScavo.getListWsContent());
|
||||||
|
//
|
||||||
|
// } else if (listBoxPaths.getSelectedItemText().contains(SECTION_POSIZIONAMENTO_SCAVO)) {
|
||||||
|
// section = SECTION_POSIZIONAMENTO_SCAVO;
|
||||||
|
// LayerConcessioneDV posiz = fullConcessione.getPosizionamentoScavo();
|
||||||
|
// if (posiz == null) {
|
||||||
|
// showMessage(SECTION_POSIZIONAMENTO_SCAVO + " NOT AVAILABLE", LabelType.WARNING);
|
||||||
|
//// pathIndex = 0;
|
||||||
|
//// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// fillListBoxToBeReplaced(listBoxContentIndex, section, posizIndex, posiz.getTitolo(),
|
||||||
|
// posiz.getListWsContent());
|
||||||
|
//
|
||||||
|
// } else if (listBoxPaths.getSelectedItemText().contains(SECTION_PIANTE)) {
|
||||||
|
// section = SECTION_PIANTE;
|
||||||
|
// List<LayerConcessioneDV> piante = fullConcessione.getPianteFineScavo();
|
||||||
|
// if (piante == null || piante.isEmpty()) {
|
||||||
|
// showMessage(SECTION_PIANTE + " NOT AVAILABLE", LabelType.WARNING);
|
||||||
|
//// pathIndex = 0;
|
||||||
|
//// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (LayerConcessioneDV lcDV : piante) {
|
||||||
|
// fillListBoxToBeReplaced(listBoxContentIndex, SECTION_PIANTE, posizIndex, lcDV.getTitolo(),
|
||||||
|
// lcDV.getListWsContent());
|
||||||
|
// posizIndex++;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// controlsContent.add(listBoxContentIndex);
|
||||||
|
//
|
||||||
|
// if (listBoxContentIndex.getItemCount() == 2) {
|
||||||
|
// // listBoxContentIndex.setSelectedIndex(1);
|
||||||
|
// listBoxContentIndex.setSelectedValue(listBoxContentIndex.getItemText(1));
|
||||||
|
//
|
||||||
|
// DomEvent.fireNativeEvent(Document.get().createChangeEvent(), listBoxContentIndex);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void fillListBoxToBeReplaced(ListBox listBoxContentIndex, String section, int posizIndex, String title,
|
||||||
|
// List<WorkspaceContentDV> listWSC) {
|
||||||
|
// GWT.log("fillListBoxToBeReplaced called, posizIndex: "+posizIndex+", listWSC: "+listWSC);
|
||||||
|
//
|
||||||
|
// if(mapWSContentListBox==null) {
|
||||||
|
// mapWSContentListBox = new HashMap<Integer, List<WorkspaceContentDV>>();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// listBoxContentIndex.addItem(title, posizIndex + "");
|
||||||
|
// mapWSContentListBox.put(posizIndex, listWSC);
|
||||||
|
//
|
||||||
|
// // adding handler once
|
||||||
|
// if (posizIndex == 0) {
|
||||||
|
//
|
||||||
|
// listBoxContentIndex.addChangeHandler(new ChangeHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onChange(ChangeEvent event) {
|
||||||
|
// GWT.log("listBoxContentIndex changed, value: "+listBoxContentIndex.getSelectedValue());
|
||||||
|
//
|
||||||
|
// if (placeholderListBoxIndex) {
|
||||||
|
// listBoxContentIndex.removeItem(0); // this is the placeholder, removing it once
|
||||||
|
// placeholderListBoxIndex = false;
|
||||||
|
// }
|
||||||
|
// int selectedIndex = listBoxContentIndex.getSelectedIndex();
|
||||||
|
// GWT.log("selected index: "+selectedIndex);
|
||||||
|
// List<WorkspaceContentDV> theListWC = mapWSContentListBox.get(selectedIndex);
|
||||||
|
//
|
||||||
|
// if (theListWC == null || theListWC.isEmpty()) {
|
||||||
|
// uploadFileContainer.clear();
|
||||||
|
// showMessage(section + " does not contain file!", LabelType.WARNING);
|
||||||
|
// pathIndex = posizIndex;
|
||||||
|
// showNewFileUpload();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// showFileBrowseInteraction(selectedIndex, mapWSContentListBox.get(selectedIndex));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
////
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void showFileBrowseInteraction(int pathContentIndex, List<WorkspaceContentDV> listWSC) {
|
||||||
|
// uploadFileContainer.clear();
|
||||||
|
// pathIndex = pathContentIndex;
|
||||||
|
// GWT.log("showing pathContentIndex: "+pathContentIndex);
|
||||||
|
// GWT.log("showing ws content: "+listWSC);
|
||||||
|
//
|
||||||
|
// // map for current content uploading
|
||||||
|
// mapForCCUploading = new HashMap<Integer, WorkspaceContentDV>(listWSC.size());
|
||||||
|
// int index = 0;
|
||||||
|
// for (WorkspaceContentDV workspaceContentDV : listWSC) {
|
||||||
|
// workspaceContentDV.setCliendId(index);
|
||||||
|
// mapForCCUploading.put(index, workspaceContentDV);
|
||||||
|
// index++;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (listWSC.size() > 0) {
|
||||||
|
// FlexTable table = new FlexTable();
|
||||||
|
// table.addStyleName("table-current-content");
|
||||||
|
// table.setHTML(0, 0, "<span style='color:rgb(155, 80, 78); font-weight:bold;'>Current content:</span>");
|
||||||
|
// table.setHTML(1, 0, "<span style='color:rgb(155, 80, 78);'>Filename</span>");
|
||||||
|
// table.setHTML(1, 1, "<span style='color:rgb(155, 80, 78);'>MimeType<span>");
|
||||||
|
// table.setHTML(1, 2, "<span style='color:rgb(155, 80, 78);'>Link</span>");
|
||||||
|
//
|
||||||
|
// int i = 2;
|
||||||
|
// for (final WorkspaceContentDV wsContent : listWSC) {
|
||||||
|
// table.setHTML(i, 0, wsContent.getName());
|
||||||
|
// table.setHTML(i, 1, wsContent.getMimetype());
|
||||||
|
// String link = "<a target=\"_blank\" href=" + wsContent.getLink() + ">View</a>";
|
||||||
|
// table.setHTML(i, 2, link);
|
||||||
|
//
|
||||||
|
// final int rowIndexToRem = i;
|
||||||
|
// Button buttonRemoveFile = new Button();
|
||||||
|
// buttonRemoveFile.setIcon(IconType.TRASH);
|
||||||
|
// buttonRemoveFile.setTitle("Remove this file");
|
||||||
|
// buttonRemoveFile.addClickHandler(new ClickHandler() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onClick(ClickEvent event) {
|
||||||
|
// mapForCCUploading.remove(wsContent.getCliendId());
|
||||||
|
// table.getRowFormatter().getElement(rowIndexToRem).setAttribute("hidden", "hidden");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// table.setWidget(i, 3, buttonRemoveFile);
|
||||||
|
// i++;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// uploadFileContainer.add(table);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// showNewFileUpload();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// private void showNewFileUpload() {
|
||||||
|
//
|
||||||
|
// HTML label = new HTML();
|
||||||
|
// label.getElement().getStyle().setMarginTop(10, Unit.PX);
|
||||||
|
// label.getElement().getStyle().setMarginBottom(10, Unit.PX);
|
||||||
|
// label.setHTML("<b>Add new file/s:</b>");
|
||||||
|
// uploadFileContainer.add(label);
|
||||||
|
// // mDU = new MultipleDilaogUpload();
|
||||||
|
//
|
||||||
|
// MetadataFieldWrapper uploadField = new MetadataFieldWrapper();
|
||||||
|
// uploadField.setFieldName("File");
|
||||||
|
// uploadField.setMandatory(false);
|
||||||
|
// uploadField.setType(DataTypeWrapper.File);
|
||||||
|
// uploadField.setMaxOccurs(1000);
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// fieldUploadWidget = new MetaDataField(uploadField, uiBus, OPERATION.NEW);
|
||||||
|
// uploadFileContainer.add(fieldUploadWidget);
|
||||||
|
//
|
||||||
|
// buttonUpdate.setVisible(true);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Test if profile data are valid.
|
||||||
|
// *
|
||||||
|
// * @return the string
|
||||||
|
// */
|
||||||
|
// private String checkValidUpload() {
|
||||||
|
//
|
||||||
|
// if (fieldUploadWidget == null)
|
||||||
|
// return "No file uploaded";
|
||||||
|
//
|
||||||
|
// for (MetaDataFieldSkeleton field : fieldUploadWidget.getListOfMetadataFields()) {
|
||||||
|
//
|
||||||
|
// field.removeError();
|
||||||
|
//
|
||||||
|
// String error = field.isFieldValueValid();
|
||||||
|
// if (error != null) {
|
||||||
|
// field.showError();
|
||||||
|
// String errorMsg = field.getFieldNameOriginal() + " is not valid. Suggestion: " + error;
|
||||||
|
// return errorMsg;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void showMessage(String txt, LabelType type) {
|
||||||
|
// Label l = new Label();
|
||||||
|
// l.setType(type);
|
||||||
|
// l.setText(txt);
|
||||||
|
// uploadFileContainer.add(l);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +1,50 @@
|
||||||
|
<!-- <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
|
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||||
|
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||||
|
<ui:style>
|
||||||
|
.important {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-save-style {
|
||||||
|
margin-top: 10px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max-height-500 {
|
||||||
|
max-height: 450px;
|
||||||
|
}
|
||||||
|
</ui:style>
|
||||||
|
<g:HTMLPanel>
|
||||||
|
<g:ScrollPanel addStyleNames="{style.max-height-500}">
|
||||||
|
<b:Form type="INLINE">
|
||||||
|
<b:Fieldset addStyleNames="form-fieldset-edit">
|
||||||
|
<b:ControlGroup>
|
||||||
|
<b:ControlLabel>Section</b:ControlLabel>
|
||||||
|
<b:Controls>
|
||||||
|
<b:ListBox ui:field="listBoxPaths"></b:ListBox>
|
||||||
|
</b:Controls>
|
||||||
|
</b:ControlGroup>
|
||||||
|
<b:ControlGroup ui:field="cgSelectFile"
|
||||||
|
visible="false">
|
||||||
|
<b:ControlLabel>Manage the content of</b:ControlLabel>
|
||||||
|
<b:Controls ui:field="controlsContent">
|
||||||
|
<b:ListBox ui:field="listBoxIndex"
|
||||||
|
addStyleNames="{style.width-500}"></b:ListBox>
|
||||||
|
</b:Controls>
|
||||||
|
</b:ControlGroup>
|
||||||
|
<b:ControlGroup>
|
||||||
|
<g:ScrollPanel>
|
||||||
|
<g:HTMLPanel ui:field="uploadFileContainer"
|
||||||
|
addStyleNames="upload-file-container"></g:HTMLPanel>
|
||||||
|
</g:ScrollPanel>
|
||||||
|
</b:ControlGroup>
|
||||||
|
</b:Fieldset>
|
||||||
|
</b:Form>
|
||||||
|
</g:ScrollPanel>
|
||||||
|
<b:Button icon="SAVE" type="INFO"
|
||||||
|
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate"
|
||||||
|
visible="false">UPDATE</b:Button>
|
||||||
|
</g:HTMLPanel>
|
||||||
|
</ui:UiBinder> -->
|
|
@ -1,383 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEvent;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
|
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.GenericFormEvents.GenericFormEventsListener;
|
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
|
||||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
|
||||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.dom.client.Element;
|
|
||||||
import com.google.gwt.dom.client.NodeList;
|
|
||||||
import com.google.gwt.event.dom.client.ChangeEvent;
|
|
||||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
||||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
|
||||||
|
|
||||||
public class UpdateRecord extends Composite {
|
|
||||||
|
|
||||||
private static UpdateRecordUiBinder uiBinder = GWT.create(UpdateRecordUiBinder.class);
|
|
||||||
|
|
||||||
interface UpdateRecordUiBinder extends UiBinder<Widget, UpdateRecord> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
ListBox listBoxSections;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
ScrollPanel scrollSectionContent;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
HTMLPanel htmlPanelContainer;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
HTMLPanel alertHTMLPanel;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
ControlGroup controlsControlGroup;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
Button buttonUpdate;
|
|
||||||
|
|
||||||
public static final String PLACEHOLDER_LIST_BOX = "Select section...";
|
|
||||||
|
|
||||||
private LoaderIcon loaderProjectSections = new LoaderIcon("Loading Project sections... please wait");
|
|
||||||
|
|
||||||
private GeoNaFormCardModel currentCardSelected;
|
|
||||||
|
|
||||||
private String profileID;
|
|
||||||
|
|
||||||
private String projectID;
|
|
||||||
|
|
||||||
private HashMap<String, List<FilePathDV>> sectionPathFilePaths = new HashMap<>();
|
|
||||||
|
|
||||||
private MetadataFormCardEventHandler formCardEventHandler = new MetadataFormCardEventHandler();
|
|
||||||
|
|
||||||
private ProjectEdit projectEditDTO;
|
|
||||||
|
|
||||||
private HandlerManager appManagerBus;
|
|
||||||
|
|
||||||
public UpdateRecord(HandlerManager appManagerBus, String profileID, String projectID, int modalWidth, int modalHeight) {
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
|
||||||
this.appManagerBus = appManagerBus;
|
|
||||||
this.profileID = profileID;
|
|
||||||
this.projectID = projectID;
|
|
||||||
setUpdateButtonEnabled(false);
|
|
||||||
|
|
||||||
htmlPanelContainer.setVisible(false);
|
|
||||||
|
|
||||||
alertHTMLPanel.add(loaderProjectSections);
|
|
||||||
|
|
||||||
scrollSectionContent.setHeight((modalHeight-350)+"px");
|
|
||||||
|
|
||||||
listBoxSections.setWidth((modalWidth-50)+"px");
|
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
|
||||||
new AsyncCallback<ProjectEdit>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ProjectEdit result) {
|
|
||||||
projectEditDTO = result;
|
|
||||||
htmlPanelContainer.setVisible(true);
|
|
||||||
|
|
||||||
try {
|
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
listBoxSections.addItem(PLACEHOLDER_LIST_BOX, PLACEHOLDER_LIST_BOX);
|
|
||||||
listBoxSections.getElement().getElementsByTagName("option").getItem(0).setAttribute("disabled",
|
|
||||||
"disabled");
|
|
||||||
listBoxSections.setSelectedValue(PLACEHOLDER_LIST_BOX);
|
|
||||||
|
|
||||||
int sectionArray = 0;
|
|
||||||
|
|
||||||
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
|
||||||
|
|
||||||
GcubeProfileDV profileDV = profileBean.getGcubeProfileDV();
|
|
||||||
|
|
||||||
String sectionPath = profileDV.getParentName() != null ? profileDV.getParentName() : "";
|
|
||||||
|
|
||||||
sectionPath += profileDV.getSectionName();
|
|
||||||
|
|
||||||
// increment section stored as array
|
|
||||||
if (profileDV.getMaxOccurs() == 0 || profileDV.getMaxOccurs() > 1) {
|
|
||||||
sectionPath += "[" + sectionArray + "]";
|
|
||||||
sectionArray++;
|
|
||||||
} else {
|
|
||||||
sectionArray = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<FilePathDV> filePaths = profileDV.getFilePaths();
|
|
||||||
|
|
||||||
if (filePaths != null)
|
|
||||||
sectionPathFilePaths.put(sectionPath, filePaths);
|
|
||||||
|
|
||||||
GWT.log("Adding type: " + profileBean.getType() + ", in the section path: " + sectionPath);
|
|
||||||
|
|
||||||
listBoxSections.addItem(profileBean.getType(), sectionPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
listBoxSections.addChangeHandler(new ChangeHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChange(ChangeEvent event) {
|
|
||||||
setUpdateButtonEnabled(false);
|
|
||||||
|
|
||||||
// -1 because the first element is the PLACEHOLDER "Select section..."
|
|
||||||
int selectedIndex = listBoxSections.getSelectedIndex() - 1;
|
|
||||||
|
|
||||||
MetaDataProfileBeanExt selectedBean = result.getTheProfileBeans()
|
|
||||||
.get(selectedIndex);
|
|
||||||
GWT.log("Change handler fired " + selectedBean);
|
|
||||||
controlsControlGroup.setVisible(true);
|
|
||||||
scrollSectionContent.clear();
|
|
||||||
|
|
||||||
GcubeProfileDV gcubeProfile = selectedBean.getGcubeProfileDV();
|
|
||||||
|
|
||||||
currentCardSelected = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile(
|
|
||||||
gcubeProfile, 1, selectedBean, OPERATION.UPDATE, appManagerBus);
|
|
||||||
|
|
||||||
currentCardSelected.getMetadataForm().addListener(formCardEventHandler);
|
|
||||||
|
|
||||||
scrollSectionContent.add(currentCardSelected.getMetadataForm());
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
projectEditDTO = null;
|
|
||||||
htmlPanelContainer.setVisible(true);
|
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
|
||||||
|
|
||||||
String errorMsg = caught.getMessage();
|
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
|
||||||
alert.setClose(false);
|
|
||||||
try {
|
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
alertHTMLPanel.add(alert);
|
|
||||||
Window.alert(errorMsg);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bindEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpdateButtonEnabled(boolean bool) {
|
|
||||||
buttonUpdate.setEnabled(bool);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void bindEvents() {
|
|
||||||
|
|
||||||
buttonUpdate.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
|
|
||||||
alertHTMLPanel.clear();
|
|
||||||
boolean isFormValid = currentCardSelected.getMetadataForm().isFormDataValid();
|
|
||||||
|
|
||||||
if (!isFormValid) {
|
|
||||||
Alert alert = new Alert("Error/s detected, please check your data entry...", AlertType.WARNING);
|
|
||||||
alert.setClose(true);
|
|
||||||
alertHTMLPanel.add(alert);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GeoNaFormDataObject gfdo = new GeoNaFormDataObject(
|
|
||||||
Arrays.asList(currentCardSelected.getMetadataForm().getFormDataBean()),
|
|
||||||
currentCardSelected.getGcubeProfile());
|
|
||||||
|
|
||||||
String sectionPath = listBoxSections.getSelectedValue();
|
|
||||||
|
|
||||||
GWT.log("sectionPath is: " + sectionPath);
|
|
||||||
|
|
||||||
List<FilePathDV> listFilePaths = sectionPathFilePaths.get(sectionPath);
|
|
||||||
|
|
||||||
final Modal modal = new Modal(true, true);
|
|
||||||
DocumentDV theDocument = projectEditDTO.getTheProjectDV().getTheDocument();
|
|
||||||
|
|
||||||
modal.setTitle("Updating...");
|
|
||||||
|
|
||||||
final FlowPanel panelContainer = new FlowPanel();
|
|
||||||
|
|
||||||
LoaderIcon loader = new LoaderIcon("Operation in progress... please wait");
|
|
||||||
modal.add(loader);
|
|
||||||
String htmlMsg = "Updating the section <b>"+listBoxSections.getSelectedItemText()+"</b> of the project with:";
|
|
||||||
htmlMsg += "<ul>";
|
|
||||||
htmlMsg += "<li>id: " + projectID + "</li>";
|
|
||||||
htmlMsg += "<li>" + theDocument.getFirstEntryOfMap().getKey() + ": "
|
|
||||||
+ theDocument.getFirstEntryOfMap().getValue() + "</li>";
|
|
||||||
htmlMsg += "</ul>";
|
|
||||||
htmlMsg += "<br>";
|
|
||||||
panelContainer.add(new HTML(htmlMsg));
|
|
||||||
panelContainer.add(loader);
|
|
||||||
panelContainer.add(new HTML("<br><br>"));
|
|
||||||
|
|
||||||
modal.add(panelContainer);
|
|
||||||
// modal3.setWidth(950);
|
|
||||||
// modal3.setHeight("700px");
|
|
||||||
modal.setCloseVisible(false);
|
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().updateGeportalDataForm(profileID, projectID, gfdo,
|
|
||||||
sectionPath, listFilePaths, new AsyncCallback<CommitReport>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
modal.setCloseVisible(true);
|
|
||||||
modal.setTitle("Error :-(");
|
|
||||||
panelContainer.clear();
|
|
||||||
String errorMsg = "Sorry, an error occurred when updating the project with id: "+projectID+". Please, try again. If the problem persists, please contact the support";
|
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
|
||||||
alert.setClose(false);
|
|
||||||
modal.add(alert);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommitReport result) {
|
|
||||||
modal.setCloseVisible(true);
|
|
||||||
modal.setTitle("Project updated!");
|
|
||||||
panelContainer.clear();
|
|
||||||
Alert alert = new Alert();
|
|
||||||
alert.setClose(false);
|
|
||||||
alert.setType(AlertType.SUCCESS);
|
|
||||||
String htmlMsg = "The project with:";
|
|
||||||
htmlMsg += "<ul>";
|
|
||||||
htmlMsg += "<li>id: " + projectID + "</li>";
|
|
||||||
htmlMsg += "<li>" + theDocument.getFirstEntryOfMap().getKey() + ": "
|
|
||||||
+ theDocument.getFirstEntryOfMap().getValue() + "</li>";
|
|
||||||
htmlMsg += "</ul>";
|
|
||||||
htmlMsg += "<br>";
|
|
||||||
htmlMsg += "has been updated successfully!";
|
|
||||||
alert.setHTML(htmlMsg);
|
|
||||||
|
|
||||||
ReportTemplateToHTML rtth2 = new ReportTemplateToHTML("Project", result.getProjectAsJSON(),
|
|
||||||
false, false);
|
|
||||||
rtth2.showAsJSON(false);
|
|
||||||
|
|
||||||
panelContainer.add(alert);
|
|
||||||
panelContainer.add(rtth2);
|
|
||||||
|
|
||||||
appManagerBus.fireEvent(new OperationPerformedOnItemEvent<ResultDocumentDV>(
|
|
||||||
profileID, null, ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void noUpdateMode() {
|
|
||||||
buttonUpdate.setVisible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class MetadataFormCardEventHandler.
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
|
||||||
*
|
|
||||||
* Oct 12, 2020
|
|
||||||
*/
|
|
||||||
private class MetadataFormCardEventHandler implements GenericFormEventsListener {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* On form data valid.
|
|
||||||
*
|
|
||||||
* @param genericDatasetBean the generic dataset bean
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onFormDataValid(GenericDatasetBean genericDatasetBean) {
|
|
||||||
setUpdateButtonEnabled(true);
|
|
||||||
//Disabling option not selected
|
|
||||||
int selectedIndex = listBoxSections.getSelectedIndex();
|
|
||||||
NodeList<Element> elementOption = listBoxSections.getElement().getElementsByTagName("option");
|
|
||||||
for (int i = 0; i < listBoxSections.getItemCount(); i++) {
|
|
||||||
if (i != selectedIndex) {
|
|
||||||
elementOption.getItem(i).setAttribute("disabled", "disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* On form data edit.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onFormDataEdit() {
|
|
||||||
setUpdateButtonEnabled(false);
|
|
||||||
NodeList<Element> elementOption = listBoxSections.getElement().getElementsByTagName("option");
|
|
||||||
//i==0 is the PLACEHOLDER
|
|
||||||
for (int i = 1; i < listBoxSections.getItemCount(); i++) {
|
|
||||||
elementOption.getItem(i).removeAttribute("disabled");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* On form aborted.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onFormAborted() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* On validation error.
|
|
||||||
*
|
|
||||||
* @param throwable the throwable
|
|
||||||
* @param errorMsg the error msg
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onValidationError(Throwable throwable, String errorMsg) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
|
||||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
|
||||||
<ui:style>
|
|
||||||
.important {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-save-style {
|
|
||||||
margin-top: 10px;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.max-height-500 {
|
|
||||||
max-height: 450px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-top-10 {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-operation {
|
|
||||||
font-size: 12px;
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
</ui:style>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<g:HTMLPanel ui:field="alertHTMLPanel">
|
|
||||||
</g:HTMLPanel>
|
|
||||||
<g:HTMLPanel ui:field="htmlPanelContainer">
|
|
||||||
<b:Form type="INLINE">
|
|
||||||
<b:Fieldset addStyleNames="form-fieldset-edit">
|
|
||||||
<b:ControlGroup>
|
|
||||||
<b:Label type="INFO">Select the section of the document you want
|
|
||||||
to update...</b:Label>
|
|
||||||
<b:Controls>
|
|
||||||
<b:ListBox ui:field="listBoxSections"></b:ListBox>
|
|
||||||
</b:Controls>
|
|
||||||
</b:ControlGroup>
|
|
||||||
<b:ControlGroup ui:field="controlsControlGroup"
|
|
||||||
visible="false">
|
|
||||||
<b:Label type="INFO">Manage the content of</b:Label>
|
|
||||||
<b:Controls>
|
|
||||||
<g:ScrollPanel ui:field="scrollSectionContent"></g:ScrollPanel>
|
|
||||||
</b:Controls>
|
|
||||||
</b:ControlGroup>
|
|
||||||
<b:ControlGroup>
|
|
||||||
<g:ScrollPanel>
|
|
||||||
<g:HTMLPanel ui:field="uploadFileContainer"
|
|
||||||
addStyleNames="upload-file-container"></g:HTMLPanel>
|
|
||||||
</g:ScrollPanel>
|
|
||||||
</b:ControlGroup>
|
|
||||||
</b:Fieldset>
|
|
||||||
</b:Form>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
<g:HTMLPanel>
|
|
||||||
<g:HTMLPanel addStyleNames="{style.info-operation}">
|
|
||||||
To update the document:
|
|
||||||
"Select the Section you wish to update, update the metadata and/or
|
|
||||||
the
|
|
||||||
file/s and then confirm by clicking on "Create".
|
|
||||||
Finally select
|
|
||||||
"Update".
|
|
||||||
</g:HTMLPanel>
|
|
||||||
<b:Button icon="SAVE" type="INFO"
|
|
||||||
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate">UPDATE</b:Button>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
|
|
||||||
</g:HTMLPanel>
|
|
||||||
</ui:UiBinder>
|
|
|
@ -248,7 +248,7 @@ public class GeonaDataEntryMainForm extends Composite {
|
||||||
|
|
||||||
appManagerBus.fireEvent(new SaveGeonaDataFormsEvent(treeItemPanel.getProfileID(), treeNode));
|
appManagerBus.fireEvent(new SaveGeonaDataFormsEvent(treeItemPanel.getProfileID(), treeNode));
|
||||||
TreeVisitUtil.preOrderVisit(treeNode);
|
TreeVisitUtil.preOrderVisit(treeNode);
|
||||||
//showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true);
|
showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
showAlertOnSaveAction("Detected errors, please fix it/them", AlertType.ERROR, true);
|
showAlertOnSaveAction("Detected errors, please fix it/them", AlertType.ERROR, true);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.projects;
|
package org.gcube.portlets.user.geoportaldataentry.client.ui.projects;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -324,9 +323,11 @@ public class ListOfProjectTablePanel extends Composite {
|
||||||
if (ucdProjectTypesForListingDataView.size() == 1) {
|
if (ucdProjectTypesForListingDataView.size() == 1) {
|
||||||
// noProjectSelectionMessage.setVisible(false);
|
// noProjectSelectionMessage.setVisible(false);
|
||||||
UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0);
|
UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0);
|
||||||
GetListOfRecordsEvent event = new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
|
alertProjectType.setText(singleUCD.getName());
|
||||||
getCurrentSearchingFilter(), true);
|
// setFilteringParameters(displayFields, sortByFields, searchForFields,
|
||||||
setSearchTypeAndFire(singleUCD.getName(), event);
|
// currentSearchingFilter);
|
||||||
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
|
||||||
|
getCurrentSearchingFilter(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -334,16 +335,6 @@ public class ListOfProjectTablePanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchTypeAndFire(String ucdName, GetListOfRecordsEvent event) {
|
|
||||||
alertProjectType.setText(ucdName);
|
|
||||||
|
|
||||||
// if(event.getSearchingFilter().getProfileID()!=null && event.getSearchingFilter().getProjectID()) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
appManagerBus.fireEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Built searching filter.
|
* Built searching filter.
|
||||||
*
|
*
|
||||||
|
@ -355,25 +346,21 @@ public class ListOfProjectTablePanel extends Composite {
|
||||||
if (searchText != null && !searchText.isEmpty()) {
|
if (searchText != null && !searchText.isEmpty()) {
|
||||||
Map<String, Object> searchInto = new HashMap<String, Object>();
|
Map<String, Object> searchInto = new HashMap<String, Object>();
|
||||||
|
|
||||||
List<String> listOfSeachingFields = new ArrayList<String>();
|
String searchForField = "";
|
||||||
|
|
||||||
for (ItemFieldDV recordField : cacheSearchingFilterParameters.getSearchByFields()) {
|
for (ItemFieldDV recordField : cacheSearchingFilterParameters.getSearchByFields()) {
|
||||||
if (recordField.getDisplayName().equals(alertSearchFor.getText())) {
|
if (recordField.getDisplayName().equals(alertSearchFor.getText())) {
|
||||||
listOfSeachingFields = recordField.getJsonFields();
|
searchForField = recordField.getJsonFields().get(0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
searchInto.put(searchForField, searchText);
|
||||||
for (String fieldname : listOfSeachingFields) {
|
|
||||||
searchInto.put(fieldname, searchText);
|
|
||||||
}
|
|
||||||
|
|
||||||
WhereClause where = new WhereClause();
|
WhereClause where = new WhereClause();
|
||||||
where.setSearchInto(searchInto);
|
where.setSearchInto(searchInto);
|
||||||
where.setOperator(LOGICAL_OP.OR);
|
where.setOperator(LOGICAL_OP.OR);
|
||||||
|
|
||||||
searchingFilter.setConditions(Arrays.asList(where));
|
searchingFilter.setConditions(Arrays.asList(where));
|
||||||
}
|
}
|
||||||
|
|
||||||
return searchingFilter;
|
return searchingFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,9 +467,4 @@ public class ListOfProjectTablePanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getSelectedProjectType() {
|
|
||||||
return alertProjectType.getText();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,17 +4,12 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.WORKFLOW_PHASE;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.CloseCreateRelationGUIEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.CloseCreateRelationGUIEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
|
@ -22,7 +17,6 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.Label;
|
import com.github.gwtbootstrap.client.ui.Label;
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
|
@ -41,7 +35,6 @@ import com.google.gwt.user.client.ui.FlexTable;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class ViewRelationshipPanel extends Composite {
|
public class ViewRelationshipPanel extends Composite {
|
||||||
|
@ -180,37 +173,15 @@ public class ViewRelationshipPanel extends Composite {
|
||||||
|
|
||||||
FlowPanel panelContainer = new FlowPanel();
|
FlowPanel panelContainer = new FlowPanel();
|
||||||
Button deleteRelation = new Button("", IconType.TRASH);
|
Button deleteRelation = new Button("", IconType.TRASH);
|
||||||
deleteRelation.setTitle("Delete this relation");
|
deleteRelation.setTitle("Delete this releation");
|
||||||
deleteRelation.setType(ButtonType.LINK);
|
deleteRelation.setType(ButtonType.LINK);
|
||||||
deleteRelation.addClickHandler(new ClickHandler() {
|
deleteRelation.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
ResultDocumentDV toProject = mapOfTargetProjectForId.get(relationDV.getTargetUCD());
|
||||||
// #24571
|
appManagerBus.fireEvent(
|
||||||
boolean isNotInDRAFT = false;
|
new RelationActionHandlerEvent(project, relationDV.getRelationshipName(), toProject));
|
||||||
|
|
||||||
if (fromTheProject.getLifecycleInfo() != null) {
|
|
||||||
String phase = fromTheProject.getLifecycleInfo().getPhase();
|
|
||||||
// IF the project is not in DRAFT, showing an alert and the no Update Mode will
|
|
||||||
// be activated
|
|
||||||
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) != 0) {
|
|
||||||
|
|
||||||
String msg = ConstantsGeoPortalDataEntryApp.ALERT_MESSAGE_DELETE_RELATION_FORBIDDEN;
|
|
||||||
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
|
||||||
"Forbidden: " + OPERATION_ON_ITEM.DELETE_RELATION, msg, AlertType.WARNING);
|
|
||||||
modalW.show();
|
|
||||||
|
|
||||||
isNotInDRAFT = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//If the project is in DRAFT, going to delete the releation after confirm
|
|
||||||
if(!isNotInDRAFT) {
|
|
||||||
ResultDocumentDV toProject = mapOfTargetProjectForId.get(relationDV.getTargetUCD());
|
|
||||||
appManagerBus.fireEvent(
|
|
||||||
new RelationActionHandlerEvent(project, relationDV.getRelationshipName(), toProject));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class LifecycleInformationPanel extends FlowPanel {
|
||||||
final LoaderIcon lc = new LoaderIcon("Get link...");
|
final LoaderIcon lc = new LoaderIcon("Get link...");
|
||||||
hpGetLink.add(lc);
|
hpGetLink.add(lc);
|
||||||
add(hpGetLink);
|
add(hpGetLink);
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID, GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER,
|
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID,
|
||||||
new AsyncCallback<GeoportalItemReferences>() {
|
new AsyncCallback<GeoportalItemReferences>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class ReportTemplateToHTML extends Composite {
|
||||||
boolean openJSONReport) {
|
boolean openJSONReport) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
vpContainer.setVisible(false);
|
vpContainer.setVisible(false);
|
||||||
vpContainer.setWidth("95%");
|
|
||||||
|
|
||||||
showReportAsJSON.setDefaultOpen(openJSONReport);
|
showReportAsJSON.setDefaultOpen(openJSONReport);
|
||||||
showReportAsTable.setDefaultOpen(openTableReport);
|
showReportAsTable.setDefaultOpen(openTableReport);
|
||||||
|
|
|
@ -10,17 +10,13 @@
|
||||||
.margin-top-10 {
|
.margin-top-10 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.table-style {
|
|
||||||
margin-top: 10px;
|
|
||||||
width: 95%;
|
|
||||||
}
|
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<g:VerticalPanel ui:field="vpContainer"
|
<g:VerticalPanel ui:field="vpContainer"
|
||||||
addStyleNames="{style.table-style}">
|
addStyleNames="{style.margin-top-10}">
|
||||||
<b:Label ui:field="labelToReport">Report: </b:Label>
|
<b:Label ui:field="labelToReport">Report: </b:Label>
|
||||||
<g:VerticalPanel ui:field="htmlContainer"
|
<g:VerticalPanel ui:field="htmlContainer"
|
||||||
addStyleNames="{style.table-style}"></g:VerticalPanel>
|
addStyleNames="{style.margin-top-10}"></g:VerticalPanel>
|
||||||
<b:AccordionGroup heading="Show as Table"
|
<b:AccordionGroup heading="Show as Table"
|
||||||
ui:field="showReportAsTable">
|
ui:field="showReportAsTable">
|
||||||
<b:Paragraph ui:field="reportTable"></b:Paragraph>
|
<b:Paragraph ui:field="reportTable"></b:Paragraph>
|
||||||
|
|
|
@ -27,7 +27,6 @@ import com.google.gwt.core.shared.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
|
|
||||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||||
|
@ -103,127 +102,6 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
|
||||||
super.addItems(items);
|
super.addItems(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CellRender {
|
|
||||||
|
|
||||||
String tooltip;
|
|
||||||
String value;
|
|
||||||
|
|
||||||
public CellRender() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTooltip() {
|
|
||||||
return tooltip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTooltip(String tooltip) {
|
|
||||||
this.tooltip = tooltip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public CellRender toCellRender(ItemFieldDV itemField, DocumentDV documentDV) {
|
|
||||||
|
|
||||||
StringBuilder tooltipBuilder = new StringBuilder();
|
|
||||||
StringBuilder valueBuilder = new StringBuilder();
|
|
||||||
String newLine = "<br>";
|
|
||||||
String newLineTxt = "\n";
|
|
||||||
String bullet = "• "; // it is the dot. As <li> rendered in the <ul> tag
|
|
||||||
|
|
||||||
String newBullet = newLine + bullet;
|
|
||||||
|
|
||||||
List<String> listJsonFields = itemField.getJsonFields();
|
|
||||||
|
|
||||||
int numberOfFields = listJsonFields.size();
|
|
||||||
|
|
||||||
if (numberOfFields > 1) {
|
|
||||||
valueBuilder.append(bullet);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String jsonKey : listJsonFields) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
String objectToRender = "";
|
|
||||||
// removing the '_theDocument.' prefix for searching in the Document Map
|
|
||||||
String key = jsonKey.replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", "");
|
|
||||||
Object value = documentDV.getDocumentAsMap().get(key);
|
|
||||||
// GWT.log("key: "+key+" is instance of: "+value.getClass());
|
|
||||||
|
|
||||||
if (value == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
GWT.log("value instance: " + value.getClass());
|
|
||||||
|
|
||||||
if (value instanceof ArrayList) {
|
|
||||||
ArrayList<Object> arrayValues = (ArrayList<Object>) value;
|
|
||||||
String toReturn = "<ul>";
|
|
||||||
for (Object arrayValue : arrayValues) {
|
|
||||||
toReturn += "<li>" + arrayValue + "</li>";
|
|
||||||
}
|
|
||||||
toReturn += "</ul>";
|
|
||||||
GWT.log("Array returning: " + key + " is instance of: " + value.getClass() + " to return: "
|
|
||||||
+ toReturn);
|
|
||||||
objectToRender = StringUtil.ellipsize(toReturn, MAX_TEXT_DIMENSION);
|
|
||||||
} else {
|
|
||||||
objectToRender = StringUtil.ellipsize(value.toString(), MAX_TEXT_DIMENSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
valueBuilder.append(objectToRender);
|
|
||||||
valueBuilder.append(newBullet);
|
|
||||||
|
|
||||||
if (numberOfFields > 1) {
|
|
||||||
tooltipBuilder.append("* " + key + newLineTxt);
|
|
||||||
}else {
|
|
||||||
tooltipBuilder.append(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
GWT.log("Error e: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CellRender cellRender = new CellRender();
|
|
||||||
|
|
||||||
String toRender = valueBuilder.toString();
|
|
||||||
cellRender.setValue(toRender.substring(0, toRender.length() - newBullet.length()));
|
|
||||||
|
|
||||||
String toTooltip = tooltipBuilder.toString();
|
|
||||||
toTooltip = numberOfFields > 1 ? toTooltip.substring(0, toTooltip.length() - newLineTxt.length())
|
|
||||||
: toTooltip;
|
|
||||||
cellRender.setTooltip(toTooltip);
|
|
||||||
|
|
||||||
return cellRender;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Templates extends SafeHtmlTemplates {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start tool tip.
|
|
||||||
*
|
|
||||||
* @param toolTipText the tool tip text
|
|
||||||
* @return the safe html
|
|
||||||
*/
|
|
||||||
@Template("<span title=\"{0}\">")
|
|
||||||
SafeHtml startToolTip(String toolTipText);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* End tool tip.
|
|
||||||
*
|
|
||||||
* @return the safe html
|
|
||||||
*/
|
|
||||||
@Template("</span>")
|
|
||||||
SafeHtml endToolTip();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inits the table.
|
* Inits the table.
|
||||||
*
|
*
|
||||||
|
@ -252,10 +130,27 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
|
||||||
String displayName = itemField.getDisplayName();
|
String displayName = itemField.getDisplayName();
|
||||||
|
|
||||||
TextColumn<T> col = new TextColumn<T>() {
|
TextColumn<T> col = new TextColumn<T>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue(T object) {
|
public String getValue(T object) {
|
||||||
|
|
||||||
|
if (object == null)
|
||||||
|
return "";
|
||||||
|
|
||||||
|
DocumentDV documentDV = (DocumentDV) object;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// removing the '_theDocument.' prefix for searching in the Document Map
|
||||||
|
String key = itemField.getJsonFields().get(0)
|
||||||
|
.replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", "");
|
||||||
|
Object value = documentDV.getDocumentAsMap().get(key);
|
||||||
|
if(value==null)
|
||||||
|
return "";
|
||||||
|
|
||||||
|
return value.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
GWT.log("Error e: " + e);
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,12 +158,39 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
|
||||||
public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
|
public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
|
||||||
if (object == null)
|
if (object == null)
|
||||||
return;
|
return;
|
||||||
Templates TEMPLATES = GWT.create(Templates.class);
|
|
||||||
|
|
||||||
CellRender cellRender = toCellRender(itemField, object);
|
DocumentDV documentDV = (DocumentDV) object;
|
||||||
sb.append(TEMPLATES.startToolTip(cellRender.getTooltip()));
|
String objectToRender = "";
|
||||||
sb.appendHtmlConstant(cellRender.getValue());
|
try {
|
||||||
sb.append(TEMPLATES.endToolTip());
|
// removing the '_theDocument.' prefix for searching in the Document Map
|
||||||
|
String key = itemField.getJsonFields().get(0)
|
||||||
|
.replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", "");
|
||||||
|
Object value = documentDV.getDocumentAsMap().get(key);
|
||||||
|
// GWT.log("key: "+key+" is instance of: "+value.getClass());
|
||||||
|
|
||||||
|
if(value==null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (value instanceof ArrayList) {
|
||||||
|
ArrayList<Object> arrayValues = (ArrayList<Object>) value;
|
||||||
|
String toReturn = "<ul>";
|
||||||
|
for (Object arrayValue : arrayValues) {
|
||||||
|
toReturn += "<li>" + arrayValue + "</li>";
|
||||||
|
}
|
||||||
|
toReturn += "</ul>";
|
||||||
|
GWT.log("Array returning: " + key + " is instance of: " + value.getClass() + " to return: "
|
||||||
|
+ toReturn);
|
||||||
|
objectToRender = StringUtil.ellipsize(toReturn, MAX_TEXT_DIMENSION);
|
||||||
|
} else {
|
||||||
|
objectToRender = StringUtil.ellipsize(value.toString(), MAX_TEXT_DIMENSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
GWT.log("Error e: " + e);
|
||||||
|
}
|
||||||
|
sb.appendHtmlConstant(objectToRender);
|
||||||
|
// super.render(context, object, sb);
|
||||||
|
// sb.appendHtmlConstant("</span>");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,28 @@ public class TreeItemPanel {
|
||||||
|
|
||||||
treeItemParents.put(JSON_ROOT_PATH, Arrays.asList(root));
|
treeItemParents.put(JSON_ROOT_PATH, Arrays.asList(root));
|
||||||
|
|
||||||
|
/*
|
||||||
|
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
||||||
|
|
||||||
|
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
||||||
|
String parentName = profile.getParentName();
|
||||||
|
|
||||||
|
if (profile.getSectionName().compareTo("relazioneScavo") == 0) {
|
||||||
|
profile.setParentName(JSON_ROOT_PATH + "abstractRelazione");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.getSectionName().compareTo("posizionamentoScavo") == 0) {
|
||||||
|
profile.setParentName(JSON_ROOT_PATH + "immaginiRappresentative");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.getSectionName().compareTo("pianteFineScavo") == 0) {
|
||||||
|
profile.setParentName(JSON_ROOT_PATH + "immaginiRappresentative.posizionamentoScavo");
|
||||||
|
}
|
||||||
|
|
||||||
|
GWT.log(" print tree parentName: " + parentName + " name: " + profile.getSectionName() + " title: "
|
||||||
|
+ profile.getSectionTitle());
|
||||||
|
}*/
|
||||||
|
|
||||||
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
||||||
|
|
||||||
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
||||||
|
|
|
@ -29,7 +29,6 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
*/
|
*/
|
||||||
public class ModalConfirm extends Modal implements ClickHandler {
|
public class ModalConfirm extends Modal implements ClickHandler {
|
||||||
|
|
||||||
private static final int modal_width = 800;
|
|
||||||
private DockPanel dock = new DockPanel();
|
private DockPanel dock = new DockPanel();
|
||||||
private Button yesButton;
|
private Button yesButton;
|
||||||
private VerticalPanel vpContainer;
|
private VerticalPanel vpContainer;
|
||||||
|
@ -45,7 +44,7 @@ public class ModalConfirm extends Modal implements ClickHandler {
|
||||||
* @param text the text
|
* @param text the text
|
||||||
*/
|
*/
|
||||||
public ModalConfirm(Image img, String caption, String text) {
|
public ModalConfirm(Image img, String caption, String text) {
|
||||||
setWidth(modal_width);
|
setWidth(800);
|
||||||
setAnimation(true);
|
setAnimation(true);
|
||||||
// getElement().setClassName("gwt-DialogBoxNew");
|
// getElement().setClassName("gwt-DialogBoxNew");
|
||||||
dock.setSpacing(4);
|
dock.setSpacing(4);
|
||||||
|
@ -66,9 +65,7 @@ public class ModalConfirm extends Modal implements ClickHandler {
|
||||||
|
|
||||||
vpContainer = new VerticalPanel();
|
vpContainer = new VerticalPanel();
|
||||||
vpContainer.getElement().getStyle().setMargin(20.0, Unit.PX);
|
vpContainer.getElement().getStyle().setMargin(20.0, Unit.PX);
|
||||||
vpContainer.setWidth((modal_width - 70) + "px");
|
vpContainer.add(new HTML(text));
|
||||||
if (text != null)
|
|
||||||
vpContainer.add(new HTML(text));
|
|
||||||
hpButtons = new HorizontalPanel();
|
hpButtons = new HorizontalPanel();
|
||||||
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
||||||
// hpButtons.getElement().getStyle().setMarginTop(20.0, Unit.PX);
|
// hpButtons.getElement().getStyle().setMarginTop(20.0, Unit.PX);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class FormDataObjectToJSON {
|
||||||
|
|
||||||
// the root, instancing new json document
|
// the root, instancing new json document
|
||||||
if (tree_Node.isRoot()) {
|
if (tree_Node.isRoot()) {
|
||||||
theRootDocument = JSONObjectOrdered.instance();
|
theRootDocument = JSONObjecOrdered.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration configuration = Configuration.builder().jsonProvider(new JsonOrgJsonProvider()).build();
|
Configuration configuration = Configuration.builder().jsonProvider(new JsonOrgJsonProvider()).build();
|
||||||
|
@ -161,9 +161,9 @@ public class FormDataObjectToJSON {
|
||||||
* @return the JSON object
|
* @return the JSON object
|
||||||
* @throws JSONException the JSON exception
|
* @throws JSONException the JSON exception
|
||||||
*/
|
*/
|
||||||
protected JSONObject genericDatasetBeanToJSON(GenericDatasetBean gdb) throws JSONException {
|
private JSONObject genericDatasetBeanToJSON(GenericDatasetBean gdb) throws JSONException {
|
||||||
|
|
||||||
JSONObject sectJSONObject = JSONObjectOrdered.instance();
|
JSONObject sectJSONObject = JSONObjecOrdered.instance();
|
||||||
|
|
||||||
LinkedHashMap<String, List<String>> mapFields = gdb.getFormDataEntryFields();
|
LinkedHashMap<String, List<String>> mapFields = gdb.getFormDataEntryFields();
|
||||||
LOG.debug("Map ordered: " + mapFields);
|
LOG.debug("Map ordered: " + mapFields);
|
||||||
|
@ -180,9 +180,7 @@ public class FormDataObjectToJSON {
|
||||||
// value is a list
|
// value is a list
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
for (String value : listValues) {
|
for (String value : listValues) {
|
||||||
if(value!=null && !value.isEmpty()) {
|
array.put(value);
|
||||||
array.put(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sectJSONObject.put(key, array);
|
sectJSONObject.put(key, array);
|
||||||
|
@ -240,7 +238,6 @@ public class FormDataObjectToJSON {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class JSONObjecOrdered.
|
* The Class JSONObjecOrdered.
|
||||||
*
|
*
|
||||||
|
@ -248,7 +245,7 @@ public class FormDataObjectToJSON {
|
||||||
*
|
*
|
||||||
* Mar 10, 2022
|
* Mar 10, 2022
|
||||||
*/
|
*/
|
||||||
public static class JSONObjectOrdered {
|
public static class JSONObjecOrdered {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instance.
|
* Instance.
|
||||||
|
|
|
@ -5,11 +5,7 @@ import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -26,6 +22,7 @@ import org.bson.Document;
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
import org.gcube.application.geoportal.common.model.rest.TempFile;
|
import org.gcube.application.geoportal.common.model.rest.TempFile;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition;
|
||||||
|
@ -39,6 +36,7 @@ import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
|
||||||
import org.gcube.application.geoportalcommon.geoportal.ProjectsCaller;
|
import org.gcube.application.geoportalcommon.geoportal.ProjectsCaller;
|
||||||
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
|
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
|
||||||
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
|
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
|
@ -55,29 +53,21 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
||||||
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
|
||||||
import org.gcube.common.portal.PortalContext;
|
import org.gcube.common.portal.PortalContext;
|
||||||
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ProjectFormCard;
|
import org.gcube.portlets.user.geoportaldataentry.client.ProjectFormCard;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.json.JsonMerge;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.json.JsonMerge.MERGE_OPTION;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.ProjectNotFoundException;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node;
|
import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.UserRights;
|
import org.gcube.portlets.user.geoportaldataentry.shared.UserRights;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploadedRemote;
|
|
||||||
import org.gcube.vomanagement.usermanagement.RoleManager;
|
import org.gcube.vomanagement.usermanagement.RoleManager;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
||||||
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||||
|
@ -88,14 +78,9 @@ import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gwt.user.client.Random;
|
|
||||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||||
import com.jayway.jsonpath.Configuration;
|
|
||||||
import com.jayway.jsonpath.DocumentContext;
|
|
||||||
import com.jayway.jsonpath.JsonPath;
|
import com.jayway.jsonpath.JsonPath;
|
||||||
import com.jayway.jsonpath.spi.json.GsonJsonProvider;
|
import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The server side implementation of the RPC service.
|
* The server side implementation of the RPC service.
|
||||||
|
@ -137,7 +122,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
* Save geona data forms.
|
* Save geona data forms.
|
||||||
*
|
*
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param optionalMessage the optional message
|
|
||||||
* @param tree_Node the tree node
|
* @param tree_Node the tree node
|
||||||
* @param stepsOnPostCreation the steps on post creation
|
* @param stepsOnPostCreation the steps on post creation
|
||||||
* @return the commit report
|
* @return the commit report
|
||||||
|
@ -197,7 +181,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
LOG.info("stepsOnPostCreation are {}", stepsOnPostCreation);
|
LOG.info("stepsOnPostCreation are {}", stepsOnPostCreation);
|
||||||
for (String stepID : stepsOnPostCreation) {
|
for (String stepID : stepsOnPostCreation) {
|
||||||
LOG.info("calling step OnPostCreation are {}", stepID);
|
LOG.info("calling step OnPostCreation are {}", stepID);
|
||||||
theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null, null);
|
theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -234,187 +218,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update geportal data form.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @param section the section
|
|
||||||
* @param sectionPath the section path
|
|
||||||
* @param listFilePaths the list file paths
|
|
||||||
* @return the commit report
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
|
|
||||||
String sectionPath, List<FilePathDV> listFilePaths) throws Exception {
|
|
||||||
LOG.info("updateGeonaDataForm called for profileID {}", profileID);
|
|
||||||
LOG.info("and sectionPath {}", sectionPath);
|
|
||||||
LOG.info("and listFilePaths {}", listFilePaths);
|
|
||||||
|
|
||||||
ProjectsCaller client = null;
|
|
||||||
Project currentProject = null;
|
|
||||||
JSONObject updatedSectionObject = null;
|
|
||||||
Configuration configurationGson = null;
|
|
||||||
GenericDatasetBean sectionBean = null;
|
|
||||||
try {
|
|
||||||
|
|
||||||
if (projectID == null)
|
|
||||||
throw new Exception("projectID is null");
|
|
||||||
|
|
||||||
if (profileID == null)
|
|
||||||
throw new Exception("profileID is null");
|
|
||||||
|
|
||||||
if (section == null || section.getListGDB() == null || section.getListGDB().get(0) == null)
|
|
||||||
throw new Exception("Input error. The section is null");
|
|
||||||
|
|
||||||
sectionBean = section.getListGDB().get(0);
|
|
||||||
|
|
||||||
// Converter
|
|
||||||
FormDataObjectToJSON metadataConverter = new FormDataObjectToJSON();
|
|
||||||
// JSON Section to update converted as JSONObject
|
|
||||||
updatedSectionObject = metadataConverter.genericDatasetBeanToJSON(sectionBean);
|
|
||||||
LOG.info("Input Json Section (to update): {}", updatedSectionObject.toString());
|
|
||||||
|
|
||||||
configurationGson = Configuration.builder().jsonProvider(new GsonJsonProvider()).build();
|
|
||||||
// Type type = new TypeToken<Set<LinkedTreeMap<String, Object>>>() {}.getType();
|
|
||||||
// Set<LinkedTreeMap<String, Object>> myMap = gson.fromJson(json, type);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.error("Error on converting form data: ", e);
|
|
||||||
throw new Exception(
|
|
||||||
"Error occurred on converting data, try again or contact the support. Error: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
Boolean errorOccurred = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
client = GeoportalClientCaller.projects();
|
|
||||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
|
||||||
currentProject = client.getProjectByID(profileID, projectID);
|
|
||||||
Document currentDoc = currentProject.getTheDocument();
|
|
||||||
|
|
||||||
// Source Project
|
|
||||||
String theDocumentJson = currentDoc.toJson();
|
|
||||||
LOG.debug("Source document: {}", theDocumentJson);
|
|
||||||
|
|
||||||
// If the section path is the Root document, passed as "$.", fixing as "$"
|
|
||||||
if (sectionPath.compareTo(FormDataObjectToJSON.JSON_$_POINTER + ".") == 0)
|
|
||||||
sectionPath = FormDataObjectToJSON.JSON_$_POINTER;
|
|
||||||
|
|
||||||
com.google.gson.JsonObject targetSectionJObject = JsonPath.parse(theDocumentJson, configurationGson)
|
|
||||||
.read(sectionPath);
|
|
||||||
LOG.debug("Current Section path {} in the Document is {}", sectionPath, targetSectionJObject.toString());
|
|
||||||
String srcJ = updatedSectionObject.toString();
|
|
||||||
String trgJ = targetSectionJObject.toString();
|
|
||||||
LOG.debug("Merging src {} in the target: {}", srcJ, trgJ);
|
|
||||||
String mergedDoc = JsonMerge.merge(srcJ, trgJ, MERGE_OPTION.REPLACE);
|
|
||||||
LOG.debug("mergedDoc: {}", mergedDoc);
|
|
||||||
|
|
||||||
String newDocJson;
|
|
||||||
// If Updating path is first level of the root
|
|
||||||
if (sectionPath.equals(FormDataObjectToJSON.JSON_$_POINTER)) {
|
|
||||||
// The merged DOC is the root Document, no action required
|
|
||||||
newDocJson = mergedDoc;
|
|
||||||
} else {
|
|
||||||
// If the merged DOC is a child of the root Document, setting it as child of the
|
|
||||||
// Document in the proper section
|
|
||||||
Gson gson = new Gson();
|
|
||||||
JsonObject gsonOject = gson.fromJson(mergedDoc, JsonObject.class);
|
|
||||||
// Putting the merged section into Document
|
|
||||||
DocumentContext newContextDocJson = JsonPath.parse(theDocumentJson, configurationGson).set(sectionPath,
|
|
||||||
gsonOject);
|
|
||||||
newDocJson = newContextDocJson.json().toString();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Document updatedDocument = Serialization.read(newDocJson.toString(), Document.class);
|
|
||||||
LOG.info("New document is: {}", updatedDocument.toJson());
|
|
||||||
|
|
||||||
Project updatedProject = client.updateProject(profileID, projectID, updatedDocument);
|
|
||||||
// Project project = client.getProjectByID(profileID, projectID);
|
|
||||||
LOG.debug("Medatata Updated with document: {}", updatedProject.getTheDocument());
|
|
||||||
|
|
||||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
|
||||||
|
|
||||||
if (listFilePaths != null) {
|
|
||||||
|
|
||||||
// Collecting new files
|
|
||||||
List<? extends FileUploaded> filesUploaded = sectionBean.getFilesUploaded();
|
|
||||||
Map<String, FileSetDataObject> mapFilesToRegistrer = null;
|
|
||||||
if (filesUploaded != null && !filesUploaded.isEmpty()) {
|
|
||||||
mapFilesToRegistrer = collectFiles(currentProject, sectionPath, section.getGcubeProfileDV(),
|
|
||||||
filesUploaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cleaning all the fileset path of the section (defined in the UCD)
|
|
||||||
for (FilePathDV filePath : listFilePaths) {
|
|
||||||
|
|
||||||
String filesetFieldName = filePath.getFieldName();
|
|
||||||
String filesetPath = sectionPath + "." + filesetFieldName;
|
|
||||||
// // Replacing $.abc with $..abc
|
|
||||||
// filesetPath = filesetPath.replaceFirst("\\.", "..");
|
|
||||||
LOG.info("Going to delete fileset path: {}", filesetPath);
|
|
||||||
try {
|
|
||||||
client.deleteFileset(profileID, projectID, filesetPath, true, true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Error deleting the fileset path {} for the project {}", filesetPath, projectID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Registering fileset in the section according to mapFilesToRegistrer
|
|
||||||
if (mapFilesToRegistrer != null && mapFilesToRegistrer.size() > 0) {
|
|
||||||
LOG.info("Cluster of fileset per fieldDefinition is: " + mapFilesToRegistrer);
|
|
||||||
String theJSONDocument = currentProject.getTheDocument().toJson();
|
|
||||||
MongoServiceUtil mongoService = new MongoServiceUtil();
|
|
||||||
|
|
||||||
for (String fieldDefinition : mapFilesToRegistrer.keySet()) {
|
|
||||||
FileSetDataObject uploadedFileset = mapFilesToRegistrer.get(fieldDefinition);
|
|
||||||
LOG.info("Uploading fileset: " + uploadedFileset);
|
|
||||||
File[] fileset = uploadedFileset.getFileset();
|
|
||||||
FilePathDV filePath = uploadedFileset.getFilePathDV();
|
|
||||||
Access access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument,
|
|
||||||
sectionPath);
|
|
||||||
|
|
||||||
LOG.info("Going to register fileset: " + Arrays.asList(fileset).toString());
|
|
||||||
mongoService.registerFileSet(currentProject.getProfileID(), currentProject, sectionPath,
|
|
||||||
filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.info("Project with id " + currentProject.getId() + " updated correclty");
|
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
|
||||||
// Reading again the project to be sure
|
|
||||||
updatedProject = client.getProjectByID(profileID, projectID);
|
|
||||||
ProjectDV toProjectDV = ConvertToDataValueObjectModel.toProjectDV(updatedProject, projectBuilder);
|
|
||||||
String newDocumentString = toProjectDV.getTheDocument().getDocumentAsJSON();
|
|
||||||
LOG.info("Got Document: {} ", newDocumentString);
|
|
||||||
return new CommitReport(projectID, profileID, newDocumentString, null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorOccurred = true;
|
|
||||||
LOG.error("Error on updating data: ", e);
|
|
||||||
throw new Exception("Error occurred on updating data, try again or contact the support. Error: "
|
|
||||||
+ e.getMessage() + ". Tried to revert the project to the previous version");
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
// If an error occurs on updating, the previous version of the document will be
|
|
||||||
// restored
|
|
||||||
if (errorOccurred && currentProject != null) {
|
|
||||||
Document currentDocument = currentProject.getTheDocument();
|
|
||||||
try {
|
|
||||||
Project updatedProject = client.updateProject(profileID, projectID, currentDocument);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// Silent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursive upload fileset.
|
* Recursive upload fileset.
|
||||||
*
|
*
|
||||||
|
@ -484,50 +287,43 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
// Iterating on the files upload for the section
|
// Iterating on the files upload for the section
|
||||||
for (int i = 0; i < files.size(); i++) {
|
for (int i = 0; i < files.size(); i++) {
|
||||||
FileUploaded file = files.get(i);
|
FileUploaded file = files.get(i);
|
||||||
if (file != null && file.getFilePath() != null) {
|
String formFieldName = file.getFilePath().getFormFieldLabel();
|
||||||
String formFieldName = file.getFilePath().getFormFieldLabel();
|
LOG.debug("Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
||||||
LOG.debug(
|
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, profile);
|
||||||
"Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
||||||
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, profile);
|
if (filePath == null) {
|
||||||
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
String error = "It is not possible to register the file " + formFieldName
|
||||||
if (filePath == null) {
|
+ ", missing configuration in the filePaths config of: " + profile;
|
||||||
String error = "It is not possible to register the file " + formFieldName
|
throw new Exception(error);
|
||||||
+ ", missing configuration in the filePaths config of: " + profile;
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collecting Fileset per Field Definition
|
|
||||||
FileSetDataObject collFieldDef = collectFilesetPerFieldDef
|
|
||||||
.get(filePath.getFieldDefinition());
|
|
||||||
if (collFieldDef == null) {
|
|
||||||
collFieldDef = new FileSetDataObject();
|
|
||||||
collFieldDef.setFilePathDV(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
File input = new File(file.getTempSystemPath());
|
|
||||||
LOG.debug("Temp file is: " + file.getTempSystemPath());
|
|
||||||
File tempDir = Files.createTempDirectory("GEOPORTAL_UPLOAD_").toFile();
|
|
||||||
|
|
||||||
String tmpDirPath = tempDir.getAbsolutePath();
|
|
||||||
File output = new File(tmpDirPath, file.getFileName());
|
|
||||||
// input.renameTo(output);
|
|
||||||
copyContent(input, output);
|
|
||||||
collFieldDef.addFile(output);
|
|
||||||
tempDirs.add(tempDir);
|
|
||||||
tempDir.deleteOnExit();
|
|
||||||
LOG.info("Temp file: " + file.getTempSystemPath() + ", copied to new file: "
|
|
||||||
+ file.getFileName());
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
throw new Exception("Error occurred on uploading file in the section: " + sectionJSONPath
|
|
||||||
+ ". Please upload it/them again and retry");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Collecting Fileset per Field Definition
|
||||||
|
FileSetDataObject collFieldDef = collectFilesetPerFieldDef.get(filePath.getFieldDefinition());
|
||||||
|
if (collFieldDef == null) {
|
||||||
|
collFieldDef = new FileSetDataObject();
|
||||||
|
collFieldDef.setFilePathDV(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
File input = new File(file.getTempSystemPath());
|
||||||
|
LOG.debug("Temp file is: " + file.getTempSystemPath());
|
||||||
|
File tempDir = Files.createTempDirectory("GEOPORTAL_UPLOAD_").toFile();
|
||||||
|
|
||||||
|
String tmpDirPath = tempDir.getAbsolutePath();
|
||||||
|
File output = new File(tmpDirPath, file.getFileName());
|
||||||
|
// input.renameTo(output);
|
||||||
|
copyContent(input, output);
|
||||||
|
collFieldDef.addFile(output);
|
||||||
|
tempDirs.add(tempDir);
|
||||||
|
tempDir.deleteOnExit();
|
||||||
|
LOG.info("Temp file: " + file.getTempSystemPath() + ", copied to new file: "
|
||||||
|
+ file.getFileName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -549,15 +345,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
String arraySectionJSONPAth = String.format("%s[%d]", sectionJSONPath, jpcV);
|
String arraySectionJSONPAth = String.format("%s[%d]", sectionJSONPath, jpcV);
|
||||||
LOG.debug("registering the fileset in the array section: " + sectionJSONPath);
|
LOG.debug("registering the fileset in the array section: " + sectionJSONPath);
|
||||||
|
|
||||||
access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument,
|
access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument,arraySectionJSONPAth);
|
||||||
arraySectionJSONPAth);
|
|
||||||
mongoService.registerFileSet(profileID, theProject, arraySectionJSONPAth,
|
mongoService.registerFileSet(profileID, theProject, arraySectionJSONPAth,
|
||||||
filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
||||||
} else {
|
} else {
|
||||||
LOG.info("The gCube Profile with the section " + sectionJSONPath + " has maxOccurs = 1");
|
LOG.info("The gCube Profile with the section " + sectionJSONPath + " has maxOccurs = 1");
|
||||||
LOG.debug("registering the fileset in the section: " + sectionJSONPath);
|
LOG.debug("registering the fileset in the section: " + sectionJSONPath);
|
||||||
access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument,
|
access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument,sectionJSONPath);
|
||||||
sectionJSONPath);
|
|
||||||
mongoService.registerFileSet(profileID, theProject, sectionJSONPath, filePath.getFieldName(),
|
mongoService.registerFileSet(profileID, theProject, sectionJSONPath, filePath.getFieldName(),
|
||||||
filePath.getFieldDefinition(), access, fileset);
|
filePath.getFieldDefinition(), access, fileset);
|
||||||
}
|
}
|
||||||
|
@ -574,174 +368,44 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public Access getAccessFromDocumentSection(String theJSONDocument, String sectionJSONPath) {
|
||||||
* Collect files.
|
String accessPolicyPath = String.format("%s.%s", sectionJSONPath, ConvertToDataValueObjectModel.POLICY);
|
||||||
*
|
AccessPolicy accessPolicy = AccessPolicy.OPEN;
|
||||||
* @param theProject the the project
|
com.jayway.jsonpath.Configuration config = com.jayway.jsonpath.Configuration.builder()
|
||||||
* @param sectionJSONPath the section JSON path
|
.jsonProvider(new JsonOrgJsonProvider()).build();
|
||||||
* @param gcubeProfile the gcube profile
|
|
||||||
* @param files the files
|
|
||||||
* @return the map of files that must be registered
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
protected Map<String, FileSetDataObject> collectFiles(Project theProject, String sectionJSONPath,
|
|
||||||
GcubeProfileDV gcubeProfile, List<? extends FileUploaded> files) throws Exception {
|
|
||||||
LOG.debug("collectFiles called [projectID: " + theProject.getId() + "], [sectionJSONPath: " + sectionJSONPath
|
|
||||||
+ "], [files: " + files + "]");
|
|
||||||
|
|
||||||
Map<String, FileSetDataObject> collectFilesetPerFieldDef = new HashMap<String, FileSetDataObject>();
|
|
||||||
if (files.size() > 0) {
|
|
||||||
// Iterating on the files upload for the section
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
|
||||||
FileUploaded file = files.get(i);
|
|
||||||
String formFieldName = file.getFilePath().getFormFieldLabel();
|
|
||||||
LOG.debug("Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
|
||||||
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, gcubeProfile);
|
|
||||||
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
|
||||||
if (filePath == null) {
|
|
||||||
String error = "It is not possible to register the file " + formFieldName
|
|
||||||
+ ", missing configuration in the filePaths config of: " + gcubeProfile;
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collecting Fileset per Field Definition
|
|
||||||
FileSetDataObject collFieldDef = collectFilesetPerFieldDef.get(filePath.getFieldDefinition());
|
|
||||||
if (collFieldDef == null) {
|
|
||||||
collFieldDef = new FileSetDataObject();
|
|
||||||
collFieldDef.setFilePathDV(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
File tempDir = Files.createTempDirectory("GEOPORTAL_REPLACE_FILES_").toFile();
|
|
||||||
String tmpDirPath = tempDir.getAbsolutePath();
|
|
||||||
File input;
|
|
||||||
File output;
|
|
||||||
if (file instanceof FileUploadedRemote) {
|
|
||||||
FileUploadedRemote remote = (FileUploadedRemote) file;
|
|
||||||
LOG.info("Uploaded file is remote: " + remote.getUrl());
|
|
||||||
InputStream in = new URL(remote.getUrl()).openStream();
|
|
||||||
String fileName = (remote.getFileName() == null || remote.getFileName().isEmpty())
|
|
||||||
? "file_" + Random.nextInt()
|
|
||||||
: remote.getFileName();
|
|
||||||
output = new File(tmpDirPath, fileName);
|
|
||||||
Path outputAbsolutePath = Paths.get(output.getAbsolutePath());
|
|
||||||
Files.copy(in, outputAbsolutePath, StandardCopyOption.REPLACE_EXISTING);
|
|
||||||
LOG.info("Remote file: " + remote.getUrl() + ", copied to new file: " + output.getName());
|
|
||||||
} else {
|
|
||||||
LOG.info("Uploaded file is local: " + file.getTempSystemPath());
|
|
||||||
input = new File(file.getTempSystemPath());
|
|
||||||
output = new File(tmpDirPath, file.getFileName());
|
|
||||||
copyContent(input, output);
|
|
||||||
LOG.info(
|
|
||||||
"Temp file: " + file.getTempSystemPath() + ", copied to new file: " + output.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
collFieldDef.addFile(output);
|
|
||||||
tempDir.deleteOnExit();
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
|
||||||
|
|
||||||
|
// Reading policy fields
|
||||||
|
try {
|
||||||
|
JsonPath theSectionPolycJsonPath = JsonPath.compile(accessPolicyPath);
|
||||||
|
String policy = theSectionPolycJsonPath.read(theJSONDocument, config).toString();
|
||||||
|
LOG.debug("Read " + ConvertToDataValueObjectModel.POLICY + ": " + policy + ", from section: "
|
||||||
|
+ accessPolicyPath);
|
||||||
|
if (policy != null) {
|
||||||
|
accessPolicy = AccessPolicy.valueOf(policy.toUpperCase());
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.info("No " + ConvertToDataValueObjectModel.POLICY + "found in the path: " + accessPolicyPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return collectFilesetPerFieldDef;
|
// Reading policy fields
|
||||||
}
|
String licenseIDPath = String.format("%s.%s", sectionJSONPath, ConvertToDataValueObjectModel.LICENSE_ID);
|
||||||
|
String licenseID = null;
|
||||||
/**
|
try {
|
||||||
* Replace files.
|
JsonPath theSectionLicenseJsonPath = JsonPath.compile(licenseIDPath);
|
||||||
*
|
licenseID = theSectionLicenseJsonPath.read(theJSONDocument, config).toString();
|
||||||
* @param theProject the the project
|
LOG.debug("Read " + ConvertToDataValueObjectModel.LICENSE_ID + ": " + licenseID + ", from section: "
|
||||||
* @param sectionJSONPath the section JSON path
|
+ theSectionLicenseJsonPath);
|
||||||
* @param gcubeProfile the gcube profile
|
} catch (Exception e) {
|
||||||
* @param files the files
|
LOG.info("No " + ConvertToDataValueObjectModel.LICENSE_ID + "found in the path: " + licenseIDPath);
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
protected void replaceFiles(Project theProject, String sectionJSONPath, GcubeProfileDV gcubeProfile,
|
|
||||||
List<? extends FileUploaded> files) throws Exception {
|
|
||||||
LOG.debug("replaceFiles called [projectID: " + theProject.getId() + "], [sectionJSONPath: " + sectionJSONPath
|
|
||||||
+ "], [files: " + files + "]");
|
|
||||||
|
|
||||||
Map<String, FileSetDataObject> collectFilesetPerFieldDef = new HashMap<String, FileSetDataObject>();
|
|
||||||
if (files.size() > 0) {
|
|
||||||
// Iterating on the files upload for the section
|
|
||||||
for (int i = 0; i < files.size(); i++) {
|
|
||||||
FileUploaded file = files.get(i);
|
|
||||||
String formFieldName = file.getFilePath().getFormFieldLabel();
|
|
||||||
LOG.debug("Uploading file: " + file.getFileName() + ", from formFieldName: " + formFieldName);
|
|
||||||
FilePathDV filePath = retrieveFilePathForGcubeProfileFieldName(formFieldName, gcubeProfile);
|
|
||||||
LOG.info("Found {} for the form fieldName {}", filePath, formFieldName);
|
|
||||||
if (filePath == null) {
|
|
||||||
String error = "It is not possible to register the file " + formFieldName
|
|
||||||
+ ", missing configuration in the filePaths config of: " + gcubeProfile;
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collecting Fileset per Field Definition
|
|
||||||
FileSetDataObject collFieldDef = collectFilesetPerFieldDef.get(filePath.getFieldDefinition());
|
|
||||||
if (collFieldDef == null) {
|
|
||||||
collFieldDef = new FileSetDataObject();
|
|
||||||
collFieldDef.setFilePathDV(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
File tempDir = Files.createTempDirectory("GEOPORTAL_REPLACE_FILES_").toFile();
|
|
||||||
String tmpDirPath = tempDir.getAbsolutePath();
|
|
||||||
File input;
|
|
||||||
File output;
|
|
||||||
if (file instanceof FileUploadedRemote) {
|
|
||||||
FileUploadedRemote remote = (FileUploadedRemote) file;
|
|
||||||
LOG.info("Uploaded file is remote: " + remote.getUrl());
|
|
||||||
InputStream in = new URL(remote.getUrl()).openStream();
|
|
||||||
String fileName = (remote.getFileName() == null || remote.getFileName().isEmpty())
|
|
||||||
? "file_" + Random.nextInt()
|
|
||||||
: remote.getFileName();
|
|
||||||
output = new File(tmpDirPath, fileName);
|
|
||||||
Path outputAbsolutePath = Paths.get(output.getAbsolutePath());
|
|
||||||
Files.copy(in, outputAbsolutePath, StandardCopyOption.REPLACE_EXISTING);
|
|
||||||
LOG.info("Remote file: " + remote.getUrl() + ", copied to new file: " + output.getName());
|
|
||||||
} else {
|
|
||||||
LOG.info("Uploaded file is local: " + file.getTempSystemPath());
|
|
||||||
input = new File(file.getTempSystemPath());
|
|
||||||
output = new File(tmpDirPath, file.getFileName());
|
|
||||||
copyContent(input, output);
|
|
||||||
LOG.info(
|
|
||||||
"Temp file: " + file.getTempSystemPath() + ", copied to new file: " + output.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
collFieldDef.addFile(output);
|
|
||||||
tempDir.deleteOnExit();
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
collectFilesetPerFieldDef.put(filePath.getFieldDefinition(), collFieldDef);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Cluster of fileset per fieldDefinition is: " + collectFilesetPerFieldDef);
|
Access access = new Access();
|
||||||
String theJSONDocument = theProject.getTheDocument().toJson();
|
access.setPolicy(accessPolicy);
|
||||||
MongoServiceUtil mongoService = new MongoServiceUtil();
|
if (licenseID != null)
|
||||||
|
access.setLicense(licenseID);
|
||||||
|
|
||||||
for (String fieldDefinition : collectFilesetPerFieldDef.keySet()) {
|
LOG.info("Access is: " + access);
|
||||||
FileSetDataObject uploadedFileset = collectFilesetPerFieldDef.get(fieldDefinition);
|
return access;
|
||||||
LOG.info("Uploading fileset: " + uploadedFileset);
|
|
||||||
File[] fileset = uploadedFileset.getFileset();
|
|
||||||
FilePathDV filePath = uploadedFileset.getFilePathDV();
|
|
||||||
Access access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument, sectionJSONPath);
|
|
||||||
|
|
||||||
LOG.info("Going to register files: " + Arrays.asList(fileset).toString());
|
|
||||||
mongoService.registerFileSet(theProject.getProfileID(), theProject, sectionJSONPath,
|
|
||||||
filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -831,7 +495,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public GeoportalISConfig getGeonaInitConfig() {
|
public GeoportalISConfig getGeonaInitConfig() {
|
||||||
LOG.info("getGeonaInitConfig called");
|
LOG.info("getConfig called");
|
||||||
|
|
||||||
String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), false);
|
String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), false);
|
||||||
String theSecondaryType;
|
String theSecondaryType;
|
||||||
|
@ -854,23 +518,21 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
/**
|
/**
|
||||||
* Gets the links for.
|
* Gets the links for.
|
||||||
*
|
*
|
||||||
* @param itemId the item id is the mongoId
|
* @param itemId the item id is the mongoId
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param shareLinkTo the share link to
|
|
||||||
* @return the links for
|
* @return the links for
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public GeoportalItemReferences getLinksFor(String itemId, String profileID,
|
public GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception {
|
||||||
GeoportalItemReferences.SHARE_LINK_TO shareLinkTo) throws Exception {
|
|
||||||
LOG.info("getLinksFor called");
|
LOG.info("getLinksFor called");
|
||||||
|
|
||||||
String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
|
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
|
||||||
// GNADataViewerConfigProfile grViewerProfile =
|
GNADataViewerConfigProfile grViewerProfile = SessionUtil
|
||||||
// SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest());
|
.getGeportalViewerResourceProfile(getThreadLocalRequest());
|
||||||
GeoportalCommon gc = new GeoportalCommon();
|
GeoportalCommon gc = new GeoportalCommon(grViewerProfile);
|
||||||
GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID, shareLinkTo);
|
GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID);
|
||||||
item = gc.getPublicLinksFor(scope, item, true);
|
item = gc.getPublicLinksFor(item, true);
|
||||||
LOG.info("Returning: " + item);
|
LOG.info("Returning: " + item);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
@ -899,11 +561,11 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
ResultSetPaginatedData searchedData = new ResultSetPaginatedData();
|
ResultSetPaginatedData searchedData = new ResultSetPaginatedData();
|
||||||
|
|
||||||
// If reloadFromService = true, loads the document from the service
|
//If reloadFromService = true, loads the document from the service
|
||||||
Integer totalProjectForProfile = null;
|
Integer totalProjectForProfile = null;
|
||||||
|
|
||||||
// Loading total documents from the session
|
//Loading total documents from the session
|
||||||
if (!reloadFromService) {
|
if(!reloadFromService) {
|
||||||
totalProjectForProfile = SessionUtil.getTotalDocumentForProfileID(getThreadLocalRequest(),
|
totalProjectForProfile = SessionUtil.getTotalDocumentForProfileID(getThreadLocalRequest(),
|
||||||
theProfileID);
|
theProfileID);
|
||||||
}
|
}
|
||||||
|
@ -916,8 +578,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
searchedData.setTotalItems(totalProjectForProfile);
|
searchedData.setTotalItems(totalProjectForProfile);
|
||||||
LOG.info("Total Docs read from config: " + totalProjectForProfile);
|
LOG.info("Total Docs read from config: " + totalProjectForProfile);
|
||||||
|
|
||||||
boolean isSearchForIds = filter.getProfileID() != null && filter.getProjectID() != null;
|
|
||||||
|
|
||||||
// Saving client PROJECTION
|
// Saving client PROJECTION
|
||||||
LinkedHashMap<String, Object> originalProjection = filter.getProjection();
|
LinkedHashMap<String, Object> originalProjection = filter.getProjection();
|
||||||
int totalItems = totalProjectForProfile;
|
int totalItems = totalProjectForProfile;
|
||||||
|
@ -943,23 +603,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
totalItems = listProjectIDs.size();
|
totalItems = listProjectIDs.size();
|
||||||
searchedData.setTotalItems(totalItems);
|
searchedData.setTotalItems(totalItems);
|
||||||
LOG.info("Total Docs read from query per ID: " + totalItems);
|
LOG.info("Total Docs read from query per ID: " + totalItems);
|
||||||
} else if (isSearchForIds) {
|
|
||||||
// searching one item for IDs
|
|
||||||
searchedData.setTotalItems(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOW PERFORMING THE (REAL) SECOND QUERY FROM CLIENT
|
// NOW PERFORMING THE (REAL) SECOND QUERY FROM CLIENT
|
||||||
// SETTING ORIGINAL PROJECTION FROM CLIENT
|
// SETTING ORIGINAL PROJECTION FROM CLIENT
|
||||||
filter.setProjection(originalProjection);
|
filter.setProjection(originalProjection);
|
||||||
// LIMIT IS FROM CLIENT
|
// LIMIT IS FROM CLIENT
|
||||||
|
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter);
|
||||||
Iterator<Project> projects = null;
|
|
||||||
if (!isSearchForIds) {
|
|
||||||
projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter);
|
|
||||||
} else {
|
|
||||||
Project project = client.getProjectByID(filter.getProfileID(), filter.getProjectID());
|
|
||||||
projects = Arrays.asList(project).iterator();
|
|
||||||
}
|
|
||||||
|
|
||||||
searchedData.setClientStartIndex(start);
|
searchedData.setClientStartIndex(start);
|
||||||
searchedData.setLimit(limit);
|
searchedData.setLimit(limit);
|
||||||
|
@ -1017,18 +667,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||||
|
|
||||||
client.deleteProject(profileID, projectID, true);
|
client.deleteProject(profileID, projectID, true);
|
||||||
|
|
||||||
try {
|
|
||||||
Project deletedP = client.getProjectByID(profileID, projectID);
|
|
||||||
if (deletedP != null) {
|
|
||||||
String error = "The project with id " + projectID + " still exists";
|
|
||||||
LOG.error(error + ". Sending exception..");
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Updating count of Documents in session per profileID
|
// Updating count of Documents in session per profileID
|
||||||
Integer totalProjectForProfile = client.getTotalDocument(profileID);
|
Integer totalProjectForProfile = client.getTotalDocument(profileID);
|
||||||
SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), profileID, totalProjectForProfile);
|
SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), profileID, totalProjectForProfile);
|
||||||
|
@ -1036,7 +674,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Error on deleting the project with id: " + projectID, e);
|
LOG.error("Error on deleting the project with id: " + projectID, e);
|
||||||
throw new Exception("Error occurred on the server side when deleting the project");
|
throw new Exception(
|
||||||
|
"Error occurred on deleting the project with id: " + projectID + ". Error: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1112,8 +751,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception {
|
public GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception {
|
||||||
LOG.info("readDataEntryPresentationConfig called");
|
LOG.info("readDataViewerConfig called");
|
||||||
|
|
||||||
GCubeUser user = null;
|
GCubeUser user = null;
|
||||||
GNADataEntryExtendedConfigProfile gnaDEExtConfig = new GNADataEntryExtendedConfigProfile();
|
GNADataEntryExtendedConfigProfile gnaDEExtConfig = new GNADataEntryExtendedConfigProfile();
|
||||||
|
@ -1145,8 +784,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest());
|
long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest());
|
||||||
|
|
||||||
if (user == null || scope == null) {
|
if (user == null || scope == null) {
|
||||||
LOG.warn("called readDataEntryPresentationConfig with invalid parameter user: " + user
|
LOG.warn("called getMyRightsInTheContext with invalid parameter user: " + user + ", in the scope: "
|
||||||
+ ", in the scope: " + scope, ", returning null");
|
+ scope, ", returning null");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,7 +829,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
gnaDEExtConfig.setUserRights(userRights);
|
gnaDEExtConfig.setUserRights(userRights);
|
||||||
return gnaDEExtConfig;
|
return gnaDEExtConfig;
|
||||||
} catch (UserRetrievalFault | GroupRetrievalFault | GNAConfigException e) {
|
} catch (UserRetrievalFault | GroupRetrievalFault | GNAConfigException e) {
|
||||||
LOG.error("An error occurred during readDataEntryPresentationConfig: " + user, e);
|
LOG.error("An error occurred during getMyRightsInTheContext: " + user, e);
|
||||||
|
|
||||||
Map<OPERATION_ON_ITEM, OPERATION_TYPE> permissions = new HashMap<OPERATION_ON_ITEM, RoleRights.OPERATION_TYPE>();
|
Map<OPERATION_ON_ITEM, OPERATION_TYPE> permissions = new HashMap<OPERATION_ON_ITEM, RoleRights.OPERATION_TYPE>();
|
||||||
RoleRights roleRights = new RoleRights(permissions, GcubeUserRole.DATA_MEMBER);
|
RoleRights roleRights = new RoleRights(permissions, GcubeUserRole.DATA_MEMBER);
|
||||||
|
@ -1283,16 +922,15 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
/**
|
/**
|
||||||
* Perform action steps.
|
* Perform action steps.
|
||||||
*
|
*
|
||||||
* @param profileID the profile ID
|
* @param profileID the profile ID
|
||||||
* @param projectID the project ID
|
* @param projectID the project ID
|
||||||
* @param optionalMessage the optional message
|
* @param action the action
|
||||||
* @param action the action
|
|
||||||
* @return the project DV
|
* @return the project DV
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage,
|
public ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action)
|
||||||
ActionDefinitionDV action) throws Exception {
|
throws Exception {
|
||||||
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
||||||
|
|
||||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
ProjectsCaller client = GeoportalClientCaller.projects();
|
||||||
|
@ -1306,18 +944,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
Project project = null;
|
Project project = null;
|
||||||
for (String stepID : action.getCallSteps()) {
|
for (String stepID : action.getCallSteps()) {
|
||||||
LOG.info("calling stepID {} on projectID {}", stepID, projectID);
|
LOG.info("calling stepID {} on projectID {}", stepID, projectID);
|
||||||
project = client.performStep(profileID, projectID, stepID, optionalMessage, null);
|
project = client.performStep(profileID, projectID, stepID, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
LifecycleInformationDV lifecycleInfo = getLifecycleInfoForProjectId(profileID, projectID);
|
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||||
lifecycleInfo.getLastOperationStatus();
|
ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||||
|
LOG.info("performActionSteps returning theProject with ID {}", projectID);
|
||||||
StepPerformedResultDV sprv = new StepPerformedResultDV(profileID, projectID, lifecycleInfo);
|
return theProject;
|
||||||
|
|
||||||
// ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
|
||||||
// ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
|
||||||
LOG.info("performActionSteps returning theProject with ID {}", sprv);
|
|
||||||
return sprv;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String error = "Error occurred on performing the workflow step/s on the project id " + projectID;
|
String error = "Error occurred on performing the workflow step/s on the project id " + projectID;
|
||||||
LOG.error(error, e);
|
LOG.error(error, e);
|
||||||
|
@ -1448,7 +1081,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
Project project = projects.getProjectByID(profileID, projectID);
|
Project project = projects.getProjectByID(profileID, projectID);
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||||
ProjectDV projectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
ProjectDV projectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||||
LOG.info("returning ProjectByID: " + projectDV.getId());
|
LOG.info("returning: " + projectDV.getId());
|
||||||
return projectDV;
|
return projectDV;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -1476,21 +1109,14 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||||
ProjectsCaller projects = GeoportalClientCaller.projects();
|
ProjectsCaller projects = GeoportalClientCaller.projects();
|
||||||
Project project = projects.getProjectByID(profileID, projectID);
|
Project project = projects.getProjectByID(profileID, projectID);
|
||||||
if (project == null) {
|
|
||||||
throw new ProjectNotFoundException(
|
|
||||||
"Project with coordinates id: " + projectID + " and type: " + profileID + " not found");
|
|
||||||
}
|
|
||||||
ResultDocumentDV documentDV = ConvertToDataValueObjectModel.toResultDocumentDV(project);
|
ResultDocumentDV documentDV = ConvertToDataValueObjectModel.toResultDocumentDV(project);
|
||||||
LOG.info("returning: " + documentDV.getId());
|
LOG.info("returning: " + documentDV.getId());
|
||||||
return documentDV;
|
return documentDV;
|
||||||
|
|
||||||
} catch (ProjectNotFoundException e) {
|
|
||||||
LOG.error(ProjectNotFoundException.class.getSimpleName(), e);
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String error = "Error occurred on reading the project with id: " + projectID;
|
String error = "Error occurred on reading the project with id: " + projectID;
|
||||||
LOG.error(error, e);
|
LOG.error(error, e);
|
||||||
throw new ProjectNotFoundException(
|
throw new Exception(
|
||||||
error + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
error + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,84 +1185,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the project edit.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @return the project edit
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ProjectEdit getProjectEdit(String profileID, String projectID) throws Exception {
|
|
||||||
LOG.info("getProjectEdit called for profileID: {}, and projectID: {}", profileID, projectID);
|
|
||||||
try {
|
|
||||||
PortalContext pContext = PortalContext.getConfiguration();
|
|
||||||
GCubeUser user = pContext.getCurrentUser(this.getThreadLocalRequest());
|
|
||||||
String scope = SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
|
||||||
|
|
||||||
ProjectsCaller clientProjects = GeoportalClientCaller.projects();
|
|
||||||
Project theProject = clientProjects.getProjectByID(profileID, projectID);
|
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
|
||||||
projectBuilder.relationships(true);
|
|
||||||
ProjectDV theProjectDV = ConvertToDataValueObjectModel.toProjectDV(theProject, projectBuilder);
|
|
||||||
|
|
||||||
ProjectEdit projectEdit = Geoportal_JSON_Mapper.loadProjectEdit(theProjectDV, scope, user.getUsername());
|
|
||||||
|
|
||||||
if (LOG.isDebugEnabled() || !SessionUtil.isIntoPortal()) {
|
|
||||||
Geoportal_JSON_Mapper.prettyPrintProjectEdit(projectEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.info(ProjectEdit.class.getSimpleName() + " returing not null: " + (projectEdit != null));
|
|
||||||
return projectEdit;
|
|
||||||
} catch (Exception e) {
|
|
||||||
String erroMsg = "Error occurred on reading " + ProjectEdit.class.getSimpleName() + " DTO for id: "
|
|
||||||
+ projectID;
|
|
||||||
LOG.warn(erroMsg, e);
|
|
||||||
throw new Exception(
|
|
||||||
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the project view.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param projectID the project ID
|
|
||||||
* @return the project view
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ProjectView getProjectView(String profileID, String projectID) throws Exception {
|
|
||||||
LOG.info("getProjectEdit called for profileID: {}, and projectID: {}", profileID, projectID);
|
|
||||||
try {
|
|
||||||
PortalContext pContext = PortalContext.getConfiguration();
|
|
||||||
GCubeUser user = pContext.getCurrentUser(this.getThreadLocalRequest());
|
|
||||||
String scope = SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
|
||||||
|
|
||||||
ProjectsCaller clientProjects = GeoportalClientCaller.projects();
|
|
||||||
Project theProject = clientProjects.getProjectByID(profileID, projectID);
|
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
|
||||||
projectBuilder.relationships(true);
|
|
||||||
ProjectDV theProjectDV = ConvertToDataValueObjectModel.toProjectDV(theProject, projectBuilder);
|
|
||||||
|
|
||||||
ProjectView projectView = Geoportal_JSON_Mapper.loadProjectView(theProjectDV, scope, user.getUsername());
|
|
||||||
|
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
Geoportal_JSON_Mapper.prettyPrintProjectView(projectView);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.info(ProjectView.class.getSimpleName() + " returing not null: " + (projectView != null));
|
|
||||||
return projectView;
|
|
||||||
} catch (Exception e) {
|
|
||||||
String erroMsg = "Error occurred on reading " + ProjectView.class.getSimpleName() + " DTO for id: "
|
|
||||||
+ projectID;
|
|
||||||
LOG.warn(erroMsg, e);
|
|
||||||
throw new Exception(
|
|
||||||
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pretty print client data entry map.
|
* Pretty print client data entry map.
|
||||||
*
|
*
|
||||||
|
@ -1657,9 +1205,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
for (String keyEntry : map.keySet()) {
|
for (String keyEntry : map.keySet()) {
|
||||||
LOG.debug("\t " + keyEntry + ": " + map.get(keyEntry));
|
LOG.debug("\t " + keyEntry + ": " + map.get(keyEntry));
|
||||||
}
|
}
|
||||||
// for (FileUploaded fup : gbd.getFilesUploaded()) {
|
for (FileUploaded fup : gbd.getFilesUploaded()) {
|
||||||
// LOG.debug("\t " + fup);
|
LOG.debug("\t " + fup);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,7 @@ import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPl
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -27,7 +25,6 @@ import org.gcube.application.geoportal.common.utils.FileSets;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploadedRemote;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -46,35 +43,16 @@ public class MongoServiceUtil {
|
||||||
|
|
||||||
UseCaseDescriptorsI client = null;
|
UseCaseDescriptorsI client = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Use case descriptors client.
|
|
||||||
*
|
|
||||||
* @return the use case descriptors I
|
|
||||||
*/
|
|
||||||
public UseCaseDescriptorsI useCaseDescriptorsClient() {
|
public UseCaseDescriptorsI useCaseDescriptorsClient() {
|
||||||
LOG.debug("useCaseDescriptorsClient called");
|
LOG.debug("useCaseDescriptorsClient called");
|
||||||
return useCaseDescriptors().build();
|
return useCaseDescriptors().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the projects client.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @return the projects client
|
|
||||||
*/
|
|
||||||
public Projects<Project> getProjectsClient(String profileID) {
|
public Projects<Project> getProjectsClient(String profileID) {
|
||||||
LOG.debug("getProjectsClient called for profileID: " + profileID);
|
LOG.debug("getProjectsClient called for profileID: " + profileID);
|
||||||
return projects(profileID).build();
|
return projects(profileID).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the new.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param jsonDocument the json document
|
|
||||||
* @return the project
|
|
||||||
* @throws RemoteException the remote exception
|
|
||||||
*/
|
|
||||||
public Project createNew(String profileID, String jsonDocument) throws RemoteException {
|
public Project createNew(String profileID, String jsonDocument) throws RemoteException {
|
||||||
LOG.debug("createNew called for profileID: " + profileID);
|
LOG.debug("createNew called for profileID: " + profileID);
|
||||||
Document myDocument = Document.parse(jsonDocument);
|
Document myDocument = Document.parse(jsonDocument);
|
||||||
|
@ -85,29 +63,10 @@ public class MongoServiceUtil {
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Register file set.
|
|
||||||
*
|
|
||||||
* @param profileID the profile ID
|
|
||||||
* @param project the project
|
|
||||||
* @param parentPath the parent path
|
|
||||||
* @param fieldName the field name
|
|
||||||
* @param fieldDefinition the field definition
|
|
||||||
* @param access the access
|
|
||||||
* @param files the files
|
|
||||||
* @throws RemoteException the remote exception
|
|
||||||
* @throws FileNotFoundException the file not found exception
|
|
||||||
* @throws JsonProcessingException the json processing exception
|
|
||||||
* @throws InvalidRequestException the invalid request exception
|
|
||||||
*/
|
|
||||||
public void registerFileSet(String profileID, Project project, String parentPath, String fieldName,
|
public void registerFileSet(String profileID, Project project, String parentPath, String fieldName,
|
||||||
String fieldDefinition, Access access, File... files)
|
String fieldDefinition, Access access, File... files)
|
||||||
throws RemoteException, FileNotFoundException, JsonProcessingException, InvalidRequestException {
|
throws RemoteException, FileNotFoundException, JsonProcessingException, InvalidRequestException {
|
||||||
LOG.info("registerFileSet called for profileID: " + profileID);
|
LOG.debug("registerFileSet called for profileID: " + profileID);
|
||||||
LOG.info("and for parentPath: " + parentPath);
|
|
||||||
LOG.info("and for fieldName: " + fieldName);
|
|
||||||
LOG.info("and for fieldDefinition: " + fieldDefinition);
|
|
||||||
LOG.info("and for access: " + access);
|
|
||||||
|
|
||||||
Projects<Project> client = getProjectsClient(profileID);
|
Projects<Project> client = getProjectsClient(profileID);
|
||||||
// Prepare request
|
// Prepare request
|
||||||
|
@ -116,7 +75,6 @@ public class MongoServiceUtil {
|
||||||
fsRequest.setToSetAccess(access);
|
fsRequest.setToSetAccess(access);
|
||||||
|
|
||||||
project = client.registerFileSet(project.getId(), fsRequest);
|
project = client.registerFileSet(project.getId(), fsRequest);
|
||||||
|
|
||||||
LOG.trace("Resulting Project : " + project);
|
LOG.trace("Resulting Project : " + project);
|
||||||
LOG.debug("Resulting Project as JSON: " + Serialization.write(project));
|
LOG.debug("Resulting Project as JSON: " + Serialization.write(project));
|
||||||
}
|
}
|
||||||
|
@ -180,31 +138,32 @@ public class MongoServiceUtil {
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
/**
|
// * To tem files from WSC.
|
||||||
* To temp file from remote.
|
// *
|
||||||
*
|
// * @param listFiles the list files
|
||||||
* @param file the file
|
// * @return the list
|
||||||
* @return the temp file
|
// */
|
||||||
*/
|
// public List<TempFile> toTemFilesFromWSC(List<WorkspaceContentDV> listFiles) {
|
||||||
public TempFile toTempFileFromRemote(FileUploadedRemote file) {
|
// LOG.debug("toTemFilesFromWSC called");
|
||||||
LOG.debug("toTemFilesFromRemote called");
|
// if (listFiles == null || listFiles.isEmpty())
|
||||||
if (file == null)
|
// return null;
|
||||||
return null;
|
//
|
||||||
|
// // Building TempFile
|
||||||
// Building TempFile
|
// List<TempFile> files = new ArrayList<TempFile>(listFiles.size());
|
||||||
TempFile storageTempFile = null;
|
// for (WorkspaceContentDV fileUploaded : listFiles) {
|
||||||
try {
|
// InputStream is;
|
||||||
InputStream is = new URL(file.getUrl()).openStream();
|
// try {
|
||||||
// Creating TempFile
|
// is = new URL(fileUploaded.getLink()).openStream();
|
||||||
storageTempFile = createTempFileOnStorage(is, file.getFileName());
|
// // Creating TempFile
|
||||||
} catch (IOException e) {
|
// TempFile storageTempFile = createTempFileOnStorage(is, fileUploaded.getName());
|
||||||
LOG.error("Error on creating temp file from URL: " + file.getUrl(), e);
|
// files.add(storageTempFile);
|
||||||
}
|
// } catch (IOException e) {
|
||||||
|
// LOG.error("Error on creating temp file from URL: " + fileUploaded.getLink(), e);
|
||||||
return storageTempFile;
|
// }
|
||||||
}
|
// }
|
||||||
|
// return files;
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To JSON.
|
* To JSON.
|
||||||
|
|
|
@ -12,7 +12,9 @@ import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||||
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
|
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
|
||||||
|
import org.gcube.application.geoportalcommon.GeoportalCommon;
|
||||||
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
|
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
|
@ -41,7 +43,7 @@ public class SessionUtil {
|
||||||
|
|
||||||
private static final String GNA_DATAENTRY_CONFIG_PROFILE = "GNA_DATAENTRY_CONFIG_PROFILE";
|
private static final String GNA_DATAENTRY_CONFIG_PROFILE = "GNA_DATAENTRY_CONFIG_PROFILE";
|
||||||
private static final String LATEST_RESULT_SET_SORTED = "LATEST_RESULT_SET_SORTED";
|
private static final String LATEST_RESULT_SET_SORTED = "LATEST_RESULT_SET_SORTED";
|
||||||
//private static final String GEONA_DATAVIEWER_PROFILE = "GEONA_DATAVIEWER_PROFILE";
|
private static final String GEONA_DATAVIEWER_PROFILE = "GEONA_DATAVIEWER_PROFILE";
|
||||||
private static final String LIST_OF_CONCESSIONI = "LIST_OF_CONCESSIONI";
|
private static final String LIST_OF_CONCESSIONI = "LIST_OF_CONCESSIONI";
|
||||||
|
|
||||||
private static final String LIST_OF_RELATIONSHIP_DEFINITION = "LIST_OF_RELATIONSHIP_DEFINITION";
|
private static final String LIST_OF_RELATIONSHIP_DEFINITION = "LIST_OF_RELATIONSHIP_DEFINITION";
|
||||||
|
@ -230,28 +232,28 @@ public class SessionUtil {
|
||||||
return listOfConcessioni;
|
return listOfConcessioni;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * Gets the geportal viewer resource profile.
|
* Gets the geportal viewer resource profile.
|
||||||
// *
|
*
|
||||||
// * @param httpServletRequest the http servlet request
|
* @param httpServletRequest the http servlet request
|
||||||
// * @return the geportal viewer resource profile
|
* @return the geportal viewer resource profile
|
||||||
// * @throws Exception the exception
|
* @throws Exception the exception
|
||||||
// */
|
*/
|
||||||
// public static GNADataViewerConfigProfile getGeportalViewerResourceProfile(HttpServletRequest httpServletRequest)
|
public static GNADataViewerConfigProfile getGeportalViewerResourceProfile(HttpServletRequest httpServletRequest)
|
||||||
// throws Exception {
|
throws Exception {
|
||||||
// HttpSession session = httpServletRequest.getSession();
|
HttpSession session = httpServletRequest.getSession();
|
||||||
// GNADataViewerConfigProfile geoNaDataViewerProfile = (GNADataViewerConfigProfile) session
|
GNADataViewerConfigProfile geoNaDataViewerProfile = (GNADataViewerConfigProfile) session
|
||||||
// .getAttribute(GEONA_DATAVIEWER_PROFILE);
|
.getAttribute(GEONA_DATAVIEWER_PROFILE);
|
||||||
//
|
|
||||||
// if (geoNaDataViewerProfile == null) {
|
if (geoNaDataViewerProfile == null) {
|
||||||
// GeoportalCommon gc = new GeoportalCommon();
|
GeoportalCommon gc = new GeoportalCommon();
|
||||||
// geoNaDataViewerProfile = gc.readGNADataViewerConfig(null);
|
geoNaDataViewerProfile = gc.readGNADataViewerConfig(null);
|
||||||
// session.setAttribute(GEONA_DATAVIEWER_PROFILE, geoNaDataViewerProfile);
|
session.setAttribute(GEONA_DATAVIEWER_PROFILE, geoNaDataViewerProfile);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// return geoNaDataViewerProfile;
|
return geoNaDataViewerProfile;
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the latest result set sorted.
|
* Gets the latest result set sorted.
|
||||||
|
|
|
@ -1,328 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.server.json;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class provides methods to merge two json of any nested level into a
|
|
||||||
* single json.
|
|
||||||
*
|
|
||||||
* copied from: https://github.com/hemantsonu20/json-merge
|
|
||||||
*
|
|
||||||
* @maintainer updated by Francesco Mangiacrapa at ISTI-CNR
|
|
||||||
* francesco.mangiacrapa@isti.cnr.it
|
|
||||||
*
|
|
||||||
* Apr 21, 2023
|
|
||||||
*/
|
|
||||||
public class JsonMerge {
|
|
||||||
|
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Enum MERGE_OPTION.
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
||||||
*
|
|
||||||
* Apr 21, 2023
|
|
||||||
*/
|
|
||||||
public static enum MERGE_OPTION {
|
|
||||||
MERGE, REPLACE
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to merge two json objects into single json object.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* It merges two json of any nested level into a single json following below
|
|
||||||
* logic.
|
|
||||||
* </p>
|
|
||||||
* <ul>
|
|
||||||
* <li>When keys are different, both keys with there values will be copied at
|
|
||||||
* same level.</li>
|
|
||||||
* <li>
|
|
||||||
* <p>
|
|
||||||
* When keys are same at some level, following table denotes what value will be
|
|
||||||
* used.
|
|
||||||
* </p>
|
|
||||||
* <table border="1" summary="">
|
|
||||||
* <thead>
|
|
||||||
* <tr>
|
|
||||||
* <th align="left">Src / Target</th>
|
|
||||||
* <th align="left">JSON Value</th>
|
|
||||||
* <th align="left">JSON Array</th>
|
|
||||||
* <th align="left">JSON Object</th>
|
|
||||||
* </tr>
|
|
||||||
* </thead> <tbody>
|
|
||||||
* <tr>
|
|
||||||
* <td align="left">JSON Value<sup>1</sup></td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* </tr>
|
|
||||||
* <tr>
|
|
||||||
* <td align="left">JSON Array</td>
|
|
||||||
* <td align="left">Src<sup>2</sup></td>
|
|
||||||
* <td align="left">Merge</td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* </tr>
|
|
||||||
* <tr>
|
|
||||||
* <td align="left">JSON Object</td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* <td align="left">Src</td>
|
|
||||||
* <td align="left">Merge<sup>3</sup></td>
|
|
||||||
* </tr>
|
|
||||||
* </tbody>
|
|
||||||
* </table>
|
|
||||||
* <ul>
|
|
||||||
* <li><sup><strong>1</strong></sup> Json Value denotes boolean, number or
|
|
||||||
* string value in json.</li>
|
|
||||||
* <li><sup><strong>2</strong></sup> Src denotes <code>Src</code> value will be
|
|
||||||
* copied.</li>
|
|
||||||
* <li><sup><strong>3</strong></sup> Merge denotes both <code>Src</code> and
|
|
||||||
* <code>Target</code> values will be merged.</li>
|
|
||||||
* </ul>
|
|
||||||
* </li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* <h2>Examples</h2>
|
|
||||||
* <h3>Example 1</h3>
|
|
||||||
* <p>
|
|
||||||
* <strong>Source Json</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "name": "json-merge-src"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
* <p>
|
|
||||||
* <strong>Target Json</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "name": "json-merge-target"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
* <p>
|
|
||||||
* <strong>Output</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "name": "json-merge-src"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* <h3>Example 2</h3>
|
|
||||||
* <p>
|
|
||||||
* <strong>Source Json</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "level1": {
|
|
||||||
* "key1": "SrcValue1"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
* <p>
|
|
||||||
* <strong>Target Json</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "level1": {
|
|
||||||
* "key1": "targetValue1",
|
|
||||||
* "level2": {
|
|
||||||
* "key2": "value2"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
* <p>
|
|
||||||
* <strong>Output</strong>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* {@code
|
|
||||||
* {
|
|
||||||
* "level1": {
|
|
||||||
* "key1": "SrcValue1",
|
|
||||||
* "level2": {
|
|
||||||
* "key2": "value2"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @param srcJsonStr source json string
|
|
||||||
* @param targetJsonStr target json string
|
|
||||||
* @param option the option
|
|
||||||
* @return merged json as a string
|
|
||||||
*/
|
|
||||||
public static String merge(String srcJsonStr, String targetJsonStr, MERGE_OPTION option) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (option == null)
|
|
||||||
option = MERGE_OPTION.MERGE;
|
|
||||||
|
|
||||||
JsonNode srcNode = OBJECT_MAPPER.readTree(srcJsonStr);
|
|
||||||
JsonNode targetNode = OBJECT_MAPPER.readTree(targetJsonStr);
|
|
||||||
JsonNode result = merge(srcNode, targetNode, option);
|
|
||||||
return OBJECT_MAPPER.writeValueAsString(result);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new JsonMergeException("Unable to merge json", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge.
|
|
||||||
*
|
|
||||||
* @param srcNode the src node
|
|
||||||
* @param targetNode the target node
|
|
||||||
* @param option the option
|
|
||||||
* @return the json node
|
|
||||||
*/
|
|
||||||
public static JsonNode merge(JsonNode srcNode, JsonNode targetNode, MERGE_OPTION option) {
|
|
||||||
|
|
||||||
if (option == null)
|
|
||||||
option = MERGE_OPTION.MERGE;
|
|
||||||
|
|
||||||
// if both nodes are object node, merged object node is returned
|
|
||||||
if (srcNode.isObject() && targetNode.isObject()) {
|
|
||||||
return merge((ObjectNode) srcNode, (ObjectNode) targetNode, option);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if both nodes are array node, merged array node is returned
|
|
||||||
if (srcNode.isArray() && targetNode.isArray()) {
|
|
||||||
return mergeArray((ArrayNode) srcNode, (ArrayNode) targetNode, option);
|
|
||||||
}
|
|
||||||
|
|
||||||
// special case when src node is null
|
|
||||||
if (srcNode.isNull()) {
|
|
||||||
return targetNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
return srcNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge.
|
|
||||||
*
|
|
||||||
* @param srcNode the src node
|
|
||||||
* @param targetNode the target node
|
|
||||||
* @param option the option
|
|
||||||
* @return the object node
|
|
||||||
*/
|
|
||||||
public static ObjectNode merge(ObjectNode srcNode, ObjectNode targetNode, MERGE_OPTION option) {
|
|
||||||
|
|
||||||
ObjectNode result = OBJECT_MAPPER.createObjectNode();
|
|
||||||
|
|
||||||
Iterator<Map.Entry<String, JsonNode>> srcItr = srcNode.fields();
|
|
||||||
while (srcItr.hasNext()) {
|
|
||||||
|
|
||||||
Map.Entry<String, JsonNode> entry = srcItr.next();
|
|
||||||
|
|
||||||
// check key in src json exists in target json or not at same level
|
|
||||||
if (targetNode.has(entry.getKey())) {
|
|
||||||
result.set(entry.getKey(), merge(entry.getValue(), targetNode.get(entry.getKey()), option));
|
|
||||||
} else {
|
|
||||||
// if key in src json doesn't exist in target json, just copy the same in result
|
|
||||||
result.set(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy fields from target json into result which were missing in src json
|
|
||||||
Iterator<Map.Entry<String, JsonNode>> targetItr = targetNode.fields();
|
|
||||||
while (targetItr.hasNext()) {
|
|
||||||
Map.Entry<String, JsonNode> entry = targetItr.next();
|
|
||||||
if (!result.has(entry.getKey())) {
|
|
||||||
result.set(entry.getKey(), entry.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge.
|
|
||||||
*
|
|
||||||
* @param srcNode the src node
|
|
||||||
* @param targetNode the target node
|
|
||||||
* @param option the option
|
|
||||||
* @return the array node
|
|
||||||
*/
|
|
||||||
public static ArrayNode mergeArray(ArrayNode srcNode, ArrayNode targetNode, MERGE_OPTION option) {
|
|
||||||
ArrayNode result = OBJECT_MAPPER.createArrayNode();
|
|
||||||
|
|
||||||
switch (option) {
|
|
||||||
case REPLACE:
|
|
||||||
//Replacing source json value as result
|
|
||||||
return result.addAll(srcNode);
|
|
||||||
//return result.addAll(srcNode).addAll(targetNode);
|
|
||||||
default:
|
|
||||||
return mergeSet(srcNode, targetNode);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Added by Francesco Mangiacrapa Merge set.
|
|
||||||
*
|
|
||||||
* @param srcNode the src node
|
|
||||||
* @param targetNode the target node
|
|
||||||
* @return the array node
|
|
||||||
*/
|
|
||||||
public static ArrayNode mergeSet(ArrayNode srcNode, ArrayNode targetNode) {
|
|
||||||
ArrayNode result = OBJECT_MAPPER.createArrayNode();
|
|
||||||
|
|
||||||
HashSet<JsonNode> set = new HashSet<>();
|
|
||||||
|
|
||||||
set = toHashSet(set, srcNode);
|
|
||||||
set = toHashSet(set, targetNode);
|
|
||||||
|
|
||||||
Iterator<JsonNode> itr = set.iterator();
|
|
||||||
while (itr != null && itr.hasNext()) {
|
|
||||||
JsonNode arrayValue = itr.next();
|
|
||||||
result.add(arrayValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To hash set.
|
|
||||||
*
|
|
||||||
* @param set the set
|
|
||||||
* @param srcNode the src node
|
|
||||||
* @return the hash set
|
|
||||||
*/
|
|
||||||
public static HashSet<JsonNode> toHashSet(HashSet<JsonNode> set, ArrayNode srcNode) {
|
|
||||||
if (srcNode != null) {
|
|
||||||
Iterator<JsonNode> itr = srcNode.elements();
|
|
||||||
while (itr != null && itr.hasNext()) {
|
|
||||||
JsonNode arrayValue = itr.next();
|
|
||||||
set.add(arrayValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.server.json;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exception to be thrown in case of any error occured while merging two json.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class JsonMergeException extends RuntimeException {
|
|
||||||
|
|
||||||
public JsonMergeException() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonMergeException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonMergeException(String msg, Throwable th) {
|
|
||||||
super(msg, th);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.shared;
|
|
||||||
|
|
||||||
public class ProjectNotFoundException extends Exception {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 4918313646452701634L;
|
|
||||||
|
|
||||||
public ProjectNotFoundException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProjectNotFoundException(String error){
|
|
||||||
super(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProjectNotFoundException(Throwable error){
|
|
||||||
super(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -12,31 +12,28 @@
|
||||||
|
|
||||||
<inherits name="com.google.gwt.json.JSON" />
|
<inherits name="com.google.gwt.json.JSON" />
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
|
||||||
|
|
||||||
<inherits
|
|
||||||
name='org.gcube.portlets.widgets.gdvw.geoportal_data_viewer_widget' />
|
|
||||||
|
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||||
|
|
||||||
|
<inherits name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||||
|
|
||||||
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
<!-- Inherit the default GWT style sheet. You can change -->
|
||||||
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
<!-- the theme of your GWT application by uncommenting -->
|
||||||
|
<!-- any one of the following lines. -->
|
||||||
|
<!--<inherits name='com.google.gwt.user.theme.standard.Standard' /> -->
|
||||||
|
|
||||||
<!-- Other module inherits -->
|
<inherits name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||||
<entry-point
|
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
||||||
class='org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp' />
|
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
<!-- Other module inherits -->
|
||||||
<source path='client' />
|
|
||||||
<source path='shared' />
|
<!-- Specify the app entry point class. -->
|
||||||
|
<entry-point class='org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp' />
|
||||||
|
|
||||||
|
<!-- Specify the paths for translatable code -->
|
||||||
|
<source path='client' />
|
||||||
|
<source path='shared' />
|
||||||
|
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -49,7 +49,6 @@ h1 {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-html-table td {
|
.my-html-table td {
|
||||||
|
@ -101,9 +100,6 @@ h1 {
|
||||||
max-height: 700px !important;
|
max-height: 700px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-body-edit {
|
|
||||||
max-height: none !important;
|
|
||||||
}
|
|
||||||
.disable-div {
|
.disable-div {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
@ -114,16 +110,12 @@ h1 {
|
||||||
padding: 10px !important;
|
padding: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-fieldset-edit .control-group {
|
.gna-dataentry-form-fieldset fieldset {
|
||||||
margin-bottom: 15px !important;
|
margin: 10px !important;
|
||||||
|
border: 1px groove #ddd !important;
|
||||||
|
padding: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-fieldset-edit .control-group > span {
|
|
||||||
padding-top: 3px !important;
|
|
||||||
padding-bottom: 3px !important;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.table-current-content {
|
.table-current-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #efefef !important;
|
background-color: #efefef !important;
|
||||||
|
@ -298,39 +290,3 @@ h1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
|
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
|
||||||
|
|
||||||
|
|
||||||
/** OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
|
|
||||||
|
|
||||||
.legend-style {
|
|
||||||
width: auto !important;
|
|
||||||
padding-left: 10px !important;
|
|
||||||
padding-top: 0px !important;
|
|
||||||
padding-right: 10px !important;
|
|
||||||
margin-bottom: 0px !important;
|
|
||||||
border-bottom: 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend-style small {
|
|
||||||
display: block;
|
|
||||||
font-size: 12px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
|
|
||||||
|
|
||||||
|
|
||||||
.general_info {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.general_info div {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.general_info_facility {
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #3e6eac;
|
|
||||||
font-family: Helvetica, Arial;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,231 +0,0 @@
|
||||||
package org.gcube.application;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import javax.ws.rs.WebApplicationException;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
|
||||||
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
|
|
||||||
import org.gcube.application.geoportalcommon.geoportal.ProjectsCaller;
|
|
||||||
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.MongoServiceUtil;
|
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploadedRemote;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import com.google.gwt.user.client.Random;
|
|
||||||
|
|
||||||
public class Service_Tests {
|
|
||||||
|
|
||||||
private static final String GCUBE_CONFIG_PROPERTIES_FILENAME = "gcube_config.properties";
|
|
||||||
// APP Working Directory + /src/test/resources must be the location of
|
|
||||||
// gcube_config.properties
|
|
||||||
private static String gcube_config_path = String.format("%s/%s",
|
|
||||||
System.getProperty("user.dir") + "/src/test/resources", GCUBE_CONFIG_PROPERTIES_FILENAME);
|
|
||||||
private static String CONTEXT;
|
|
||||||
private static String TOKEN;
|
|
||||||
|
|
||||||
private UseCaseDescriptorCaller clientUCD = null;
|
|
||||||
private ProjectsCaller clientPrj = null;
|
|
||||||
|
|
||||||
private static String PROFILE_ID = "profiledConcessioni";
|
|
||||||
private static String PROJECT_ID = "644a66e944aad51c80409a3b";
|
|
||||||
|
|
||||||
private static String MY_LOGIN = "francesco.mangiacrapa";
|
|
||||||
|
|
||||||
public static final String JSON_$_POINTER = "$";
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(Service_Tests.class);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read context settings.
|
|
||||||
*/
|
|
||||||
public static void readContextSettings() {
|
|
||||||
|
|
||||||
try (InputStream input = new FileInputStream(gcube_config_path)) {
|
|
||||||
|
|
||||||
Properties prop = new Properties();
|
|
||||||
|
|
||||||
// load a properties file
|
|
||||||
prop.load(input);
|
|
||||||
|
|
||||||
CONTEXT = prop.getProperty("CONTEXT");
|
|
||||||
TOKEN = prop.getProperty("TOKEN");
|
|
||||||
// get the property value and print it out
|
|
||||||
System.out.println("CONTEXT: " + CONTEXT);
|
|
||||||
System.out.println("TOKEN: " + TOKEN);
|
|
||||||
|
|
||||||
} catch (IOException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Before
|
|
||||||
public void init() {
|
|
||||||
readContextSettings();
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
|
||||||
clientPrj = GeoportalClientCaller.projects();
|
|
||||||
clientUCD = GeoportalClientCaller.useCaseDescriptors();
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void deleteFileSet_ServiceTest() throws Exception {
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
|
||||||
|
|
||||||
boolean ignore_errors = false;
|
|
||||||
String path = "$.abstractRelazione.filesetIta";
|
|
||||||
|
|
||||||
Project doc = clientPrj.getProjectByID(PROFILE_ID, PROJECT_ID);
|
|
||||||
|
|
||||||
// JSONPathWrapper wrapper = new JSONPathWrapper(doc.getTheDocument().toJson());
|
|
||||||
// List<String> matchingPaths = wrapper.getMatchingPaths(path);
|
|
||||||
//
|
|
||||||
// LOG.info("matchingPaths is: " + matchingPaths);
|
|
||||||
//
|
|
||||||
// String error = null;
|
|
||||||
// if (matchingPaths.isEmpty()) {
|
|
||||||
// error = "No Registered FileSet found at " + path;
|
|
||||||
// if (!ignore_errors) {
|
|
||||||
// throw new WebApplicationException(error, Response.Status.BAD_REQUEST);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (matchingPaths.size() > 1 && !ignore_errors) {
|
|
||||||
// error = "Multiple Fileset (" + matchingPaths.size() + ") matching " + path;
|
|
||||||
// if (!ignore_errors)
|
|
||||||
// throw new WebApplicationException(error, Response.Status.BAD_REQUEST);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (error != null && ignore_errors) {
|
|
||||||
// LOG.info("Error detected {}. Ignoring it and returning input doc", error);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// List<Object> listPath = wrapper.getByPath(path);
|
|
||||||
// LOG.info("List path: " + listPath);
|
|
||||||
// RegisteredFileSet fs = Serialization.convert(listPath.get(0), RegisteredFileSet.class);
|
|
||||||
// LOG.info("Going to delete {}", fs);
|
|
||||||
|
|
||||||
LOG.info("Going to delete {}", path);
|
|
||||||
Project newDoc = clientPrj.deleteFileset(PROFILE_ID, PROJECT_ID, path, true, true);
|
|
||||||
LOG.info("newDoc {}", newDoc);
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void registerFileSet() throws Exception {
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
|
||||||
|
|
||||||
Project theProject = clientPrj.getProjectByID(PROFILE_ID, PROJECT_ID);
|
|
||||||
|
|
||||||
MongoServiceUtil mongoService = new MongoServiceUtil();
|
|
||||||
|
|
||||||
Access access = new Access();
|
|
||||||
access.setLicense("CC-BY");
|
|
||||||
access.setPolicy(AccessPolicy.OPEN);
|
|
||||||
|
|
||||||
String sectionJSONPath = "$.abstractRelazione";
|
|
||||||
String fieldName = "filesetIta";
|
|
||||||
String fieldDefinition = "$.abstractRelazione._children[?(@.filesetIta)]";
|
|
||||||
|
|
||||||
String theFileName = "Application_Profile_for_CSW_2.0-2.pdf";
|
|
||||||
String theFileURL = "https://data.dev.d4science.org/shub/E_bnN2aDJZZUMySy9peE9ScEVLNVFNWjBOZWx0cXQ2UUFkQ2E3Rjc1S29EelJIMEJGbDRoczBnbHVPWHczZTNQTw==";
|
|
||||||
|
|
||||||
FileUploadedRemote file = new FileUploadedRemote();
|
|
||||||
file.setUrl(theFileURL);
|
|
||||||
file.setFileName(theFileName);
|
|
||||||
|
|
||||||
File input = null;
|
|
||||||
File output = null;
|
|
||||||
try {
|
|
||||||
File tempDir = Files.createTempDirectory("GEOPORTAL_REPLACE_FILES_").toFile();
|
|
||||||
String tmpDirPath = tempDir.getAbsolutePath();
|
|
||||||
if (file instanceof FileUploadedRemote) {
|
|
||||||
FileUploadedRemote remote = (FileUploadedRemote) file;
|
|
||||||
LOG.info("Uploaded file is remote: " + remote.getUrl());
|
|
||||||
InputStream in = new URL(remote.getUrl()).openStream();
|
|
||||||
String fileName = (remote.getFileName() == null || remote.getFileName().isEmpty())
|
|
||||||
? "file_" + Random.nextInt()
|
|
||||||
: remote.getFileName();
|
|
||||||
LOG.info("the fileName is: " + fileName);
|
|
||||||
output = new File(tmpDirPath, fileName);
|
|
||||||
Path outputAbsolutePath = Paths.get(output.getAbsolutePath());
|
|
||||||
Files.copy(in, outputAbsolutePath, StandardCopyOption.REPLACE_EXISTING);
|
|
||||||
LOG.info("Remote file: " + remote.getUrl() + ", copied to new file: " + output.getName());
|
|
||||||
} else {
|
|
||||||
LOG.info("Uploaded file is local: " + file.getTempSystemPath());
|
|
||||||
input = new File(file.getTempSystemPath());
|
|
||||||
output = new File(tmpDirPath, file.getFileName());
|
|
||||||
copyContent(input, output);
|
|
||||||
LOG.info("Temp file: " + file.getTempSystemPath() + ", copied to new file: " + output.getName());
|
|
||||||
}
|
|
||||||
//tempDir.deleteOnExit();
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
File fileset = output;
|
|
||||||
LOG.info("final fileName is: " + fileset.getName());
|
|
||||||
mongoService.registerFileSet(theProject.getProfileID(), theProject, sectionJSONPath, fieldName, fieldDefinition, access, fileset);
|
|
||||||
|
|
||||||
LOG.info("registerFileSet: finished!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy content.
|
|
||||||
*
|
|
||||||
* @param a the a
|
|
||||||
* @param b the b
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
public static void copyContent(File a, File b) throws Exception {
|
|
||||||
FileInputStream in = new FileInputStream(a);
|
|
||||||
FileOutputStream out = new FileOutputStream(b);
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
int n;
|
|
||||||
|
|
||||||
// read() function to read the
|
|
||||||
// byte of data
|
|
||||||
while ((n = in.read()) != -1) {
|
|
||||||
// write() function to write
|
|
||||||
// the byte of data
|
|
||||||
out.write(n);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
if (in != null) {
|
|
||||||
|
|
||||||
// close() function to close the
|
|
||||||
// stream
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
// close() function to close
|
|
||||||
// the stream
|
|
||||||
if (out != null) {
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG.debug("File Copied");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +1,15 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry;
|
package org.gcube.portlets.user.geoportaldataentry;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import javax.ws.rs.WebApplicationException;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
import org.gcube.application.geoportalcommon.ConvertToDataServiceModel;
|
|
||||||
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
|
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
|
||||||
import org.gcube.application.geoportalcommon.ProjectDVBuilder;
|
import org.gcube.application.geoportalcommon.ProjectDVBuilder;
|
||||||
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
|
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
|
||||||
|
@ -50,18 +31,10 @@ import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.FileSetDataObject;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.FormDataObjectToJSON;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.FormDataObjectToJSON.JSONObjectOrdered;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.MongoServiceUtil;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.json.JsonMerge;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.server.json.JsonMerge.MERGE_OPTION;
|
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderServiceImpl;
|
import org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderServiceImpl;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploadedRemote;
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -71,28 +44,18 @@ import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.google.gwt.user.client.Random;
|
|
||||||
import com.jayway.jsonpath.Configuration;
|
|
||||||
import com.jayway.jsonpath.DocumentContext;
|
|
||||||
import com.jayway.jsonpath.JsonPath;
|
import com.jayway.jsonpath.JsonPath;
|
||||||
import com.jayway.jsonpath.spi.json.GsonJsonProvider;
|
|
||||||
import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
||||||
|
|
||||||
public class Complex_Tests {
|
public class Complex_Tests {
|
||||||
|
|
||||||
private static final String GCUBE_CONFIG_PROPERTIES_FILENAME = "gcube_config.properties";
|
|
||||||
// APP Working Directory + /src/test/resources must be the location of
|
|
||||||
// gcube_config.properties
|
|
||||||
private static String gcube_config_path = String.format("%s/%s",
|
|
||||||
System.getProperty("user.dir") + "/src/test/resources", GCUBE_CONFIG_PROPERTIES_FILENAME);
|
|
||||||
private static String CONTEXT;
|
|
||||||
private static String TOKEN;
|
|
||||||
|
|
||||||
private UseCaseDescriptorCaller clientUCD = null;
|
private UseCaseDescriptorCaller clientUCD = null;
|
||||||
private ProjectsCaller clientPrj = null;
|
private ProjectsCaller clientPrj = null;
|
||||||
|
private static String CONTEXT = "/gcube/devsec/devVRE";
|
||||||
|
private static String TOKEN = ""; // devVRE
|
||||||
private static String PROFILE_ID = "profiledConcessioni";
|
private static String PROFILE_ID = "profiledConcessioni";
|
||||||
private static String PROJECT_ID = "644a66e944aad51c80409a3b";
|
|
||||||
|
private static String PROJECT_ID = "632c633155e2947b0278c999";
|
||||||
|
|
||||||
private static String MY_LOGIN = "francesco.mangiacrapa";
|
private static String MY_LOGIN = "francesco.mangiacrapa";
|
||||||
|
|
||||||
|
@ -131,149 +94,15 @@ public class Complex_Tests {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//@Before
|
||||||
* Read context settings.
|
|
||||||
*/
|
|
||||||
public static void readContextSettings() {
|
|
||||||
|
|
||||||
try (InputStream input = new FileInputStream(gcube_config_path)) {
|
|
||||||
|
|
||||||
Properties prop = new Properties();
|
|
||||||
|
|
||||||
// load a properties file
|
|
||||||
prop.load(input);
|
|
||||||
|
|
||||||
CONTEXT = prop.getProperty("CONTEXT");
|
|
||||||
TOKEN = prop.getProperty("TOKEN");
|
|
||||||
// get the property value and print it out
|
|
||||||
System.out.println("CONTEXT: " + CONTEXT);
|
|
||||||
System.out.println("TOKEN: " + TOKEN);
|
|
||||||
|
|
||||||
} catch (IOException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void init() {
|
public void init() {
|
||||||
readContextSettings();
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
ScopeProvider.instance.set(CONTEXT);
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
SecurityTokenProvider.instance.set(TOKEN);
|
||||||
clientPrj = GeoportalClientCaller.projects();
|
clientPrj = GeoportalClientCaller.projects();
|
||||||
clientUCD = GeoportalClientCaller.useCaseDescriptors();
|
clientUCD = GeoportalClientCaller.useCaseDescriptors();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
//@Before
|
||||||
public void testSectionPathInnerParse() throws Exception {
|
|
||||||
String sectionPath = "$.abstractRelazione";
|
|
||||||
|
|
||||||
String profileID = "profiledConcessioni";
|
|
||||||
String projectID = "6425598a8593b215a1281e1c";
|
|
||||||
|
|
||||||
Configuration configurationGSON = Configuration.builder().jsonProvider(new GsonJsonProvider()).build();
|
|
||||||
|
|
||||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
|
||||||
|
|
||||||
Project proejct = client.getProjectByID(profileID, projectID);
|
|
||||||
|
|
||||||
String jsonSourceProject = proejct.getTheDocument().toJson();
|
|
||||||
|
|
||||||
// If the section path is the Root document, passed as "$.", fixing as "$"
|
|
||||||
if (sectionPath.compareTo(FormDataObjectToJSON.JSON_$_POINTER + ".") == 0)
|
|
||||||
sectionPath = FormDataObjectToJSON.JSON_$_POINTER;
|
|
||||||
|
|
||||||
LOG.info("theString: {}", jsonSourceProject);
|
|
||||||
com.google.gson.JsonObject currentSectionJObject = JsonPath.parse(jsonSourceProject, configurationGSON)
|
|
||||||
.read(sectionPath);
|
|
||||||
LOG.info("currentSectionJObject: {}", currentSectionJObject.toString());
|
|
||||||
LOG.info("sourceSectionObject: {}", currentSectionJObject.toString());
|
|
||||||
|
|
||||||
JSONObject targetSectionJObject = new JSONObjectOrdered().instance();
|
|
||||||
targetSectionJObject.put("abstractIta", "Prova REJECT 1");
|
|
||||||
targetSectionJObject.put("titolo", "Prova REJECT abstract relazione di scavo 1");
|
|
||||||
LOG.info("targetSectionJObject: {}", targetSectionJObject.toString());
|
|
||||||
|
|
||||||
String mergedDoc = JsonMerge.merge(targetSectionJObject.toString(), currentSectionJObject.toString(),
|
|
||||||
MERGE_OPTION.REPLACE);
|
|
||||||
LOG.info("output: {}", mergedDoc);
|
|
||||||
|
|
||||||
String newDocJson;
|
|
||||||
// Updating path is first level of the root
|
|
||||||
if (sectionPath.equals(FormDataObjectToJSON.JSON_$_POINTER)) {
|
|
||||||
// The merged DOC is the root Document
|
|
||||||
newDocJson = mergedDoc;
|
|
||||||
} else {
|
|
||||||
// The merged DOC is a child of the root Document
|
|
||||||
Gson gson = new Gson();
|
|
||||||
JsonObject gsonOject = gson.fromJson(mergedDoc, JsonObject.class);
|
|
||||||
// Putting the merged section into Document
|
|
||||||
DocumentContext newContextDocJson = JsonPath.parse(jsonSourceProject, configurationGSON).set(sectionPath,
|
|
||||||
gsonOject);
|
|
||||||
newDocJson = newContextDocJson.json().toString();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Document updatedDocument = Serialization.read(newDocJson.toString(), Document.class);
|
|
||||||
LOG.info("New document is: {}", updatedDocument.toJson());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testSectionPathRootParse() throws Exception {
|
|
||||||
String sectionPath = "$.";
|
|
||||||
|
|
||||||
String profileID = "profiledConcessioni";
|
|
||||||
String projectID = "6425598a8593b215a1281e1c";
|
|
||||||
|
|
||||||
Configuration configurationGSON = Configuration.builder().jsonProvider(new GsonJsonProvider()).build();
|
|
||||||
|
|
||||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
|
||||||
|
|
||||||
Project proejct = client.getProjectByID(profileID, projectID);
|
|
||||||
|
|
||||||
String jsonSourceProject = proejct.getTheDocument().toJson();
|
|
||||||
|
|
||||||
// If the section path is the Root document, passed as "$.", fixing as "$"
|
|
||||||
if (sectionPath.compareTo(FormDataObjectToJSON.JSON_$_POINTER + ".") == 0)
|
|
||||||
sectionPath = FormDataObjectToJSON.JSON_$_POINTER;
|
|
||||||
|
|
||||||
LOG.info("theString: {}", jsonSourceProject);
|
|
||||||
com.google.gson.JsonObject currentSectionJObject = JsonPath.parse(jsonSourceProject, configurationGSON)
|
|
||||||
.read(sectionPath);
|
|
||||||
LOG.info("currentSectionJObject: {}", currentSectionJObject.toString());
|
|
||||||
LOG.info("sourceSectionObject: {}", currentSectionJObject.toString());
|
|
||||||
|
|
||||||
JSONObject targetSectionJObject = new JSONObjectOrdered().instance();
|
|
||||||
targetSectionJObject.put("nome", proejct.getTheDocument().get("nome") + " 1");
|
|
||||||
targetSectionJObject.put("titolo", proejct.getTheDocument().get("introduzione") + " 1");
|
|
||||||
LOG.info("targetSectionJObject: {}", targetSectionJObject.toString());
|
|
||||||
|
|
||||||
// JSONObject mergedSection = FormDataObjectToJSON.deepMerge(sourceSectionObject,
|
|
||||||
// targetSectionJObject);
|
|
||||||
|
|
||||||
String output = JsonMerge.merge(targetSectionJObject.toString(), currentSectionJObject.toString(),
|
|
||||||
MERGE_OPTION.REPLACE);
|
|
||||||
LOG.info("output: {}", output);
|
|
||||||
|
|
||||||
Gson gson = new Gson();
|
|
||||||
JsonObject gsonOject = gson.fromJson(output, JsonObject.class);
|
|
||||||
|
|
||||||
// Putting the merged section into Document
|
|
||||||
DocumentContext newContextDocJson = JsonPath.parse(jsonSourceProject, configurationGSON).set(sectionPath,
|
|
||||||
gsonOject);
|
|
||||||
// DocumentContext newDocument = JsonPath.parse(jsonSourceProject,
|
|
||||||
// configurationGSON).set(sectionPath, new JSONObject(output));
|
|
||||||
// String newDocJson = JsonPath.parse(jsonSourceProject).set(sectionPath, new
|
|
||||||
// JSONObject(output)).jsonString();
|
|
||||||
String newDocJson = newContextDocJson.json().toString();
|
|
||||||
LOG.info("Going to call updateProject with document: {}", newDocJson);
|
|
||||||
|
|
||||||
Document updatedDocument = Serialization.read(newDocJson.toString(), Document.class);
|
|
||||||
LOG.info("New document is: {}", updatedDocument.toJson());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Before
|
|
||||||
public void preloadgCubeProfilesForUCDs() {
|
public void preloadgCubeProfilesForUCDs() {
|
||||||
LOG.debug("preloadgCubeProfilesForUCDs called");
|
LOG.debug("preloadgCubeProfilesForUCDs called");
|
||||||
try {
|
try {
|
||||||
|
@ -335,145 +164,6 @@ public class Complex_Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
//@Test
|
||||||
public void deleteFileSet_ServiceTest() throws Exception {
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
|
||||||
|
|
||||||
boolean ignore_errors = false;
|
|
||||||
String path = "$.abstractRelazione.filesetIta";
|
|
||||||
|
|
||||||
Project doc = clientPrj.getProjectByID(PROFILE_ID, PROJECT_ID);
|
|
||||||
|
|
||||||
JSONPathWrapper wrapper = new JSONPathWrapper(doc.getTheDocument().toJson());
|
|
||||||
List<String> matchingPaths = wrapper.getMatchingPaths(path);
|
|
||||||
|
|
||||||
LOG.info("matchingPaths is: " + matchingPaths);
|
|
||||||
|
|
||||||
String error = null;
|
|
||||||
if (matchingPaths.isEmpty()) {
|
|
||||||
error = "No Registered FileSet found at " + path;
|
|
||||||
if (!ignore_errors) {
|
|
||||||
throw new WebApplicationException(error, Response.Status.BAD_REQUEST);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (matchingPaths.size() > 1 && !ignore_errors) {
|
|
||||||
error = "Multiple Fileset (" + matchingPaths.size() + ") matching " + path;
|
|
||||||
if (!ignore_errors)
|
|
||||||
throw new WebApplicationException(error, Response.Status.BAD_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error != null && ignore_errors) {
|
|
||||||
LOG.info("Error detected {}. Ignoring it and returning input doc", error);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Object> listPath = wrapper.getByPath(path);
|
|
||||||
LOG.info("List path: "+listPath);
|
|
||||||
// RegisteredFileSet fs = Serialization.convert(listPath.get(0), RegisteredFileSet.class);
|
|
||||||
// LOG.info("Going to delete {}", fs);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void registerFileSet() throws Exception {
|
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
|
||||||
|
|
||||||
Project theProject = clientPrj.getProjectByID(PROFILE_ID, PROJECT_ID);
|
|
||||||
|
|
||||||
MongoServiceUtil mongoService = new MongoServiceUtil();
|
|
||||||
|
|
||||||
Access access = new Access();
|
|
||||||
access.setLicense("CC-BY");
|
|
||||||
access.setPolicy(AccessPolicy.OPEN);
|
|
||||||
|
|
||||||
String sectionJSONPath = "$.abstractRelazione";
|
|
||||||
String fieldName = "filesetIta";
|
|
||||||
String fieldDefinition = "$.abstractRelazione._children[?(@.filesetIta)]";
|
|
||||||
|
|
||||||
String theFileName = "Application_Profile_for_CSW_2.0-2.pdf";
|
|
||||||
String theFileURL = "https://data.dev.d4science.org/shub/E_bnN2aDJZZUMySy9peE9ScEVLNVFNWjBOZWx0cXQ2UUFkQ2E3Rjc1S29EelJIMEJGbDRoczBnbHVPWHczZTNQTw==";
|
|
||||||
|
|
||||||
FileUploadedRemote file = new FileUploadedRemote();
|
|
||||||
file.setUrl(theFileURL);
|
|
||||||
file.setFileName(theFileName);
|
|
||||||
|
|
||||||
File input = null;
|
|
||||||
File output = null;
|
|
||||||
try {
|
|
||||||
File tempDir = Files.createTempDirectory("GEOPORTAL_REPLACE_FILES_").toFile();
|
|
||||||
String tmpDirPath = tempDir.getAbsolutePath();
|
|
||||||
if (file instanceof FileUploadedRemote) {
|
|
||||||
FileUploadedRemote remote = (FileUploadedRemote) file;
|
|
||||||
LOG.info("Uploaded file is remote: " + remote.getUrl());
|
|
||||||
InputStream in = new URL(remote.getUrl()).openStream();
|
|
||||||
String fileName = (remote.getFileName() == null || remote.getFileName().isEmpty())
|
|
||||||
? "file_" + Random.nextInt()
|
|
||||||
: remote.getFileName();
|
|
||||||
LOG.info("the fileName is: " + fileName);
|
|
||||||
output = new File(tmpDirPath, fileName);
|
|
||||||
Path outputAbsolutePath = Paths.get(output.getAbsolutePath());
|
|
||||||
Files.copy(in, outputAbsolutePath, StandardCopyOption.REPLACE_EXISTING);
|
|
||||||
LOG.info("Remote file: " + remote.getUrl() + ", copied to new file: " + output.getName());
|
|
||||||
} else {
|
|
||||||
LOG.info("Uploaded file is local: " + file.getTempSystemPath());
|
|
||||||
input = new File(file.getTempSystemPath());
|
|
||||||
output = new File(tmpDirPath, file.getFileName());
|
|
||||||
copyContent(input, output);
|
|
||||||
LOG.info("Temp file: " + file.getTempSystemPath() + ", copied to new file: " + output.getName());
|
|
||||||
}
|
|
||||||
// tempDir.deleteOnExit();
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.warn("Skipping file: " + file.getFileName() + ". Error: " + e.getMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
File fileset = output;
|
|
||||||
LOG.info("the fileName is: " + fileset.getName());
|
|
||||||
|
|
||||||
mongoService.registerFileSet(theProject.getProfileID(), theProject, sectionJSONPath, fieldName, fieldDefinition,
|
|
||||||
access, fileset);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy content.
|
|
||||||
*
|
|
||||||
* @param a the a
|
|
||||||
* @param b the b
|
|
||||||
* @throws Exception the exception
|
|
||||||
*/
|
|
||||||
public static void copyContent(File a, File b) throws Exception {
|
|
||||||
FileInputStream in = new FileInputStream(a);
|
|
||||||
FileOutputStream out = new FileOutputStream(b);
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
int n;
|
|
||||||
|
|
||||||
// read() function to read the
|
|
||||||
// byte of data
|
|
||||||
while ((n = in.read()) != -1) {
|
|
||||||
// write() function to write
|
|
||||||
// the byte of data
|
|
||||||
out.write(n);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
if (in != null) {
|
|
||||||
|
|
||||||
// close() function to close the
|
|
||||||
// stream
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
// close() function to close
|
|
||||||
// the stream
|
|
||||||
if (out != null) {
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG.debug("File Copied");
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testReadProjectForUCDDataEntry() {
|
public void testReadProjectForUCDDataEntry() {
|
||||||
ScopeProvider.instance.set(CONTEXT);
|
ScopeProvider.instance.set(CONTEXT);
|
||||||
SecurityTokenProvider.instance.set(TOKEN);
|
SecurityTokenProvider.instance.set(TOKEN);
|
||||||
|
@ -605,7 +295,7 @@ public class Complex_Tests {
|
||||||
String filesetJSONPath = String.format("%s.%s", JSON_$_POINTER, filePath.getFieldName());
|
String filesetJSONPath = String.format("%s.%s", JSON_$_POINTER, filePath.getFieldName());
|
||||||
List<Payload> listPayloads = readPayloadsForFileset(filesetJSONPath, fromSectionDocJSON);
|
List<Payload> listPayloads = readPayloadsForFileset(filesetJSONPath, fromSectionDocJSON);
|
||||||
FilesetDV filesetDV = new FilesetDV();
|
FilesetDV filesetDV = new FilesetDV();
|
||||||
filesetDV.setGcubeProfileFieldName(filePath.getGcubeProfileFieldName());
|
filesetDV.setName(filePath.getGcubeProfileFieldName());
|
||||||
for (Payload payload : listPayloads) {
|
for (Payload payload : listPayloads) {
|
||||||
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
||||||
filesetDV.addPayloadDV(payloadDV);
|
filesetDV.addPayloadDV(payloadDV);
|
||||||
|
@ -640,7 +330,7 @@ public class Complex_Tests {
|
||||||
System.out.println("***** Files");
|
System.out.println("***** Files");
|
||||||
if (subDocument.getListFiles() != null) {
|
if (subDocument.getListFiles() != null) {
|
||||||
for (FilesetDV filesetDV : subDocument.getListFiles()) {
|
for (FilesetDV filesetDV : subDocument.getListFiles()) {
|
||||||
System.out.println("******* File Fileset name: " + filesetDV.getGcubeProfileFieldName());
|
System.out.println("******* File Fileset name: " + filesetDV.getName());
|
||||||
for (PayloadDV payload : filesetDV.getListPayload()) {
|
for (PayloadDV payload : filesetDV.getListPayload()) {
|
||||||
System.out.println("********* Payload: " + payload);
|
System.out.println("********* Payload: " + payload);
|
||||||
}
|
}
|
||||||
|
@ -649,7 +339,7 @@ public class Complex_Tests {
|
||||||
System.out.println("***** Images");
|
System.out.println("***** Images");
|
||||||
if (subDocument.getListImages() != null) {
|
if (subDocument.getListImages() != null) {
|
||||||
for (FilesetDV filesetDV : subDocument.getListImages()) {
|
for (FilesetDV filesetDV : subDocument.getListImages()) {
|
||||||
System.out.println("******* Image Fileset name: " + filesetDV.getGcubeProfileFieldName());
|
System.out.println("******* Image Fileset name: " + filesetDV.getName());
|
||||||
for (PayloadDV payload : filesetDV.getListPayload()) {
|
for (PayloadDV payload : filesetDV.getListPayload()) {
|
||||||
System.out.println("********* Payload: " + payload);
|
System.out.println("********* Payload: " + payload);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,3 @@
|
||||||
/ISTI.gcubekey
|
/ISTI.gcubekey
|
||||||
/d4science.research-infrastructures.eu.gcubekey
|
/d4science.research-infrastructures.eu.gcubekey
|
||||||
/howto.txt
|
/howto.txt
|
||||||
/gcube_config.properties
|
|
||||||
|
|
Loading…
Reference in New Issue