From 2b0bf9c3d0be28ab0fdcf38234dcd89d9f52781c Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Tue, 14 Jul 2015 16:11:11 +0000 Subject: [PATCH] Fixed bug on getACLOwner git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@117237 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/rpc/GWTWorkspaceService.java | 631 ++++++++++++++++-- .../client/rpc/GWTWorkspaceServiceAsync.java | 576 +++++++++++++++- .../client/view/windows/DialogGetInfo.java | 2 +- .../workspace/server/GWTWorkspaceBuilder.java | 2 +- .../server/GWTWorkspaceServiceImpl.java | 27 +- 5 files changed, 1160 insertions(+), 78 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java index e7d6987..abaf72c 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceService.java @@ -32,281 +32,788 @@ import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + +/** + * The Interface GWTWorkspaceService. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jul 14, 2015 + */ @RemoteServiceRelativePath("WorkspaceService") public interface GWTWorkspaceService extends RemoteService{ + /** + * Gets the user workspace size. + * + * @return the user workspace size + * @throws Exception the exception + */ String getUserWorkspaceSize() throws Exception; + /** + * Gets the root for tree. + * + * @return the root for tree + * @throws Exception the exception + */ public FolderModel getRootForTree() throws Exception; + /** + * Gets the root for tree. + * + * @param scopeId the scope id + * @return the root for tree + * @throws Exception the exception + */ public FolderModel getRootForTree(String scopeId) throws Exception; + /** + * Gets the all scope. + * + * @return the all scope + * @throws Exception the exception + */ public List getAllScope() throws Exception; + /** + * Gets the folder children. + * + * @param folder the folder + * @return the folder children + * @throws Exception the exception + * @throws SessionExpiredException the session expired exception + */ public List getFolderChildren(FolderModel folder) throws Exception, SessionExpiredException; + /** + * Gets the folder children for file grid. + * + * @param folder the folder + * @return the folder children for file grid + * @throws Exception the exception + * @throws SessionExpiredException the session expired exception + */ public List getFolderChildrenForFileGrid(FileModel folder) throws Exception, SessionExpiredException; + /** + * Gets the details file. + * + * @param item the item + * @return the details file + * @throws Exception the exception + */ public FileDetailsModel getDetailsFile(FileModel item) throws Exception; + /** + * Creates the folder. + * + * @param nameFolder the name folder + * @param description the description + * @param parent the parent + * @return the folder model + * @throws Exception the exception + */ public FolderModel createFolder(String nameFolder, String description, FileModel parent) throws Exception; + /** + * Gets the children sub tree to root by identifier. + * + * @param itemIdentifier the item identifier + * @return the children sub tree to root by identifier + * @throws Exception the exception + */ public ArrayList getChildrenSubTreeToRootByIdentifier(String itemIdentifier) throws Exception; + /** + * Gets the smart folder results by category. + * + * @param category the category + * @return the smart folder results by category + * @throws Exception the exception + */ public List getSmartFolderResultsByCategory(String category) throws Exception; + /** + * Creates the smart folder. + * + * @param name the name + * @param description the description + * @param query the query + * @return the smart folder model + * @throws Exception the exception + */ public SmartFolderModel createSmartFolder(String name, String description, String query) throws Exception; + /** + * Gets the smart folder results by id. + * + * @param folderId the folder id + * @return the smart folder results by id + * @throws Exception the exception + */ public List getSmartFolderResultsById(String folderId) throws Exception; + /** + * Gets the all smart folders. + * + * @return the all smart folders + * @throws Exception the exception + */ public List getAllSmartFolders() throws Exception; + /** + * Gets the image by id. + * + * @param identifier the identifier + * @param isInteralImage the is interal image + * @param fullDetails the full details + * @return the image by id + * @throws Exception the exception + */ public GWTWorkspaceItem getImageById(String identifier, boolean isInteralImage, boolean fullDetails) throws Exception; + /** + * Gets the url by id. + * + * @param identifier the identifier + * @param isInternalUrl the is internal url + * @param fullDetails the full details + * @return the url by id + * @throws Exception the exception + */ public GWTWorkspaceItem getUrlById(String identifier, boolean isInternalUrl, boolean fullDetails) throws Exception; + /** + * Creates the external url. + * + * @param parentFileModel the parent file model + * @param name the name + * @param description the description + * @param url the url + * @return the file model + * @throws Exception the exception + */ public FileModel createExternalUrl(FileModel parentFileModel, String name, String description, String url) throws Exception; + /** + * Sets the value in session. + * + * @param name the name + * @param value the value + * @throws Exception the exception + */ public void setValueInSession(String name, String value) throws Exception; + /** + * Gets the items by search name. + * + * @param text the text + * @return the items by search name + * @throws Exception the exception + */ public List getItemsBySearchName(String text) throws Exception; + /** + * Move item. + * + * @param itemId the item id + * @param destinationId the destination id + * @return the boolean + * @throws Exception the exception + */ public Boolean moveItem(String itemId, String destinationId) throws Exception; + /** + * Removes the item. + * + * @param itemId the item id + * @return the boolean + * @throws Exception the exception + */ public Boolean removeItem(String itemId) throws Exception; + /** + * Rename item. + * + * @param itemId the item id + * @param newName the new name + * @param oldName the old name + * @return the boolean + * @throws Exception the exception + */ public Boolean renameItem(String itemId, String newName, String oldName) throws Exception; + /** + * Removes the smart folder. + * + * @param itemId the item id + * @param name the name + * @return the boolean + * @throws Exception the exception + */ public Boolean removeSmartFolder(String itemId, String name) throws Exception; + /** + * Gets the all contacts. + * + * @return the all contacts + * @throws Exception the exception + */ public List getAllContacts() throws Exception; + /** + * Gets the url web dav. + * + * @param itemId the item id + * @return the url web dav + * @throws Exception the exception + */ public String getUrlWebDav(String itemId) throws Exception; // public boolean sendTo(List listContacts, List listAttachments, String subject, String text) throws Exception; + /** + * Sent to by message model. + * + * @param message the message + * @return true, if successful + * @throws Exception the exception + */ public boolean sentToByMessageModel(MessageModel message) throws Exception; + /** + * Send to by id. + * + * @param listContactsId the list contacts id + * @param listAttachmentsId the list attachments id + * @param subject the subject + * @param text the text + * @return true, if successful + * @throws Exception the exception + */ public boolean sendToById(List listContactsId, List listAttachmentsId, String subject, String text) throws Exception; + /** + * Gets the all messages received. + * + * @return the all messages received + * @throws Exception the exception + */ public List getAllMessagesReceived() throws Exception; + /** + * Gets the new messages received. + * + * @return the new messages received + * @throws Exception the exception + */ public List getNewMessagesReceived() throws Exception; + /** + * Gets the all messages sent. + * + * @return the all messages sent + * @throws Exception the exception + */ public List getAllMessagesSent() throws Exception; + /** + * Search in sent messages by text. + * + * @param text the text + * @return the list + * @throws Exception the exception + */ public List searchInSentMessagesByText(String text) throws Exception; + /** + * Search in received messages by text. + * + * @param text the text + * @return the list + * @throws Exception the exception + */ public List 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. + * + * @param itemId the item id + * @param destinationFolderId the destination folder id + * @return true, if successful + * @throws Exception the exception + */ public boolean copyItem(String itemId, String destinationFolderId) throws Exception; + /** + * Gets the list folder bulk creator. + * + * @return the list folder bulk creator + * @throws Exception the exception + */ public List getListFolderBulkCreator() throws Exception; + /** + * Delete bulk. + * + * @param bulkId the bulk id + * @return true, if successful + * @throws Exception the exception + */ public boolean deleteBulk(String bulkId) throws Exception; + /** + * Gets the time series by id. + * + * @param identifier the identifier + * @return the time series by id + * @throws Exception the exception + */ public GWTWorkspaceItem getTimeSeriesById(String identifier) throws Exception; + /** + * Share folder. + * + * @param folder the folder + * @param listContacts the list contacts + * @param isNewFolder the is new folder + * @param acl the acl + * @return true, if successful + * @throws Exception the exception + */ boolean shareFolder(FileModel folder, List listContacts, boolean isNewFolder, WorkspaceACL acl) throws Exception; + /** + * Gets the list user shared by folder shared id. + * + * @param itemId the item id + * @return the list user shared by folder shared id + * @throws Exception the exception + */ public List getListUserSharedByFolderSharedId(String itemId) throws Exception; + /** + * Un shared folder by folder shared id. + * + * @param folderSharedId the folder shared id + * @return true, if successful + * @throws Exception the exception + */ public boolean unSharedFolderByFolderSharedId(String folderSharedId) throws Exception; + /** + * Gets the list parents by item identifier. + * + * @param itemIdentifier the item identifier + * @param includeItemAsParent the include item as parent + * @return the list parents by item identifier + * @throws Exception the exception + */ public List getListParentsByItemIdentifier(String itemIdentifier, boolean includeItemAsParent) throws Exception; + /** + * Gets the URL from application profile. + * + * @param oid the oid + * @return the URL from application profile + * @throws Exception the exception + */ public String getURLFromApplicationProfile(String oid) throws Exception; + /** + * Gets the owner by item id. + * + * @param itemId the item id + * @return the owner by item id + * @throws Exception the exception + */ public InfoContactModel getOwnerByItemId(String itemId) throws Exception; + /** + * Item exists in workpace folder. + * + * @param parentId the parent id + * @param itemName the item name + * @return the string + * @throws Exception the exception + */ public String itemExistsInWorkpaceFolder(String parentId, String itemName) throws Exception; + /** + * Gets the list user shared by shared item. + * + * @param sharedItemId the shared item id + * @return the list user shared by shared item + * @throws Exception the exception + */ public List getListUserSharedBySharedItem(String sharedItemId) throws Exception; + /** + * Gets the item creation date by id. + * + * @param itemId the item id + * @return the item creation date by id + * @throws Exception the exception + */ public Date getItemCreationDateById(String itemId) throws Exception; + /** + * Load size by item id. + * + * @param itemId the item id + * @return the long + * @throws Exception the exception + */ public Long loadSizeByItemId(String itemId) throws Exception; + /** + * Load last modification date by id. + * + * @param itemId the item id + * @return the date + * @throws Exception the exception + */ public Date loadLastModificationDateById(String itemId) throws Exception; + /** + * Gets the parent by item id. + * + * @param identifier the identifier + * @return the parent by item id + * @throws Exception the exception + */ public FileModel getParentByItemId(String identifier) throws Exception; /** - * @param identifier - * @return - * @throws Exception + * Gets the accounting readers. + * + * @param identifier the identifier + * @return the accounting readers + * @throws Exception the exception */ public List getAccountingReaders(String identifier) throws Exception; /** - * @param identifier - * @return - * @throws Exception + * Gets the accounting history. + * + * @param identifier the identifier + * @return the accounting history + * @throws Exception the exception */ public List getAccountingHistory(String identifier) throws Exception; /** - * @param itemId - * @return - * @throws Exception + * Gets the item for file grid. + * + * @param itemId the item id + * @return the item for file grid + * @throws Exception the exception */ public FileGridModel getItemForFileGrid(String itemId) throws Exception; /** - * @param folderId - * @return - * @throws Exception + * Gets the folder children for file grid by id. + * + * @param folderId the folder id + * @return the folder children for file grid by id + * @throws Exception the exception + * @throws SessionExpiredException the session expired exception */ List getFolderChildrenForFileGridById(String folderId) throws Exception, SessionExpiredException; + /** + * Gets the short url. + * + * @param longUrl the long url + * @return the short url + * @throws Exception the exception + */ String getShortUrl(String longUrl) throws Exception; /** - * @param itemId - * @param shortenUrl - * @return - * @throws Exception + * Gets the public link for folder item id. + * + * @param itemId the item id + * @param shortenUrl the shorten url + * @return the public link for folder item id + * @throws Exception the exception */ PublicLink getPublicLinkForFolderItemId(String itemId, boolean shortenUrl) throws Exception; + /** + * Checks if is session expired. + * + * @return true, if is session expired + * @throws Exception the exception + */ boolean isSessionExpired() throws Exception; + /** + * Delete list items for ids. + * + * @param ids the ids + * @throws Exception the exception + */ void deleteListItemsForIds(List ids) throws Exception; /** - * @param idsItem - * @param destinationFolderId - * @return - * @throws Exception + * Copy items. + * + * @param idsItem the ids item + * @param destinationFolderId the destination folder id + * @return true, if successful + * @throws Exception the exception */ boolean copyItems(List idsItem, String destinationFolderId) throws Exception; /** - * @param ids - * @param destinationId - * @return - * @throws Exception + * Move items. + * + * @param ids the ids + * @param destinationId the destination id + * @return the boolean + * @throws Exception the exception */ Boolean moveItems(List ids, String destinationId) throws Exception; + /** + * Gets the AC ls. + * + * @return the AC ls + * @throws Exception the exception + */ List getACLs() throws Exception; + /** + * Sets the ac ls. + * + * @param folderId the folder id + * @param listLogins the list logins + * @param aclType the acl type + * @throws Exception the exception + */ void setACLs(String folderId, List listLogins, String aclType) throws Exception; + /** + * Gets the my login. + * + * @return the my login + */ UserBean getMyLogin(); + /** + * Update acl for vr eby group name. + * + * @param folderId the folder id + * @param aclType the acl type + * @throws Exception the exception + */ void updateACLForVREbyGroupName(String folderId, String aclType) throws Exception; /** - * @param folderId - * @return - * @throws Exception + * Gets the user acl for folder id. + * + * @param folderId the folder id + * @return the user acl for folder id + * @throws Exception the exception */ List getUserACLForFolderId(String folderId) throws Exception; /** - * @return - * @throws Exception + * Gets the trash content. + * + * @return the trash content + * @throws Exception the exception */ List getTrashContent() throws Exception; + /** - * @param folderId - * @return - * @throws Exception + * Gets the AC ls description for workspace item by id. + * + * @param workspaceItemId the workspace item id + * @return the AC ls description for workspace item by id + * @throws Exception the exception */ - String getACLsDescriptionForSharedFolderId(String folderId) throws Exception; + String getACLsDescriptionForWorkspaceItemById(String workspaceItemId) throws Exception; /** - * @param folderId - * @return - * @throws Exception + * Gets the users manager to shared folder. + * + * @param folderId the folder id + * @return the users manager to shared folder + * @throws Exception the exception */ List getUsersManagerToSharedFolder(String folderId) throws Exception; /** - * @param listTrashItemIds - * @param operation - * @return - * @throws Exception + * Update trash content. + * + * @param operation the operation + * @return the trash content + * @throws Exception the exception */ TrashContent updateTrashContent(WorkspaceTrashOperation operation) throws Exception; /** - * @param listTrashItemIds - * @param operation - * @return - * @throws Exception + * Execute operation on trash. + * + * @param listTrashItemIds the list trash item ids + * @param operation the operation + * @return the trash operation content + * @throws Exception the exception */ TrashOperationContent executeOperationOnTrash(List listTrashItemIds, WorkspaceTrashOperation operation) throws Exception; + /** + * Adds the administrators by folder id. + * + * @param folderId the folder id + * @param listContactIds the list contact ids + * @return true, if successful + * @throws Exception the exception + */ boolean addAdministratorsByFolderId(String folderId, List listContactIds) throws Exception; + /** + * Gets the administrators by folder id. + * + * @param identifier the identifier + * @return the administrators by folder id + * @throws Exception the exception + */ List getAdministratorsByFolderId(String identifier) throws Exception; + /** + * Gets the ACL by shared folder id. + * + * @param identifier the identifier + * @return the ACL by shared folder id + * @throws Exception the exception + */ WorkspaceACL getACLBySharedFolderId(String identifier) throws Exception; /** - * @return - * @throws Exception + * Gets the user workspace total items. + * + * @return the user workspace total items + * @throws Exception the exception */ long getUserWorkspaceTotalItems() throws Exception; /** - * @return - * @throws Exception + * Gets the user workspace quote. + * + * @return the user workspace quote + * @throws Exception the exception */ WorkspaceUserQuote getUserWorkspaceQuote() throws Exception; /** - * @param identifier - * @return - * @throws Exception + * Gets the item description by id. + * + * @param identifier the identifier + * @return the item description by id + * @throws Exception the exception */ String getItemDescriptionById(String identifier) throws Exception; /** - * @param folderId - * @param listLogins - * @param aclType - * @return - * @throws Exception + * Validate acl to user. + * + * @param folderId the folder id + * @param listLogins the list logins + * @param aclType the acl type + * @return the report assignment acl + * @throws Exception the exception */ ReportAssignmentACL validateACLToUser(String folderId, List listLogins, String aclType) throws Exception; + /** + * Load gcube item properties. + * + * @param itemId the item id + * @return the map + * @throws Exception the exception + */ Map loadGcubeItemProperties(String itemId) throws Exception; /** - * @param itemId - * @return - * @throws Exception + * Gets the HTML gcube item properties. + * + * @param itemId the item id + * @return the HTML gcube item properties + * @throws Exception the exception */ String getHTMLGcubeItemProperties(String itemId) throws Exception; /** - * @param itemId - * @param properties - * @throws Exception + * Sets the gcube item properties. + * + * @param itemId the item id + * @param properties the properties + * @throws Exception the exception */ void setGcubeItemProperties(String itemId, Map properties) throws Exception; diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java index a68c2f0..66abd88 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/rpc/GWTWorkspaceServiceAsync.java @@ -30,218 +30,782 @@ import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import com.google.gwt.user.client.rpc.AsyncCallback; + +/** + * The Interface GWTWorkspaceServiceAsync. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jul 14, 2015 + */ public interface GWTWorkspaceServiceAsync { + + /** + * Gets the user workspace size. + * + * @param callback the callback + * @return the user workspace size + */ void getUserWorkspaceSize(AsyncCallback callback); + /** + * Gets the root for tree. + * + * @param callback the callback + * @return the root for tree + */ void getRootForTree(AsyncCallback callback); + /** + * Gets the root for tree. + * + * @param scopeId the scope id + * @param callback the callback + * @return the root for tree + */ void getRootForTree(String scopeId, AsyncCallback callback); + /** + * Gets the folder children. + * + * @param folder the folder + * @param callback the callback + * @return the folder children + */ void getFolderChildren(FolderModel folder, AsyncCallback> callback); + /** + * Gets the folder children for file grid. + * + * @param folder the folder + * @param callback the callback + * @return the folder children for file grid + */ void getFolderChildrenForFileGrid(FileModel folder, AsyncCallback> callback); + /** + * Move item. + * + * @param itemId the item id + * @param destinationId the destination id + * @param callback the callback + */ void moveItem(String itemId, String destinationId, AsyncCallback callback); + /** + * Removes the item. + * + * @param itemId the item id + * @param callback the callback + */ void removeItem(String itemId, AsyncCallback callback); + /** + * Rename item. + * + * @param itemId the item id + * @param newName the new name + * @param oldName the old name + * @param callback the callback + */ void renameItem(String itemId, String newName, String oldName, AsyncCallback callback); + /** + * Creates the folder. + * + * @param nameFolder the name folder + * @param description the description + * @param parent the parent + * @param callback the callback + */ void createFolder(String nameFolder, String description, FileModel parent, AsyncCallback callback); + /** + * Gets the details file. + * + * @param item the item + * @param callback the callback + * @return the details file + */ void getDetailsFile(FileModel item, AsyncCallback callback); + /** + * Gets the children sub tree to root by identifier. + * + * @param itemIdentifier the item identifier + * @param callback the callback + * @return the children sub tree to root by identifier + */ void getChildrenSubTreeToRootByIdentifier(String itemIdentifier, AsyncCallback> callback); + /** + * Gets the items by search name. + * + * @param text the text + * @param callback the callback + * @return the items by search name + */ void getItemsBySearchName(String text, AsyncCallback> callback); + /** + * Gets the smart folder results by category. + * + * @param category the category + * @param callback the callback + * @return the smart folder results by category + */ void getSmartFolderResultsByCategory(String category, AsyncCallback> callback); + /** + * Creates the smart folder. + * + * @param name the name + * @param description the description + * @param query the query + * @param callback the callback + */ void createSmartFolder(String name, String description, String query, AsyncCallback callback); + /** + * Gets the smart folder results by id. + * + * @param folderId the folder id + * @param callback the callback + * @return the smart folder results by id + */ void getSmartFolderResultsById(String folderId, AsyncCallback> callback); + /** + * Gets the all smart folders. + * + * @param callback the callback + * @return the all smart folders + */ void getAllSmartFolders(AsyncCallback> callback); + /** + * Gets the image by id. + * + * @param identifier the identifier + * @param isInteralImage the is interal image + * @param fullDetails the full details + * @param callback the callback + * @return the image by id + */ void getImageById(String identifier, boolean isInteralImage, boolean fullDetails, AsyncCallback callback); + /** + * Gets the url by id. + * + * @param identifier the identifier + * @param isInternalUrl the is internal url + * @param fullDetails the full details + * @param callback the callback + * @return the url by id + */ void getUrlById(String identifier, boolean isInternalUrl, boolean fullDetails, AsyncCallback callback); + /** + * Creates the external url. + * + * @param parentFileModel the parent file model + * @param name the name + * @param description the description + * @param url the url + * @param callback the callback + */ void createExternalUrl(FileModel parentFileModel, String name, String description, String url, AsyncCallback callback); + /** + * Sets the value in session. + * + * @param name the name + * @param value the value + * @param callback the callback + */ void setValueInSession(String name, String value, AsyncCallback callback); + /** + * Removes the smart folder. + * + * @param itemId the item id + * @param name the name + * @param callback the callback + */ void removeSmartFolder(String itemId, String name, AsyncCallback callback); + /** + * Gets the all scope. + * + * @param callback the callback + * @return the all scope + */ void getAllScope(AsyncCallback> callback); + /** + * Gets the all contacts. + * + * @param callback the callback + * @return the all contacts + */ void getAllContacts(AsyncCallback> callback); // void sendTo(List listContacts, List listAttachments, String subject, String text, AsyncCallback callback); - void sendToById(List listContactsId, List listAttachmentsId, String subject, String text, AsyncCallback callback); + /** + * Send to by id. + * + * @param listContactsId the list contacts id + * @param listAttachmentsId the list attachments id + * @param subject the subject + * @param text the text + * @param callback the callback + */ +void sendToById(List listContactsId, List listAttachmentsId, String subject, String text, AsyncCallback callback); + /** + * Gets the all messages received. + * + * @param callback the callback + * @return the all messages received + */ void getAllMessagesReceived(AsyncCallback> callback); + /** + * Gets the all messages sent. + * + * @param callback the callback + * @return the all messages sent + */ void getAllMessagesSent(AsyncCallback> 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 asyncCallback); + /** + * Sent to by message model. + * + * @param message the message + * @param callback the callback + */ void sentToByMessageModel(MessageModel message, AsyncCallback callback); + /** + * Save attachments. + * + * @param messageIdentifier the message identifier + * @param messageType the message type + * @param callback the callback + */ void saveAttachments(String messageIdentifier, String messageType, AsyncCallback callback); + /** + * Save attach. + * + * @param attachId the attach id + * @param callback the callback + */ void saveAttach(String attachId, AsyncCallback 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 callback); + /** + * Delete message. + * + * @param messageIdentifier the message identifier + * @param messageType the message type + * @param callback the callback + */ void deleteMessage(String messageIdentifier, String messageType, AsyncCallback callback); + /** + * Gets the new messages received. + * + * @param callback the callback + * @return the new messages received + */ void getNewMessagesReceived(AsyncCallback> callback); + /** + * Copy item. + * + * @param itemId the item id + * @param destinationFolderId the destination folder id + * @param callback the callback + */ void copyItem(String itemId, String destinationFolderId, AsyncCallback callback); + /** + * Gets the list folder bulk creator. + * + * @param callback the callback + * @return the list folder bulk creator + */ void getListFolderBulkCreator(AsyncCallback> callback); + /** + * Delete bulk. + * + * @param bulkId the bulk id + * @param callback the callback + */ void deleteBulk(String bulkId, AsyncCallback callback); + /** + * Gets the url web dav. + * + * @param itemId the item id + * @param callback the callback + * @return the url web dav + */ void getUrlWebDav(String itemId, AsyncCallback callback); + /** + * Search in sent messages by text. + * + * @param text the text + * @param callback the callback + */ void searchInSentMessagesByText(String text, AsyncCallback> callback); + /** + * Search in received messages by text. + * + * @param text the text + * @param callback the callback + */ void searchInReceivedMessagesByText(String text, AsyncCallback> callback); + /** + * Gets the time series by id. + * + * @param identifier the identifier + * @param callback the callback + * @return the time series by id + */ void getTimeSeriesById(String identifier, AsyncCallback callback); + /** + * Share folder. + * + * @param folder the folder + * @param listContacts the list contacts + * @param isNewFolder the is new folder + * @param acl the acl + * @param callback the callback + */ void shareFolder(FileModel folder, List listContacts, boolean isNewFolder, WorkspaceACL acl, AsyncCallback callback); + /** + * Gets the list user shared by folder shared id. + * + * @param itemId the item id + * @param callback the callback + * @return the list user shared by folder shared id + */ void getListUserSharedByFolderSharedId(String itemId, AsyncCallback> callback); + /** + * Un shared folder by folder shared id. + * + * @param folderSharedId the folder shared id + * @param callback the callback + */ void unSharedFolderByFolderSharedId(String folderSharedId, AsyncCallback callback); + /** + * Gets the list parents by item identifier. + * + * @param itemIdentifier the item identifier + * @param includeItemAsParent the include item as parent + * @param callback the callback + * @return the list parents by item identifier + */ void getListParentsByItemIdentifier(String itemIdentifier, boolean includeItemAsParent, AsyncCallback> callback); + /** + * Gets the URL from application profile. + * + * @param oid the oid + * @param callback the callback + * @return the URL from application profile + */ void getURLFromApplicationProfile(String oid, AsyncCallback callback); + /** + * Gets the owner by item id. + * + * @param itemId the item id + * @param callback the callback + * @return the owner by item id + */ void getOwnerByItemId(String itemId, AsyncCallback callback); + /** + * Item exists in workpace folder. + * + * @param parentId the parent id + * @param itemName the item name + * @param callback the callback + */ void itemExistsInWorkpaceFolder(String parentId, String itemName, AsyncCallback callback); + /** + * Gets the list user shared by shared item. + * + * @param sharedItemId the shared item id + * @param callback the callback + * @return the list user shared by shared item + */ void getListUserSharedBySharedItem(String sharedItemId, AsyncCallback> callback); + /** + * Gets the item creation date by id. + * + * @param itemId the item id + * @param asyncCallback the async callback + * @return the item creation date by id + */ void getItemCreationDateById(String itemId, AsyncCallback asyncCallback); + /** + * Load size by item id. + * + * @param itemId the item id + * @param asyncCallback the async callback + */ void loadSizeByItemId(String itemId, AsyncCallback asyncCallback); + /** + * Load last modification date by id. + * + * @param itemId the item id + * @param callback the callback + */ void loadLastModificationDateById(String itemId, AsyncCallback callback); + /** + * Gets the parent by item id. + * + * @param identifier the identifier + * @param asyncCallback the async callback + * @return the parent by item id + */ void getParentByItemId(String identifier, AsyncCallback asyncCallback); + /** + * Gets the accounting readers. + * + * @param identifier the identifier + * @param callback the callback + * @return the accounting readers + */ void getAccountingReaders(String identifier, AsyncCallback> callback); + /** + * Gets the accounting history. + * + * @param identifier the identifier + * @param callback the callback + * @return the accounting history + */ void getAccountingHistory(String identifier, AsyncCallback> callback); + /** + * Gets the item for file grid. + * + * @param itemId the item id + * @param callback the callback + * @return the item for file grid + */ void getItemForFileGrid(String itemId, AsyncCallback callback); + /** + * Gets the folder children for file grid by id. + * + * @param folderId the folder id + * @param callback the callback + * @return the folder children for file grid by id + */ void getFolderChildrenForFileGridById(String folderId, AsyncCallback> callback); + /** + * Gets the short url. + * + * @param longUrl the long url + * @param callback the callback + * @return the short url + */ void getShortUrl(String longUrl, AsyncCallback callback); + /** + * Gets the public link for folder item id. + * + * @param itemId the item id + * @param shortenUrl the shorten url + * @param callback the callback + * @return the public link for folder item id + */ void getPublicLinkForFolderItemId(String itemId, boolean shortenUrl, AsyncCallback callback); /** - * + * Checks if is session expired. + * + * @param callback the callback */ void isSessionExpired(AsyncCallback callback); + /** + * Delete list items for ids. + * + * @param ids the ids + * @param callback the callback + */ void deleteListItemsForIds(List ids, AsyncCallback callback); + /** + * Copy items. + * + * @param idsItem the ids item + * @param destinationFolderId the destination folder id + * @param callback the callback + */ void copyItems(List idsItem, String destinationFolderId, AsyncCallback callback); + /** + * Move items. + * + * @param ids the ids + * @param destinationId the destination id + * @param callback the callback + */ void moveItems(List ids, String destinationId, AsyncCallback callback); + /** + * Gets the AC ls. + * + * @param callback the callback + * @return the AC ls + */ void getACLs(AsyncCallback> callback); + /** + * Sets the ac ls. + * + * @param folderId the folder id + * @param listLogins the list logins + * @param aclType the acl type + * @param callback the callback + */ void setACLs(String folderId, List listLogins, String aclType, AsyncCallback callback); + /** + * Gets the my login. + * + * @param callback the callback + * @return the my login + */ void getMyLogin(AsyncCallback callback); + /** + * Update acl for vr eby group name. + * + * @param folderId the folder id + * @param aclType the acl type + * @param callback the callback + */ void updateACLForVREbyGroupName(String folderId, String aclType, AsyncCallback callback); + /** + * Gets the user acl for folder id. + * + * @param folderId the folder id + * @param callback the callback + * @return the user acl for folder id + */ void getUserACLForFolderId(String folderId, AsyncCallback> callback); + /** + * Gets the trash content. + * + * @param callback the callback + * @return the trash content + */ void getTrashContent(AsyncCallback> callback); + /** + * Update trash content. + * + * @param operation the operation + * @param callback the callback + */ void updateTrashContent(WorkspaceTrashOperation operation, AsyncCallback callback); - void getACLsDescriptionForSharedFolderId(String folderId, + /** + * Gets the AC ls description for workspace item by id. + * + * @param workspaceItemId the workspace item id + * @param callback the callback + * @return the AC ls description for workspace item by id + */ + void getACLsDescriptionForWorkspaceItemById(String workspaceItemId, AsyncCallback callback); + /** + * Gets the users manager to shared folder. + * + * @param folderId the folder id + * @param callback the callback + * @return the users manager to shared folder + */ void getUsersManagerToSharedFolder(String folderId, AsyncCallback> callback); + /** + * Execute operation on trash. + * + * @param listTrashItemIds the list trash item ids + * @param operation the operation + * @param callback the callback + */ void executeOperationOnTrash(List listTrashItemIds, WorkspaceTrashOperation operation, AsyncCallback callback); + /** + * Adds the administrators by folder id. + * + * @param folderId the folder id + * @param listLogins the list logins + * @param callback the callback + */ void addAdministratorsByFolderId(String folderId, List listLogins, AsyncCallback callback); /** - * @param identifier + * Gets the administrators by folder id. + * + * @param identifier the identifier + * @param callback the callback + * @return the administrators by folder id */ void getAdministratorsByFolderId(String identifier, AsyncCallback> callback); + /** + * Gets the ACL by shared folder id. + * + * @param identifier the identifier + * @param callback the callback + * @return the ACL by shared folder id + */ void getACLBySharedFolderId(String identifier, AsyncCallback callback); + /** + * Gets the user workspace total items. + * + * @param callback the callback + * @return the user workspace total items + */ void getUserWorkspaceTotalItems(AsyncCallback callback); + /** + * Gets the user workspace quote. + * + * @param callback the callback + * @return the user workspace quote + */ void getUserWorkspaceQuote(AsyncCallback callback); + /** + * Gets the item description by id. + * + * @param identifier the identifier + * @param callback the callback + * @return the item description by id + */ void getItemDescriptionById(String identifier, AsyncCallback callback); + /** + * Validate acl to user. + * + * @param folderId the folder id + * @param listLogins the list logins + * @param aclType the acl type + * @param callback the callback + */ void validateACLToUser(String folderId, List listLogins, String aclType, AsyncCallback callback); /** - * @param itemId - * @param asyncCallback + * Load gcube item properties. + * + * @param itemId the item id + * @param asyncCallback the async callback */ void loadGcubeItemProperties(String itemId, AsyncCallback> asyncCallback); + /** + * Gets the HTML gcube item properties. + * + * @param itemId the item id + * @param callback the callback + * @return the HTML gcube item properties + */ void getHTMLGcubeItemProperties(String itemId, AsyncCallback callback); + /** + * Sets the gcube item properties. + * + * @param itemId the item id + * @param properties the properties + * @param callback the callback + */ void setGcubeItemProperties(String itemId, Map properties, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java index 43a4846..608e8e8 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java @@ -399,7 +399,7 @@ public class DialogGetInfo extends Dialog { htmlUsersWidget.mask(); - AppControllerExplorer.rpcWorkspaceService.getACLsDescriptionForSharedFolderId(sharedId, new AsyncCallback() { + AppControllerExplorer.rpcWorkspaceService.getACLsDescriptionForWorkspaceItemById(sharedId, new AsyncCallback() { @Override public void onFailure(Throwable caught) { diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java index 39821cc..913f0a7 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java @@ -2024,7 +2024,7 @@ public class GWTWorkspaceBuilder { * Gets the formatted html acl from ac ls. * * @param aclOwner the acl owner - * @return the formatted html acl from ac ls + * @return the formatted html of the ACLs */ public String getFormatHtmlACLFromACLs(Map> aclOwner) { diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java index 46708d1..aed8e51 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java @@ -2988,22 +2988,33 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT } /** - * Gets the AC ls description for shared folder id. + * Gets ACLs Description For WorkspaceItem ById * - * @param folderId the folder id - * @return Format HTML - A DIV HTML containing ACLs description for folderId + * @param workspaceItemId the folder id + * @return a description of the ACLs * @throws Exception the exception */ @Override - public String getACLsDescriptionForSharedFolderId(String folderId) throws Exception{ + public String getACLsDescriptionForWorkspaceItemById(String workspaceItemId) throws Exception{ try { - WorkspaceFolder wsFolder = getSharedWorkspaceFolderForId(folderId); + workspaceLogger.trace("Get ACLsDescriptionForWorkspaceItemById: "+workspaceItemId); + + Workspace workspace = getWorkspace(); + WorkspaceItem wsItem = workspace.getItem(workspaceItemId); + GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder(); - return builder.getFormatHtmlACLFromACLs(wsFolder.getACLOwner()); + + Map> acls = wsItem.getACLOwner(); + + if(acls==null) + throw new Exception("ACLOwner is null!"); + + return builder.getFormatHtmlACLFromACLs(acls); + } catch (Exception e) { - workspaceLogger.error("Error in server get getACLForFolderId", e); - String error = ConstantsExplorer.SERVER_ERROR +" get ACL rules for selected folder. "+e.getMessage(); + workspaceLogger.error("Error in getACLsDescriptionForWorkspaceItemById for workspaceItemId: "+workspaceItemId, e); + String error = ConstantsExplorer.SERVER_ERROR +" getting ACL rules for requested item. "+e.getMessage(); throw new Exception(error); } }