From d358a21182d38ea61d31c40356f7188b8d27388b Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 29 Sep 2021 11:38:24 +0200 Subject: [PATCH] passing object instead of List into GWT-RPC --- .settings/org.eclipse.wst.common.component | 27 +++++++++----- pom.xml | 8 +++- .../client/GeoportalDataEntryService.java | 37 ++++++++++++++----- .../GeoportalDataEntryServiceAsync.java | 3 +- .../client/ui/edit/EditModeRecord.java | 7 ++-- .../server/GeoportalDataEntryServiceImpl.java | 11 ++---- src/main/webapp/GeoPortalDataEntryApp.css | 6 +-- 7 files changed, 65 insertions(+), 34 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index c4e9c0b..354d1cb 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -12,7 +13,8 @@ - + + @@ -25,7 +27,8 @@ - + + @@ -38,7 +41,8 @@ - + + @@ -51,7 +55,8 @@ - + + @@ -64,7 +69,8 @@ - + + @@ -77,7 +83,8 @@ - + + @@ -90,7 +97,8 @@ - + + @@ -103,7 +111,8 @@ - + + diff --git a/pom.xml b/pom.xml index abc93a3..a21a5ff 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ - + javax.servlet @@ -87,6 +87,12 @@ ${gwtVersion} provided + + com.google.gwt + gwt-servlet + ${gwtVersion} + runtime + com.github.gwtbootstrap gwt-bootstrap diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index 768eefb..410b42a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -4,6 +4,7 @@ import java.util.List; import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; +import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; @@ -53,41 +54,59 @@ public interface GeoportalDataEntryService extends RemoteService { /** * Gets the list concessioni. * - * @param start the start - * @param limit the limit - * @param filter the filter + * @param start the start + * @param limit the limit + * @param filter the filter * @param reloadFromService the reload from service * @return the list concessioni * @throws Exception the exception */ - public ResultSetPaginatedData getListConcessioni(Integer start, Integer limit, SortFilter filter, boolean reloadFromService) throws Exception; - + public ResultSetPaginatedData getListConcessioni(Integer start, Integer limit, SortFilter filter, + boolean reloadFromService) throws Exception; /** * Delete record. * - * @param itemId the item id + * @param itemId the item id * @param recordType the record type * @return true, if successful + * @throws Exception the exception */ boolean deleteRecord(String itemId, RECORD_TYPE recordType) throws Exception; + /** + * Gets the JSON record. + * + * @param itemId the item id + * @param recordType the record type + * @return the JSON record + * @throws Exception the exception + */ String getJSONRecord(String itemId, RECORD_TYPE recordType) throws Exception; + /** + * Update record. + * + * @param itemId the item id + * @param jsonUpdate the json update + * @param recordType the record type + * @return the concessione DV + * @throws Exception the exception + */ ConcessioneDV updateRecord(String itemId, String jsonUpdate, RECORD_TYPE recordType) throws Exception; /** * Read file set paths. * - * @return the list + * @return the file set paths DV * @throws Exception the exception */ - List readFileSetPaths() throws Exception; + FileSetPathsDV readFileSetPaths() throws Exception; /** * Gets the record. * - * @param itemId the item id + * @param itemId the item id * @param recordType the record type * @return the record * @throws Exception the exception diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index 3143c1a..1df72e8 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -4,6 +4,7 @@ import java.util.List; import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; +import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; @@ -62,7 +63,7 @@ public interface GeoportalDataEntryServiceAsync void updateRecord(String itemId, String jsonUpdate, RECORD_TYPE recordType, AsyncCallback callback); - void readFileSetPaths(AsyncCallback> callback); + void readFileSetPaths(AsyncCallback callback); void getRecord(String itemId, RECORD_TYPE recordType, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java index e05ad80..fc43957 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java @@ -4,6 +4,7 @@ import java.util.List; import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; +import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_ON_ITEM; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp; @@ -87,7 +88,7 @@ public class EditModeRecord extends Composite { } private void instanceUpdateFilesetEditor() { - GeoPortalDataEntryApp.geoportalDataEntryService.readFileSetPaths(new AsyncCallback>() { + GeoPortalDataEntryApp.geoportalDataEntryService.readFileSetPaths(new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -96,8 +97,8 @@ public class EditModeRecord extends Composite { } @Override - public void onSuccess(List listFileSetPaths) { - UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, listFileSetPaths); + public void onSuccess(FileSetPathsDV fileSetPaths) { + UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, fileSetPaths.getFileSetPaths()); filesUpdatePanel.add(updateFileset); } }); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 12bc97a..72e8e3f 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -23,6 +23,7 @@ import org.gcube.application.geoportalcommon.shared.GeoNaDataViewerProfile; import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV; +import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.portlets.user.geoportaldataentry.client.ConcessioniFormCardTitle; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_FIELD; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; @@ -723,15 +724,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen * @throws Exception the exception */ @Override - public List readFileSetPaths() throws Exception { + public FileSetPathsDV readFileSetPaths() throws Exception { LOG.info("readFileSetPaths called"); - List fileSetPaths = new ArrayList(); - fileSetPaths.add(Concessione.Paths.ABSTRACT_RELAZIONE); - fileSetPaths.add(Concessione.Paths.RELAZIONE); - fileSetPaths.add(Concessione.Paths.IMMAGINI); - fileSetPaths.add(Concessione.Paths.POSIZIONAMENTO); - fileSetPaths.add(Concessione.Paths.PIANTE); - return fileSetPaths; + return ConvertToDataViewModel.getFileSetPaths(); } } diff --git a/src/main/webapp/GeoPortalDataEntryApp.css b/src/main/webapp/GeoPortalDataEntryApp.css index 59e5c1c..0a9a0ce 100644 --- a/src/main/webapp/GeoPortalDataEntryApp.css +++ b/src/main/webapp/GeoPortalDataEntryApp.css @@ -95,7 +95,7 @@ h1 { } .form-fielset-edit { - margin: 10px 0px; - border: 1px groove #ddd; - padding: 10px; + margin: 10px 0px !important; + border: 1px groove #ddd !important; + padding: 10px !important; }