Fixed package name
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@84022 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a89d3b64a5
commit
486136ca1b
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Codelist;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Dataset;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDGXTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDOpenSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TabResource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.AvailableCharsetList;
|
||||
|
@ -37,44 +37,44 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
|||
@RemoteServiceRelativePath("TDGWTService")
|
||||
public interface TDGWTService extends RemoteService {
|
||||
|
||||
public TabResource getTabResource() throws TDGXTServiceException;
|
||||
public TabResource getTabResource() throws TDGWTServiceException;
|
||||
|
||||
public void setTabResource(TabResource tr) throws TDGXTServiceException;
|
||||
public void setTabResource(TabResource tr) throws TDGWTServiceException;
|
||||
|
||||
public List<TabResource> getTabularResources() throws TDGXTServiceException;
|
||||
public List<TabResource> getTabularResources() throws TDGWTServiceException;
|
||||
|
||||
public TabResource createTabularResource(TabResource tabResource) throws TDGXTServiceException;
|
||||
public TabResource createTabularResource(TabResource tabResource) throws TDGWTServiceException;
|
||||
|
||||
//Open
|
||||
public void setTDOpenSession(TDOpenSession s) throws TDGXTServiceException;
|
||||
public void setTDOpenSession(TDOpenSession s) throws TDGWTServiceException;
|
||||
|
||||
//Import SDMX
|
||||
public ArrayList<Codelist> getCodelists() throws TDGXTServiceException;
|
||||
public ArrayList<Codelist> getCodelists() throws TDGWTServiceException;
|
||||
|
||||
public ArrayList<Dataset> getDatasets() throws TDGXTServiceException;
|
||||
public ArrayList<Dataset> getDatasets() throws TDGWTServiceException;
|
||||
|
||||
public ArrayList<Agencies> getAgencies() throws TDGXTServiceException;
|
||||
public ArrayList<Agencies> getAgencies() throws TDGWTServiceException;
|
||||
|
||||
public void setSDMXSession(SDMXImportSession s) throws TDGXTServiceException;
|
||||
public void setSDMXSession(SDMXImportSession s) throws TDGWTServiceException;
|
||||
|
||||
public SDMXImportMonitor getSDMXImportMonitor() throws TDGXTServiceException;
|
||||
public SDMXImportMonitor getSDMXImportMonitor() throws TDGWTServiceException;
|
||||
|
||||
public void importSDMXClientLibraryRequest(SDMXImportSession s) throws TDGXTServiceException;
|
||||
public void importSDMXClientLibraryRequest(SDMXImportSession s) throws TDGWTServiceException;
|
||||
|
||||
//Import CSV
|
||||
public FileUploadMonitor getFileUploadMonitor() throws TDGXTServiceException;
|
||||
public FileUploadMonitor getFileUploadMonitor() throws TDGWTServiceException;
|
||||
|
||||
public CSVImportMonitor getCSVImportMonitor() throws TDGXTServiceException;
|
||||
public CSVImportMonitor getCSVImportMonitor() throws TDGWTServiceException;
|
||||
|
||||
public void setCSVSession(CSVImportSession s) throws TDGXTServiceException;
|
||||
public void setCSVSession(CSVImportSession s) throws TDGWTServiceException;
|
||||
|
||||
|
||||
public AvailableCharsetList getAvailableCharset() throws TDGXTServiceException;
|
||||
public AvailableCharsetList getAvailableCharset() throws TDGWTServiceException;
|
||||
|
||||
public ArrayList<String> configureCSVParser(String encoding, HeaderPresence headerPresence, char delimiter, char comment) throws TDGXTServiceException;
|
||||
public ArrayList<String> configureCSVParser(String encoding, HeaderPresence headerPresence, char delimiter, char comment) throws TDGWTServiceException;
|
||||
|
||||
public ArrayList<CSVRowError> checkCSV(long errorsLimit) throws TDGXTServiceException;
|
||||
public ArrayList<CSVRowError> checkCSV(long errorsLimit) throws TDGWTServiceException;
|
||||
|
||||
public void startCSVImport(boolean[] columnToImportMask) throws TDGXTServiceException;
|
||||
public void startCSVImport(boolean[] columnToImportMask) throws TDGWTServiceException;
|
||||
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationsId;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Codelist;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Dataset;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDGXTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TDOpenSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.TabResource;
|
||||
|
@ -78,7 +78,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
protected ASLSession aslSession;
|
||||
|
||||
public void setTabResource(TabResource tabResource)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
SessionUtil.setTabResource(session, tabResource);
|
||||
|
@ -88,7 +88,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error setting TabResource parameter: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error setting TabResource parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public TabResource getTabResource() throws TDGXTServiceException {
|
||||
public TabResource getTabResource() throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.getTabResource(session);
|
||||
|
@ -107,7 +107,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error setting TabResource parameter: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error setting TabResource parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
*/
|
||||
|
||||
@Override
|
||||
public void setTDOpenSession(TDOpenSession s) throws TDGXTServiceException {
|
||||
public void setTDOpenSession(TDOpenSession s) throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
SessionUtil.setTDOpenSession(session, s);
|
||||
|
@ -168,14 +168,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} catch (Exception e) {
|
||||
logger.error("Error setting TDOpenSession parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error setting TDOpenSession parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected TabResource retriveTRMetadataFromService(TabularResource tr, int i)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
NameMetadata nameMeta;
|
||||
RightsMetadata rightsMeta;
|
||||
|
@ -190,13 +190,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
rightsMeta = tr.getMetadata(RightsMetadata.class);
|
||||
} catch (NoSuchMetadataException e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retriving metadata from service: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
if (nameMeta == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retriving metadata from service: TR nameMeta is null");
|
||||
}
|
||||
String nameTR = nameMeta.getValue();
|
||||
|
@ -230,7 +230,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public ArrayList<TabResource> getTabularResources()
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
aslSession = SessionUtil.getAslSession(session);
|
||||
|
@ -253,7 +253,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} catch (Exception e) {
|
||||
logger.error("Error retrieving TabularResources: "
|
||||
+ e.getLocalizedMessage());
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving TabularResources: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -264,18 +264,18 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
/**
|
||||
*
|
||||
* @param tabResource
|
||||
* @throws TDGXTServiceException
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
|
||||
public void removeTabularResource(TabResource tabResource)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
if (tabResource == null) {
|
||||
logger.error("Error removing TabularResource: tabResource is null");
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error removing TabularResource no parameters set");
|
||||
}
|
||||
TabularDataService service = new TabularDataServiceMock();
|
||||
|
@ -287,7 +287,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error removing TabularResource: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException("Error removing TabularResource: "
|
||||
throw new TDGWTServiceException("Error removing TabularResource: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
@ -299,14 +299,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public TabResource createTabularResource(TabResource tabResource)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
if (tabResource == null) {
|
||||
logger.error("Error creating new TabularResource: tabResource is null");
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error creating new TabularResource no parameters set");
|
||||
}
|
||||
service = new TabularDataServiceMock();
|
||||
|
@ -322,7 +322,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error creating new TabularResource: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error creating new TabularResource: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -333,13 +333,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* jar {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Codelist> getCodelists() throws TDGXTServiceException {
|
||||
public ArrayList<Codelist> getCodelists() throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.retrieveCodelists(session);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException("Error retrieving codelists: "
|
||||
throw new TDGWTServiceException("Error retrieving codelists: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -349,13 +349,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Dataset> getDatasets() throws TDGXTServiceException {
|
||||
public ArrayList<Dataset> getDatasets() throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.retrieveDatasets(session);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException("Error retrieving datasets: "
|
||||
throw new TDGWTServiceException("Error retrieving datasets: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -365,13 +365,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Agencies> getAgencies() throws TDGXTServiceException {
|
||||
public ArrayList<Agencies> getAgencies() throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
return SessionUtil.retrieveAgencies(session);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException("Error retrieving datasets: "
|
||||
throw new TDGWTServiceException("Error retrieving datasets: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public void importSDMXClientLibraryRequest(
|
||||
SDMXImportSession sdmxImportSession) throws TDGXTServiceException {
|
||||
SDMXImportSession sdmxImportSession) throws TDGWTServiceException {
|
||||
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -439,13 +439,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
return;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException("Error in Client Library Request: "
|
||||
throw new TDGWTServiceException("Error in Client Library Request: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected EligibleOperation getEligibleOperationWithId(String op,
|
||||
List<EligibleOperation> capabilities) throws TDGXTServiceException {
|
||||
List<EligibleOperation> capabilities) throws TDGWTServiceException {
|
||||
for (EligibleOperation operation : capabilities) {
|
||||
if (Long.valueOf(op) == operation.getOperationDescriptor()
|
||||
.getOperationId().getValue()) {
|
||||
|
@ -454,13 +454,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
;
|
||||
|
||||
}
|
||||
throw new TDGXTServiceException("ElegibleOperation not found");
|
||||
throw new TDGWTServiceException("ElegibleOperation not found");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SDMXImportMonitor getSDMXImportMonitor()
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
aslSession = SessionUtil.getAslSession(session);
|
||||
|
@ -471,16 +471,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
SDMXImportMonitor importMonitor = new SDMXImportMonitor();
|
||||
if (trId == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error in importSDMX TabularResource Id null");
|
||||
} else {
|
||||
if (task == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error in importSDMX task null");
|
||||
} else {
|
||||
ActivityStatus status = task.getStatus();
|
||||
if (status == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error in importSDMX Status null");
|
||||
} else {
|
||||
importMonitor.setStatus(task.getStatus().ordinal());
|
||||
|
@ -527,7 +527,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
return importMonitor;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error in importSDMX ImportMonitor: "
|
||||
+ e.getLocalizedMessage());
|
||||
|
||||
|
@ -537,7 +537,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public void setSDMXSession(SDMXImportSession sdmxImportSession)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
SessionUtil.setSDMXImportSession(session, sdmxImportSession);
|
||||
|
@ -547,7 +547,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error setting SDMXImportSession parameter: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error setting SDMXImportSession parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public void setCSVSession(CSVImportSession importSession)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
SessionUtil.setCSVImportSession(session, importSession);
|
||||
|
@ -571,7 +571,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.error(
|
||||
"Error setting SDMXImportSession parameter: "
|
||||
+ e.getLocalizedMessage(), e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error setting SDMXImportSession parameter: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -580,27 +580,27 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public FileUploadMonitor getFileUploadMonitor()
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
FileUploadSession fileUploadSession = SessionUtil
|
||||
.getFileUploadSession(session);
|
||||
if (fileUploadSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the fileUploadSession: null");
|
||||
}
|
||||
return fileUploadSession.getFileUploadMonitor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CSVImportMonitor getCSVImportMonitor() throws TDGXTServiceException {
|
||||
public CSVImportMonitor getCSVImportMonitor() throws TDGWTServiceException {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.info("Session:" + session.getId());
|
||||
|
@ -608,7 +608,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
FileUploadSession importSession = SessionUtil
|
||||
.getFileUploadSession(session);
|
||||
if (importSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the fileUploadSession: null");
|
||||
}
|
||||
return importSession.getCsvImportMonitor();
|
||||
|
@ -616,10 +616,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public AvailableCharsetList getAvailableCharset()
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.info("Session:" + session.getId());
|
||||
|
@ -632,10 +632,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
@Override
|
||||
public ArrayList<String> configureCSVParser(String encoding,
|
||||
HeaderPresence headerPresence, char delimiter, char comment)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.info("Session:" + session.getId());
|
||||
|
@ -646,7 +646,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
FileUploadSession fileUploadSession = SessionUtil
|
||||
.getFileUploadSession(session);
|
||||
if (fileUploadSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the fileUploadSession: null");
|
||||
}
|
||||
CSVParserConfiguration parserConfiguration = fileUploadSession
|
||||
|
@ -666,7 +666,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
fileUploadSession.getParserConfiguration());
|
||||
} catch (Exception e) {
|
||||
logger.error("Error retrieving the CSV header", e);
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error calculating the CSV header: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
@ -674,18 +674,18 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public ArrayList<CSVRowError> checkCSV(long errorsLimit)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.info("Session:" + session.getId());
|
||||
FileUploadSession fileUploadSession = SessionUtil
|
||||
.getFileUploadSession(session);
|
||||
if (fileUploadSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the fileUploadSession: null");
|
||||
}
|
||||
|
||||
|
@ -694,7 +694,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
fileUploadSession.getParserConfiguration(), errorsLimit);
|
||||
} catch (Exception e) {
|
||||
logger.error("Error checking the CSV file", e);
|
||||
throw new TDGXTServiceException("Error checking the CSV file: "
|
||||
throw new TDGWTServiceException("Error checking the CSV file: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -702,17 +702,17 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
@Override
|
||||
public void startCSVImport(boolean[] columnToImportMask)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
if (session == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the session: null");
|
||||
}
|
||||
logger.info("Session:" + session.getId());
|
||||
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
if (aslSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the asl session: null");
|
||||
}
|
||||
String user = aslSession.getUsername();
|
||||
|
@ -721,7 +721,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
FileUploadSession fileUploadSession = SessionUtil
|
||||
.getFileUploadSession(session);
|
||||
if (fileUploadSession == null) {
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving the fileUploadSession: null");
|
||||
}
|
||||
|
||||
|
@ -754,7 +754,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
protected void importCSVFileOnService(String user,
|
||||
FileUploadSession fileUploadSession, boolean[] columnToImportMask)
|
||||
throws TDGXTServiceException {
|
||||
throws TDGWTServiceException {
|
||||
FilesStorage filesStorage = new FilesStorage();
|
||||
|
||||
String fileUrlOnStorage = filesStorage.storageCSVTempFile(user,
|
||||
|
@ -780,7 +780,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
trTask = service.execute(oi, tabularResource.getId());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGXTServiceException(
|
||||
throw new TDGWTServiceException(
|
||||
"Tabular Data Service error creating TabularResource: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
|
|
@ -7,21 +7,21 @@ package org.gcube.portlets.user.td.gwtservice.shared;
|
|||
* @author "Federico De Faveri defaveri@isti.cnr.it"
|
||||
*
|
||||
*/
|
||||
public class TDGXTServiceException extends Exception {
|
||||
public class TDGWTServiceException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -9066034060104406559L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public TDGXTServiceException() {
|
||||
public TDGWTServiceException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public TDGXTServiceException(String message) {
|
||||
public TDGWTServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
Loading…
Reference in New Issue