removed bug on person tagged uid ref

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@73549 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-04-17 15:42:35 +00:00
parent 1a56979f8d
commit a1907bbe76
1 changed files with 11 additions and 3 deletions

View File

@ -125,7 +125,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
System.out.println("SessionID = " + sessionID);
return SessionManager.getInstance().getASLSession(sessionID, user);
}
/**
* this method extractPeopleTags from the user post
* @param postText text with tagged people: txt .. <input with the actual person profile
* @return
*/
private ArrayList<String> extractPeopleTags(String postText) {
ArrayList<String> toReturn = new ArrayList<String>();
String toParse = "<html><head></head><body>" + postText + "</body></html>";
@ -144,7 +148,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
}
return toReturn;
}
/**
* remove all the html and leave the text
* @param html
* @return the text inside the html
*/
private static String html2text(String html) {
return Jsoup.parse(html).text();
}
@ -186,7 +194,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
i = 0;
for (String tagged : taggedPeople) {
String username = (i < usernames.size()) ? usernames.get(i) : "";
String taggedHTML = "<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?uid=\""+ username + "\">"+tagged+"</a> ";
String taggedHTML = "<a class=\"link\" href=\""+GCubeSocialNetworking.USER_PROFILE_LINK+"?uid="+ username + "\">"+tagged+"</a> ";
escapedFeedText = escapedFeedText.replace("_usr_place_holder_["+i+"]", taggedHTML);
i++;
}