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

pull/4/head
Francesco Mangiacrapa 3 years ago
parent 86f9234c83
commit d358a21182

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -12,7 +13,8 @@
<wb-module deploy-name="geoportal-data-entry-app-2.0.0-SNAPSHOT">
@ -25,7 +27,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -38,7 +41,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -51,7 +55,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -64,7 +69,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
@ -77,7 +83,8 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -90,7 +97,8 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -103,7 +111,8 @@
</wb-module>

@ -59,7 +59,7 @@
</dependencyManagement>
<dependencies>
<!-- needed to compile with gwt > 2.7 -->
<dependency>
<groupId>javax.servlet</groupId>
@ -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>

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

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

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

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

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

Loading…
Cancel
Save