Changed rpc parameter

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@84225 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-10-25 10:47:17 +00:00
parent 5cb1fd5762
commit b26c7fabf3
3 changed files with 24 additions and 30 deletions

View File

@ -75,6 +75,6 @@ public interface TDGWTService extends RemoteService {
public ArrayList<CSVRowError> checkCSV(long errorsLimit) throws TDGWTServiceException;
public void startCSVImport(boolean[] columnToImportMask) throws TDGWTServiceException;
public void startCSVImport(CSVImportSession s) throws TDGWTServiceException;
}

View File

@ -73,7 +73,7 @@ public interface TDGWTServiceAsync {
void checkCSV(long errorsLimit, AsyncCallback<ArrayList<CSVRowError> > callback);
void startCSVImport(boolean[] columnToImportMask, AsyncCallback<Void> callback);
void startCSVImport(CSVImportSession s, AsyncCallback<Void> callback);
}

View File

@ -78,9 +78,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
protected HttpSession session;
protected ASLSession aslSession;
public void setTabResource(TabResource tabResource)
throws TDGWTServiceException {
try {
@ -115,8 +112,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TabResource currentTR = SessionUtil.getTabResource(session);
if (currentTR == null) {
logger.error(
"CURRENT_TABULAR_RESOURCE is null");
logger.error("CURRENT_TABULAR_RESOURCE is null");
throw new TDGWTServiceException(
"CURRENT_TABULAR_RESOURCE is null");
}
@ -194,7 +190,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
protected void syncTRMetaData(TabularResource tr, TabResource tabResource) {
Date date = Calendar.getInstance().getTime();
tabResource.setDate(sdf.format(date));
@ -208,7 +203,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
tabResource.setTrId(trId);
}
protected void retriveTRMetadataFromService(TabularResource tr)
throws TDGWTServiceException {
retriveTRMetadataFromService(tr, 0);
@ -546,8 +540,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
sdmxImportTabResource.setTrId(trId);
SessionUtil.setSDMXImportTabResource(
session, sdmxImportTabResource);
SessionUtil
.setTabResource(session, sdmxImportTabResource);
SessionUtil.setTabResource(session,
sdmxImportTabResource);
SessionUtil.setTRId(session, trId);
@ -739,7 +733,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
@Override
public void startCSVImport(boolean[] columnToImportMask)
public void startCSVImport(CSVImportSession csvImportSession)
throws TDGWTServiceException {
session = this.getThreadLocalRequest().getSession();
if (session == null) {
@ -763,13 +757,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
"Error retrieving the fileUploadSession: null");
}
importCSVFileOnService(user, fileUploadSession, columnToImportMask);
importCSVFileOnService(user, fileUploadSession, csvImportSession);
}
protected Map<String, Object> csvImportFileParameter(
String fileUrlOnStorage, FileUploadSession fileUploadSession,
boolean[] columnToImportMask) {
CSVImportSession csvImportSession) {
final String ENCODING = "encoding";
final String HASHEADER = "hasHeader";
final String SEPARATOR = "separator";
@ -790,7 +784,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
protected void importCSVFileOnService(String user,
FileUploadSession fileUploadSession, boolean[] columnToImportMask)
FileUploadSession fileUploadSession, CSVImportSession csvImportSession)
throws TDGWTServiceException {
FilesStorage filesStorage = new FilesStorage();
@ -798,7 +792,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
fileUploadSession.getCsvFile());
Map<String, Object> parameterInstance = csvImportFileParameter(
fileUrlOnStorage, fileUploadSession, columnToImportMask);
fileUrlOnStorage, fileUploadSession, csvImportSession);
service = new TabularDataServiceMock();