Added Chart

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@101556 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-11-10 17:59:04 +00:00
parent dd7e16bd7b
commit 25830d5b39
6 changed files with 260 additions and 306 deletions

View File

@ -17,6 +17,7 @@ import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession;
import org.gcube.portlets.user.td.gwtservice.server.file.CodelistMappingFileUploadSession;
import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager;
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
@ -82,17 +83,17 @@ public class SessionUtil {
ASLSession session;
if (username == null) {
logger.warn("no user found in session, using test one");
throw new TDGWTSessionExpiredException("Session Expired!");
/* throw new TDGWTSessionExpiredException("Session Expired!"); */
// Remove comment for Test
/*
* username = Constants.DEFAULT_USER; String scope =
* Constants.DEFAULT_SCOPE;
*
* httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE,
* username); session = SessionManager.getInstance().getASLSession(
* httpSession.getId(), username); session.setScope(scope);
*/
username = Constants.DEFAULT_USER;
String scope = Constants.DEFAULT_SCOPE;
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
session = SessionManager.getInstance().getASLSession(
httpSession.getId(), username);
session.setScope(scope);
} else {
session = SessionManager.getInstance().getASLSession(
httpSession.getId(), username);
@ -1564,7 +1565,8 @@ public class SessionUtil {
ChartTopRatingSession chart = (ChartTopRatingSession) httpSession
.getAttribute(SessionConstants.CHART_TOPRATING_SESSION);
if (chart != null) {
httpSession.removeAttribute(SessionConstants.CHART_TOPRATING_SESSION);
httpSession
.removeAttribute(SessionConstants.CHART_TOPRATING_SESSION);
}
httpSession.setAttribute(SessionConstants.CHART_TOPRATING_SESSION,
chartTopRatingSession);

View File

@ -0,0 +1,81 @@
package org.gcube.portlets.user.td.gwtservice.shared.chart;
import java.io.Serializable;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.web.bindery.event.shared.EventBus;
/**
* Chart Session
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChartSession implements Serializable {
private static final long serialVersionUID = -51554111438593905L;
private TRId trId;
private UserInfo userInfo;
private EventBus eventBus;
private ArrayList<ColumnData> columns;
public ChartSession() {
super();
}
public ChartSession(TRId trId, UserInfo userInfo, EventBus eventBus,
ArrayList<ColumnData> columns) {
super();
this.trId = trId;
this.userInfo = userInfo;
this.eventBus = eventBus;
this.columns = columns;
}
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
public UserInfo getUserInfo() {
return userInfo;
}
public void setUserInfo(UserInfo userInfo) {
this.userInfo = userInfo;
}
public EventBus getEventBus() {
return eventBus;
}
public void setEventBus(EventBus eventBus) {
this.eventBus = eventBus;
}
public ArrayList<ColumnData> getColumns() {
return columns;
}
public void setColumns(ArrayList<ColumnData> columns) {
this.columns = columns;
}
@Override
public String toString() {
return "ChartSession [trId=" + trId + ", userInfo=" + userInfo
+ ", eventBus=" + eventBus + ", columns=" + columns + "]";
}
}

View File

@ -26,7 +26,7 @@ public class ChartTopRatingSession implements Serializable {
public ChartTopRatingSession() {
super();
}
/**
*
* @param trId
@ -43,47 +43,38 @@ public class ChartTopRatingSession implements Serializable {
this.valueOperation = valueOperation;
}
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
public ColumnData getColumn() {
return column;
}
public void setColumn(ColumnData column) {
this.column = column;
}
public Integer getSampleSize() {
return sampleSize;
}
public void setSampleSize(Integer sampleSize) {
this.sampleSize = sampleSize;
}
public String getValueOperation() {
return valueOperation;
}
public void setValueOperation(String valueOperation) {
this.valueOperation = valueOperation;
}
@Override
public String toString() {
return "ChartTopRatingSession [trId=" + trId + ", column=" + column
@ -95,4 +86,7 @@ public class ChartTopRatingSession implements Serializable {
}

View File

@ -45,13 +45,16 @@ import org.slf4j.LoggerFactory;
*
*/
public class BackgroundOperationMonitorCreator {
protected static Logger logger = LoggerFactory
private static final String SECURITY_EXCEPTION_RIGHTS = "Security exception, you don't have the required rights!";
private static Logger logger = LoggerFactory
.getLogger(BackgroundOperationMonitorCreator.class);
protected static SimpleDateFormat sdf = new SimpleDateFormat(
private static SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd HH:mm");
protected static SimpleDateFormat sdfDate = new SimpleDateFormat(
@SuppressWarnings("unused")
private static SimpleDateFormat sdfDate = new SimpleDateFormat(
"yyyy-MM-dd");
protected HttpSession session;
@ -345,7 +348,7 @@ public class BackgroundOperationMonitorCreator {
} catch (SecurityException e) {
e.printStackTrace();
throw new TDGWTServiceException(
"Security exception, you haven't rights!");
SECURITY_EXCEPTION_RIGHTS);
} catch (Throwable e) {
e.printStackTrace();
throw new TDGWTServiceException("Error in Client Library Request: "

View File

@ -46,13 +46,16 @@ import org.slf4j.LoggerFactory;
*
*/
public class OperationMonitorCreator {
protected static Logger logger = LoggerFactory
private static final String SECURITY_EXCEPTION_RIGHTS = "Security exception, you don't have the required rights!";
private static Logger logger = LoggerFactory
.getLogger(OperationMonitorCreator.class);
protected static SimpleDateFormat sdf = new SimpleDateFormat(
private static SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd HH:mm");
protected static SimpleDateFormat sdfDate = new SimpleDateFormat(
@SuppressWarnings("unused")
private static SimpleDateFormat sdfDate = new SimpleDateFormat(
"yyyy-MM-dd");
protected HttpSession session;
@ -399,7 +402,7 @@ public class OperationMonitorCreator {
} catch (SecurityException e) {
e.printStackTrace();
throw new TDGWTServiceException(
"Security exception, you haven't rights!");
SECURITY_EXCEPTION_RIGHTS);
} catch (Throwable e) {
e.printStackTrace();
throw new TDGWTServiceException("Error Retrieving Basic Data: "