refactored service and service impl

This commit is contained in:
francesco 2020-10-22 16:50:14 +02:00
parent 13235384d0
commit cc6b6705fd
6 changed files with 36 additions and 29 deletions

View File

@ -6,6 +6,7 @@
<wb-module deploy-name="geoportal-data-entry-app-1.0.0-SNAPSHOT">
@ -14,6 +15,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -22,6 +24,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -30,6 +33,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -38,6 +42,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -46,10 +51,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="metadata-profile-form-builder-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -63,6 +67,7 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -71,6 +76,7 @@
</wb-module>
@ -79,4 +85,5 @@
</project-modules>

View File

@ -49,7 +49,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
/**
* Create a remote service proxy to talk to the server-side Greeting service.
*/
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
private final GeoportalDataEntryServiceAsync greetingService = GWT.create(GeoportalDataEntryService.class);
private final HandlerManager appManagerBus = new HandlerManager(null);
@ -73,7 +73,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
GreetingServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeonaISConfig>() {
GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeonaISConfig>() {
@Override
public void onFailure(Throwable caught) {
@ -205,7 +205,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
loader.setText("Trying to save the data, please wait...");
modal.add(loader);
GreetingServiceAsync.Util.getInstance().saveGeonaDataForms(saveGeonaDataFormsEvent.getListGeonaDataForms(), new AsyncCallback<CommitReport>() {
GeoportalDataEntryServiceAsync.Util.getInstance().saveGeonaDataForms(saveGeonaDataFormsEvent.getListGeonaDataForms(), new AsyncCallback<CommitReport>() {
@Override
public void onFailure(Throwable caught) {

View File

@ -12,8 +12,8 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*/
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
@RemoteServiceRelativePath("geoportaldataentryservice")
public interface GeoportalDataEntryService extends RemoteService {
CommitReport saveGeonaDataForms(List<GeoNaFormDataObject> listGeonaFormObjects) throws Exception;

View File

@ -9,7 +9,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
public interface GreetingServiceAsync
public interface GeoportalDataEntryServiceAsync
{
/**
@ -17,13 +17,13 @@ public interface GreetingServiceAsync
*/
public static final class Util
{
private static GreetingServiceAsync instance;
private static GeoportalDataEntryServiceAsync instance;
public static final GreetingServiceAsync getInstance()
public static final GeoportalDataEntryServiceAsync getInstance()
{
if ( instance == null )
{
instance = (GreetingServiceAsync) GWT.create( GreetingService.class );
instance = (GeoportalDataEntryServiceAsync) GWT.create( GeoportalDataEntryService.class );
}
return instance;
}

View File

@ -15,7 +15,7 @@ import org.gcube.application.geoportal.model.concessioni.RelazioneScavo;
import org.gcube.application.geoportal.model.content.UploadedImage;
import org.gcube.application.geoportal.model.content.WorkspaceContent;
import org.gcube.portlets.user.geoportaldataentry.client.ConcessioniFormCardTitle;
import org.gcube.portlets.user.geoportaldataentry.client.GreetingService;
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService;
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport.STATE;
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
@ -32,10 +32,10 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {
public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implements GeoportalDataEntryService {
public static final String GEONA_GENERIC_RESOURCE_SECONDARY_TYPE = "GEONA_GENERIC_RESOURCE_SECONDARY_TYPE";
private static final Logger LOG = LoggerFactory.getLogger(GreetingServiceImpl.class);
private static final Logger LOG = LoggerFactory.getLogger(GeoportalDataEntryServiceImpl.class);
@Override
public CommitReport saveGeonaDataForms(List<GeoNaFormDataObject> listGeonaFormObjects) throws Exception {

View File

@ -6,8 +6,8 @@
version="3.0">
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.geoportaldataentry.server.GreetingServiceImpl</servlet-class>
<servlet-name>geoportalDataEntryServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.geoportaldataentry.server.GeoportalDataEntryServiceImpl</servlet-class>
</servlet>
<servlet>
@ -21,8 +21,8 @@
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/GeoPortalDataEntryApp/greet</url-pattern>
<servlet-name>geoportalDataEntryServlet</servlet-name>
<url-pattern>/GeoPortalDataEntryApp/geoportaldataentryservice</url-pattern>
</servlet-mapping>
<servlet-mapping>