Compare commits

...

55 Commits

Author SHA1 Message Date
Francesco Mangiacrapa 58fc9d0d52 removed -SNAPSHOT to be released 2024-06-28 15:58:11 +02:00
Francesco Mangiacrapa 3aa1712faf Merge pull request 'feature_27120' (!13) from feature_27120 into master
Reviewed-on: #13
2024-06-28 15:56:13 +02:00
Francesco Mangiacrapa 40ad3ee2cf updated typo 2024-06-20 17:50:44 +02:00
Francesco Mangiacrapa bb323df98a updated logs 2024-05-22 15:34:23 +02:00
Francesco Mangiacrapa 54545e7048 Enforced deleteProject UX 2024-05-10 12:50:51 +02:00
Francesco Mangiacrapa c3a923eb69 updated exception message 2024-05-10 12:29:33 +02:00
Francesco Mangiacrapa acaf4eb37c Enforced deleteProject method 2024-05-10 12:25:20 +02:00
Francesco Mangiacrapa 89ddb6bc5f updated title 2024-04-16 11:22:38 +02:00
Francesco Mangiacrapa 4a1b26128c commented test 2024-04-15 12:35:16 +02:00
Francesco Mangiacrapa ed5b39d106 updated CSS 2024-04-11 12:22:58 +02:00
Francesco Mangiacrapa 63816fe648 integrated new bean StepPerformedResultDV 2024-04-11 11:04:54 +02:00
Francesco Mangiacrapa 140856db03 - Added optional message when performing lifecycle step [#27192] 2024-04-08 17:18:29 +02:00
Francesco Mangiacrapa c8c500c736 - Integrated new Uri-Resolver-Manager [#27160]
- Added Get Shareable Link facility [#27120]
2024-04-05 15:54:09 +02:00
Francesco Mangiacrapa b86439cba6 added information when resolving shared link 2024-03-27 10:55:42 +01:00
Francesco Mangiacrapa fb7a80bb2f Implementing the init facility to resolve a public link on an item
#27120
2024-03-26 17:00:37 +01:00
Roberto Cirillo 50a688a820 Update 'pom.xml'
fix geoportal-data-viewer-widget range
2024-02-27 10:26:34 +01:00
Francesco Mangiacrapa ecc14f2283 Updated geoportal-data-mapper range at [1.0.1, 2.0.0-SNAPSHOT) 2024-02-26 15:09:40 +01:00
Francesco Mangiacrapa fe2f7b3795 removed -SNAPSHOT to be released 2024-01-11 16:38:28 +01:00
Francesco Mangiacrapa 9ca7b52b60 Improved display of results on multiple fields #26372 2024-01-11 15:56:54 +01:00
Francesco Mangiacrapa c16bcdbc76 Updated README 2023-07-25 11:35:15 +02:00
Francesco Mangiacrapa 4c8a75685b Updated README 2023-07-25 11:29:10 +02:00
Francesco Mangiacrapa e853dd8da3 Update 'README.md' 2023-07-12 23:39:52 +02:00
Francesco Mangiacrapa f32a75b9df Updated README 2023-07-08 18:14:24 +02:00
Francesco Mangiacrapa 1d93733386 removed -SNAPSHOT to be released 2023-06-19 11:00:59 +02:00
Francesco Mangiacrapa c9e2b1598d Merge pull request 'bug_25265' (!12) from bug_25265 into master
Reviewed-on: #12
2023-06-19 10:59:13 +02:00
Francesco Mangiacrapa 20ead3b970 updated description 2023-06-16 15:39:45 +02:00
Francesco Mangiacrapa 869b13d5fe bug fixed the search facility [#25265] 2023-06-16 15:14:15 +02:00
Roberto Cirillo 8eecd5c638 Update 'CHANGELOG.md'
fix changelog
2023-05-31 14:28:29 +02:00
Francesco Mangiacrapa c32af933df removed -SNAPSHOT to be released 2023-05-12 10:58:13 +02:00
Francesco Mangiacrapa 51e9d9f7fe Merge pull request 'task_24166' (!11) from task_24166 into master
Reviewed-on: #11
2023-05-12 10:57:14 +02:00
Francesco Mangiacrapa 4407711fe6 Merged manually against the `task_24166` to resolve conflicts 2023-05-12 10:57:02 +02:00
Francesco Mangiacrapa 84a8bdf5d2 merged manually some files to resolve conflicts with `task_24166` 2023-05-12 10:55:03 +02:00
Francesco Mangiacrapa 217df66cb3 removed -SNAPSHOT to be released 2023-03-06 14:52:29 +01:00
Francesco Mangiacrapa dcc6ca6828 Merge pull request 'task_24567' (!10) from task_24567 into master
Reviewed-on: #10
2023-03-06 14:49:35 +01:00
Francesco Mangiacrapa 3efdb92d2a Performed reload from service 2023-02-21 11:00:26 +01:00
Francesco Mangiacrapa a596e180e5 Done - [#24569] and [#24571] 2023-02-09 14:12:44 +01:00
Francesco Mangiacrapa ed93d7ab43 removed -SNAPSHOT to be released 2023-02-03 15:20:44 +01:00
Francesco Mangiacrapa 7edb0446d4 Merge pull request 'fixes_24532' (!9) from fixes_24532 into master
Reviewed-on: #9
2023-02-03 14:47:36 +01:00
Francesco Mangiacrapa 6f77cf23e9 [#24475] Done 2023-02-03 11:42:06 +01:00
Francesco Mangiacrapa 5474b5e25b #24520 Added parameter "force=true" to Delete Project 2023-02-02 16:56:50 +01:00
Francesco Mangiacrapa 3e01fba65a commented console.log 2023-01-25 11:41:20 +01:00
Francesco Mangiacrapa 1844c32a4b Just updated the message "A Published project cannot be updated" 2023-01-19 15:56:52 +01:00
Francesco Mangiacrapa a89dd687cb [#24458] Published projects cannot be edited/updated 2023-01-19 14:51:42 +01:00
Francesco Mangiacrapa 8dc90cbd6e Fixing #24432 serialization issue using LinkedHashMap<String, String>
instead of LinkedHashMap<String, Object>
2023-01-17 17:07:36 +01:00
Francesco Mangiacrapa 3775f54f02 OVERRDING legend-style into 'metadata-profile-form-builder-widget', see
#24188#note-7
2023-01-13 11:37:20 +01:00
Francesco Mangiacrapa 7f850b805f Removed -SNAPSHOT to be released 2023-01-12 11:51:09 +01:00
Francesco Mangiacrapa 97c9f19b7c Building SNAPSHOT version 2023-01-12 11:49:31 +01:00
Francesco Mangiacrapa 8d6ba8b8f5 Removed -SNAPSHOT to be released 2022-12-21 11:28:56 +01:00
Francesco Mangiacrapa 7e81f7a347 Merge pull request 'task_24282' (!8) from task_24282 into master
Reviewed-on: #8
2022-12-21 11:27:46 +01:00
Francesco Mangiacrapa f053195d92 #24049 Fixed "Show on Map" changing its behaviour 2022-12-13 15:30:47 +01:00
Francesco Mangiacrapa 1992d2227a only indentation 2022-12-13 14:41:33 +01:00
Francesco Mangiacrapa bd88048989 #24281 Fixed filtering selection label 2022-12-13 14:40:21 +01:00
Francesco Mangiacrapa ac95b4616a Fixing the conflict on 'json' library, see #24263?#note-1 2022-12-07 10:53:16 +01:00
Francesco Mangiacrapa 2cb435c546 fixing issue on clicking event 2022-11-30 10:06:42 +01:00
Francesco Mangiacrapa 55dc9379c5 Bug fixing the pagination via getListProjects method 2022-11-29 15:45:43 +01:00
35 changed files with 1623 additions and 325 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.2.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.2.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.3.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.2.0-SNAPSHOT
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.3.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -111,8 +111,116 @@
<wb-module deploy-name="geoportal-data-entry-app-3.2.0-SNAPSHOT">
<wb-module deploy-name="geoportal-data-entry-app-3.3.0-SNAPSHOT">
@ -225,7 +333,61 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -338,7 +500,61 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -451,7 +667,61 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -516,7 +786,64 @@
<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>
@ -629,7 +956,61 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -742,7 +1123,61 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -855,7 +1290,61 @@
</wb-module>

View File

@ -4,14 +4,30 @@
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).
## [v3.2.0-SNAPSHOT] - 2022-05-11
## [v3.3.0] - 2024-06-28
- 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]
- DELETE relation operation allowed only in DRAFT phase [#25104]
## [v3.1.0] - 2023-03-06
@ -49,6 +65,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- [#23913] Integrated with GUI presentation configurations read from IS
- [#23926] Integrated a Post Creation Action in the UCD and manage it
- [#24136] Integrated the temporal dimension on the front-end side
- [#24458] Published projects cannot be edited/updated
## [v2.2.1] - 2022-06-29

View File

@ -1,6 +1,6 @@
# GeoPortal Data Entry App
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
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).
## Built With
@ -18,14 +18,42 @@ The GeoPortal Data Entry App is an application to build the web forms for data e
<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 lArcheologia (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
Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html)
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" />
Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html)
## Change log
See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-entry-app/releases)

13
pom.xml
View File

@ -7,14 +7,14 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-entry-app</artifactId>
<packaging>war</packaging>
<version>3.2.0-SNAPSHOT</version>
<version>3.3.0</version>
<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>
<scm>
@ -30,6 +30,7 @@
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
@ -51,7 +52,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.8.0-SNAPSHOT</version>
<version>3.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -95,14 +96,14 @@
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>geoportal-data-viewer-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<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.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<version>[1.0.1, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
@ -224,7 +225,7 @@
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- TESTS -->
<dependency>
<groupId>junit</groupId>

View File

@ -25,6 +25,12 @@ public class ConstantsGeoPortalDataEntryApp {
public static final String DIV_PORTLET_ID = "geoportal-data-entry";
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;

View File

@ -28,8 +28,6 @@ public class GeoPortalClientCaches {
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType;
//private Map<String, List<HandlerDeclarationDV>> mapHandlersConfigurationsForProfileId;
private Map<String, UseCaseDescriptorDV> mapUseCaseDescriptor;
private Map<String, CacheSearchingFilterParametersFromConfig> mapSearchingFilterParametersForProfileId;

View File

@ -6,6 +6,7 @@ import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
@ -20,8 +21,9 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.BasicLifecycleInformationDV.Status;
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.step.StepPerformedResultDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
@ -55,12 +57,14 @@ import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView;
import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow;
import org.gcube.portlets.user.geoportaldataentry.client.ui.action.DeleteViewPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.action.StepViewPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord;
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.UpdateRecord;
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProjectTablePanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.LifecycleInformationPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.NodeItem;
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
@ -72,6 +76,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
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.UserRights;
import org.gcube.portlets.widgets.gdvw.client.GeoportalDataViewerWidget;
@ -103,9 +108,12 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Command;
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.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
@ -162,32 +170,21 @@ public class GeoPortalDataEntryApp implements EntryPoint {
private GeoPortalClientCaches geoportalCaches;
private String paramGeonaItemType;
private String paramGeonaItemID;
private boolean canCreateNewItem = false;
private GNADataEntryExtendedConfigProfile gNADataEntryPresentationConfig = null;
/**
* This is the entry point method.
*/
public void onModuleLoad() {
/*
* ArrayList<GeoNaFormCardModel> gnaCardsModels = new
* ArrayList<GeoNaFormCardModel>(10); GcubeProfileDV gprofile = new
* GcubeProfileDV(); gprofile.setParentName("$.");
* gprofile.setSectionTitle("Istruzione"); GeoNaFormCardModel fcm = new
* GeoNaFormCardModel(); fcm.setGcubeProfile(gprofile); gnaCardsModels.add(fcm);
*
* for (int i = 0; i < 2; i++) { GcubeProfileDV gprofile1 = new
* GcubeProfileDV(); gprofile1.setParentName("$.livello1");
* gprofile1.setSectionTitle("Secondaria Superiore "+i); GeoNaFormCardModel fcm1
* = new GeoNaFormCardModel(); fcm1.setGcubeProfile(gprofile1);
* gnaCardsModels.add(fcm1); }
*
* for (int i = 0; i < 3; i++) { GcubeProfileDV gprofile2 = new
* GcubeProfileDV(); gprofile2.setParentName("$.livello1.livello2");
* gprofile2.setSectionTitle("Alberghiero di Pisa "+i); GeoNaFormCardModel fcm2
* = new GeoNaFormCardModel(); fcm2.setGcubeProfile(gprofile2);
* gnaCardsModels.add(fcm2); }
*
* TreeItemPanel tip = new TreeItemPanel("Concessione", gnaCardsModels);
* RootPanel.get(GeoPortalDataEntryApp.DIV_PORTLET_ID).add(tip.getTree());
*/
final InitExecutor initExecutor = new InitExecutor();
geoportalCaches = new GeoPortalClientCaches();
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement()
@ -198,94 +195,271 @@ public class GeoPortalDataEntryApp implements EntryPoint {
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
mainTabPanel.addFormPanel(geoNaMainForm);
paramGeonaItemType = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_PARAMETER_ITEM_TYPE);
paramGeonaItemID = Window.Location.getParameter(ConstantsGeoPortalDataEntryApp.GET_PARAMETER_ITEM_ID);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(mainTabPanel);
// ROOT_PANEL_DIV_PORTLET.getElement().getStyle().setOpacity(0.3);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeoportalISConfig>() {
// Loads Geoportal init configurations
Command commandGeonaInitConfig = new Command() {
@Override
public void onFailure(Throwable caught) {
String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support";
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
public void execute() {
GWT.log("Execute commandGeonaInitConfig...");
GeoportalDataEntryServiceAsync.Util.getInstance()
.getGeonaInitConfig(new AsyncCallback<GeoportalISConfig>() {
@Override
public void onFailure(Throwable caught) {
String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support";
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
}
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(alert);
Window.alert(errorMsg);
initExecutor.execute();
}
@Override
public void onSuccess(GeoportalISConfig geoportalISConfig) {
geoportalISConfigs = geoportalISConfig;
if (geoportalISConfig != null && geoportalISConfig.getScope() != null) {
loadGeoportalConfigs(geoportalISConfig.getScope());
} else
Window.alert("Sorry, no scope found in the session. Re-login and try again");
initExecutor.execute();
}
});
}
};
// Loads data entry presetentation configurations
Command commandReadDataViewerConfig = new Command() {
@Override
public void execute() {
GWT.log("Execute commandReadDataViewerConfig...");
// Loading Geoportal Configurations from IS
GeoportalDataEntryServiceAsync.Util.getInstance()
.readDataEntryPresentationConfig(new AsyncCallback<GNADataEntryExtendedConfigProfile>() {
@Override
public void onFailure(Throwable caught) {
String errorMsg = "Sorry, an error occurred on instancing the application. Please, contact the support. Error is: "
+ caught.getMessage();
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement().removeClassName(
ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
} catch (Exception e) {
}
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert);
Window.alert(errorMsg);
initExecutor.execute();
}
@Override
public void onSuccess(GNADataEntryExtendedConfigProfile gNADataEntryConfig) {
GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: "
+ gNADataEntryConfig);
gNADataEntryPresentationConfig = gNADataEntryConfig;
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
}
// PERMISSIONS
myRights = gNADataEntryConfig.getUserRights();
initGUI();
GcubeUserRole userRole = myRights.getRoleRights().getUserRole();
mainTabPanel.setRole(userRole);
// GUI Presentation
mainTabPanel.setGUIPresentation(gNADataEntryConfig.getDataEntryGUIPresentation());
RoleRights roleRights = myRights.getRoleRights();
canCreateNewItem = roleRights.getListPermessions().keySet()
.contains(OPERATION_ON_ITEM.CREATE_NEW_PROJECT);
if (!canCreateNewItem) {
// removing Tab "Create New Project"
mainTabPanel.removeTab(0);
// activating Tab "List of Project"
mainTabPanel.setTabActive(0);
// mainTabPanel.instanceAndShowListOfProjects();
}
initExecutor.execute();
}
});
}
};
Command commandInitOnItem = null;
// Resolves the gid={ITEM_ID}&git={PROFILE_ID}
if (paramGeonaItemType != null && paramGeonaItemID != null) {
commandInitOnItem = new Command() {
@Override
public void execute() {
GWT.log("Execute commandInitOnItem...");
GeoportalDataEntryServiceAsync.Util.getInstance().getResultDocumentFoProjectByID(paramGeonaItemType,
paramGeonaItemID, new AsyncCallback<ResultDocumentDV>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof ProjectNotFoundException) {
Modal errorModal = new Modal(true, true);
errorModal.setCloseVisible(true);
errorModal.setTitle("Oops...");
Image geoportalError = new Image(Images.ICONS.warningError());
FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_warning");
errorPanelMsg.add(geoportalError);
errorPanelMsg.add(new HTML("D4S GeoPortal"));
HTML erroMessage = new HTML(
"Oops something went wrong, either the project does not exist or you are not authorized to access it");
errorPanelMsg.add(erroMessage);
errorModal.add(errorPanelMsg);
errorModal.show();
} else {
Window.alert("Error " + caught.getMessage());
}
initExecutor.execute();
}
@Override
public void onSuccess(final ResultDocumentDV result) {
GWT.log("commandInitOnItem success: " + result);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
// appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(
// Arrays.asList(result), OPERATION_ON_ITEM.VIEW_PROJECT_AS_DOCUMENT));
Timer timer = new Timer() {
int attempts = 0;
@Override
public void run() {
attempts++;
GWT.log("commandInitOnItem run timer...");
List<UseCaseDescriptorDV> list = mainTabPanel
.getUcdProjectTypesForListingDataView();
if (list.size() > 0) {
this.cancel();
List<UseCaseDescriptorDV> filterUCD = mainTabPanel
.getUcdProjectTypesForListingDataView().stream()
.filter(u -> u.getId()
.contentEquals(paramGeonaItemType))
.collect(Collectors.toList());
if (filterUCD.size() == 1) {
GWT.log("FilterUCD");
UseCaseDescriptorDV ucd = filterUCD.get(0);
ListOfProjectTablePanel listProjectPanel = mainTabPanel
.getListOfProjectTablePanel();
SearchingFilter searchingFilter = new SearchingFilter();
searchingFilter.setGetForIDs(result.getProfileID(),
result.getProjectID());
// searchFilter.setConditions(null);
// searchFilter.setGetForIDs(result.getProfileID(),
// result.getProjectID());
GetListOfRecordsEvent event = new GetListOfRecordsEvent(
true, ucd.getProfileID(), searchingFilter, true);
listProjectPanel.setSearchTypeAndFire(
filterUCD.get(0).getName(), event);
Modal errorModal = new Modal(true, true);
// errorModal.setWidth("800px");
errorModal.setCloseVisible(true);
errorModal.setTitle("Information...");
Image geoportalError = new Image(Images.ICONS.info());
geoportalError.setWidth("128px");
FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_info");
errorPanelMsg.add(geoportalError);
errorPanelMsg.add(new HTML(gNADataEntryPresentationConfig
.getDataEntryGUIPresentation().getHeader()
.getTitle()));
HTML erroMessage = new HTML(
"The <span class='general_info_facility'>List of Projects</span> only shows the <br/><br/><b>\""
+ result.getFirstEntryOfMap().getValue()
+ "\"</b><br/><br/>project resolved by shareable link<br/><br/>To view all projects select <span class='general_info_facility'>Reload Projects</span> button");
errorPanelMsg.add(erroMessage);
errorModal.add(errorPanelMsg);
errorModal.show();
}
if (attempts > 20) {
this.cancel();
}
}
}
};
timer.schedule(500);
initExecutor.execute();
}
});
if (canCreateNewItem) {
mainTabPanel.setTabActive(1);
} else
mainTabPanel.setTabActive(0);
}
});
}
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(alert);
Window.alert(errorMsg);
};
}
try {
initExecutor.putCommand(commandGeonaInitConfig);
initExecutor.putCommand(commandReadDataViewerConfig);
if (commandInitOnItem != null) {
initExecutor.putCommand(commandInitOnItem);
}
@Override
public void onSuccess(GeoportalISConfig geoportalISConfig) {
geoportalISConfigs = geoportalISConfig;
if (geoportalISConfig != null && geoportalISConfig.getScope() != null) {
loadGeoportalConfigs(geoportalISConfig.getScope());
} else
Window.alert("Sorry, no scope found in the session. Re-login and try again");
}
});
// Loading Geoportal Configurations from IS
GeoportalDataEntryServiceAsync.Util.getInstance()
.readDataViewerConfig(new AsyncCallback<GNADataEntryExtendedConfigProfile>() {
@Override
public void onFailure(Throwable caught) {
String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support";
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
} catch (Exception e) {
}
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert);
Window.alert(errorMsg);
}
@Override
public void onSuccess(GNADataEntryExtendedConfigProfile gNADataEntryConfig) {
GWT.log(GNADataEntryExtendedConfigProfile.class.getSimpleName() + " loaded: "
+ gNADataEntryConfig);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
}
// PERMISSIONS
myRights = gNADataEntryConfig.getUserRights();
initGUI();
GcubeUserRole userRole = myRights.getRoleRights().getUserRole();
mainTabPanel.setRole(userRole);
// GUI Presentation
mainTabPanel.setGUIPresentation(gNADataEntryConfig.getDataEntryGUIPresentation());
RoleRights roleRights = myRights.getRoleRights();
boolean canCreateNewItem = roleRights.getListPermessions().keySet()
.contains(OPERATION_ON_ITEM.CREATE_NEW_PROJECT);
if (!canCreateNewItem) {
// removing Tab "Create New Project"
mainTabPanel.removeTab(0);
// activating Tab "List of Project"
mainTabPanel.setTabActive(0);
// mainTabPanel.instanceAndShowListOfProjects();
}
}
});
initExecutor.execute();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@ -790,7 +964,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
GWT.log("Fired: " + getListOfRecordsEvent);
GWT.log("Fired onGetList: " + getListOfRecordsEvent);
SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter();
CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches
@ -809,7 +983,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit()
|| getListOfRecordsEvent.isReloadFilteringParameters()) {
mainTabPanel.setFilteringParameters(seachingFilterParameters);
searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter();
// Searching in the cache if the list of relationship definition is present
List<RelationshipDefinitionDV> listRelationshipsDef = geoportalCaches
@ -835,16 +1008,16 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
});
}
if (searchingFilter == null) {
searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter();
}
}
// TODO MUST MANAGE getListOfRecordsEvent.isReloadFilteringParameters()
searchingFilter.setProjection(seachingFilterParameters.getProjection());
List<ItemFieldDV> displayFields = seachingFilterParameters.getDisplayFields();
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, searchingFilter);
mainTabPanel.showListOfProjectsView(grpw);
// The Project Type is changed
@ -1167,21 +1340,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final ResultDocumentDV resultDocumentDV = (ResultDocumentDV) item;
String htmlMsg = "Going to perform the step/s <i><b>" + wActionOnItem.getAction().getCallSteps()
+ "</b></i> on the project with:";
htmlMsg += "<ul>";
htmlMsg += "<li>id: " + resultDocumentDV.getId() + "</li>";
htmlMsg += "<li>profile: " + resultDocumentDV.getProfileID() + "</li>";
htmlMsg += "<li>" + resultDocumentDV.getFirstEntryOfMap().getKey() + ": "
+ resultDocumentDV.getFirstEntryOfMap().getValue() + "</li>";
htmlMsg += "</ul>";
htmlMsg += "<br>";
htmlMsg += "Would you like to proceed?";
final ModalConfirm dialog = new ModalConfirm(null,
"Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", htmlMsg);
dialog.addToCenterPanel(
new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false));
"Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", null);
final StepViewPanel stvp = new StepViewPanel(resultDocumentDV, wActionOnItem.getAction());
dialog.addToCenterPanel(stvp);
dialog.getYesButton().addClickHandler(new ClickHandler() {
@ -1191,7 +1354,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final Modal modal = new Modal(true, true);
modal.setCloseVisible(false);
modal.setTitle("Perfoming Steps...");
modal.setTitle("Performing Steps...");
modal.hide(false);
modal.setWidth(800);
modal.setMaxHeigth("650px");
@ -1204,7 +1367,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps(
resultDocumentDV.getProfileID(), resultDocumentDV.getId(),
wActionOnItem.getAction(), new AsyncCallback<ProjectDV>() {
stvp.getOptionalMessage(), wActionOnItem.getAction(),
new AsyncCallback<StepPerformedResultDV>() {
@Override
public void onFailure(Throwable caught) {
@ -1220,7 +1384,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
@Override
public void onSuccess(final ProjectDV result) {
public void onSuccess(final StepPerformedResultDV result) {
modal.setTitle("Step/s performed");
modal.setCloseVisible(true);
try {
@ -1234,22 +1398,53 @@ public class GeoPortalDataEntryApp implements EntryPoint {
String stepsToString = "";
for (String step : wActionOnItem.getAction().getCallSteps()) {
stepsToString += step + ", ";
stepsToString += step + " ";
}
Status status = Status.NOT_SPECIFIED;
AlertType alertType = AlertType.INFO;
String statusMsg = "status " + status.getLabel();
try {
status = result.getLifecycleInfoDV().getLastOperationStatus();
switch (status) {
case OK:
alertType = AlertType.SUCCESS;
statusMsg = "performed with " + status.getLabel().toUpperCase()
+ "!";
break;
case WARNING:
alertType = AlertType.WARNING;
statusMsg = "performed with " + status.getLabel().toUpperCase()
+ "!";
break;
case ERROR:
alertType = AlertType.ERROR;
statusMsg = "performed with " + status.getLabel().toUpperCase()
+ "!";
break;
default:
alertType = AlertType.INFO;
statusMsg = "performed. Current status " + status.getLabel();
break;
}
} catch (Exception e) {
// silent
}
Alert alert = new Alert(
stepString + " " + stepsToString + "performed correclty!");
alert.setType(AlertType.INFO);
stepString + " " + stepsToString + " " + statusMsg);
alert.setType(alertType);
alert.setClose(false);
modal.add(alert);
GeoportalDataEntryServiceAsync.Util.getInstance()
.getResultDocumentFoProjectByID(result.getProfileID(),
result.getId(), new AsyncCallback<ResultDocumentDV>() {
result.getProjectId(),
new AsyncCallback<ResultDocumentDV>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
Window.alert("Error: " + caught.getMessage());
}
@ -1469,7 +1664,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
modal.add(hpGetLink);
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
resultDocumentDV.getProfileID(), new AsyncCallback<GeoportalItemReferences>() {
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER,
new AsyncCallback<GeoportalItemReferences>() {
@Override
public void onFailure(Throwable caught) {
try {
@ -1480,7 +1676,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
alert.setClose(false);
hpGetLink.add(alert);
modal.add(alert);
// newBrowserWindow.close();
}
@ -1518,6 +1714,67 @@ public class GeoPortalDataEntryApp implements EntryPoint {
break;
}
case GET_SHAREABLE_LINK: {
final Modal modal = new Modal(true, true);
modal.setTitle("Share the Project by link...");
modal.setCloseVisible(true);
final HorizontalPanel hpGetLink = new HorizontalPanel();
final LoaderIcon lc = new LoaderIcon("Just moment getting link...");
hpGetLink.add(lc);
modal.add(hpGetLink);
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_ENTRY,
new AsyncCallback<GeoportalItemReferences>() {
@Override
public void onFailure(Throwable caught) {
try {
hpGetLink.setVisible(false);
modal.remove(hpGetLink);
} catch (Exception e) {
// TODO: handle exception
}
Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
alert.setClose(false);
modal.add(alert);
// newBrowserWindow.close();
}
@Override
public void onSuccess(GeoportalItemReferences result) {
try {
hpGetLink.setVisible(false);
modal.remove(hpGetLink);
} catch (Exception e) {
// TODO: handle exception
}
String theURL = result.getRestrictedLink().getShortURL() != null
? result.getRestrictedLink().getShortURL()
: result.getRestrictedLink().getCompleteURL();
// newBrowserWindow.setUrl(theURL);
Anchor anchor = new Anchor(theURL);
anchor.setHref(theURL);
anchor.setTarget("_blank");
anchor.setTitle("Shareable link of the project with id: "
+ resultDocumentDV.getId());
com.github.gwtbootstrap.client.ui.Label label = new com.github.gwtbootstrap.client.ui.Label(
"Shareable link");
label.setType(LabelType.SUCCESS);
modal.add(label);
modal.add(new HTML("<br>"));
modal.add(anchor);
}
});
modal.show();
break;
}
case VIEW_REPORT: {
final Modal modal2 = new Modal(true, true);
@ -1714,19 +1971,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
case DELETE_PROJECT: {
String htmlMsg = "Going to delete the project with:";
htmlMsg += "<ul>";
htmlMsg += "<li>id: " + resultDocumentDV.getId() + "</li>";
htmlMsg += "<li>profile: " + resultDocumentDV.getProfileID() + "</li>";
htmlMsg += "<li>" + resultDocumentDV.getFirstEntryOfMap().getKey() + ": "
+ resultDocumentDV.getFirstEntryOfMap().getValue() + "</li>";
htmlMsg += "</ul>";
htmlMsg += "<br>";
htmlMsg += "This operation cannot be undone. Would you like to proceed?";
DeleteViewPanel dvp = new DeleteViewPanel(resultDocumentDV);
final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", htmlMsg);
dialog.addToCenterPanel(
new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false));
final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", null);
dialog.addToCenterPanel(dvp);
dialog.show();
dialog.getYesButton().addClickHandler(new ClickHandler() {
@ -1758,6 +2006,32 @@ public class GeoPortalDataEntryApp implements EntryPoint {
alert.setClose(false);
hp.add(alert);
VerticalPanel vp = new VerticalPanel();
vp.getElement().getStyle().setMarginTop(20, Unit.PX);
vp.add(new Label("Check outcome in the Publication Report"));
Button buttonShowPublicationReport = new Button(
"Show Publication Report");
buttonShowPublicationReport.setType(ButtonType.INFO);
buttonShowPublicationReport.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
modal.hide();
appManagerBus
.fireEvent(new OperationOnItemEvent<DocumentDV>(
Arrays.asList(resultDocumentDV),
OPERATION_ON_ITEM.VIEW_REPORT));
}
});
buttonShowPublicationReport.getElement().getStyle().setMarginTop(10,
Unit.PX);
buttonShowPublicationReport.getElement().getStyle()
.setMarginBottom(20, Unit.PX);
vp.add(buttonShowPublicationReport);
modal.add(vp);
}
@Override

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
import java.util.List;
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.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
@ -11,6 +12,7 @@ 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.ProjectDV;
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.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
@ -56,12 +58,13 @@ public interface GeoportalDataEntryService extends RemoteService {
/**
* Gets the links for.
*
* @param itemId the item id
* @param itemId the item id is the mongoId
* @param profileID the profile ID
* @param shareLinkTo the share link to
* @return the links for
* @throws Exception the exception
*/
GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception;
GeoportalItemReferences getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo) throws Exception;
/**
* Gets the list projects.
@ -104,7 +107,7 @@ public interface GeoportalDataEntryService extends RemoteService {
* @return the GNA data entry ext config profile
* @throws Exception the exception
*/
GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception;
GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception;
/**
* Gets the list use case descriptors.
@ -140,11 +143,11 @@ public interface GeoportalDataEntryService extends RemoteService {
*
* @param profileID the profile ID
* @param projectID the project ID
* @param action the action
* @param optionalMessage the optional message
* @param action the action
* @return the project DV
* @throws Exception the exception
*/
ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action) throws Exception;
StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action) throws Exception;
/**
* Gets the relationships definition.
@ -235,6 +238,14 @@ public interface GeoportalDataEntryService extends RemoteService {
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;
}

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
import java.util.List;
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.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
@ -11,6 +12,7 @@ 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.ProjectDV;
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.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
@ -59,7 +61,8 @@ public interface GeoportalDataEntryServiceAsync {
void getGeonaInitConfig(AsyncCallback<GeoportalISConfig> callback);
void getLinksFor(String itemId, String profileID, AsyncCallback<GeoportalItemReferences> callback);
void getLinksFor(String itemId, String profileID, SHARE_LINK_TO shareLinkTo,
AsyncCallback<GeoportalItemReferences> callback);
void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
boolean reloadFromService, AsyncCallback<ResultSetPaginatedData> callback);
@ -70,15 +73,15 @@ public interface GeoportalDataEntryServiceAsync {
void updateRecord(String profileID, String projectID, String jsonUpdate, AsyncCallback<ProjectDV> callback);
void readDataViewerConfig(AsyncCallback<GNADataEntryExtendedConfigProfile> asyncCallback);
void readDataEntryPresentationConfig(AsyncCallback<GNADataEntryExtendedConfigProfile> asyncCallback);
void getListUseCaseDescriptors(List<String> handlersIds, AsyncCallback<List<UseCaseDescriptorDV>> callback);
void getLifecycleInfoForProjectId(String profileID, String projectID,
AsyncCallback<LifecycleInformationDV> callback);
void performActionSteps(String profileID, String projectID, ActionDefinitionDV action,
AsyncCallback<ProjectDV> callback);
void performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action,
AsyncCallback<StepPerformedResultDV> callback);
void getRelationshipsDefinition(String profileID, AsyncCallback<List<RelationshipDefinitionDV>> callback);

View File

@ -0,0 +1,43 @@
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());
}
}
}

View File

@ -15,7 +15,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
/** The type. */
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
private SearchingFilter sortFilter;
private SearchingFilter searchingFilter;
private String profileID;
private String projectName;
private Boolean reloadFilteringParameters = false;
@ -26,13 +26,13 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
*
* @param onApplicationInit the on application init
* @param profileID the profile ID
* @param sortFilter the sort filter
* @param searchingFilter the searching filter
* @param reloadFilteringParameters the reload filtering parameters
*/
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter sortFilter,
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter searchingFilter,
Boolean reloadFilteringParameters) {
this.onApplicationInit = onApplicationInit;
this.sortFilter = sortFilter;
this.searchingFilter = searchingFilter;
this.profileID = profileID;
this.reloadFilteringParameters = reloadFilteringParameters;
}
@ -75,7 +75,7 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
* @return the searching filter
*/
public SearchingFilter getSearchingFilter() {
return sortFilter;
return searchingFilter;
}
/**
@ -105,22 +105,19 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
return reloadFilteringParameters;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GetListOfRecordsEvent [sortFilter=");
builder.append(sortFilter);
builder.append("GetListOfRecordsEvent [searchingFilter=");
builder.append(searchingFilter);
builder.append(", profileID=");
builder.append(profileID);
builder.append(", projectName=");
builder.append(projectName);
builder.append(", reloadFilteringParameters=");
builder.append(reloadFilteringParameters);
builder.append(", onApplicationInit=");
builder.append(onApplicationInit);
builder.append("]");
return builder.toString();
}

View File

@ -21,6 +21,7 @@ public class OperationOnItemEvent<T extends DocumentDV> extends GwtEvent<Operati
private List<T> selectItems;
private OPERATION_ON_ITEM action;
private Element sourceElement;
private String ucdName;
/**
* Instantiates a new action on item event.
@ -65,6 +66,10 @@ public class OperationOnItemEvent<T extends DocumentDV> extends GwtEvent<Operati
protected void dispatch(OperationOnItemEventHandler handler) {
handler.onDoActionFired(this);
}
public String getUcdName() {
return ucdName;
}
/**
* Gets the select items.

View File

@ -16,4 +16,10 @@ public interface Images extends ClientBundle {
@Source("one-finger-icon.png")
ImageResource oneFingerIcon();
@Source("information_icon.png")
ImageResource info();
@Source("warning_error.png")
ImageResource warningError();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -106,6 +106,9 @@ public class GeonaMainTabPanel extends Composite {
@UiField
NavLink navShowOnMap;
@UiField
NavLink navShareLink;
@UiField
NavLink navShowReport;
@ -249,6 +252,21 @@ 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() {
@ -432,6 +450,7 @@ public class GeonaMainTabPanel extends Composite {
tabPanel.selectTab(index);
}
/**
* Dirty solution. I created this one because I had problem on firing click
* event for Tab element
@ -694,5 +713,13 @@ public class GeonaMainTabPanel extends Composite {
grpw.removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS);
}
}
public ListOfProjectTablePanel getListOfProjectTablePanel() {
return listOfProjectTablePanel;
}
public List<UseCaseDescriptorDV> getUcdProjectTypesForListingDataView() {
return ucdProjectTypesForListingDataView;
}
}

View File

@ -107,6 +107,8 @@
<b:Divider addStyleNames="{style.divider-border-right}" />
<b:NavLink ui:field="navShowOnMap" title="Show on Map"
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"
title="Show Publication Report" icon="FILE_TEXT_ALT">Publication Report</b:NavLink>

View File

@ -50,7 +50,6 @@ public class GeonaRecordsPaginatedView {
private MyCustomDataProvider<DocumentDV> dataProvider = new MyCustomDataProvider<DocumentDV>();
protected Widget orginalLoadingIndicator = null;
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
// private int serverStartIndex;
private HandlerManager eventBus;
private SearchingFilter currentSearchingFilter;
private String profileID;
@ -74,7 +73,6 @@ public class GeonaRecordsPaginatedView {
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
initPagination(ITEMS_PER_PAGE);
// loadNewPage(ITEM_START_INDEX, ITEMS_PER_PAGE, false);
loadItemsForType(profileID);
}
@ -117,31 +115,27 @@ public class GeonaRecordsPaginatedView {
/**
* Load new page.
*
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentSortFilter the current sort filter
* @param invalidCache the invalid cache
* @param profileID the profile ID
* @param startIdx the start idx
* @param limit the limit
* @param resetStore the reset store
* @param currentSearchFilter the current search filter
* @param invalidCache the invalid cache
*/
private void loadNewPage(String profileID, final int startIdx, final int limit, final boolean resetStore,
final SearchingFilter currentSortFilter, final boolean invalidCache) {
// initFirstRangeChanged = resetStore;
final SearchingFilter currentSearchFilter, final boolean invalidCache) {
GWT.log("loadNewPage with parameters [startIdx: " + startIdx + ", limit: " + limit + ", resetStore:"
+ resetStore + "]");
// showLoading(true);
int newStartIndex = startIdx;
if (resetStore) {
GWT.log("Cleaning all data...");
newStartIndex = 0;
// serverStartIndex = 0;
GWT.log("Store reset performed start index is: " + newStartIndex);
getTableDataProvider().updateRowCount(ITEMS_PER_PAGE, false);
}
loadProjects(profileID, newStartIndex, limit, currentSortFilter, invalidCache);
loadProjects(profileID, newStartIndex, limit, currentSearchFilter, invalidCache);
}
/**
@ -194,6 +188,16 @@ public class GeonaRecordsPaginatedView {
}
// 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());
}
}
/**
@ -221,17 +225,17 @@ public class GeonaRecordsPaginatedView {
* @param theProfileID the the profile ID
* @param newStartIndex the new start index
* @param limit the limit
* @param sortFilter the sort filter
* @param searchFilter the search filter
* @param invalidCache the invalid cache
*/
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter sortFilter,
private <T> void loadProjects(String theProfileID, int newStartIndex, int limit, SearchingFilter searchFilter,
boolean invalidCache) {
showLoading(true);
GWT.log("calling loadItemsForStatus with parameters [theProfileID: " + theProfileID + ", startIndex: "
+ newStartIndex + ", limit: " + limit + ", sortFilter: " + sortFilter + "]");
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit, sortFilter,
invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
+ newStartIndex + ", limit: " + limit + ", searchFilter: " + searchFilter + "]");
GeoPortalDataEntryApp.geoportalDataEntryService.getListProjects(theProfileID, newStartIndex, limit,
searchFilter, invalidCache, new AsyncCallback<ResultSetPaginatedData>() {
@Override
public void onFailure(Throwable caught) {
@ -265,11 +269,16 @@ public class GeonaRecordsPaginatedView {
itemsTable.getSelectionModel().setSelected(item, select);
}
}
/**
* Removes the column.
*
* @param columnName the column name
*/
public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) {
try {
itemsTable.removeColumn(columnName);
}catch (Exception e) {
} catch (Exception e) {
// TODO: handle exception
}
}
@ -283,9 +292,6 @@ public class GeonaRecordsPaginatedView {
return itemsTable.getSelectedItems();
}
// int latestRangeStart = -1;
// int latestRangeLenght = -1;
/**
* A custom {@link AsyncDataProvider}.
*
@ -310,15 +316,6 @@ public class GeonaRecordsPaginatedView {
int start = range.getStart();
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) {
GWT.log("initClassFirstRangeChanged is true.. returning");
initClassFirstRangeChanged = false;
@ -326,8 +323,6 @@ public class GeonaRecordsPaginatedView {
}
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
loadNewPage(profileID, start, length, false, currentSearchingFilter, false);
// eventBus.fireEvent(new TableRangeViewChangedEvent<T>(start, length));
}
}

View File

@ -0,0 +1,60 @@
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));
}
}

View File

@ -0,0 +1,33 @@
<!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>

View File

@ -0,0 +1,72 @@
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();
}
}

View File

@ -0,0 +1,46 @@
<!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>

View File

@ -35,7 +35,7 @@ public class JSONEditorWrapper extends JavaScriptObject {
console.log("JSONEditorWrapper error: " + error)
}
};
console.log("container is: " + container);
//console.log("container is: " + container);
return new $wnd.JSONEditor(container, options);
}-*/;
@ -47,7 +47,7 @@ public class JSONEditorWrapper extends JavaScriptObject {
public final native void set(String json) /*-{
var toJSONObject = JSON.parse(json);
// set json
console.log("displayng JSON: " + toJSONObject);
//console.log("displayng JSON: " + toJSONObject);
this.set(toJSONObject);
this.refresh();
}-*/;
@ -58,7 +58,7 @@ public class JSONEditorWrapper extends JavaScriptObject {
* @return the text
*/
public final native String getText() /*-{
console.log("this.get(): " +this.getText());
//console.log("this.get(): " +this.getText());
return this.getText();
}-*/;

View File

@ -248,7 +248,7 @@ public class GeonaDataEntryMainForm extends Composite {
appManagerBus.fireEvent(new SaveGeonaDataFormsEvent(treeItemPanel.getProfileID(), treeNode));
TreeVisitUtil.preOrderVisit(treeNode);
showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true);
//showAlertOnSaveAction("Andiamo a salvare", AlertType.INFO, true);
} else {
showAlertOnSaveAction("Detected errors, please fix it/them", AlertType.ERROR, true);

View File

@ -1,5 +1,6 @@
package org.gcube.portlets.user.geoportaldataentry.client.ui.projects;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -81,7 +82,7 @@ public class ListOfProjectTablePanel extends Composite {
@UiField
Dropdown ddProjectType;
@UiField
Hero noProjectSelectionMessage;
@ -323,17 +324,25 @@ public class ListOfProjectTablePanel extends Composite {
if (ucdProjectTypesForListingDataView.size() == 1) {
// noProjectSelectionMessage.setVisible(false);
UseCaseDescriptorDV singleUCD = ucdProjectTypesForListingDataView.get(0);
alertProjectType.setText(singleUCD.getName());
// setFilteringParameters(displayFields, sortByFields, searchForFields,
// currentSearchingFilter);
appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
getCurrentSearchingFilter(), true));
GetListOfRecordsEvent event = new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
getCurrentSearchingFilter(), true);
setSearchTypeAndFire(singleUCD.getName(), event);
}
}
});
}
public void setSearchTypeAndFire(String ucdName, GetListOfRecordsEvent event) {
alertProjectType.setText(ucdName);
// if(event.getSearchingFilter().getProfileID()!=null && event.getSearchingFilter().getProjectID()) {
//
// }
//
appManagerBus.fireEvent(event);
}
/**
* Built searching filter.
@ -346,21 +355,25 @@ public class ListOfProjectTablePanel extends Composite {
if (searchText != null && !searchText.isEmpty()) {
Map<String, Object> searchInto = new HashMap<String, Object>();
String searchForField = "";
List<String> listOfSeachingFields = new ArrayList<String>();
for (ItemFieldDV recordField : cacheSearchingFilterParameters.getSearchByFields()) {
if (recordField.getDisplayName().equals(alertSearchFor.getText())) {
searchForField = recordField.getJsonFields().get(0);
listOfSeachingFields = recordField.getJsonFields();
continue;
}
}
searchInto.put(searchForField, searchText);
for (String fieldname : listOfSeachingFields) {
searchInto.put(fieldname, searchText);
}
WhereClause where = new WhereClause();
where.setSearchInto(searchInto);
where.setOperator(LOGICAL_OP.OR);
searchingFilter.setConditions(Arrays.asList(where));
}
return searchingFilter;
}
@ -421,7 +434,7 @@ public class ListOfProjectTablePanel extends Composite {
}
public void showListOfProjectsView(GeonaRecordsPaginatedView grpw) {
GWT.log("showListOfProjectsView for: "+grpw);
GWT.log("showListOfProjectsView for: " + grpw);
this.grpw = grpw;
geonaListOfRecordsPanel.clear();
VerticalPanel verticalPanel = new VerticalPanel();
@ -466,5 +479,10 @@ public class ListOfProjectTablePanel extends Composite {
ddProjectType.add(link);
}
public String getSelectedProjectType() {
return alertProjectType.getText();
}
}

View File

@ -78,7 +78,7 @@ public class LifecycleInformationPanel extends FlowPanel {
final LoaderIcon lc = new LoaderIcon("Get link...");
hpGetLink.add(lc);
add(hpGetLink);
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID,
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID, GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER,
new AsyncCallback<GeoportalItemReferences>() {
@Override

View File

@ -76,6 +76,7 @@ public class ReportTemplateToHTML extends Composite {
boolean openJSONReport) {
initWidget(uiBinder.createAndBindUi(this));
vpContainer.setVisible(false);
vpContainer.setWidth("95%");
showReportAsJSON.setDefaultOpen(openJSONReport);
showReportAsTable.setDefaultOpen(openTableReport);

View File

@ -10,13 +10,17 @@
.margin-top-10 {
margin-top: 10px;
}
.table-style {
margin-top: 10px;
width: 95%;
}
</ui:style>
<g:HTMLPanel>
<g:VerticalPanel ui:field="vpContainer"
addStyleNames="{style.margin-top-10}">
addStyleNames="{style.table-style}">
<b:Label ui:field="labelToReport">Report: </b:Label>
<g:VerticalPanel ui:field="htmlContainer"
addStyleNames="{style.margin-top-10}"></g:VerticalPanel>
addStyleNames="{style.table-style}"></g:VerticalPanel>
<b:AccordionGroup heading="Show as Table"
ui:field="showReportAsTable">
<b:Paragraph ui:field="reportTable"></b:Paragraph>

View File

@ -27,6 +27,7 @@ import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.shared.HandlerManager;
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.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
@ -102,6 +103,127 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
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 = "&#8226; "; // 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.
*
@ -130,27 +252,10 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
String displayName = itemField.getDisplayName();
TextColumn<T> col = new TextColumn<T>() {
@Override
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 "";
}
@ -158,39 +263,12 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
if (object == null)
return;
Templates TEMPLATES = GWT.create(Templates.class);
DocumentDV documentDV = (DocumentDV) object;
String objectToRender = "";
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);
// 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>");
CellRender cellRender = toCellRender(itemField, object);
sb.append(TEMPLATES.startToolTip(cellRender.getTooltip()));
sb.appendHtmlConstant(cellRender.getValue());
sb.append(TEMPLATES.endToolTip());
};
@ -198,7 +276,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
sortedCellTable.addColumn(col, displayName, true);
i++;
}
// COL RELATIONS
TextColumn<T> colRelationship = new TextColumn<T>() {
@Override
@ -231,7 +309,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
};
};
colRelationship.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_B);
sortedCellTable.addColumn(colRelationship, DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS.getTitle(), true);
mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS, colRelationship);
@ -258,7 +336,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
}
};
colCreated.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O);
sortedCellTable.addColumn(colCreated, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED.getTitle(), true);
sortedCellTable.setColumnWidth(colCreated, 130, Unit.PX);
@ -286,7 +364,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
}
};
colPublisher.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O);
sortedCellTable.addColumn(colPublisher, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY.getTitle(), true);
mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY, colPublisher);
@ -363,7 +441,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
};
};
colOperationStatus.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_Y);
sortedCellTable.addColumn(colOperationStatus, DEFAULT_DISPLAYING_COLUMN_NAME.STATUS.getTitle(), true);
sortedCellTable.setColumnWidth(colOperationStatus, 120, Unit.PX);

View File

@ -29,6 +29,7 @@ import com.google.gwt.user.client.ui.Widget;
*/
public class ModalConfirm extends Modal implements ClickHandler {
private static final int modal_width = 800;
private DockPanel dock = new DockPanel();
private Button yesButton;
private VerticalPanel vpContainer;
@ -44,7 +45,7 @@ public class ModalConfirm extends Modal implements ClickHandler {
* @param text the text
*/
public ModalConfirm(Image img, String caption, String text) {
setWidth(800);
setWidth(modal_width);
setAnimation(true);
// getElement().setClassName("gwt-DialogBoxNew");
dock.setSpacing(4);
@ -65,7 +66,9 @@ public class ModalConfirm extends Modal implements ClickHandler {
vpContainer = new VerticalPanel();
vpContainer.getElement().getStyle().setMargin(20.0, Unit.PX);
vpContainer.add(new HTML(text));
vpContainer.setWidth((modal_width - 70) + "px");
if (text != null)
vpContainer.add(new HTML(text));
hpButtons = new HorizontalPanel();
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
// hpButtons.getElement().getStyle().setMarginTop(20.0, Unit.PX);

View File

@ -55,6 +55,7 @@ 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.ProjectDV;
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.RelationshipDefinitionDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
@ -71,6 +72,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
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.UserRights;
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
@ -135,6 +137,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
* Save geona data forms.
*
* @param profileID the profile ID
* @param optionalMessage the optional message
* @param tree_Node the tree node
* @param stepsOnPostCreation the steps on post creation
* @return the commit report
@ -194,7 +197,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
LOG.info("stepsOnPostCreation are {}", stepsOnPostCreation);
for (String stepID : stepsOnPostCreation) {
LOG.info("calling step OnPostCreation are {}", stepID);
theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null);
theProject = client.performStep(theProject.getProfileID(), theProject.getId(), stepID, null, null);
}
} catch (Exception e) {
@ -361,7 +364,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
}
// Registering fileset in the section according to mapFilesToRegistrer
if (mapFilesToRegistrer != null && mapFilesToRegistrer.size()>0) {
if (mapFilesToRegistrer != null && mapFilesToRegistrer.size() > 0) {
LOG.info("Cluster of fileset per fieldDefinition is: " + mapFilesToRegistrer);
String theJSONDocument = currentProject.getTheDocument().toJson();
MongoServiceUtil mongoService = new MongoServiceUtil();
@ -821,7 +824,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
*/
@Override
public GeoportalISConfig getGeonaInitConfig() {
LOG.info("getConfig called");
LOG.info("getGeonaInitConfig called");
String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), false);
String theSecondaryType;
@ -844,19 +847,22 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
/**
* Gets the links for.
*
* @param itemId the item id is the mongoId
* @param profileID the profile ID
* @param itemId the item id is the mongoId
* @param profileID the profile ID
* @param shareLinkTo the share link to
* @return the links for
* @throws Exception the exception
*/
@Override
public GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception {
public GeoportalItemReferences getLinksFor(String itemId, String profileID,
GeoportalItemReferences.SHARE_LINK_TO shareLinkTo) throws Exception {
LOG.info("getLinksFor called");
String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
//GNADataViewerConfigProfile grViewerProfile = SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest());
// GNADataViewerConfigProfile grViewerProfile =
// SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest());
GeoportalCommon gc = new GeoportalCommon();
GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID);
GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID, shareLinkTo);
item = gc.getPublicLinksFor(scope, item, true);
LOG.info("Returning: " + item);
return item;
@ -903,6 +909,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
searchedData.setTotalItems(totalProjectForProfile);
LOG.info("Total Docs read from config: " + totalProjectForProfile);
boolean isSearchForIds = filter.getProfileID() != null && filter.getProjectID() != null;
// Saving client PROJECTION
LinkedHashMap<String, Object> originalProjection = filter.getProjection();
int totalItems = totalProjectForProfile;
@ -928,13 +936,23 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
totalItems = listProjectIDs.size();
searchedData.setTotalItems(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
// SETTING ORIGINAL PROJECTION FROM CLIENT
filter.setProjection(originalProjection);
// 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.setLimit(limit);
@ -992,6 +1010,18 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
SessionUtil.getCurrentContext(getThreadLocalRequest(), 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
Integer totalProjectForProfile = client.getTotalDocument(profileID);
SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), profileID, totalProjectForProfile);
@ -999,8 +1029,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
} catch (Exception e) {
LOG.error("Error on deleting the project with id: " + projectID, e);
throw new Exception(
"Error occurred on deleting the project with id: " + projectID + ". Error: " + e.getMessage());
throw new Exception("Error occurred on the server side when deleting the project");
}
}
@ -1076,8 +1105,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
* @throws Exception the exception
*/
@Override
public GNADataEntryExtendedConfigProfile readDataViewerConfig() throws Exception {
LOG.info("readDataViewerConfig called");
public GNADataEntryExtendedConfigProfile readDataEntryPresentationConfig() throws Exception {
LOG.info("readDataEntryPresentationConfig called");
GCubeUser user = null;
GNADataEntryExtendedConfigProfile gnaDEExtConfig = new GNADataEntryExtendedConfigProfile();
@ -1109,7 +1138,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
long groupId = pContext.getCurrentGroupId(this.getThreadLocalRequest());
if (user == null || scope == null) {
LOG.warn("called getMyRightsInTheContext with invalid parameter user: " + user + ", in the scope: "
LOG.warn("called readDataEntryPresentationConfig with invalid parameter user: " + user + ", in the scope: "
+ scope, ", returning null");
return null;
}
@ -1154,7 +1183,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
gnaDEExtConfig.setUserRights(userRights);
return gnaDEExtConfig;
} catch (UserRetrievalFault | GroupRetrievalFault | GNAConfigException e) {
LOG.error("An error occurred during getMyRightsInTheContext: " + user, e);
LOG.error("An error occurred during readDataEntryPresentationConfig: " + user, e);
Map<OPERATION_ON_ITEM, OPERATION_TYPE> permissions = new HashMap<OPERATION_ON_ITEM, RoleRights.OPERATION_TYPE>();
RoleRights roleRights = new RoleRights(permissions, GcubeUserRole.DATA_MEMBER);
@ -1249,12 +1278,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
*
* @param profileID the profile ID
* @param projectID the project ID
* @param optionalMessage the optional message
* @param action the action
* @return the project DV
* @throws Exception the exception
*/
@Override
public ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action)
public StepPerformedResultDV performActionSteps(String profileID, String projectID, String optionalMessage, ActionDefinitionDV action)
throws Exception {
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
@ -1269,13 +1299,18 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
Project project = null;
for (String stepID : action.getCallSteps()) {
LOG.info("calling stepID {} on projectID {}", stepID, projectID);
project = client.performStep(profileID, projectID, stepID, null);
project = client.performStep(profileID, projectID, stepID, optionalMessage, null);
}
LifecycleInformationDV lifecycleInfo = getLifecycleInfoForProjectId(profileID, projectID);
lifecycleInfo.getLastOperationStatus();
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
LOG.info("performActionSteps returning theProject with ID {}", projectID);
return theProject;
StepPerformedResultDV sprv = new StepPerformedResultDV(profileID, projectID, lifecycleInfo);
// 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) {
String error = "Error occurred on performing the workflow step/s on the project id " + projectID;
LOG.error(error, e);
@ -1406,7 +1441,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
Project project = projects.getProjectByID(profileID, projectID);
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
ProjectDV projectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
LOG.info("returning: " + projectDV.getId());
LOG.info("returning ProjectByID: " + projectDV.getId());
return projectDV;
} catch (Exception e) {
@ -1434,14 +1469,21 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
ProjectsCaller projects = GeoportalClientCaller.projects();
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);
LOG.info("returning: " + documentDV.getId());
return documentDV;
} catch (ProjectNotFoundException e) {
LOG.error(ProjectNotFoundException.class.getSimpleName(), e);
throw e;
} catch (Exception e) {
String error = "Error occurred on reading the project with id: " + projectID;
LOG.error(error, e);
throw new Exception(
throw new ProjectNotFoundException(
error + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
}

View File

@ -0,0 +1,21 @@
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);
}
}

View File

@ -49,6 +49,7 @@ h1 {
margin-left: 10px;
margin-bottom: 10px;
margin-right: 5px;
width: 100%;
}
.my-html-table td {
@ -315,4 +316,21 @@ h1 {
font-size: 12px !important;
}
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
/** 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;
}