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
Feature/26194
Massimiliano Assante 8 years ago
parent b05a56db80
commit ac207b4ada

@ -840,11 +840,19 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
ArrayList<EnhancedFeed> toReturn = new ArrayList<EnhancedFeed>();
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) {

Loading…
Cancel
Save