task_24567 #10
|
@ -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.0.2-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry including="**/*.java" kind="src" output="target/geoportal-data-entry-app-3.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
@ -31,5 +31,5 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.0.2-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/geoportal-data-entry-app-3.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
jarsExcludedFromWebInfLib=
|
jarsExcludedFromWebInfLib=
|
||||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.0.2-SNAPSHOT
|
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-entry-app/target/geoportal-data-entry-app-3.1.0-SNAPSHOT
|
||||||
warSrcDir=src/main/webapp
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
|
@ -80,7 +80,17 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="geoportal-data-entry-app-3.0.2-SNAPSHOT">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<wb-module deploy-name="geoportal-data-entry-app-3.1.0-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,6 +233,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,6 +320,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,6 +364,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -361,9 +386,11 @@
|
||||||
|
|
||||||
|
|
||||||
<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="geoportal-data-common-2.0.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -506,6 +533,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -588,6 +620,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -670,6 +707,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
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.1.0-SNAPSHOT] - 2023-02-09
|
||||||
|
|
||||||
|
#### Enhancements
|
||||||
|
|
||||||
|
- [#24569] The Edit operation is available only in the "DRAFT" phase
|
||||||
|
- [#24571] The "Create Relation" operation is available only in the "DRAFT" phase
|
||||||
|
|
||||||
## [v3.0.2] - 2023-02-02
|
## [v3.0.2] - 2023-02-02
|
||||||
|
|
||||||
#### Fixes
|
#### Fixes
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -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.0.2</version>
|
<version>3.1.0-SNAPSHOT</version>
|
||||||
<name>GeoPortal Data Entry App</name>
|
<name>GeoPortal Data Entry App</name>
|
||||||
<description>The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service</description>
|
<description>The GeoPortal Data Entry App is an application to build the web forms for data entries needed to create projects/documents (based on UCD) in the D4Science Geoportal service</description>
|
||||||
<scm>
|
<scm>
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.WORKFLOW_PHASE;
|
||||||
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.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
|
@ -49,6 +50,16 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
|
|
||||||
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
||||||
|
|
||||||
|
public static final String ALERT_MESSAGE_PROJECT_NOT_EDITABLE = "A Project can only be edited/updated in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name()
|
||||||
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
|
||||||
|
public static final String ALERT_MESSAGE_CREATE_RELATION_FORBIDDEN = "The Create Relation operation can be performed only in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name()
|
||||||
|
+ " phase. You need to perform the step 'Reject' or 'UnPublish' to take back the project in "
|
||||||
|
+ WORKFLOW_PHASE.DRAFT.name() + " phase.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum ACTION_PERFORMED_ON_ITEM.
|
* The Enum ACTION_PERFORMED_ON_ITEM.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1514,6 +1514,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
case EDIT_PROJECT: {
|
case EDIT_PROJECT: {
|
||||||
|
|
||||||
final Modal modal3 = new Modal(true, true);
|
final Modal modal3 = new Modal(true, true);
|
||||||
modal3.setTitle(
|
modal3.setTitle(
|
||||||
"<span style='font-size:20px;'>Edit: <span style='color:#555; font-size:20px;'>"
|
"<span style='font-size:20px;'>Edit: <span style='color:#555; font-size:20px;'>"
|
||||||
|
@ -1524,18 +1525,22 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
((Element) modal3.getElement().getChildNodes().getItem(1))
|
((Element) modal3.getElement().getChildNodes().getItem(1))
|
||||||
.addClassName("modal-body-custom");
|
.addClassName("modal-body-custom");
|
||||||
|
|
||||||
boolean isPublishedProject = false;
|
//#24569
|
||||||
|
boolean isNotInDRAFT = false;
|
||||||
|
|
||||||
if (resultDocumentDV.getLifecycleInfo() != null) {
|
if (resultDocumentDV.getLifecycleInfo() != null) {
|
||||||
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
|
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
|
||||||
if(phase!=null && phase.compareToIgnoreCase(WORKFLOW_PHASE.PUBLISHED.getLabel())==0) {
|
// IF the project is not in DRAFT phase, showing an alert and no Update Mode will
|
||||||
|
// be activated
|
||||||
|
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) != 0) {
|
||||||
|
|
||||||
Alert alert = new Alert("A '"+WORKFLOW_PHASE.PUBLISHED.getLabel()+"' project cannot be updated.");
|
Alert alert = new Alert(
|
||||||
|
ConstantsGeoPortalDataEntryApp.ALERT_MESSAGE_PROJECT_NOT_EDITABLE);
|
||||||
alert.setType(AlertType.WARNING);
|
alert.setType(AlertType.WARNING);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
modal3.add(alert);
|
modal3.add(alert);
|
||||||
|
|
||||||
isPublishedProject = true;
|
isNotInDRAFT = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1543,7 +1548,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
modal3.add(emr);
|
modal3.add(emr);
|
||||||
modal3.show();
|
modal3.show();
|
||||||
|
|
||||||
if(isPublishedProject) {
|
if (isNotInDRAFT) {
|
||||||
emr.noUpdateMode();
|
emr.noUpdateMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1551,7 +1556,28 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
case CREATE_RELATION: {
|
case CREATE_RELATION: {
|
||||||
|
|
||||||
|
//#24571
|
||||||
|
boolean isNotInDRAFT = false;
|
||||||
|
|
||||||
|
if (resultDocumentDV.getLifecycleInfo() != null) {
|
||||||
|
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
|
||||||
|
// IF the project is not in DRAFT, showing an alert and the no Update Mode will
|
||||||
|
// be activated
|
||||||
|
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) != 0) {
|
||||||
|
|
||||||
|
String msg = ConstantsGeoPortalDataEntryApp.ALERT_MESSAGE_CREATE_RELATION_FORBIDDEN;
|
||||||
|
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
||||||
|
"Forbidden: " + action, msg, AlertType.WARNING);
|
||||||
|
modalW.show();
|
||||||
|
|
||||||
|
isNotInDRAFT = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Allowing the Create Relation only in DRAFT phase
|
||||||
|
if (!isNotInDRAFT) {
|
||||||
mainTabPanel.showCreateRelationPanel(true, resultDocumentDV);
|
mainTabPanel.showCreateRelationPanel(true, resultDocumentDV);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,8 +561,14 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
|
|
||||||
ResultSetPaginatedData searchedData = new ResultSetPaginatedData();
|
ResultSetPaginatedData searchedData = new ResultSetPaginatedData();
|
||||||
|
|
||||||
Integer totalProjectForProfile = SessionUtil.getTotalDocumentForProfileID(getThreadLocalRequest(),
|
//If reloadFromService = true, loads the document from the service
|
||||||
|
Integer totalProjectForProfile = null;
|
||||||
|
|
||||||
|
//Loading total documents from the session
|
||||||
|
if(!reloadFromService) {
|
||||||
|
totalProjectForProfile = SessionUtil.getTotalDocumentForProfileID(getThreadLocalRequest(),
|
||||||
theProfileID);
|
theProfileID);
|
||||||
|
}
|
||||||
|
|
||||||
if (totalProjectForProfile == null) {
|
if (totalProjectForProfile == null) {
|
||||||
totalProjectForProfile = client.getTotalDocument(theProfileID);
|
totalProjectForProfile = client.getTotalDocument(theProfileID);
|
||||||
|
|
Loading…
Reference in New Issue