Bug fix and update to handle the new ClientFeed class
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@122276 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
97f39a4ee4
commit
1cae9150af
|
@ -367,6 +367,8 @@ public class ShareUpdateForm extends Composite {
|
|||
|
||||
if(numberOfAttachmentsUploaded() > 0){
|
||||
postContent = PostContent.TEXT_AND_ATTACHMENTS;
|
||||
|
||||
if(toShare.equals(""))
|
||||
toShare = NO_TEXT_FILE_SHARE;
|
||||
}
|
||||
|
||||
|
@ -494,9 +496,6 @@ public class ShareUpdateForm extends Composite {
|
|||
@Override
|
||||
public void onSuccess(ClientFeed result) {
|
||||
|
||||
GWT.log("OK");
|
||||
|
||||
|
||||
submitButton.setEnabled(true);
|
||||
shareTextArea.setEnabled(true);
|
||||
shareTextArea.setText(SHARE_UPDATE_TEXT);
|
||||
|
|
|
@ -243,7 +243,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
//everything went fine
|
||||
ClientFeed cf = new ClientFeed(toShare.getKey(), toShare.getType().toString(), username, feedDate, toShare.getUri(),
|
||||
TextTransfromUtils.replaceAmpersand(toShare.getDescription()), fullName, email, thumbnailAvatarURL, toShare.getLinkTitle(), toShare.getLinkDescription(),
|
||||
toShare.getUriThumbnail(), toShare.getLinkHost());
|
||||
toShare.getUriThumbnail(), toShare.getLinkHost(), null);
|
||||
|
||||
|
||||
//send the notification about this posts to everyone in the group if notifyGroup is true
|
||||
|
@ -277,6 +277,8 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
PrivacyLevel pLevel, String vreId, ArrayList<UploadedFile> uploadedFiles,
|
||||
ArrayList<String> mentionedUserFullNames, boolean notifyGroup, boolean saveCopyWokspace) {
|
||||
|
||||
_log.debug("Incoming text is " + feedText);
|
||||
|
||||
// escape text
|
||||
String escapedFeedText = TextTransfromUtils.escapeHtmlAndTransformUrl(feedText);
|
||||
|
||||
|
@ -321,7 +323,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
firstAttachmentDescription = "",
|
||||
firstAttachmentFormat = "",
|
||||
firstAttachmentDownloadUrl = "",
|
||||
firstAttachmenturlThumbnail = "";
|
||||
firstAttachmenturlThumbnail = "null";
|
||||
|
||||
if(uploadedFiles.size() > 0){
|
||||
|
||||
|
@ -332,7 +334,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
firstAttachmentDescription = firstAttachment.getDescription();
|
||||
firstAttachmentFormat = firstAttachment.getFormat();
|
||||
firstAttachmentDownloadUrl = firstAttachment.getDownloadUrl();
|
||||
firstAttachmenturlThumbnail = firstAttachment.getThumbnailUrl();
|
||||
firstAttachmenturlThumbnail = firstAttachment.getThumbnailUrl() != null ? firstAttachment.getThumbnailUrl() : "null";
|
||||
|
||||
if(uploadedFiles.size() > 1){
|
||||
|
||||
|
@ -430,10 +432,12 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
}
|
||||
if (!result) return null;
|
||||
|
||||
_log.debug("Saved feed text is " + toShare.getDescription());
|
||||
|
||||
//everything went fine
|
||||
ClientFeed cf = new ClientFeed(toShare.getKey(), toShare.getType().toString(), username, feedDate, toShare.getUri(),
|
||||
TextTransfromUtils.replaceAmpersand(toShare.getDescription()), fullName, email, thumbnailAvatarURL, toShare.getLinkTitle(), toShare.getLinkDescription(),
|
||||
toShare.getUriThumbnail(), toShare.getLinkHost());
|
||||
toShare.getUriThumbnail(), toShare.getLinkHost(), attachments);
|
||||
|
||||
|
||||
//send the notification about this posts to everyone in the group if notifyGroup is true
|
||||
|
@ -537,14 +541,14 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
|
||||
String httpURL = "";
|
||||
String smpURI = "";
|
||||
//if (isWithinPortal()) {
|
||||
if (isWithinPortal()) {
|
||||
//get the url to show, before actually uploading it
|
||||
smpURI = "http://ciccio.com";//storageClient.getUrl(true).RFile(remoteFilePath);
|
||||
smpURI = storageClient.getUrl(true).RFile(remoteFilePath); //"http://ciccio.com";
|
||||
|
||||
//The storage uploader Thread starts here asyncronously
|
||||
//Thread thread = new Thread(new UploadToStorageThread(storageClient, fileName, fileabsolutePathOnServer, remoteFilePath));
|
||||
//thread.start();
|
||||
//}
|
||||
Thread thread = new Thread(new UploadToStorageThread(storageClient, fileName, fileabsolutePathOnServer, remoteFilePath));
|
||||
thread.start();
|
||||
}
|
||||
|
||||
try {
|
||||
String mimeType = FilePreviewer.getMimeType(new File(fileabsolutePathOnServer), fileName);
|
||||
|
|
Loading…
Reference in New Issue