Added RStudio

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@111436 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-01-22 11:23:09 +00:00
parent fff545a8bb
commit 44cc5740eb
5 changed files with 78 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.chartswidget.client.ChartsWidgetTD;
import org.gcube.portlets.user.td.client.logs.TDMLogs;
import org.gcube.portlets.user.td.client.rstudio.RStudio;
import org.gcube.portlets.user.td.client.template.TemplateApplyDialog;
import org.gcube.portlets.user.td.client.template.TemplateDeleteDialog;
import org.gcube.portlets.user.td.client.template.TemplateOpenDialog;
@ -878,6 +879,7 @@ public class TabularDataController {
openCreateChart();
break;
case RSTUDIO:
openRStudio();
break;
case STATISTICAL:
openStatistical();
@ -1607,6 +1609,20 @@ public class TabularDataController {
HistoryDiscard historyDiscard = new HistoryDiscard(eventBus);
historyDiscard.discard();
}
private void openRStudio() {
Log.debug("Request Open RStudio");
if (trId != null) {
@SuppressWarnings("unused")
RStudio rStudio=new RStudio(trId, eventBus);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No current tabular resource present");
}
}
private void openStatistical() {
GWT.runAsync(new RunAsyncCallback() {

View File

@ -354,8 +354,7 @@ public class AnalyseToolBar {
rstudioButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
eventBus.fireEvent(new RibbonEvent(RibbonType.RSTUDIO));
}
});
@ -459,12 +458,14 @@ public class AnalyseToolBar {
chartCreateButton.disable();
gisButton.disable();
statisticalButton.disable();
rstudioButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
chartCreateButton.disable();
gisButton.disable();
statisticalButton.disable();
rstudioButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
@ -472,11 +473,13 @@ public class AnalyseToolBar {
chartCreateButton.enable();
gisButton.enable();
statisticalButton.enable();
rstudioButton.enable();
break;
case WIZARD_OPEN:
chartCreateButton.disable();
gisButton.disable();
statisticalButton.disable();
rstudioButton.disable();
break;
default:
break;

View File

@ -0,0 +1,41 @@
package org.gcube.portlets.user.td.client.rstudio;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.web.bindery.event.shared.EventBus;
/**
*
* RStudio Widget
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class RStudio {
private static final String TAB_RESOURCE_ID_PARAMETER = "TabResourceId";
public RStudio(TRId trId, EventBus eventBus) {
callRStudioServlet(trId);
}
private void callRStudioServlet(TRId trId) {
Log.debug("Request: " + trId);
String url = GWT.getModuleBaseURL() + "TDRStudioServlet?"
+ TAB_RESOURCE_ID_PARAMETER + "="
+ trId.getId();
Log.debug("Server URL: " + url);
Window.open(url, "RStudio", "");
}
}

View File

@ -74,14 +74,14 @@
<!-- Specify the app entry point class. -->
<entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' />
<!--
<set-property name="log_DivLogger" value="ENABLED" />
<!-- <set-property name="log_DivLogger" value="ENABLED" />
<set-property name="log_ConsoleLogger" value="ENABLED" />
<set-property name="log_GWTLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" /> -->
<set-property name="log_SystemLogger" value="ENABLED" /> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED" /> -->
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />

View File

@ -49,6 +49,13 @@
<servlet-name>RetrieveChartFileServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.td.gwtservice.server.RetrieveChartFileServlet</servlet-class>
</servlet>
<!-- TD RStudio Servlet -->
<servlet>
<servlet-name>TDRStudioServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.td.gwtservice.server.TDRStudioServlet</servlet-class>
</servlet>
<!-- TD Expression -->
<servlet>
@ -199,6 +206,11 @@
<url-pattern>/tabulardataportlet/RetrieveChartFileServlet</url-pattern>
</servlet-mapping>
<!-- TD RStudio -->
<servlet-mapping>
<servlet-name>TDRStudioServlet</servlet-name>
<url-pattern>/tabulardataportlet/TDRStudioServlet</url-pattern>
</servlet-mapping>
<!-- TD Expression -->
<servlet-mapping>