|
|
|
@ -134,9 +134,6 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
|
|
|
|
|
private static final Logger _log = LoggerFactory.getLogger(ReportServiceImpl.class);
|
|
|
|
|
|
|
|
|
|
public static final String TEST_SCOPE = "/gcube/devsec/devVRE";
|
|
|
|
|
//public static final String TEST_SCOPE = "/gcube/devNext/NextNext";
|
|
|
|
|
|
|
|
|
|
protected static final String IMAGE_SERVICE_URL = "reports/DownloadService";
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -156,7 +153,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
public static final String RSG_WS_ADDRESS = "RSG-WS-ENDPOINT";
|
|
|
|
|
|
|
|
|
|
private static final String REPORT_IMAGES_FOLDER = "Report Images";
|
|
|
|
|
|
|
|
|
|
public static final String TEST_USER = "test.user";
|
|
|
|
|
public static final String TEST_SCOPE = "/gcube/devsec/devVRE";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* the WF DB Store
|
|
|
|
@ -186,22 +184,26 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
|
|
|
|
|
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
|
|
|
|
|
if (user == null) {
|
|
|
|
|
user = getDevUser();
|
|
|
|
|
this.getThreadLocalRequest().getSession().setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, user);
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setScope(TEST_SCOPE);
|
|
|
|
|
String email = user+"@isti.cnr.it";
|
|
|
|
|
String fullName = "Massimiliano Assante";
|
|
|
|
|
String thumbnailURL = "images/Avatar_default.png";
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserEmailAddress(email);
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserAvatarId(thumbnailURL);
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserFullName(fullName);
|
|
|
|
|
user = getDevelopmentUser();
|
|
|
|
|
if (user.compareTo(TEST_USER) != 0) {
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setScope(TEST_SCOPE);
|
|
|
|
|
this.getThreadLocalRequest().getSession().setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, user);
|
|
|
|
|
String email = user+"@isti.cnr.it";
|
|
|
|
|
String fullName = "Andrea Rossi";
|
|
|
|
|
String thumbnailURL = "images/Avatar_default.png";
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserEmailAddress(email);
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserAvatarId(thumbnailURL);
|
|
|
|
|
SessionManager.getInstance().getASLSession(sessionID, user).setUserFullName(fullName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return SessionManager.getInstance().getASLSession(sessionID, user);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public static String getDevUser() {
|
|
|
|
|
return "massimiliano.assante";
|
|
|
|
|
public String getDevelopmentUser() {
|
|
|
|
|
String user = TEST_USER;
|
|
|
|
|
// user = "andrea.rossi";
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -708,13 +710,15 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
|
|
|
|
|
private RSGAccessPoint getRSGWSAddress() {
|
|
|
|
|
RSGAccessPoint rsgAp = (RSGAccessPoint) this.getThreadLocalRequest().getSession().getAttribute(RSG_WS_ADDRESS);
|
|
|
|
|
_log.trace("getRSGWSAddress: " + rsgAp.getRestUrl());
|
|
|
|
|
if (rsgAp != null)
|
|
|
|
|
_log.trace("getRSGWSAddress: " + rsgAp.getRestUrl());
|
|
|
|
|
return rsgAp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setRSGWSAddress(RSGAccessPoint rsgAp) {
|
|
|
|
|
this.getThreadLocalRequest().getSession().setAttribute(RSG_WS_ADDRESS, rsgAp);
|
|
|
|
|
_log.trace("setting RSG WS address to " + rsgAp.getRestUrl());
|
|
|
|
|
if (rsgAp != null)
|
|
|
|
|
_log.trace("setting RSG WS address to " + rsgAp.getRestUrl());
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -889,8 +893,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
else if (imageItem.getFolderItemType()==FolderItemType.IMAGE_DOCUMENT){
|
|
|
|
|
GCubeItem image = (GCubeItem)item;
|
|
|
|
|
if (image.getMimeType().equals("image/tiff"))
|
|
|
|
|
// image.getProperties().getProperties().get(NodeProperty.THUMBNAIL_DATA); //this is a problem
|
|
|
|
|
// else
|
|
|
|
|
// image.getProperties().getProperties().get(NodeProperty.THUMBNAIL_DATA); //this is a problem
|
|
|
|
|
// else
|
|
|
|
|
data = image.getData();
|
|
|
|
|
}
|
|
|
|
|
if (data != null) {
|
|
|
|
@ -1312,24 +1316,27 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
*/
|
|
|
|
|
public SessionInfo getSessionInfo(String currentHost) {
|
|
|
|
|
if (testWorkflow) {
|
|
|
|
|
|
|
|
|
|
getASLSession().setAttribute(WfDocsLibrary.WORKFLOW_ID_ATTRIBUTE, "1");
|
|
|
|
|
getASLSession().setAttribute(WfDocsLibrary.WORKFLOW_GIVEN_NAME, "TEST REPORT");
|
|
|
|
|
getASLSession().setAttribute(WfDocsLibrary.WORKFLOW_READONLY_ATTRIBUTE, true);
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), true, true, false);
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), true, true, false, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean isVME = isReportsStoreGatewayAvailable();
|
|
|
|
|
|
|
|
|
|
if (getASLSession().getAttribute(WfDocsLibrary.WORKFLOW_ID_ATTRIBUTE) == null) {
|
|
|
|
|
_log.debug("WfDocsLibrary.WORKFLOW_ID_ATTRIBUTE is NULL: ");
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), false, false, isVME);
|
|
|
|
|
String rsgEndpoint = "";
|
|
|
|
|
if (getRSGWSAddress() != null)
|
|
|
|
|
rsgEndpoint = ((RSGAccessPoint) getRSGWSAddress()).getRestUrl();
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), false, false, isVME, rsgEndpoint);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_log.debug("FOUND WORKFLOW_ID_ATTRIBUTE ***** ");
|
|
|
|
|
//String workflowid = getASLSession().getAttribute(WfDocsLibrary.WORKFLOW_ID_ATTRIBUTE).toString();
|
|
|
|
|
Boolean canEdit = ! (Boolean) getASLSession().getAttribute(WfDocsLibrary.WORKFLOW_READONLY_ATTRIBUTE);
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), true, canEdit, false);
|
|
|
|
|
return new SessionInfo(getUserBean(), getVreName(), true, canEdit, false, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1652,7 +1659,7 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|
|
|
|
}
|
|
|
|
|
return rsgReadClient;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private RsgWriteClient getRsgSecureClient() {
|
|
|
|
|
RSGAccessPoint rsgWsAddr = getRSGWSAddress();
|
|
|
|
|
if (rsgWriteClient == null) {
|
|
|
|
|