Compare commits

..

No commits in common. "master" and "bug_25265" have entirely different histories.

34 changed files with 308 additions and 1595 deletions

View File

@ -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.2.0/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.2.0/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -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.2.0
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -114,110 +114,8 @@
<wb-module deploy-name="geoportal-data-entry-app-3.2.0">
<wb-module deploy-name="geoportal-data-entry-app-3.3.0-SNAPSHOT">
@ -333,58 +231,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -500,58 +347,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -667,58 +463,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -786,61 +531,7 @@
<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>
@ -956,58 +647,7 @@
<property name="context-root" value="geoportal-data-entry-app"/> <property name="context-root" value="geoportal-data-entry-app"/>
@ -1123,58 +763,7 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/> <property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -1290,58 +879,7 @@
</wb-module> </wb-module>

View File

@ -4,19 +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.2.1-SNAPSHOT] - 2023-06-16
- 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] - Fixed issue in the Search facility [#25265]

View File

@ -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
@ -18,42 +18,14 @@ Geoportal data-entry technology allows the actors who use it, the project manage
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/8e/GeoPortalDataEntry_Architecture.png" style="max-width:800px;" alt="GeoPortal Data-Entry - 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 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 ## 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 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" /> <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 ## Change log
See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-entry-app/releases) See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-entry-app/releases)

View File

@ -14,7 +14,7 @@
<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.2.1-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>
@ -96,14 +95,14 @@
<dependency> <dependency>
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>geoportal-data-viewer-widget</artifactId> <artifactId>geoportal-data-viewer-widget</artifactId>
<version>[1.0.1, 2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.application</groupId> <groupId>org.gcube.application</groupId>
<artifactId>geoportal-data-mapper</artifactId> <artifactId>geoportal-data-mapper</artifactId>
<version>[1.0.1, 2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -225,7 +224,7 @@
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- TESTS --> <!-- TESTS -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

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

View File

@ -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;

View File

@ -6,7 +6,6 @@ import java.util.Collection;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.stream.Collectors;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
@ -21,9 +20,8 @@ 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.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV; 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.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.LifecycleInformationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.step.StepPerformedResultDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
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.HandlerDeclarationDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
@ -57,14 +55,12 @@ 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.GeonaMainTabPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView; 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.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.card.GeoNaFormCardModel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord; 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.edit.UpdateRecord;
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm; 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.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.NodeItem;
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
@ -76,7 +72,6 @@ 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.gdvw.client.GeoportalDataViewerWidget; import org.gcube.portlets.widgets.gdvw.client.GeoportalDataViewerWidget;
@ -108,12 +103,9 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.shared.HandlerManager; 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.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor; 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.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Image;
@ -170,21 +162,32 @@ public class GeoPortalDataEntryApp implements EntryPoint {
private GeoPortalClientCaches geoportalCaches; private GeoPortalClientCaches geoportalCaches;
private String paramGeonaItemType;
private String paramGeonaItemID;
private boolean canCreateNewItem = false;
private GNADataEntryExtendedConfigProfile gNADataEntryPresentationConfig = null;
/** /**
* This is the entry point method. * This is the entry point method.
*/ */
public void onModuleLoad() { public void onModuleLoad() {
/*
final InitExecutor initExecutor = new InitExecutor(); * 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());
*/
geoportalCaches = new GeoPortalClientCaches(); geoportalCaches = new GeoPortalClientCaches();
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement() ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement()
@ -195,271 +198,94 @@ public class GeoPortalDataEntryApp implements EntryPoint {
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus); geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
mainTabPanel.addFormPanel(geoNaMainForm); 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); ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(mainTabPanel);
// ROOT_PANEL_DIV_PORTLET.getElement().getStyle().setOpacity(0.3); // ROOT_PANEL_DIV_PORTLET.getElement().getStyle().setOpacity(0.3);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement() ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT); .addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
// Loads Geoportal init configurations GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeoportalISConfig>() {
Command commandGeonaInitConfig = new Command() {
@Override @Override
public void execute() { public void onFailure(Throwable caught) {
GWT.log("Execute commandGeonaInitConfig..."); String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support";
GeoportalDataEntryServiceAsync.Util.getInstance() Alert alert = new Alert(errorMsg, AlertType.ERROR);
.getGeonaInitConfig(new AsyncCallback<GeoportalISConfig>() { alert.setClose(false);
try {
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
@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);
} }
initExecutor.execute();
} catch (InterruptedException e) { @Override
// TODO Auto-generated catch block public void onSuccess(GeoportalISConfig geoportalISConfig) {
e.printStackTrace(); 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();
}
}
});
} }
@ -964,7 +790,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override @Override
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) { public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
GWT.log("Fired onGetList: " + getListOfRecordsEvent); GWT.log("Fired: " + getListOfRecordsEvent);
SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter(); SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter();
CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches
@ -983,6 +809,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit() if (searchingFilter == null || getListOfRecordsEvent.isOnApplicationInit()
|| getListOfRecordsEvent.isReloadFilteringParameters()) { || getListOfRecordsEvent.isReloadFilteringParameters()) {
mainTabPanel.setFilteringParameters(seachingFilterParameters); mainTabPanel.setFilteringParameters(seachingFilterParameters);
searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter();
// Searching in the cache if the list of relationship definition is present // Searching in the cache if the list of relationship definition is present
List<RelationshipDefinitionDV> listRelationshipsDef = geoportalCaches List<RelationshipDefinitionDV> listRelationshipsDef = geoportalCaches
@ -1008,10 +835,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
} }
}); });
} }
if (searchingFilter == null) {
searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter();
}
} }
searchingFilter.setProjection(seachingFilterParameters.getProjection()); searchingFilter.setProjection(seachingFilterParameters.getProjection());
@ -1340,11 +1163,21 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final ResultDocumentDV resultDocumentDV = (ResultDocumentDV) item; final ResultDocumentDV resultDocumentDV = (ResultDocumentDV) item;
final ModalConfirm dialog = new ModalConfirm(null, String htmlMsg = "Going to perform the step/s <i><b>" + wActionOnItem.getAction().getCallSteps()
"Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", null); + "</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 StepViewPanel stvp = new StepViewPanel(resultDocumentDV, wActionOnItem.getAction()); final ModalConfirm dialog = new ModalConfirm(null,
dialog.addToCenterPanel(stvp); "Step/s " + wActionOnItem.getAction().getTitle() + ", Confirm?", htmlMsg);
dialog.addToCenterPanel(
new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false));
dialog.getYesButton().addClickHandler(new ClickHandler() { dialog.getYesButton().addClickHandler(new ClickHandler() {
@ -1354,7 +1187,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final Modal modal = new Modal(true, true); final Modal modal = new Modal(true, true);
modal.setCloseVisible(false); modal.setCloseVisible(false);
modal.setTitle("Performing Steps..."); modal.setTitle("Perfoming Steps...");
modal.hide(false); modal.hide(false);
modal.setWidth(800); modal.setWidth(800);
modal.setMaxHeigth("650px"); modal.setMaxHeigth("650px");
@ -1367,8 +1200,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps( GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps(
resultDocumentDV.getProfileID(), resultDocumentDV.getId(), resultDocumentDV.getProfileID(), resultDocumentDV.getId(),
stvp.getOptionalMessage(), wActionOnItem.getAction(), wActionOnItem.getAction(), new AsyncCallback<ProjectDV>() {
new AsyncCallback<StepPerformedResultDV>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -1384,7 +1216,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
} }
@Override @Override
public void onSuccess(final StepPerformedResultDV result) { public void onSuccess(final ProjectDV result) {
modal.setTitle("Step/s performed"); modal.setTitle("Step/s performed");
modal.setCloseVisible(true); modal.setCloseVisible(true);
try { try {
@ -1398,53 +1230,22 @@ public class GeoPortalDataEntryApp implements EntryPoint {
String stepsToString = ""; String stepsToString = "";
for (String step : wActionOnItem.getAction().getCallSteps()) { 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( Alert alert = new Alert(
stepString + " " + stepsToString + " " + statusMsg); stepString + " " + stepsToString + "performed correclty!");
alert.setType(alertType); alert.setType(AlertType.INFO);
alert.setClose(false); alert.setClose(false);
modal.add(alert); modal.add(alert);
GeoportalDataEntryServiceAsync.Util.getInstance() GeoportalDataEntryServiceAsync.Util.getInstance()
.getResultDocumentFoProjectByID(result.getProfileID(), .getResultDocumentFoProjectByID(result.getProfileID(),
result.getProjectId(), result.getId(), new AsyncCallback<ResultDocumentDV>() {
new AsyncCallback<ResultDocumentDV>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
Window.alert("Error: " + caught.getMessage()); // TODO Auto-generated method stub
} }
@ -1664,8 +1465,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
modal.add(hpGetLink); modal.add(hpGetLink);
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
resultDocumentDV.getProfileID(), GeoportalItemReferences.SHARE_LINK_TO.DATA_VIEWER, resultDocumentDV.getProfileID(), new AsyncCallback<GeoportalItemReferences>() {
new AsyncCallback<GeoportalItemReferences>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
try { try {
@ -1676,7 +1476,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
} }
Alert alert = new Alert(caught.getMessage(), AlertType.ERROR); Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
alert.setClose(false); alert.setClose(false);
modal.add(alert); hpGetLink.add(alert);
// newBrowserWindow.close(); // newBrowserWindow.close();
} }
@ -1714,67 +1514,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
break; 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: { case VIEW_REPORT: {
final Modal modal2 = new Modal(true, true); final Modal modal2 = new Modal(true, true);
@ -1971,10 +1710,19 @@ public class GeoPortalDataEntryApp implements EntryPoint {
case DELETE_PROJECT: { case DELETE_PROJECT: {
DeleteViewPanel dvp = new DeleteViewPanel(resultDocumentDV); 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?";
final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", null); final ModalConfirm dialog = new ModalConfirm(null, "Delete Confirm?", htmlMsg);
dialog.addToCenterPanel(dvp); dialog.addToCenterPanel(
new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false));
dialog.show(); dialog.show();
dialog.getYesButton().addClickHandler(new ClickHandler() { dialog.getYesButton().addClickHandler(new ClickHandler() {
@ -2006,32 +1754,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
alert.setClose(false); alert.setClose(false);
hp.add(alert); 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 @Override

View File

@ -3,7 +3,6 @@ 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;
@ -12,7 +11,6 @@ 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.geoportalcommon.shared.geoportal.view.ProjectView;
@ -58,13 +56,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 +104,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 +140,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.
@ -238,14 +235,6 @@ public interface GeoportalDataEntryService extends RemoteService {
CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section, CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
String sectionPath, List<FilePathDV> listFilePaths) throws Exception; 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; ProjectView getProjectView(String profileID, String projectID) throws Exception;
} }

View File

@ -3,7 +3,6 @@ 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;
@ -12,7 +11,6 @@ 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.geoportalcommon.shared.geoportal.view.ProjectView;
@ -61,8 +59,7 @@ public interface GeoportalDataEntryServiceAsync {
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 +70,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);

View File

@ -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());
}
}
}

View File

@ -105,6 +105,11 @@ 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();
@ -116,8 +121,6 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
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();
} }

View File

@ -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.
@ -66,10 +65,6 @@ public class OperationOnItemEvent<T extends DocumentDV> extends GwtEvent<Operati
protected void dispatch(OperationOnItemEventHandler handler) { protected void dispatch(OperationOnItemEventHandler handler) {
handler.onDoActionFired(this); handler.onDoActionFired(this);
} }
public String getUcdName() {
return ucdName;
}
/** /**
* Gets the select items. * Gets the select items.

View File

@ -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

View File

@ -106,9 +106,6 @@ public class GeonaMainTabPanel extends Composite {
@UiField @UiField
NavLink navShowOnMap; NavLink navShowOnMap;
@UiField
NavLink navShareLink;
@UiField @UiField
NavLink navShowReport; NavLink navShowReport;
@ -252,21 +249,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() { navViewAsDocument.addClickHandler(new ClickHandler() {
@ -450,7 +432,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
@ -713,13 +694,5 @@ public class GeonaMainTabPanel extends Composite {
grpw.removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS); grpw.removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS);
} }
} }
public ListOfProjectTablePanel getListOfProjectTablePanel() {
return listOfProjectTablePanel;
}
public List<UseCaseDescriptorDV> getUcdProjectTypesForListingDataView() {
return ucdProjectTypesForListingDataView;
}
} }

View File

@ -107,8 +107,6 @@
<b:Divider addStyleNames="{style.divider-border-right}" /> <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: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>

View File

@ -188,16 +188,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());
}
} }
/** /**

View File

@ -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));
}
}

View File

@ -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>

View File

@ -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();
}
}

View File

@ -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>

View File

@ -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);

View File

@ -324,25 +324,17 @@ 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));
} }
} }
}); });
} }
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.
@ -479,10 +471,5 @@ public class ListOfProjectTablePanel extends Composite {
ddProjectType.add(link); 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..."); 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

View File

@ -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);

View File

@ -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>

View File

@ -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 = "&#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. * 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>");
}; };
@ -276,7 +198,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
sortedCellTable.addColumn(col, displayName, true); sortedCellTable.addColumn(col, displayName, true);
i++; i++;
} }
// COL RELATIONS // COL RELATIONS
TextColumn<T> colRelationship = new TextColumn<T>() { TextColumn<T> colRelationship = new TextColumn<T>() {
@Override @Override
@ -309,7 +231,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
}; };
}; };
colRelationship.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_B); colRelationship.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_B);
sortedCellTable.addColumn(colRelationship, DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS.getTitle(), true); sortedCellTable.addColumn(colRelationship, DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS.getTitle(), true);
mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS, colRelationship); mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS, colRelationship);
@ -336,7 +258,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
} }
}; };
colCreated.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O); colCreated.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O);
sortedCellTable.addColumn(colCreated, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED.getTitle(), true); sortedCellTable.addColumn(colCreated, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED.getTitle(), true);
sortedCellTable.setColumnWidth(colCreated, 130, Unit.PX); sortedCellTable.setColumnWidth(colCreated, 130, Unit.PX);
@ -364,7 +286,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
} }
}; };
colPublisher.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O); colPublisher.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_O);
sortedCellTable.addColumn(colPublisher, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY.getTitle(), true); sortedCellTable.addColumn(colPublisher, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY.getTitle(), true);
mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY, colPublisher); mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY, colPublisher);
@ -441,7 +363,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
}; };
}; };
colOperationStatus.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_Y); colOperationStatus.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL_Y);
sortedCellTable.addColumn(colOperationStatus, DEFAULT_DISPLAYING_COLUMN_NAME.STATUS.getTitle(), true); sortedCellTable.addColumn(colOperationStatus, DEFAULT_DISPLAYING_COLUMN_NAME.STATUS.getTitle(), true);
sortedCellTable.setColumnWidth(colOperationStatus, 120, Unit.PX); sortedCellTable.setColumnWidth(colOperationStatus, 120, Unit.PX);

View File

@ -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);

View File

@ -55,7 +55,6 @@ 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;
@ -72,7 +71,6 @@ 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;
@ -137,7 +135,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 +194,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) {
@ -364,7 +361,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
} }
// Registering fileset in the section according to mapFilesToRegistrer // 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); LOG.info("Cluster of fileset per fieldDefinition is: " + mapFilesToRegistrer);
String theJSONDocument = currentProject.getTheDocument().toJson(); String theJSONDocument = currentProject.getTheDocument().toJson();
MongoServiceUtil mongoService = new MongoServiceUtil(); MongoServiceUtil mongoService = new MongoServiceUtil();
@ -484,50 +481,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);
} }
} }
@ -831,7 +821,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,22 +844,19 @@ 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); String scope = SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
// GNADataViewerConfigProfile grViewerProfile = //GNADataViewerConfigProfile grViewerProfile = SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest());
// SessionUtil.getGeportalViewerResourceProfile(getThreadLocalRequest());
GeoportalCommon gc = new GeoportalCommon(); GeoportalCommon gc = new GeoportalCommon();
GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID, shareLinkTo); GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID);
item = gc.getPublicLinksFor(scope, item, true); item = gc.getPublicLinksFor(scope, item, true);
LOG.info("Returning: " + item); LOG.info("Returning: " + item);
return item; return item;
@ -916,8 +903,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 +928,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 +992,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 +999,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 +1076,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 +1109,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 +1154,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 +1247,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 +1269,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 +1406,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 +1434,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");
} }

View File

@ -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);
}
}

View File

@ -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 {
@ -316,21 +315,4 @@ h1 {
font-size: 12px !important; 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;
}