fixed posted url with ho images
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@94363 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
50b59d03ad
commit
77258468d4
|
@ -11,7 +11,6 @@ import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class LinkPreviewer extends Composite {
|
public class LinkPreviewer extends Composite {
|
||||||
|
|
||||||
private static LinkPreviewUiBinder uiBinder = GWT
|
private static LinkPreviewUiBinder uiBinder = GWT
|
||||||
.create(LinkPreviewUiBinder.class);
|
.create(LinkPreviewUiBinder.class);
|
||||||
|
|
||||||
|
@ -20,12 +19,17 @@ public class LinkPreviewer extends Composite {
|
||||||
|
|
||||||
public LinkPreviewer(String title, String titleDesc, String host, String linkThumbUrl, String url) {
|
public LinkPreviewer(String title, String titleDesc, String host, String linkThumbUrl, String url) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
if (linkThumbUrl == null || linkThumbUrl.equals("null"))
|
||||||
|
image.removeFromParent();
|
||||||
|
else {
|
||||||
|
image.setUrl(linkThumbUrl);
|
||||||
|
image.setWidth("80px");
|
||||||
|
}
|
||||||
titleArea.setHTML("<a class=\"link\" target=\"_blank\" href=\"" + url + "\">"+title+"</a> <span style=\"color: #333;\"> - " + host+ "</span>");
|
titleArea.setHTML("<a class=\"link\" target=\"_blank\" href=\"" + url + "\">"+title+"</a> <span style=\"color: #333;\"> - " + host+ "</span>");
|
||||||
urlText.setHTML((url.length() > 70) ? url.substring(0, 70)+"..." : url);
|
urlText.setHTML((url.length() > 70) ? url.substring(0, 70)+"..." : url);
|
||||||
String desc = titleDesc;
|
String desc = titleDesc;
|
||||||
descText.setHTML((desc.length() > 256) ? desc.substring(0, 256)+"..." : desc);
|
descText.setHTML((desc.length() > 256) ? desc.substring(0, 256)+"..." : desc);
|
||||||
image.setUrl(linkThumbUrl);
|
|
||||||
image.setWidth("80px");
|
|
||||||
}
|
}
|
||||||
@UiField
|
@UiField
|
||||||
HTML titleArea;
|
HTML titleArea;
|
||||||
|
|
|
@ -518,10 +518,6 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
return edited;
|
return edited;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String replaceAmpersand(String toReplace) {
|
|
||||||
String toReturn = toReplace.replaceAll("&", "&");
|
|
||||||
return toReturn;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* this method sorts the Feeds in Chronological Reversed order and adds additional user informations
|
* this method sorts the Feeds in Chronological Reversed order and adds additional user informations
|
||||||
* @param toEnhance
|
* @param toEnhance
|
||||||
|
@ -537,7 +533,6 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
boolean skip = false;
|
boolean skip = false;
|
||||||
for (Feed feed : toEnhance) {
|
for (Feed feed : toEnhance) {
|
||||||
skip = false;
|
skip = false;
|
||||||
feed.setDescription(replaceAmpersand(feed.getDescription()));
|
|
||||||
if (! feed.isApplicationFeed()) {
|
if (! feed.isApplicationFeed()) {
|
||||||
String thumb = getUserImagePortraitUrlLocal(feed.getEntityId());
|
String thumb = getUserImagePortraitUrlLocal(feed.getEntityId());
|
||||||
if (thumb == null) {
|
if (thumb == null) {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 953 B |
Loading…
Reference in New Issue