refs 5870: TDM - adding new functionalities to portlets

Task-Url: https://support.d4science.org/issues/5870

Updated to support SDMX Dataset export

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@142054 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-02-02 11:03:06 +00:00
parent 42aba812e7
commit a923c96a25
1 changed files with 44 additions and 45 deletions

View File

@ -32,23 +32,23 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
public class TDMLogs extends Window {
protected static final String TDMLogsServlet = "TDLogsServlet";
protected static final String WIDTH="700px";
protected static final String HEIGHT="500px";
protected static final String CONTENTLOGSWIDTH="674px";
protected static final String CONTENTLOGSHEIGHT="410px";
protected static final String WIDTH = "700px";
protected static final String HEIGHT = "500px";
protected static final String CONTENTLOGSWIDTH = "674px";
protected static final String CONTENTLOGSHEIGHT = "410px";
protected EventBus eventBus;
protected VerticalLayoutContainer verticalContainer;
public TDMLogs(EventBus eventBus){
public TDMLogs(EventBus eventBus) {
super();
this.eventBus=eventBus;
this.eventBus = eventBus;
init();
createLogsPanel();
callLogsServlet();
}
public void init(){
public void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
setHeadingText("TDM Logs");
@ -58,7 +58,7 @@ public class TDMLogs extends Window {
}
protected void createLogsPanel() {
FramedPanel logsPanel=new FramedPanel();
FramedPanel logsPanel = new FramedPanel();
logsPanel.setBodyBorder(false);
logsPanel.setHeaderVisible(false);
@ -78,7 +78,6 @@ public class TDMLogs extends Window {
btnReload.setToolTip("Reload");
toolBar.add(btnReload);
SimpleContainer contentLogs = new SimpleContainer();
contentLogs.setBorders(false);
contentLogs.setWidth(CONTENTLOGSWIDTH);
@ -90,26 +89,27 @@ public class TDMLogs extends Window {
contentLogs.add(verticalContainer);
VerticalLayoutContainer logsPanelLayout=new VerticalLayoutContainer();
VerticalLayoutContainer logsPanelLayout = new VerticalLayoutContainer();
logsPanelLayout.add(toolBar, new VerticalLayoutData(1,32,new Margins(1)));
logsPanelLayout.add(contentLogs, new VerticalLayoutData(1,-1,new Margins(1)));
logsPanelLayout.add(toolBar, new VerticalLayoutData(1, 32, new Margins(
1)));
logsPanelLayout.add(contentLogs, new VerticalLayoutData(1, -1,
new Margins(1)));
logsPanel.add(logsPanelLayout);
add(logsPanel);
}
public void callLogsServlet() {
String path = GWT.getModuleBaseURL() + TDMLogsServlet;
String path = GWT.getModuleBaseURL() + TDMLogsServlet + "?"
+ Constants.CURR_GROUP_ID + "="
+ GCubeClientContext.getCurrentContextId();
Log.debug("TDMLogsServlet path:" + path);
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, path);
builder.setHeader(Constants.CURR_GROUP_ID,
GCubeClientContext.getCurrentContextId());
try {
builder.sendRequest(null, new RequestCallback() {
@ -129,7 +129,7 @@ public class TDMLogs extends Window {
if (408 == response.getStatusCode()) {
Log.error("Error retrienving logs. Session expired.");
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrienving logs. Response StatusCode: "
+ response.getStatusCode());
@ -148,12 +148,11 @@ public class TDMLogs extends Window {
}
}
protected void update(String text){
protected void update(String text) {
verticalContainer.clear();
/*int body=text.indexOf("<body>");
text=text.substring(body+6);*/
/*
* int body=text.indexOf("<body>"); text=text.substring(body+6);
*/
SafeHtmlBuilder builderLogs = new SafeHtmlBuilder();
@ -161,12 +160,12 @@ public class TDMLogs extends Window {
SafeHtml safeLogs = builderLogs.toSafeHtml();
HTML hLogs = new HTML(safeLogs);
verticalContainer.add(hLogs, new VerticalLayoutData(1,-1,new Margins(1)));
verticalContainer.add(hLogs, new VerticalLayoutData(1, -1, new Margins(
1)));
forceLayout();
}
/**
* {@inheritDoc}
*/