Merged with version 3.0.1 on master

3e01fba65a
This commit is contained in:
Francesco Mangiacrapa 2023-01-30 14:47:33 +01:00
parent f1b8777ca0
commit 63102043a5
9 changed files with 164 additions and 32 deletions

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -78,7 +80,9 @@
<wb-module deploy-name="geoportal-data-entry-app-3.1.0-SNAPSHOT">
@ -157,7 +161,9 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -236,7 +242,9 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -315,7 +323,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -349,7 +359,9 @@
<dependent-module archiveName="geoportal-data-mapper-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -428,7 +440,9 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -507,7 +521,9 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -586,7 +602,9 @@
</wb-module>

View File

@ -9,12 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- [#24166] Implemented the Update facility
- [#24244] Integrated with the geoportal-data-mapper library
## [v3.0.1-SNAPSHOT] - 2022-12-13
## [v3.0.1] - 2023-01-19
#### Fixes
- [#24281] Fixed filtering selection label
- [#24049] Fixed "Show on Map" facility vs Chrome browser
- [#24432] Fixing serialization issue using LinkedHashMap<String, String> instead of LinkedHashMap<String, Object>
- [#24458] Published projects cannot be edited/updated
## [v3.0.0] - 2022-11-09
@ -31,6 +33,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- [#23926] Integrated a Post Creation Action in the UCD and manage it
- [#24136] Integrated the temporal dimension on the front-end side
## [v2.2.1] - 2022-06-29
#### Enhancements

View File

@ -25,7 +25,7 @@
<properties>
<!-- Convenience property to set the GWT version -->
<gwt.version>2.9.0</gwt.version>
<gwt.version>2.10.0</gwt.version>
<!-- GWT needs at least java 1.6 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -15,6 +15,7 @@ import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.WORKFLOW_PHASE;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
@ -457,6 +458,37 @@ public class GeoPortalDataEntryApp implements EntryPoint {
}
}
/**
* Builds the new form card model from profile.
*
* @param gcubeProfile the gcube profile
* @param order the order
* @param metaDataProfileBean the meta data profile bean
* @param operation the operation
* @return the geo na form card model
*/
private GeoNaFormCardModel buildNewFormCardModelFromProfile(GcubeProfileDV gcubeProfile, int order,
MetaDataProfileBean metaDataProfileBean, OPERATION operation) {
// Managing Forms repeatability
int minOccurs = gcubeProfile.getMinOccurs();
minOccurs = minOccurs <= 0 ? 0 : minOccurs;
int maxOccurs = gcubeProfile.getMaxOccurs();
maxOccurs = maxOccurs <= 0 ? Integer.MAX_VALUE : maxOccurs;
// TODO MUST BE MANAGED MIN_OCCURS
ProjectFormCard cct = new ProjectFormCard(gcubeProfile.getSectionName(), gcubeProfile.getSectionTitle(), order,
maxOccurs > 1, minOccurs, maxOccurs);
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
CreateMetadataForm baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()),
appManagerBus, operation);
geoNaFormCardModel.setMetadataForm(baseForm);
return geoNaFormCardModel;
}
private void buildNewCards(String profileID, String itemTypeTitle, Collection<GeoNaFormCardModel> orderedCards) {
projectSavedWithSuccess = false; // resetting state of saving
@ -1486,8 +1518,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
modal3.setTitle(
"<span style='font-size:20px;'>Edit: <span style='color:#555; font-size:20px;'>"
+ resultDocumentDV.getId() + "</span></span>");
modal3.setWidth(950);
modal3.setHeight("700px");
// modal3.setWidth(950);
// modal3.setHeight("700px");
modal3.setCloseVisible(true);
((Element) modal3.getElement().getChildNodes().getItem(1))
.addClassName("modal-body-custom");
@ -1496,9 +1528,38 @@ public class GeoPortalDataEntryApp implements EntryPoint {
int width = Window.getClientWidth() * 70 / 100;
modal3.setWidth(width);
modal3.setHeight(height + "px");
boolean isPublishedProject = false;
if(resultDocumentDV.getLifecycleInfo()!=null) {
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
if(phase!=null && phase.compareToIgnoreCase(WORKFLOW_PHASE.PUBLISHED.getLabel())==0) {
Alert alert = new Alert("A '"+WORKFLOW_PHASE.PUBLISHED.getLabel()+"' project cannot be updated.");
alert.setType(AlertType.WARNING);
alert.setClose(false);
modal3.add(alert);
isPublishedProject = true;
}
}
// EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV);
// modal3.add(emr);
// modal3.show();
//
// if(isPublishedProject) {
// emr.noUpdateMode();
// }
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(),
resultDocumentDV.getId());
if(isPublishedProject) {
ur.noUpdateMode();
}
modal3.add(ur);
modal3.show();

View File

@ -114,6 +114,10 @@ public class EditModeRecord extends Composite {
}
public void noUpdateMode() {
buttonJSONUpdate.setVisible(false);
}
private void instanceJSONEditor() {
rawUpdatePanel.clear();

View File

@ -10,6 +10,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ControlGroup;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.constants.AlertType;
@ -47,6 +48,9 @@ public class UpdateRecord extends Composite {
@UiField
ControlGroup controlsControlGroup;
@UiField
Button buttonUpdate;
public static final String PLACEHOLDER_LIST_BOX = "Select section...";
@ -122,5 +126,9 @@ public class UpdateRecord extends Composite {
}
});
}
public void noUpdateMode() {
buttonUpdate.setVisible(false);
}
}

View File

@ -140,7 +140,7 @@ public class ViewRelationshipPanel extends Composite {
secondProjectPanelContainer.clear();
this.fromTheProject = project;
Entry<String, Object> firstEntrySet = project.getFirstEntryOfMap();
Entry<String, String> firstEntrySet = project.getFirstEntryOfMap();
String htmlMsg = firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b> (id: " + project.getId()
+ ")";
@ -203,7 +203,7 @@ public class ViewRelationshipPanel extends Composite {
@Override
public void onSuccess(ResultDocumentDV result) {
mapOfTargetProjectForId.put(relationDV.getTargetUCD(), result);
Entry<String, Object> firstEntrySet = result.getFirstEntryOfMap();
Entry<String, String> firstEntrySet = result.getFirstEntryOfMap();
String htmlMsg = firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue()
+ "</b> (id: " + result.getId() + ")";

View File

@ -523,26 +523,26 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
searchedData.setTotalItems(totalProjectForProfile);
LOG.info("Total Docs read from config: " + totalProjectForProfile);
// Saving client PROJECTION
LinkedHashMap<String, Object> originalProjection = filter.getProjection();
int totalItems = totalProjectForProfile;
// PERFORMING FIRST QUERY FOR IDS IF AND ONLY IF WHERE CONDITIONS IN THE QUERY.
// SEARCHING FACILITY IS ENACTING.
if (filter.getConditions() != null) {
//PERFORMING FIRST QUERY FOR IDS IF AND ONLY IF WHERE CONDITIONS IN THE QUERY.
//SEARCHING FACILITY IS ENACTING.
if(filter.getConditions()!=null) {
// Setting PROJECTION ONLY FOR PROEJCT ID
LinkedHashMap<String, Object> projectionForIDs = new LinkedHashMap<String, Object>();
projectionForIDs.put(Project.ID, 1);
filter.setProjection(projectionForIDs);
// FIRST QUERY TO RETRIEVE IDs
// LIMIT IS NULL MEANS THAT IT IS EQUAL TO NUMBER TOTAL OF DOCUMENTS
// Calculating always the size starting from 0
//Calculating always the size starting from 0
final Iterator<Project> projectsIDs = client.queryOnMongo(theProfileID, totalProjectForProfile, 0, null,
filter);
// Getting the Project IDs from the Iterable
//Getting the Project IDs from the Iterable
Iterable<Project> itP = () -> projectsIDs;
Stream<Project> targetStream = StreamSupport.stream(itP.spliterator(), false);
List<String> listProjectIDs = targetStream.map(Project::getId).collect(Collectors.toList());
@ -550,12 +550,13 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
searchedData.setTotalItems(totalItems);
LOG.info("Total Docs read from query per ID: " + totalItems);
}
// NOW PERFORMING THE (REAL) SECOND QUERY FROM CLIENT
//NOW PERFORMING THE (REAL) SECOND QUERY FROM CLIENT
// SETTING ORIGINAL PROJECTION FROM CLIENT
filter.setProjection(originalProjection);
// LIMIT IS FROM CLIENT
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter);
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalItems, start, limit,
filter);
searchedData.setClientStartIndex(start);
searchedData.setLimit(limit);
@ -563,10 +564,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
List<ResultDocumentDV> toReturnList = ConvertToDataValueObjectModel.toListResultDocument(projects);
searchedData.setData(toReturnList);
LOG.info(
"Total Docs page size returned:" + toReturnList.size() + ", start: " + start + ", limit: " + limit);
LOG.info("Total Docs page size returned:" + toReturnList.size() + ", start: " + start + ", limit: " + limit);
if (totalProjectForProfile == limit || totalProjectForProfile == 0) {
LOG.debug("Page completed returning " + totalProjectForProfile + " projects");
int newOffset = start + limit;

View File

@ -270,4 +270,42 @@ h1 {
.no_modal_body_max_height .modal-body {
max-height: 90% !important;
}
}
/** OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
.legend-style {
width: auto !important;
padding-left: 10px !important;
padding-top: 0px !important;
padding-right: 10px !important;
margin-bottom: 0px !important;
border-bottom: 0px !important;
}
.legend-style small {
display: block;
font-size: 12px !important;
}
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
/** OVERRDING legend-style into 'metadata-profile-form-builder-widget' */
.legend-style {
width: auto !important;
padding-left: 10px !important;
padding-top: 0px !important;
padding-right: 10px !important;
margin-bottom: 0px !important;
border-bottom: 0px !important;
}
.legend-style small {
display: block;
font-size: 12px !important;
}
/** END OVERRDING legend-style into 'metadata-profile-form-builder-widget' */