@ -41,6 +41,7 @@ import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager ;
import org.gcube.application.reporting.reader.ModelReader ;
import org.gcube.application.rsg.client.RsgClient ;
import org.gcube.application.rsg.client.support.ClientException ;
import org.gcube.application.rsg.service.RsgService ;
import org.gcube.application.rsg.service.dto.ReportEntry ;
import org.gcube.application.rsg.service.dto.ReportType ;
@ -1716,15 +1717,22 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
RsgClient rsgClient = getRsgSecureClient ( ) ;
_log . debug ( "listVMEReports() securedWithEncryptedToken completed" ) ;
ReportEntry [ ] reports = null ;
try {
reports = rsgClient . listReports ( type ) ;
} catch ( ClientException e ) {
_log . error ( "failed to get the list of VME Reports: " + e . getMessage ( ) ) ;
}
if ( isVREManager ( ) ) {
for ( ReportEntry re : rsgClient . listReports ( type ) ) {
for ( ReportEntry re : r eports) {
String rfmo = re . getOwner ( ) ;
String name = re . getIdentifier ( ) ;
toReturn . add ( new VMEReportBean ( "" + re . getId ( ) , rfmo , name ) ) ;
}
} else {
ArrayList < String > allowedRFMOs = getUserRFMOs ( ) ;
for ( ReportEntry re : r sgClient. listR eports( type ) ) {
for ( ReportEntry re : r eports) {
String rfmo = re . getOwner ( ) . trim ( ) ;
String name = re . getIdentifier ( ) ;
for ( String allowedRFMO : allowedRFMOs ) {