209: TDM - Show the resources through a ListView widget
Task-Url: https://support.d4science.org/issues/209 Updated name of resources support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@115403 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
797428fcbe
commit
b454b07d2d
|
@ -9073,16 +9073,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
"This resource does not have valid storage id: "
|
||||
+ storageId);
|
||||
}
|
||||
|
||||
MimeTypeSupport mime=saveResourceSession.getMime();
|
||||
String fileName="";
|
||||
|
||||
if(mime==null|| mime.compareTo(MimeTypeSupport._unknow)==0){
|
||||
fileName=saveResourceSession.getFileName();
|
||||
} else {
|
||||
fileName=saveResourceSession.getFileName()+
|
||||
mime.getExtension();
|
||||
}
|
||||
|
||||
|
||||
logger.debug("Create Item On Workspace: [storageId=" + storageId
|
||||
+ " ,user: " + aslSession.getUsername() + " ,fileName: "
|
||||
+ saveResourceSession.getFileName() + " ,fileDescription: "
|
||||
+ fileName + " ,fileDescription: "
|
||||
+ saveResourceSession.getFileDescription() + " ,mimetype:"
|
||||
+ mimeType + " ,folder: " + saveResourceSession.getItemId()
|
||||
+ "]");
|
||||
|
||||
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspaceByStorageId(storageId,
|
||||
aslSession.getUsername(), saveResourceSession.getFileName(),
|
||||
aslSession.getUsername(), fileName,
|
||||
saveResourceSession.getFileDescription(), mimeType,
|
||||
saveResourceSession.getItemId());
|
||||
}
|
||||
|
@ -9125,16 +9138,28 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
throw new TDGWTServiceException(
|
||||
"This resource does not have valid link: " + link);
|
||||
}
|
||||
|
||||
MimeTypeSupport mime=saveResourceSession.getMime();
|
||||
String fileName="";
|
||||
|
||||
if(mime==null|| mime.compareTo(MimeTypeSupport._unknow)==0){
|
||||
fileName=saveResourceSession.getFileName();
|
||||
} else {
|
||||
fileName=saveResourceSession.getFileName()+
|
||||
mime.getExtension();
|
||||
}
|
||||
|
||||
|
||||
logger.debug("Create Item On Workspace: [uri=" + link + " ,user: "
|
||||
+ aslSession.getUsername() + " ,fileName: "
|
||||
+ saveResourceSession.getFileName() + " ,fileDescription: "
|
||||
+ fileName + " ,fileDescription: "
|
||||
+ saveResourceSession.getFileDescription() + " ,mimetype:"
|
||||
+ mimeType + " ,folder: " + saveResourceSession.getItemId()
|
||||
+ "]");
|
||||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspace(link, aslSession.getUsername(),
|
||||
saveResourceSession.getFileName(),
|
||||
fileName,
|
||||
saveResourceSession.getFileDescription(), mimeType,
|
||||
saveResourceSession.getItemId());
|
||||
}
|
||||
|
|
|
@ -32,37 +32,38 @@ public class OpExecution4CSVExport extends OpExecutionBuilder {
|
|||
private TabularDataService service;
|
||||
private CSVExportSession csvExportSession;
|
||||
|
||||
|
||||
public OpExecution4CSVExport(HttpSession session, TabularDataService service,
|
||||
CSVExportSession csvExportSession) {
|
||||
public OpExecution4CSVExport(HttpSession session,
|
||||
TabularDataService service, CSVExportSession csvExportSession) {
|
||||
this.service = service;
|
||||
this.csvExportSession = csvExportSession;
|
||||
this.session=session;
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildOpEx() throws TDGWTServiceException {
|
||||
logger.debug("CSV Export: "+csvExportSession);
|
||||
|
||||
logger.debug("CSV Export: " + csvExportSession);
|
||||
|
||||
SessionUtil.setCSVExportEnd(session, false);
|
||||
|
||||
|
||||
OperationDefinition operationDefinition;
|
||||
operationDefinition = OperationDefinitionMap.map(
|
||||
OperationsId.CSVExport.toString(), service);
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
map.put(Constants.PARAMETER_ENCODING,
|
||||
csvExportSession.getEncoding());
|
||||
map.put(Constants.PARAMETER_SEPARATOR,
|
||||
csvExportSession.getSeparator());
|
||||
|
||||
map.put(Constants.PARAMETER_RESOURCE_NAME,
|
||||
csvExportSession.getFileName());
|
||||
map.put(Constants.PARAMETER_RESOURCE_DESCRIPTION,
|
||||
csvExportSession.getFileDescription());
|
||||
map.put(Constants.PARAMETER_ENCODING, csvExportSession.getEncoding());
|
||||
map.put(Constants.PARAMETER_SEPARATOR, csvExportSession.getSeparator());
|
||||
map.put(Constants.PARAMETER_VIEW_COLUMNS,
|
||||
csvExportSession.isExportViewColumns());
|
||||
map.put(Constants.PARAMETER_COLUMNS,
|
||||
csvExportSession.getColumnsAsString());
|
||||
|
||||
|
||||
OperationExecution invocation = new OperationExecution(
|
||||
operationDefinition.getOperationId(), map);
|
||||
|
||||
|
||||
operationExecutionSpec.setOp(invocation);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,10 @@ public class OpExecution4JSONExport extends OpExecutionBuilder {
|
|||
OperationsId.JSONExport.toString(), service);
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
map.put(Constants.PARAMETER_RESOURCE_NAME, jsonExportSession.getFileName());
|
||||
|
||||
map.put(Constants.PARAMETER_RESOURCE_DESCRIPTION, jsonExportSession.getFileDescription());
|
||||
|
||||
map.put(Constants.PARAMETER_VIEW_COLUMNS,
|
||||
jsonExportSession.isExportViewColumns());
|
||||
map.put(Constants.PARAMETER_COLUMNS,
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* TDMNotification notification sharing TR, templates or rules
|
||||
* TDMNotification notification sharing TR, templates or rules
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
|
@ -44,7 +44,7 @@ public class TDMNotifications extends Thread {
|
|||
this.notificationType = NotificationType.TDM_TAB_RESOURCE_SHARE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param aslSession
|
||||
|
@ -107,7 +107,8 @@ public class TDMNotifications extends Thread {
|
|||
.getTrId().getId()));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername()
|
||||
+ " share tabular resource id="
|
||||
+ shareTabularResource.getTabResource()
|
||||
|
@ -135,7 +136,8 @@ public class TDMNotifications extends Thread {
|
|||
.getTrId().getId()));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername()
|
||||
+ " share tabular resource id="
|
||||
+ shareTabularResource.getTabResource().getTrId()
|
||||
|
@ -165,7 +167,8 @@ public class TDMNotifications extends Thread {
|
|||
.getName(), null);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername()
|
||||
+ " share rule id="
|
||||
+ shareRule.getRuleDescriptionData()
|
||||
|
@ -190,7 +193,8 @@ public class TDMNotifications extends Thread {
|
|||
.getRuleDescriptionData().getName(), null);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername() + " share rule id="
|
||||
+ shareRule.getRuleDescriptionData().getId()
|
||||
+ " with " + contact.getLogin() + "): "
|
||||
|
@ -220,7 +224,8 @@ public class TDMNotifications extends Thread {
|
|||
null);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername()
|
||||
+ " share template id="
|
||||
+ shareTemplate.getTemplateData().getId()
|
||||
|
@ -245,7 +250,8 @@ public class TDMNotifications extends Thread {
|
|||
.getName(), null);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in the notification("
|
||||
logger.error("Error in the notification(Type: "
|
||||
+ notificationType + " - "
|
||||
+ aslSession.getUsername() + " share template id="
|
||||
+ shareTemplate.getTemplateData().getId()
|
||||
+ " with " + contact.getLogin() + "): "
|
||||
|
|
|
@ -124,5 +124,8 @@ public class Constants {
|
|||
public static final String PARAMETER_EXPRESSION_VALIDATION_TITLE = "title";
|
||||
|
||||
public static final String PARAMETER_CHANGE_COLUMN_POSITION_ORDER = "order";
|
||||
|
||||
public static final String PARAMETER_RESOURCE_NAME = "name";
|
||||
public static final String PARAMETER_RESOURCE_DESCRIPTION = "description";
|
||||
|
||||
}
|
||||
|
|
|
@ -422,7 +422,7 @@ public class BackgroundOperationMonitorCreator {
|
|||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileName()+".csv",
|
||||
exportSession.getFileDescription(), "text/csv",
|
||||
exportSession.getItemId());
|
||||
|
||||
|
@ -471,7 +471,7 @@ public class BackgroundOperationMonitorCreator {
|
|||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileName()+".json",
|
||||
exportSession.getFileDescription(), "application/json",
|
||||
exportSession.getItemId());
|
||||
|
||||
|
|
|
@ -477,7 +477,7 @@ public class OperationMonitorCreator {
|
|||
|
||||
FilesStorage storage = new FilesStorage();
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileName()+".csv",
|
||||
exportSession.getFileDescription(), "text/csv",
|
||||
exportSession.getItemId());
|
||||
|
||||
|
@ -526,7 +526,7 @@ public class OperationMonitorCreator {
|
|||
FilesStorage storage = new FilesStorage();
|
||||
|
||||
storage.createItemOnWorkspaceByStorageId(exportMetadata.getUri(), user,
|
||||
exportSession.getFileName(),
|
||||
exportSession.getFileName()+".json",
|
||||
exportSession.getFileDescription(), "application/json",
|
||||
exportSession.getItemId());
|
||||
|
||||
|
|
Loading…
Reference in New Issue