passing object instead of List<String> into GWT-RPC

This commit is contained in:
Francesco Mangiacrapa 2021-09-29 11:38:24 +02:00
parent 86f9234c83
commit d358a21182
7 changed files with 65 additions and 34 deletions

View File

@ -11,6 +11,7 @@
<wb-module deploy-name="geoportal-data-entry-app-2.0.0-SNAPSHOT">
@ -24,6 +25,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -37,6 +39,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -50,6 +53,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -63,6 +67,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
@ -76,6 +81,7 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -89,6 +95,7 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -102,6 +109,7 @@
</wb-module>
@ -115,4 +123,5 @@
</project-modules>

View File

@ -87,6 +87,12 @@
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.github.gwtbootstrap</groupId>
<artifactId>gwt-bootstrap</artifactId>

View File

@ -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;
@ -60,8 +61,8 @@ public interface GeoportalDataEntryService extends RemoteService {
* @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.
@ -69,20 +70,38 @@ public interface GeoportalDataEntryService extends RemoteService {
* @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<String> readFileSetPaths() throws Exception;
FileSetPathsDV readFileSetPaths() throws Exception;
/**
* Gets the record.

View File

@ -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<ConcessioneDV> callback);
void readFileSetPaths(AsyncCallback<List<String>> callback);
void readFileSetPaths(AsyncCallback<FileSetPathsDV> callback);
void getRecord(String itemId, RECORD_TYPE recordType, AsyncCallback<ConcessioneDV> callback);

View File

@ -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<List<String>>() {
GeoPortalDataEntryApp.geoportalDataEntryService.readFileSetPaths(new AsyncCallback<FileSetPathsDV>() {
@Override
public void onFailure(Throwable caught) {
@ -96,8 +97,8 @@ public class EditModeRecord extends Composite {
}
@Override
public void onSuccess(List<String> listFileSetPaths) {
UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, listFileSetPaths);
public void onSuccess(FileSetPathsDV fileSetPaths) {
UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, fileSetPaths.getFileSetPaths());
filesUpdatePanel.add(updateFileset);
}
});

View File

@ -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<String> readFileSetPaths() throws Exception {
public FileSetPathsDV readFileSetPaths() throws Exception {
LOG.info("readFileSetPaths called");
List<String> fileSetPaths = new ArrayList<String>();
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();
}
}

View File

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