Fixed Registry Source
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@86533 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fb8f581f32
commit
ef27461516
|
@ -18,6 +18,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
|
@ -67,7 +68,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @param tr
|
* @param tr
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void setTabResource(TabResource tabResource) throws TDGWTServiceException;
|
public void setTabResource(TabResource tabResource)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a TabResource on Service
|
* Creates a TabResource on Service
|
||||||
|
@ -79,7 +81,6 @@ public interface TDGWTService extends RemoteService {
|
||||||
public TabResource createTabularResource(TabResource tabResource)
|
public TabResource createTabularResource(TabResource tabResource)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Last Table
|
* Return Last Table
|
||||||
*
|
*
|
||||||
|
@ -89,7 +90,6 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public TableData getLastTable(TRId trId) throws TDGWTServiceException;
|
public TableData getLastTable(TRId trId) throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Metadata of Table
|
* Return Metadata of Table
|
||||||
*
|
*
|
||||||
|
@ -97,8 +97,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public ArrayList<TabMetadata> getTableMetadata(TRId trId) throws TDGWTServiceException;
|
public ArrayList<TabMetadata> getTableMetadata(TRId trId)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Metadata of Tabular Resources
|
* Return Metadata of Tabular Resources
|
||||||
|
@ -107,9 +107,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public ArrayList<TRMetadata> getTRMetadata(TRId trId) throws TDGWTServiceException;
|
public ArrayList<TRMetadata> getTRMetadata(TRId trId)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
// Open
|
// Open
|
||||||
|
|
||||||
|
@ -119,7 +118,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public ArrayList<TabResource> getTabularResources() throws TDGWTServiceException;
|
public ArrayList<TabResource> getTabularResources()
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set open session for return all tabular resource of a user
|
* Set open session for return all tabular resource of a user
|
||||||
|
@ -127,7 +127,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @param s
|
* @param s
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void startTDOpen(TDOpenSession tdOpenSession) throws TDGWTServiceException;
|
public void startTDOpen(TDOpenSession tdOpenSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the list of columns in the current table
|
* Retrieves the list of columns in the current table
|
||||||
|
@ -145,7 +146,7 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public void removeTabularResource(TRId trId) throws TDGWTServiceException;
|
public void removeTabularResource(TRId trId) throws TDGWTServiceException;
|
||||||
|
|
||||||
// Import SDMX
|
// SDMX
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Codelist on a registry
|
* Get Codelist on a registry
|
||||||
|
@ -172,16 +173,16 @@ public interface TDGWTService extends RemoteService {
|
||||||
public ArrayList<Agencies> getAgencies() throws TDGWTServiceException;
|
public ArrayList<Agencies> getAgencies() throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SDMXImportSession for SDMX Import
|
* Set SDMX Registry Source
|
||||||
*
|
*
|
||||||
* @param s
|
* @param s
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void setSDMXSession(SDMXImportSession sdmxImportSession)
|
public void setSDMXRegistrySource(SDMXRegistrySource sdmxRegistrySource)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
|
// Import SDMX
|
||||||
/**
|
/**
|
||||||
* Start SDMX Import and invokes the client library
|
* Start SDMX Import and invokes the client library
|
||||||
*
|
*
|
||||||
|
@ -191,7 +192,6 @@ public interface TDGWTService extends RemoteService {
|
||||||
public void startSDMXImport(SDMXImportSession sdmxImportSession)
|
public void startSDMXImport(SDMXImportSession sdmxImportSession)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Operation Monitor during the SDMX Import operation
|
* Get Operation Monitor during the SDMX Import operation
|
||||||
*
|
*
|
||||||
|
@ -216,16 +216,16 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @param s
|
* @param s
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void setCSVSession(CSVImportSession csvImportSession) throws TDGWTServiceException;
|
public void setCSVSession(CSVImportSession csvImportSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param s
|
* @param s
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void getFileFromWorkspace(CSVImportSession csvImportSession) throws TDGWTServiceException;
|
public void getFileFromWorkspace(CSVImportSession csvImportSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -263,7 +263,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @param s
|
* @param s
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void startCSVImport(CSVImportSession csvImportSession) throws TDGWTServiceException;
|
public void startCSVImport(CSVImportSession csvImportSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Operation Monitor during the CSV Import operation
|
* Get Operation Monitor during the CSV Import operation
|
||||||
|
@ -273,8 +274,7 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public CSVImportMonitor getCSVImportMonitor() throws TDGWTServiceException;
|
public CSVImportMonitor getCSVImportMonitor() throws TDGWTServiceException;
|
||||||
|
|
||||||
|
// Export CSV
|
||||||
//Export CSV
|
|
||||||
/**
|
/**
|
||||||
* Get Operation Monitor during the CSV Export operation
|
* Get Operation Monitor during the CSV Export operation
|
||||||
*
|
*
|
||||||
|
@ -283,27 +283,24 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public CSVExportMonitor getCSVExportMonitor() throws TDGWTServiceException;
|
public CSVExportMonitor getCSVExportMonitor() throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start CSV Export and invokes the client library
|
* Start CSV Export and invokes the client library
|
||||||
*
|
*
|
||||||
* @param csvExportSession
|
* @param csvExportSession
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void startCSVExport(CSVExportSession csvExportSession) throws TDGWTServiceException;
|
public void startCSVExport(CSVExportSession csvExportSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
// Export SDMX
|
||||||
|
|
||||||
//Export SDMX
|
|
||||||
/**
|
/**
|
||||||
* Get Operation Monitor during the SDMX Export operation
|
* Get Operation Monitor during the SDMX Export operation
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public SDMXExportMonitor getSDMXExportMonitor() throws TDGWTServiceException;
|
public SDMXExportMonitor getSDMXExportMonitor()
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start SDMX Export and invokes the client library
|
* Start SDMX Export and invokes the client library
|
||||||
|
@ -311,7 +308,7 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @param sdmxExportSession
|
* @param sdmxExportSession
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void startSDMXExport(SDMXExportSession exportSession) throws TDGWTServiceException;
|
public void startSDMXExport(SDMXExportSession exportSession)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
|
@ -64,15 +65,16 @@ public interface TDGWTServiceAsync {
|
||||||
//Open
|
//Open
|
||||||
void startTDOpen(TDOpenSession tdOpenSession, AsyncCallback<Void> callback);
|
void startTDOpen(TDOpenSession tdOpenSession, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
//Import SDMX
|
//SDMX
|
||||||
void getCodelists(AsyncCallback<ArrayList<Codelist>> callback);
|
void getCodelists(AsyncCallback<ArrayList<Codelist>> callback);
|
||||||
|
|
||||||
void getDatasets(AsyncCallback<ArrayList<Dataset>> callback);
|
void getDatasets(AsyncCallback<ArrayList<Dataset>> callback);
|
||||||
|
|
||||||
void getAgencies(AsyncCallback<ArrayList<Agencies>> callback);
|
void getAgencies(AsyncCallback<ArrayList<Agencies>> callback);
|
||||||
|
|
||||||
void setSDMXSession(SDMXImportSession sdmxImportSession, AsyncCallback<Void> callback);
|
void setSDMXRegistrySource(SDMXRegistrySource sdmxRegistrySource, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
|
//Import SDMX
|
||||||
void getSDMXImportMonitor(AsyncCallback<SDMXImportMonitor> callback);
|
void getSDMXImportMonitor(AsyncCallback<SDMXImportMonitor> callback);
|
||||||
|
|
||||||
void startSDMXImport(SDMXImportSession sdmxImportSession,AsyncCallback<Void> callback);
|
void startSDMXImport(SDMXImportSession sdmxImportSession,AsyncCallback<Void> callback);
|
||||||
|
|
|
@ -31,8 +31,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi" <a
|
* @author "Giancarlo Panichi" <a
|
||||||
|
@ -42,31 +40,29 @@ import org.slf4j.LoggerFactory;
|
||||||
public class SessionUtil {
|
public class SessionUtil {
|
||||||
|
|
||||||
protected static final String CURRENT_TABULAR_RESOURCE = "CURRENT_TABULAR_RESOURCE";
|
protected static final String CURRENT_TABULAR_RESOURCE = "CURRENT_TABULAR_RESOURCE";
|
||||||
protected static final String CURRENT_TR_ID= "CURRENT_TR_ID";
|
protected static final String CURRENT_TR_ID = "CURRENT_TR_ID";
|
||||||
protected static final String TDOPEN_SESSION = "TDOPEN_SESSION";
|
protected static final String TDOPEN_SESSION = "TDOPEN_SESSION";
|
||||||
protected static final String TABULAR_RESOURCE_LIST = "TABULAR_RESOURCE_LIST";
|
protected static final String TABULAR_RESOURCE_LIST = "TABULAR_RESOURCE_LIST";
|
||||||
|
|
||||||
protected static final String TR_TASK_MANAGER= "TR_TASK_MANAGER";
|
protected static final String TR_TASK_MANAGER = "TR_TASK_MANAGER";
|
||||||
|
|
||||||
|
protected static final String SDMX_REGISTRY_SOURCE = "SDMX_REGISTRY_SOURCE";
|
||||||
|
|
||||||
protected static final String SDMX_CLIENT_ATTRIBUTE = "SDMX_CLIENT";
|
protected static final String SDMX_CLIENT_ATTRIBUTE = "SDMX_CLIENT";
|
||||||
protected static final String SDMX_IMPORT_SESSION = "SDMX_IMPORT";
|
protected static final String SDMX_IMPORT_SESSION = "SDMX_IMPORT";
|
||||||
protected static final String SDMX_IMPORT_TABULAR_RESOURCE = "SDMX_IMPORT_TABULAR_RESOURCE";
|
protected static final String SDMX_IMPORT_TABULAR_RESOURCE = "SDMX_IMPORT_TABULAR_RESOURCE";
|
||||||
protected static final String SDMX_IMPORT_TASK="SDMX_IMPORT_TASK";
|
protected static final String SDMX_IMPORT_TASK = "SDMX_IMPORT_TASK";
|
||||||
|
|
||||||
protected static final String SDMX_EXPORT_SESSION = "SDMX_EXPORT_SESSION";
|
protected static final String SDMX_EXPORT_SESSION = "SDMX_EXPORT_SESSION";
|
||||||
protected static final String SDMX_EXPORT_TASK="SDMX_EXPORT_TASK";
|
protected static final String SDMX_EXPORT_TASK = "SDMX_EXPORT_TASK";
|
||||||
|
|
||||||
protected static final String CSV_IMPORT_SESSION = "CSV_IMPORT";
|
protected static final String CSV_IMPORT_SESSION = "CSV_IMPORT";
|
||||||
protected static final String CSV_IMPORT_FILE_UPLOAD_SESSION = "CSV_IMPORT_FILE_UPLOAD";
|
protected static final String CSV_IMPORT_FILE_UPLOAD_SESSION = "CSV_IMPORT_FILE_UPLOAD";
|
||||||
protected static final String CSV_IMPORT_TASK="CSV_IMPORT_TASK";
|
protected static final String CSV_IMPORT_TASK = "CSV_IMPORT_TASK";
|
||||||
protected static final String CSV_IMPORT_TABULAR_RESOURCE = "CSV_IMPORT_TABULAR_RESOURCE";
|
protected static final String CSV_IMPORT_TABULAR_RESOURCE = "CSV_IMPORT_TABULAR_RESOURCE";
|
||||||
|
|
||||||
protected static final String CSV_EXPORT_SESSION = "CSV_EXPORT_SESSION";
|
protected static final String CSV_EXPORT_SESSION = "CSV_EXPORT_SESSION";
|
||||||
protected static final String CSV_EXPORT_TASK="CSV_EXPORT_TASK";
|
protected static final String CSV_EXPORT_TASK = "CSV_EXPORT_TASK";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected static Logger logger = LoggerFactory.getLogger(SessionUtil.class);
|
protected static Logger logger = LoggerFactory.getLogger(SessionUtil.class);
|
||||||
|
|
||||||
|
@ -85,16 +81,15 @@ public class SessionUtil {
|
||||||
session.setScope(scope);
|
session.setScope(scope);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
session= SessionManager.getInstance().getASLSession(
|
session = SessionManager.getInstance().getASLSession(
|
||||||
httpSession.getId(), username);
|
httpSession.getId(), username);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("SessionUtil: aslSession "+session.getUsername()+" "+session.getScope());
|
logger.info("SessionUtil: aslSession " + session.getUsername() + " "
|
||||||
|
+ session.getScope());
|
||||||
return session;
|
return session;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTDOpenSession(HttpSession httpSession, TDOpenSession s) {
|
public static void setTDOpenSession(HttpSession httpSession, TDOpenSession s) {
|
||||||
|
@ -109,7 +104,6 @@ public class SessionUtil {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void retrieveResources(HttpSession httpSession)
|
public static void retrieveResources(HttpSession httpSession)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
|
@ -188,8 +182,7 @@ public class SessionUtil {
|
||||||
ScopeProvider.instance.set(aslSession.getScope().toString());
|
ScopeProvider.instance.set(aslSession.getScope().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// //
|
||||||
////
|
|
||||||
public static TabResource getCSVImportTabResource(HttpSession httpSession) {
|
public static TabResource getCSVImportTabResource(HttpSession httpSession) {
|
||||||
TabResource tabResource = (TabResource) httpSession
|
TabResource tabResource = (TabResource) httpSession
|
||||||
.getAttribute(CSV_IMPORT_TABULAR_RESOURCE);
|
.getAttribute(CSV_IMPORT_TABULAR_RESOURCE);
|
||||||
|
@ -210,8 +203,7 @@ public class SessionUtil {
|
||||||
ScopeProvider.instance.set(aslSession.getScope().toString());
|
ScopeProvider.instance.set(aslSession.getScope().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
// //
|
||||||
|
|
||||||
|
|
||||||
public static void setSDMXImportSession(HttpSession httpSession,
|
public static void setSDMXImportSession(HttpSession httpSession,
|
||||||
SDMXImportSession s) {
|
SDMXImportSession s) {
|
||||||
|
@ -255,7 +247,6 @@ public class SessionUtil {
|
||||||
return importSession;
|
return importSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void setCSVExportSession(HttpSession httpSession,
|
public static void setCSVExportSession(HttpSession httpSession,
|
||||||
CSVExportSession s) {
|
CSVExportSession s) {
|
||||||
|
|
||||||
|
@ -298,7 +289,6 @@ public class SessionUtil {
|
||||||
return exportSession;
|
return exportSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void setFileUploadSession(HttpSession httpSession,
|
public static void setFileUploadSession(HttpSession httpSession,
|
||||||
FileUploadSession s) {
|
FileUploadSession s) {
|
||||||
|
|
||||||
|
@ -311,7 +301,6 @@ public class SessionUtil {
|
||||||
ScopeProvider.instance.set(aslSession.getScope().toString());
|
ScopeProvider.instance.set(aslSession.getScope().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static FileUploadSession getFileUploadSession(HttpSession httpSession) {
|
public static FileUploadSession getFileUploadSession(HttpSession httpSession) {
|
||||||
FileUploadSession fileUploadSession = (FileUploadSession) httpSession
|
FileUploadSession fileUploadSession = (FileUploadSession) httpSession
|
||||||
.getAttribute(CSV_IMPORT_FILE_UPLOAD_SESSION);
|
.getAttribute(CSV_IMPORT_FILE_UPLOAD_SESSION);
|
||||||
|
@ -321,7 +310,6 @@ public class SessionUtil {
|
||||||
return fileUploadSession;
|
return fileUploadSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<Codelist> retrieveCodelists(HttpSession httpSession)
|
public static ArrayList<Codelist> retrieveCodelists(HttpSession httpSession)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
logger.info("SessionUtil retriveCodelists");
|
logger.info("SessionUtil retriveCodelists");
|
||||||
|
@ -349,17 +337,39 @@ public class SessionUtil {
|
||||||
return client.getAllAgencies();
|
return client.getAllAgencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void setSDMXRegistrySource(HttpSession httpSession,
|
||||||
|
SDMXRegistrySource sdmxRegistrySource) {
|
||||||
|
|
||||||
|
SDMXRegistrySource source = (SDMXRegistrySource) httpSession
|
||||||
|
.getAttribute(SDMX_REGISTRY_SOURCE);
|
||||||
|
if (source != null)
|
||||||
|
httpSession.removeAttribute(SDMX_REGISTRY_SOURCE);
|
||||||
|
httpSession.setAttribute(SDMX_REGISTRY_SOURCE, sdmxRegistrySource);
|
||||||
|
ASLSession aslSession = getAslSession(httpSession);
|
||||||
|
ScopeProvider.instance.set(aslSession.getScope().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SDMXRegistrySource getSDMXRegistrySource(HttpSession httpSession) {
|
||||||
|
SDMXRegistrySource sdmxRegistrySource = (SDMXRegistrySource) httpSession
|
||||||
|
.getAttribute(SDMX_REGISTRY_SOURCE);
|
||||||
|
if (sdmxRegistrySource == null) {
|
||||||
|
logger.error("SDMXRegistrySource was not acquired");
|
||||||
|
}
|
||||||
|
return sdmxRegistrySource;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static SDMXClient getSdmxClient(HttpSession httpSession) {
|
public static SDMXClient getSdmxClient(HttpSession httpSession) {
|
||||||
SDMXClient sdmxClient = (SDMXClient) httpSession
|
SDMXClient sdmxClient = (SDMXClient) httpSession
|
||||||
.getAttribute(SDMX_CLIENT_ATTRIBUTE);
|
.getAttribute(SDMX_CLIENT_ATTRIBUTE);
|
||||||
SDMXImportSession sdmxImportSession = (SDMXImportSession) httpSession
|
SDMXRegistrySource sdmxRegistrySource = (SDMXRegistrySource) httpSession
|
||||||
.getAttribute(SDMX_IMPORT_SESSION);
|
.getAttribute(SDMX_REGISTRY_SOURCE);
|
||||||
if (sdmxImportSession == null) {
|
if (sdmxRegistrySource == null) {
|
||||||
logger.error("SDMXImportSession was not acquired");
|
logger.error("SDMXRegistrySource was not acquired");
|
||||||
} else {
|
} else {
|
||||||
if (sdmxImportSession.getSource() instanceof SDMXRegistrySource) {
|
String url = sdmxRegistrySource
|
||||||
String url = ((SDMXRegistrySource) sdmxImportSession
|
.getUrl();
|
||||||
.getSource()).getUrl();
|
|
||||||
if (url == null || url.isEmpty()) {
|
if (url == null || url.isEmpty()) {
|
||||||
if (sdmxClient == null) {
|
if (sdmxClient == null) {
|
||||||
sdmxClient = new SDMXClient();
|
sdmxClient = new SDMXClient();
|
||||||
|
@ -382,9 +392,7 @@ public class SessionUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
httpSession.setAttribute(SDMX_CLIENT_ATTRIBUTE, sdmxClient);
|
httpSession.setAttribute(SDMX_CLIENT_ATTRIBUTE, sdmxClient);
|
||||||
} else {
|
|
||||||
logger.error("SDMXImportSession does not have a SDMXRegistrySource");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return sdmxClient;
|
return sdmxClient;
|
||||||
|
@ -405,7 +413,6 @@ public class SessionUtil {
|
||||||
httpSession.setAttribute(SDMX_IMPORT_TASK, task);
|
httpSession.setAttribute(SDMX_IMPORT_TASK, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Task getCSVImportFileTask(HttpSession httpSession) {
|
public static Task getCSVImportFileTask(HttpSession httpSession) {
|
||||||
Task monitor = (Task) httpSession.getAttribute(CSV_IMPORT_TASK);
|
Task monitor = (Task) httpSession.getAttribute(CSV_IMPORT_TASK);
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
|
@ -452,18 +459,21 @@ public class SessionUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TRTasksManager getTRTasksManager(HttpSession httpSession) {
|
public static TRTasksManager getTRTasksManager(HttpSession httpSession) {
|
||||||
TRTasksManager tasksManager = (TRTasksManager) httpSession.getAttribute(TR_TASK_MANAGER);
|
TRTasksManager tasksManager = (TRTasksManager) httpSession
|
||||||
|
.getAttribute(TR_TASK_MANAGER);
|
||||||
if (tasksManager != null) {
|
if (tasksManager != null) {
|
||||||
return tasksManager;
|
return tasksManager;
|
||||||
} else {
|
} else {
|
||||||
tasksManager=new TRTasksManager();
|
tasksManager = new TRTasksManager();
|
||||||
httpSession.setAttribute(TR_TASK_MANAGER, tasksManager);
|
httpSession.setAttribute(TR_TASK_MANAGER, tasksManager);
|
||||||
return tasksManager;
|
return tasksManager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTRTasksManager(HttpSession httpSession,TRTasksManager trTasksManager) {
|
public static void setTRTasksManager(HttpSession httpSession,
|
||||||
TRTasksManager tm = (TRTasksManager) httpSession.getAttribute(TR_TASK_MANAGER);
|
TRTasksManager trTasksManager) {
|
||||||
|
TRTasksManager tm = (TRTasksManager) httpSession
|
||||||
|
.getAttribute(TR_TASK_MANAGER);
|
||||||
if (tm != null) {
|
if (tm != null) {
|
||||||
httpSession.removeAttribute(TR_TASK_MANAGER);
|
httpSession.removeAttribute(TR_TASK_MANAGER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
||||||
|
@ -850,23 +851,25 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSDMXSession(SDMXImportSession sdmxImportSession)
|
public void setSDMXRegistrySource(SDMXRegistrySource sdmxRegistrySource)
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
session = this.getThreadLocalRequest().getSession();
|
session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.setSDMXImportSession(session, sdmxImportSession);
|
SessionUtil.setSDMXRegistrySource(session, sdmxRegistrySource);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(
|
logger.error(
|
||||||
"Error setting SDMXImportSession parameter: "
|
"Error setting SDMXRegistrySource parameter: "
|
||||||
+ e.getLocalizedMessage(), e);
|
+ e.getLocalizedMessage(), e);
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error setting SDMXImportSession parameter: "
|
"Error setting SDMXRegistrySource parameter: "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.sdmx;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.source.Source;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
|
||||||
|
|
||||||
|
@ -23,11 +24,10 @@ public class SDMXExportSession implements Serializable {
|
||||||
protected String id;
|
protected String id;
|
||||||
protected TabResource tabResource;
|
protected TabResource tabResource;
|
||||||
protected Agencies agency;
|
protected Agencies agency;
|
||||||
|
protected Source source;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -44,10 +44,19 @@ public class SDMXExportSession implements Serializable {
|
||||||
this.agency = agency;
|
this.agency = agency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Source getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
public void setSource(Source source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SDMXExportSession [id=" + id + ", tabResource=" + tabResource
|
return "SDMXExportSession [id=" + id + ", tabResource=" + tabResource
|
||||||
+ ", agency=" + agency + "]";
|
+ ", agency=" + agency + ", source=" + source + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,4 +64,5 @@ public class SDMXExportSession implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue