Removed all methods regarding Messages

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@120291 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-11-17 16:14:48 +00:00
parent ea90e93dc1
commit d97b6b824b
12 changed files with 63 additions and 791 deletions

View File

@ -29,8 +29,6 @@ import org.gcube.portlets.user.workspace.client.event.CreateUrlEvent;
import org.gcube.portlets.user.workspace.client.event.CreateUrlEventHandler;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.DeleteMessageEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.DeleteSmartFolderEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteSmartFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.EditUserPermissionEvent;
@ -56,28 +54,21 @@ import org.gcube.portlets.user.workspace.client.event.MoveItemEvent;
import org.gcube.portlets.user.workspace.client.event.MoveItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenMessageEvent;
import org.gcube.portlets.user.workspace.client.event.OpenMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
import org.gcube.portlets.user.workspace.client.event.OpenReportsEventHandler;
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
import org.gcube.portlets.user.workspace.client.event.OpenUrlEventHandler;
import org.gcube.portlets.user.workspace.client.event.PasteItemEvent;
import org.gcube.portlets.user.workspace.client.event.PasteItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.PreviewMessageEvent;
import org.gcube.portlets.user.workspace.client.event.PreviewMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent;
import org.gcube.portlets.user.workspace.client.event.RefreshItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
import org.gcube.portlets.user.workspace.client.event.RenameItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.RenderForm;
import org.gcube.portlets.user.workspace.client.event.RenderFormEventHandler;
import org.gcube.portlets.user.workspace.client.event.SaveAttachmentsEvent;
import org.gcube.portlets.user.workspace.client.event.SaveAttachmentsEventHandler;
import org.gcube.portlets.user.workspace.client.event.SelectedItemEvent;
import org.gcube.portlets.user.workspace.client.event.SelectedItemEventHandler;
import org.gcube.portlets.user.workspace.client.event.SendMessageEvent;
import org.gcube.portlets.user.workspace.client.event.SendMessageEventHandler;
import org.gcube.portlets.user.workspace.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.workspace.client.event.SessionExpiredEventHandler;
import org.gcube.portlets.user.workspace.client.event.SmartFolderSelectedEvent;
@ -106,7 +97,6 @@ import org.gcube.portlets.user.workspace.client.interfaces.TreeAppControllerInte
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.FolderModel;
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import org.gcube.portlets.user.workspace.client.model.SmartFolderModel;
import org.gcube.portlets.user.workspace.client.model.SubTree;
import org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService;
@ -126,7 +116,6 @@ import org.gcube.portlets.user.workspace.client.view.windows.DialogPublicLink;
import org.gcube.portlets.user.workspace.client.view.windows.DialogShareLink;
import org.gcube.portlets.user.workspace.client.view.windows.DialogText;
import org.gcube.portlets.user.workspace.client.view.windows.DialogWebDavUrl;
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay;
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplayMessage;
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxConfirm;
@ -786,129 +775,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
});
eventBus.addHandler(DeleteMessageEvent.TYPE, new DeleteMessageEventHandler() {
@Override
public void onDeleteMessage(DeleteMessageEvent deleteMessageEvent) {
doDeleteMessage(deleteMessageEvent);
}
private void doDeleteMessage(final DeleteMessageEvent deleteMessageEvent) {
rpcWorkspaceService.deleteMessage(deleteMessageEvent.getMessageTarget().getId(), deleteMessageEvent.getMessageTarget().getMessageType(), new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR +" deleting message. " + ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(Boolean result) {
if(result)
notifySubscriber(deleteMessageEvent);
}
});
}
});
eventBus.addHandler(SaveAttachmentsEvent.TYPE, new SaveAttachmentsEventHandler() {
@Override
public void onSaveAttachments(SaveAttachmentsEvent saveAttachmentsEvent) {
final InfoDisplay saving = new InfoDisplay("Info","saving in progress...");
rpcWorkspaceService.saveAttachments(saveAttachmentsEvent.getMessageIdentifier(), saveAttachmentsEvent.getMessageType(), new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR +" saving attachments. " + ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(Boolean result) {
if(saving.isAttached())
saving.hide();
if(result){
new InfoDisplay("Info","Message attachments has been saved");
explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot();
}
}
});
}
});
eventBus.addHandler(PreviewMessageEvent.TYPE, new PreviewMessageEventHandler() {
@Override
public void onPreviewMessage(PreviewMessageEvent previewMessageEvent) {
doPreviewMessage(previewMessageEvent);
}
private void doPreviewMessage(final PreviewMessageEvent previewMessageEvent) {
rpcWorkspaceService.getMessageById(previewMessageEvent.getMessageIdentifier(), previewMessageEvent.getMessageType(), new AsyncCallback<MessageModel>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " opening message." + ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(MessageModel message) {
// String headerTitle = ConstantsExplorer.MESSAGE_SENT_IN_DATE +": " +message.getDate() + " by "+ message.getFromLogin();
// new SendMessage(result.getId(), headerTitle, result.getSubject(), result.getTextMessage(), result.getListAttachments(), result.getListContactsToString());
previewMessageEvent.setMessage(message);
notifySubscriber(previewMessageEvent);
}
});
}
});
eventBus.addHandler(OpenMessageEvent.TYPE, new OpenMessageEventHandler() {
@Override
public void onOpenMessage(OpenMessageEvent openMessageEvent) {
doOpenMessage(openMessageEvent);
}
private void doOpenMessage(final OpenMessageEvent openMessageEvent) {
rpcWorkspaceService.getMessageById(openMessageEvent.getMessageIdentifier(), openMessageEvent.getMessageType(), new AsyncCallback<MessageModel>() {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " opening message. " +ConstantsExplorer.TRY_AGAIN, null);
}
@Override
public void onSuccess(MessageModel result) {
openMessageEvent.setMessage(result); //This fill item text and list contact
notifySubscriber(openMessageEvent);
}
});
}
});
eventBus.addHandler(SwitchViewEvent.TYPE, new SwitchViewEventHandler() {
@Override
@ -917,16 +783,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
});
eventBus.addHandler(SendMessageEvent.TYPE, new SendMessageEventHandler() {
@Override
public void onSendMessage(SendMessageEvent sendMessageEvent) {
notifySubscriber(sendMessageEvent);
}
});
eventBus.addHandler(FilterScopeEvent.TYPE, new FilterScopeEventHandler() {
@Override
@ -1950,12 +1806,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
sub.createNewMessage(hashFiles);
}else if(event instanceof OpenMessageEvent){
OpenMessageEvent messageEvent = (OpenMessageEvent) event;
MessageModel message = messageEvent.getMessage();
}else if(event instanceof FileDownloadEvent){
FileDownloadEvent messageEvent = (FileDownloadEvent) event;

View File

@ -1,69 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import com.google.gwt.event.shared.GwtEvent;
public class OpenMessageEvent extends GwtEvent<OpenMessageEventHandler> implements GuiEventInterface {
public static Type<OpenMessageEventHandler> TYPE = new Type<OpenMessageEventHandler>();
private String messageIdentifier = null; //Report template
private OpenType openType;
private String messageType;
private MessageModel message;//Added for Massi
// public enum OpenType {OPEN, FORWARD}
public enum OpenType {REPLY, REPLYALL, FORWARD}//Refactor for Massi
public OpenMessageEvent(String messageIdentifier, OpenType openType, String messageType) {
this.messageIdentifier = messageIdentifier;
this.openType = openType;
this.messageType = messageType;
}
@Override
public Type<OpenMessageEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(OpenMessageEventHandler handler) {
handler.onOpenMessage(this);
}
public String getMessageIdentifier() {
return messageIdentifier;
}
public OpenType getOpenType() {
return openType;
}
public String getOpenTypeToString() {
return openType.toString();
}
public String getMessageType() {
return messageType;
}
@Override
public EventsTypeEnum getKey() {
return EventsTypeEnum.REPLY_FORWARD_MESSAGE;
}
public MessageModel getMessage() {
return message;
}
public void setMessage(MessageModel message) {
this.message = message;
}
}

View File

@ -1,7 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
public interface OpenMessageEventHandler extends EventHandler {
void onOpenMessage(OpenMessageEvent openMessageEvent);
}

View File

@ -1,54 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import com.google.gwt.event.shared.GwtEvent;
public class PreviewMessageEvent extends GwtEvent<PreviewMessageEventHandler> implements GuiEventInterface{
public static Type<PreviewMessageEventHandler> TYPE = new Type<PreviewMessageEventHandler>();
private String messageIdentifier = null; //Report template
private MessageModel message;
private String messageType;
public PreviewMessageEvent(String messageIdentifier, String messageType) {
this.messageIdentifier = messageIdentifier;
this.messageType = messageType;
}
@Override
public Type<PreviewMessageEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(PreviewMessageEventHandler handler) {
handler.onPreviewMessage(this);
}
public String getMessageIdentifier() {
return messageIdentifier;
}
public void setMessage(MessageModel message) {
this.message = message;
}
public MessageModel getMessage() {
return message;
}
@Override
public EventsTypeEnum getKey() {
return EventsTypeEnum.SELECTED_MESSAGE;
}
public String getMessageType() {
return messageType;
}
}

View File

@ -1,7 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
public interface PreviewMessageEventHandler extends EventHandler {
void onPreviewMessage(PreviewMessageEvent previewMessageEvent);
}

View File

@ -1,36 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.GwtEvent;
public class SaveAttachmentsEvent extends GwtEvent<SaveAttachmentsEventHandler> {
public static Type<SaveAttachmentsEventHandler> TYPE = new Type<SaveAttachmentsEventHandler>();
private String messageIdentifier = null;
private String messageType;
public SaveAttachmentsEvent(String messageIdentifier, String messageType) {
this.messageIdentifier = messageIdentifier;
this.messageType = messageType;
}
@Override
public Type<SaveAttachmentsEventHandler> getAssociatedType() {
// TODO Auto-generated method stub
return TYPE;
}
@Override
protected void dispatch(SaveAttachmentsEventHandler handler) {
handler.onSaveAttachments(this);
}
public String getMessageIdentifier() {
return messageIdentifier;
}
public String getMessageType() {
return messageType;
}
}

View File

@ -1,7 +0,0 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
public interface SaveAttachmentsEventHandler extends EventHandler {
void onSaveAttachments(SaveAttachmentsEvent saveAttachmentsEvent);
}

View File

@ -284,100 +284,7 @@ public interface GWTWorkspaceService extends RemoteService{
* @throws Exception the exception
*/
public boolean sendToById(List<String> listContactsId, List<String> listAttachmentsId, String subject, String text) throws Exception;
/**
* Gets the all messages received.
*
* @return the all messages received
* @throws Exception the exception
*/
public List<MessageModel> getAllMessagesReceived() throws Exception;
/**
* Gets the new messages received.
*
* @return the new messages received
* @throws Exception the exception
*/
public List<MessageModel> getNewMessagesReceived() throws Exception;
/**
* Gets the all messages sent.
*
* @return the all messages sent
* @throws Exception the exception
*/
public List<MessageModel> getAllMessagesSent() throws Exception;
/**
* Search in sent messages by text.
*
* @param text the text
* @return the list
* @throws Exception the exception
*/
public List<MessageModel> searchInSentMessagesByText(String text) throws Exception;
/**
* Search in received messages by text.
*
* @param text the text
* @return the list
* @throws Exception the exception
*/
public List<MessageModel> searchInReceivedMessagesByText(String text) throws Exception;
/**
* Gets the message by id.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @return the message by id
* @throws Exception the exception
*/
public MessageModel getMessageById(String messageIdentifier, String messageType) throws Exception;
/**
* Save attachments.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @return true, if successful
* @throws Exception the exception
*/
public boolean saveAttachments(String messageIdentifier, String messageType) throws Exception;
/**
* Save attach.
*
* @param attachId the attach id
* @return true, if successful
* @throws Exception the exception
*/
public boolean saveAttach(String attachId) throws Exception;
/**
* Mark message.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @param boolMark the bool mark
* @param markType the mark type
* @return true, if successful
* @throws Exception the exception
*/
public boolean markMessage(String messageIdentifier, String messageType, boolean boolMark, String markType) throws Exception;
/**
* Delete message.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @return true, if successful
* @throws Exception the exception
*/
public boolean deleteMessage(String messageIdentifier, String messageType) throws Exception;
/**
* Copy item.
*

View File

@ -261,80 +261,6 @@ public interface GWTWorkspaceServiceAsync {
* @param callback the callback
*/
void sendToById(List<String> listContactsId, List<String> listAttachmentsId, String subject, String text, AsyncCallback<Boolean> callback);
/**
* Gets the all messages received.
*
* @param callback the callback
* @return the all messages received
*/
void getAllMessagesReceived(AsyncCallback<List<MessageModel>> callback);
/**
* Gets the all messages sent.
*
* @param callback the callback
* @return the all messages sent
*/
void getAllMessagesSent(AsyncCallback<List<MessageModel>> callback);
/**
* Gets the message by id.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @param asyncCallback the async callback
* @return the message by id
*/
void getMessageById(String messageIdentifier, String messageType, AsyncCallback<MessageModel> asyncCallback);
/**
* Save attachments.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @param callback the callback
*/
void saveAttachments(String messageIdentifier, String messageType,
AsyncCallback<Boolean> callback);
/**
* Save attach.
*
* @param attachId the attach id
* @param callback the callback
*/
void saveAttach(String attachId, AsyncCallback<Boolean> callback);
/**
* Mark message.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @param boolMark the bool mark
* @param markType the mark type
* @param callback the callback
*/
void markMessage(String messageIdentifier, String messageType,
boolean boolMark, String markType, AsyncCallback<Boolean> callback);
/**
* Delete message.
*
* @param messageIdentifier the message identifier
* @param messageType the message type
* @param callback the callback
*/
void deleteMessage(String messageIdentifier, String messageType,
AsyncCallback<Boolean> callback);
/**
* Gets the new messages received.
*
* @param callback the callback
* @return the new messages received
*/
void getNewMessagesReceived(AsyncCallback<List<MessageModel>> callback);
/**
* Copy item.
@ -354,24 +280,6 @@ public interface GWTWorkspaceServiceAsync {
*/
void getUrlWebDav(String itemId, AsyncCallback<String> callback);
/**
* Search in sent messages by text.
*
* @param text the text
* @param callback the callback
*/
void searchInSentMessagesByText(String text,
AsyncCallback<List<MessageModel>> callback);
/**
* Search in received messages by text.
*
* @param text the text
* @param callback the callback
*/
void searchInReceivedMessagesByText(String text,
AsyncCallback<List<MessageModel>> callback);
/**
* Gets the time series by id.
*

View File

@ -1,102 +0,0 @@
package org.gcube.portlets.user.workspace.client.util;
import java.util.List;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceServiceAsync;
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*
*/
public class PollingWorkspace {
private static int counterNotOpenMessages = -1;
private static final GWTWorkspaceServiceAsync rpcWorkspaceService = (GWTWorkspaceServiceAsync) Registry.get(ConstantsExplorer.RPC_WORKSPACE_SERVICE);
public static void pollReceivedMessages(int numberMessagesNotOpen, int milliseconds){
counterNotOpenMessages = numberMessagesNotOpen;
if(counterNotOpenMessages==-1){
rpcWorkspaceService.getNewMessagesReceived(new AsyncCallback<List<MessageModel>>() {
@Override
public void onFailure(Throwable caught) {
System.out.println("Error in PollingWorkspace - in function getNewMessagesReceived ");
}
@Override
public void onSuccess(List<MessageModel> result) {
// System.out.println("result size " +result.size());
counterNotOpenMessages = result.size();
}
});
}
}
public static int getCounterNotOpenMessages() {
return counterNotOpenMessages;
}
public static void setCounterNotOpenMessages(int counterNotOpenMessages) {
PollingWorkspace.counterNotOpenMessages = counterNotOpenMessages;
}
public static void pollBulkCreator(int milliseconds){
// Timer timer = new Timer() {
// @Override
// public void run()
// {
//
// System.out.println("New rpc getListFolderBulkCreator..........................");
//
// rpcWorkspaceService.getListFolderBulkCreator(new AsyncCallback<List<BulkCreatorModel>>() {
//
// @Override
// public void onFailure(Throwable caught) {
// // TODO Auto-generated method stub
//
// }
//
// @Override
// public void onSuccess(List<BulkCreatorModel> result) {
// if(result.size()>0){
//
//// String message = "bulk creator";
////
//// if(result.size()>1)
//// message = "bulks creators";
////
//// new InfoDisplay("Bulk Creator", "Found " + result.size() + " new " +message);
//
// AppControllerExplorer.getEventBus().fireEvent(new BulkCreatorEvent(result));
//// BulkCreatorWindow.getInstance().addProgressBar(result);
//
//// cancel();
// }
//
//
// }
// });
// }
// };
//
// timer.scheduleRepeating(milliseconds);
}
}

View File

@ -47,6 +47,12 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* The Class ContextMenuTree.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Nov 17, 2015
*/
public class ContextMenuTree {
private Menu contextMenu = new Menu();
@ -57,6 +63,9 @@ public class ContextMenuTree {
private boolean hideSharing = false;
/**
* Instantiates a new context menu tree.
*/
public ContextMenuTree() {
this.contextMenu.setWidth(140);
this.listSelectedItems = new ArrayList<FileModel>();
@ -65,6 +74,9 @@ public class ContextMenuTree {
}
/**
* Creates the context menu.
*/
private void createContextMenu() {
//SPECIFIC OPERATION
@ -521,8 +533,6 @@ public class ContextMenuTree {
contextMenu.add(sendTo);
MenuItem upload = new MenuItem();
upload.setId(WorkspaceOperation.UPLOAD_FILE.getId());
upload.setText(ConstantsExplorer.MESSAGE_UPLOAD_FILE);
@ -641,20 +651,27 @@ public class ContextMenuTree {
}
/**
* Clear list selected items.
*/
public void clearListSelectedItems() {
listSelectedItems.clear();
}
/**
* Sets the hide sharing.
*/
public void setHideSharing() {
hideSharing = true;
}
/**
* Called from context menu on grid
* @param targetFileModel
* @param posX
* @param posY
* Called from context menu on grid.
*
* @param targetFileModel the target file model
* @param posX the pos x
* @param posY the pos y
*/
public void openContextMenuOnItem(final FileModel targetFileModel, final int posX, final int posY) {
clearListSelectedItems();
@ -697,6 +714,13 @@ public class ContextMenuTree {
}
/**
* View context menu.
*
* @param targetFileModel the target file model
* @param posX the pos x
* @param posY the pos y
*/
private void viewContextMenu(FileModel targetFileModel, int posX, int posY){
contextMenuSwitch(targetFileModel);
@ -716,6 +740,9 @@ public class ContextMenuTree {
}
/**
* Prints the selected.
*/
private void printSelected(){
for (FileModel sel: listSelectedItems) {
@ -725,8 +752,9 @@ public class ContextMenuTree {
/**
* switch visible operation on context menu according to selected item
* @param selectedItem
* switch visible operation on context menu according to selected item.
*
* @param selectedItem the selected item
*/
public void contextMenuSwitch(FileModel selectedItem) {
@ -884,10 +912,12 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.PASTE.getId()).setEnabled(true); //enable paste button
}
/**
* The method return input file model if is directory otherwise parent of file model
* @param fileModel
* @return
* The method return input file model if is directory otherwise parent of file model.
*
* @param fileModel the file model
* @return the directory or parent
*/
private FileModel getDirectoryOrParent(FileModel fileModel){
@ -902,20 +932,41 @@ public class ContextMenuTree {
}
/**
* Gets the context menu.
*
* @return the context menu
*/
public Menu getContextMenu(){
return this.contextMenu;
}
/**
* Sets the page position.
*
* @param x the x
* @param y the y
*/
public void setPagePosition(int x, int y){
this.contextMenu.setPagePosition(x, y);
}
/**
* Gets the list selected items.
*
* @return the list selected items
*/
public List<FileModel> getListSelectedItems() {
return listSelectedItems;
}
/**
* Sets the list selected items.
*
* @param listSelectedItems the new list selected items
*/
public void setListSelectedItems(List<FileModel> listSelectedItems) {
this.listSelectedItems.clear();
this.listSelectedItems = listSelectedItems;

View File

@ -37,7 +37,6 @@ import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalUrl;
import org.gcube.common.homelibrary.home.workspace.folder.items.GCubeItem;
import org.gcube.common.homelibrary.home.workspace.search.SearchItem;
import org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage;
import org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashFolder;
import org.gcube.common.homelibrary.home.workspace.trash.WorkspaceTrashItem;
import org.gcube.common.scope.api.ScopeProvider;
@ -50,12 +49,10 @@ import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.FileTrashedModel;
import org.gcube.portlets.user.workspace.client.model.FolderModel;
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
import org.gcube.portlets.user.workspace.client.model.MessageModel;
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
import org.gcube.portlets.user.workspace.client.model.SmartFolderModel;
import org.gcube.portlets.user.workspace.client.model.SubTree;
import org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService;
import org.gcube.portlets.user.workspace.client.util.FileModelUtils;
import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem;
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.WorkspaceHandledException;
import org.gcube.portlets.user.workspace.server.notifications.NotificationsProducer;
@ -1548,78 +1545,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
}
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#getAllMessagesSent()
*/
@Override
public List<MessageModel> getAllMessagesSent() throws Exception {
try {
Workspace workspace = getWorkspace();
workspaceLogger.trace("get All Messages Sent ");
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
List<WorkspaceMessage> listMessages = workspace.getWorkspaceMessageManager().getSentMessages();
return builder.buildGXTListMessageModelForGrid(listMessages, GXTCategoryItemInterface.MS_SENT);
} catch (Exception e) {
workspaceLogger.error("Error in server getAllMessagesSent ", e);
// workspaceLogger.trace("Error in server get getAllMessagesSent " + e.getMessage());
throw new Exception(e.getMessage());
}
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#getAllMessagesReceived()
*/
@Override
public List<MessageModel> getAllMessagesReceived() throws Exception {
try {
Workspace workspace = getWorkspace();
workspaceLogger.trace("get All Messages Received ");
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
List<WorkspaceMessage> listMessages = workspace.getWorkspaceMessageManager().getReceivedMessages();
return builder.buildGXTListMessageModelForGrid(listMessages, GXTCategoryItemInterface.MS_RECEIVED);
} catch (Exception e) {
workspaceLogger.error("Error in server getAllMessagesReceived ", e);
// workspaceLogger.trace("Error in server get getAllMessagesReceived " + e.getMessage());
throw new Exception(e.getMessage());
}
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#getMessageById(java.lang.String, java.lang.String)
*/
@Override
public MessageModel getMessageById(String messageIdentifier, String messageType) throws Exception {
try {
Workspace workspace = getWorkspace();
workspaceLogger.trace("get Message by Id: "+messageIdentifier);
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
WorkspaceMessage message = null;
if(messageType.equals(GXTCategoryItemInterface.MS_RECEIVED))
message = workspace.getWorkspaceMessageManager().getReceivedMessage(messageIdentifier);
else
message = workspace.getWorkspaceMessageManager().getSentMessage(messageIdentifier);
List<WorkspaceItem> listWorkspaceItems = getListWorkspaceItemById(workspace,message.getAttachmentsIds());
return builder.buildGXTMessageModel(message, listWorkspaceItems, messageType);
} catch (Exception e) {
workspaceLogger.error("Error in server get Message by Id ", e);
//GWT can't serialize all exceptions
throw new Exception(e.getMessage());
}
}
/**
* Gets the list workspace item by id.
@ -1645,35 +1570,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
return listWorkspaceItem;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#saveAttachments(java.lang.String, java.lang.String)
*/
@Override
@Deprecated
/**
* use WsMailWidget
*/
public boolean saveAttachments(String messageIdentifier, String messageType) throws Exception {
try {
Workspace workspace = getWorkspace();
workspaceLogger.trace(" save attachments by messageIdentifier " + messageIdentifier);
if(messageType.equals(GXTCategoryItemInterface.MS_SENT))
workspace.getWorkspaceMessageManager().getSentMessage(messageIdentifier).saveAttachments(workspace.getRoot().getId());
else
workspace.getWorkspaceMessageManager().getReceivedMessage(messageIdentifier).saveAttachments(workspace.getRoot().getId());
return true;
} catch (Exception e) {
workspaceLogger.error("Error in server save attachments by messageIdentifier ", e);
//GWT can't serialize all exceptions
throw new Exception(e.getMessage());
}
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#copyItem(java.lang.String, java.lang.String)
@ -3448,62 +3344,4 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
throw new Exception(error);
}
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#getNewMessagesReceived()
*/
@Override
public List<MessageModel> getNewMessagesReceived() throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#searchInSentMessagesByText(java.lang.String)
*/
@Override
public List<MessageModel> searchInSentMessagesByText(String text)
throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#searchInReceivedMessagesByText(java.lang.String)
*/
@Override
public List<MessageModel> searchInReceivedMessagesByText(String text)
throws Exception {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#saveAttach(java.lang.String)
*/
@Override
public boolean saveAttach(String attachId) throws Exception {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#markMessage(java.lang.String, java.lang.String, boolean, java.lang.String)
*/
@Override
public boolean markMessage(String messageIdentifier, String messageType,
boolean boolMark, String markType) throws Exception {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#deleteMessage(java.lang.String, java.lang.String)
*/
@Override
public boolean deleteMessage(String messageIdentifier, String messageType)
throws Exception {
// TODO Auto-generated method stub
return false;
}
}