News Feed: Users fetching for Mentioning is slow when portlet is in displayed at root level.

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@169025 82a268e6-3cf1-43bd-a215-b396298e98cf
Feature/26194
Massimiliano Assante 6 years ago
parent e789e56ae4
commit 0fd53fd317

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/news-feed-2.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/news-feed-2.7.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/news-feed-2.6.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/news-feed-2.7.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -39,5 +39,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/news-feed-2.6.1-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/news-feed-2.7.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -8,7 +8,10 @@
<dependent-module archiveName="gcube-widgets-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="pickitem-widget-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
<dependent-module archiveName="social-util-library-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/social-util-library/social-util-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="pickitem-widget-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>news-feed</artifactId>
<packaging>war</packaging>
<version>2.6.1-SNAPSHOT</version>
<version>2.7.0-SNAPSHOT</version>
<name>gCube News Feed Portlet</name>
<description>
@ -200,7 +200,7 @@
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>pickitem-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>

@ -65,6 +65,7 @@ public class AddCommentTemplate extends Composite {
submitButton.setVisible(false);
cancelButton.setVisible(false);
commentTextArea.setHeight("30px");
commentTextArea.setContext(owner.getVREContext());
}
/**
* called on edit comment
@ -84,6 +85,7 @@ public class AddCommentTemplate extends Composite {
commentText = commentText.replaceAll("&amp;","&");
owner = caller;
commentTextArea.setContext(owner.getVREContext());
avatarImage.setPixelSize(30, 30);
avatarImage.setUrl(caller.getMyUserInfo().getAvatarId());
commentTextArea.setText(commentText);

@ -4,11 +4,6 @@
xmlns:w="urn:import:org.gcube.portlets.user.gcubewidgets.client.elements"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:m="urn:import:org.gcube.portlets.user.newsfeed.client.ui">
<ui:style>
.important {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel styleName="comment-hidden" ui:field="mainPanel">
<table class="single-comment">
<tr>

@ -3,7 +3,6 @@
*/
package org.gcube.portlets.user.newsfeed.client.ui;
import java.util.ArrayList;
import java.util.HashSet;
import org.gcube.portlets.user.gcubewidgets.client.elements.Div;
@ -28,7 +27,6 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.TextArea;
/**
@ -45,7 +43,7 @@ public class SuperPosedTextArea extends TextArea {
private Div highlighterDIV;
public final static int ARROW_UP = 38;
public final static int ARROW_DOWN = 40;
private String context;
private HashSet<MentionedDTO> mentionedUsers = new HashSet<MentionedDTO>();
private String areaId;
@ -87,16 +85,8 @@ public class SuperPosedTextArea extends TextArea {
this.addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
newsService.getOrganizationUsers(new AsyncCallback<ArrayList<ItemBean>>() {
@Override
public void onSuccess(ArrayList<ItemBean> users) {
pickUserDlg = new PickItemsDialog('@', users, eventBus, 460);
}
@Override
public void onFailure(Throwable caught) {
}
});
pickUserDlg = new PickItemsDialog('@', eventBus, 430, context);
pickUserDlg.withPhoto();
}
});
@ -116,6 +106,13 @@ public class SuperPosedTextArea extends TextArea {
public SuperPosedTextArea(Element element) {
super(element);
}
/**
*
* @param context e.g. /gcube/devNext/NextNext
*/
public void setContext(String context) {
this.context = context;
}
/**
* paste event overridden

@ -712,12 +712,16 @@ public class TweetTemplate extends Composite {
* @return
*/
public int numberOfComments(){
// quite easy..
return myComments.size();
}
/**
* Returns the context of the Post
* @return the context (scope) of the Post
*/
public String getVREContext() {
return this.myFeed.getFeed().getVreid();
}
/**
* Returns the number of likes this post has
* @return

@ -588,10 +588,10 @@ a.person-link {
margin-left: -15px;
}
.tweet-actions {
width: 270px;
width: 330px;
}
.feed-filters {
width: 260px;
width: 320px;
}
}
@ -625,9 +625,9 @@ a.person-link {
margin-left: -10px;
}
.tweet-actions {
width: 280px;
width: 330px;
}
.feed-filters {
width: 300px;
width: 320px;
}
}

@ -18,19 +18,12 @@
<!-- -->
<title>News Feed</title>
<script src='js/jquery.min.js'></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
<script src='js/jquery.autosize.js'></script>
</head>
<script src="js/pagebus.js"></script>
<script type="text/javascript">
if(window.parent.PageBus) {
window.PageBus = window.parent.PageBus;
}
</script>
<script type="text/javascript" src="newsfeed/newsfeed.nocache.js"></script>
</head>

@ -8,7 +8,6 @@
<instanceable>false</instanceable>
<ajaxable>false</ajaxable>
<header-portlet-css>/NewsFeed.css</header-portlet-css>
<header-portlet-javascript>/js/pagebus.js</header-portlet-javascript>
</portlet>
<role-mapper>
<role-name>administrator</role-name>

@ -24,6 +24,16 @@
<servlet-name>imageservices</servlet-name>
<url-pattern>/newsfeed/imageservices</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>pickItemServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.pickitem.server.PickItemServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>pickItemServlet</servlet-name>
<url-pattern>/newsfeed/pickItemServlet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>

Loading…
Cancel
Save