partially fixed bug for mention link backward compatibility

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@130439 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-07-15 09:46:24 +00:00
parent b05a56db80
commit ac207b4ada
1 changed files with 9 additions and 1 deletions

View File

@ -841,10 +841,18 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
ASLSession session = getASLSession();
String username = session.getUsername();
//patch needed for maintaining mention link backward compatibility (they point to /group/data-e-infrastructure-gateway/profile)
final String LINK_TO_REPLACE = "data-e-infrastructure-gateway";
String siteLandinPagePath = PortalContext.getConfiguration().getSiteLandingPagePath(getThreadLocalRequest());
String tokenTosubstitute = siteLandinPagePath.replace("/group/", "");
ArrayList<String> likedFeeds = (ArrayList<String>) store.getAllLikedFeedIdsByUser(getASLSession().getUsername());
boolean skip = false;
for (Feed feed : toEnhance) {
//patch needed for maintaining mention link backward compatibility (they point to /group/data-e-infrastructure-gateway/profile)
String currPostText = feed.getDescription().replace(LINK_TO_REPLACE,tokenTosubstitute);
feed.setDescription(currPostText);
boolean isMultiFileUpload = feed.isMultiFileUpload();
ArrayList<Attachment> attachments = new ArrayList<Attachment>();
if (isMultiFileUpload) {