Service name refactoring

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@76401 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Federico De Faveri 2013-05-29 10:07:03 +00:00
parent 084f4eaf5b
commit e87dff2fdc
11 changed files with 105 additions and 50 deletions

View File

@ -5,10 +5,10 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="tabular-data-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget/tabular-data-widget">
<dependent-module archiveName="td-importer-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/td-importer-widget/td-importer-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="sdmx-import-wizard-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/sdmx-import-wizard/sdmx-import-wizard">
<dependent-module archiveName="td-csv-importer-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/td-csv-importer-widget/td-csv-importer-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="csv-import-wizard-gxt3-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/csv-import-wizard-gxt3/csv-import-wizard-gxt3">
@ -23,6 +23,9 @@
<dependent-module archiveName="workspace-light-tree-gxt3-2.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-light-tree-gxt3/workspace-light-tree-gxt3">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="sdmx-import-wizard-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/sdmx-import-wizard/sdmx-import-wizard">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="tabular-data-portlet"/>
</wb-module>

51
pom.xml
View File

@ -53,7 +53,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
<scope>runtime</scope>
</dependency>
<!-- PORTAL -->
@ -65,6 +65,18 @@
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- WORKSPACE -->
<dependency>
@ -84,31 +96,34 @@
<version>[1.1.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- IMPORTER WIDGET -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>td-importer-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT]</version>
</dependency>
<!-- CSV IMPORTER WIDGET -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>td-csv-importer-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT]</version>
</dependency>
<!-- SDMX IMPORT WIZARD -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>sdmx-import-wizard</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- CSV IMPORT WIZARD -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>csv-import-wizard-gxt3</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>csv-import-wizard-workspace-gxt3</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

View File

@ -5,15 +5,14 @@ package org.gcube.portlets.user.td.client;
import java.util.List;
import org.gcube.portlets.user.csvimportwizardgxt3.client.ImportWizard;
import org.gcube.portlets.user.csvimportwizardgxt3.client.general.WizardListener;
import org.gcube.portlets.user.csvimportwizardgxt3.client.source.local.LocalSource;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXImportWizardWindow;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXWizardSelectionEvent;
import org.gcube.portlets.user.sdmximportwizard.client.SDMXWizardSelectionEvent.WizardSelectionHandler;
import org.gcube.portlets.user.sdmximportwizard.shared.Dataset;
import org.gcube.portlets.user.td.ciw.client.CSVImporterWidget;
import org.gcube.portlets.user.td.client.event.ImportTableEvent;
import org.gcube.portlets.user.td.client.event.ImportTableType;
import org.gcube.portlets.user.td.importer.client.TabularDataImporterListener;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
@ -108,26 +107,27 @@ public class TabularDataController {
@Override
public void onSuccess() {*/
ImportWizard importWizard = new ImportWizard("DemoCSVTarget", LocalSource.INSTANCE);
importWizard.addListener(new WizardListener() {
CSVImporterWidget csvImporterWidget = new CSVImporterWidget();
csvImporterWidget.show(new TabularDataImporterListener() {
@Override
public void failed(Throwable throwable, String reason, String details) {
System.out.println("FAILED reason: "+reason+" details: "+details+" throwable: "+throwable);
// TODO Auto-generated method stub
}
@Override
public void completed() {
System.out.println("COMPLETED");
// TODO Auto-generated method stub
}
@Override
public void aborted() {
System.out.println("ABORT");
// TODO Auto-generated method stub
}
});
importWizard.show();
/*}

View File

@ -1,7 +1,7 @@
package org.gcube.portlets.user.td.client;
import org.gcube.portlets.user.td.client.rpc.GreetingService;
import org.gcube.portlets.user.td.client.rpc.GreetingServiceAsync;
import org.gcube.portlets.user.td.client.rpc.TabularDataService;
import org.gcube.portlets.user.td.client.rpc.TabularDataServiceAsync;
import org.gcube.portlets.user.td.client.toolbar.TabularDataTooBar;
import org.gcube.portlets.user.tdw.client.TabularData;
import org.gcube.portlets.user.tdw.client.TabularDataGridPanel;
@ -53,7 +53,7 @@ public class TabularDataPortlet 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 TabularDataServiceAsync greetingService = GWT.create(TabularDataService.class);
/**

View File

@ -6,7 +6,7 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*/
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
@RemoteServiceRelativePath("tds")
public interface TabularDataService extends RemoteService {
String greetServer(String name) throws IllegalArgumentException;
}

View File

@ -9,11 +9,11 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public interface GreetingServiceAsync {
public interface TabularDataServiceAsync {
/**
*
* @see org.gcube.portlets.user.td.client.rpc.GreetingService#greetServer(java.lang.String)
* @see org.gcube.portlets.user.td.client.rpc.TabularDataService#greetServer(java.lang.String)
*/
void greetServer(String name, AsyncCallback<String> callback);

View File

@ -5,7 +5,9 @@ import javax.servlet.ServletException;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portlets.user.csvimportwizardgxt3.server.csv.CSVTargetRegistry;
import org.gcube.portlets.user.csvimportwizardgxt3.server.csv.DemoCSVTarget;
import org.gcube.portlets.user.td.client.rpc.GreetingService;
import org.gcube.portlets.user.td.ciw.server.CSVTDImporter;
import org.gcube.portlets.user.td.client.rpc.TabularDataService;
import org.gcube.portlets.user.td.importer.server.TabularDataImporterManager;
import org.gcube.portlets.user.td.shared.FieldVerifier;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@ -13,7 +15,7 @@ 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 TabularDataServiceImpl extends RemoteServiceServlet implements TabularDataService {
/**
* {@inheritDoc}
@ -21,9 +23,16 @@ public class GreetingServiceImpl extends RemoteServiceServlet implements Greetin
@Override
public void init() throws ServletException {
super.init();
System.out.println("initializing the TabularDataImporterManager");
TabularDataImporterManager importerManager = new TabularDataImporterManager();
//importerManager.scanAvailableImporters();
importerManager.add(new CSVTDImporter());
importerManager.setupImporters();
//register the demo csv target
CSVTargetRegistry.getInstance().add(new DemoCSVTarget());
System.out.println("Registered DemoCSVTarget");
//CSVTargetRegistry.getInstance().add(new DemoCSVTarget());
//System.out.println("Registered DemoCSVTarget");
ScopeProvider.instance.set("/gcube/devsec");
}

View File

@ -7,3 +7,5 @@ log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} [%t,%M:%L] %m%n
log4j.logger.org.gcube.portlets.user=TRACE, A1

View File

@ -9,8 +9,7 @@
<!-- <inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' /> -->
<inherits name="org.gcube.portlets.user.tdw.TabularDataWidget" />
<inherits name='org.gcube.portlets.user.sdmximportwizard.sdmximportwizard' />
<inherits name="org.gcube.portlets.user.csvimportwizardgxt3.csvimportwizardgxt3" />
<inherits name="org.gcube.portlets.user.csvimportwizardgxt3.ws.csvimportwizardworkspacegxt3" />
<inherits name='org.gcube.portlets.user.td.ciw.csvimporterwidget' />
<!-- Specify the app entry point class. -->
<entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' />

View File

@ -7,14 +7,14 @@
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.td.server.GreetingServiceImpl</servlet-class>
<servlet-name>tdservlet</servlet-name>
<servlet-class>org.gcube.portlets.user.td.server.TabularDataServiceImpl</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/tabulardataportlet/greet</url-pattern>
<servlet-name>tdservlet</servlet-name>
<url-pattern>/tabulardataportlet/tds</url-pattern>
</servlet-mapping>
<!-- Workspace Tree

View File

@ -0,0 +1,27 @@
/**
*
*/
package org.gcube.portlets.user.td;
import org.gcube.portlets.user.td.importer.server.TabularDataImporter;
import org.gcube.portlets.user.td.importer.server.TabularDataImporterManager;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public class TestManager {
/**
* @param args
*/
public static void main(String[] args) {
TabularDataImporterManager importerManager = new TabularDataImporterManager();
//importerManager.scanAvailableImporters();
System.out.println("Importers:");
for (TabularDataImporter importer:importerManager.getImporters()) System.out.println(importer.getName());
}
}