Ported to GWT 2.8.2
Fix for Incident #11187 citing a people (with '@') in comments is not working anymore</Change> Feature #11189: Social-Networking - citing a people (with '@') in comments loses the focus. git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@164785 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
509ee88dfc
commit
0d40b1562d
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/news-feed-2.5.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/news-feed-2.6.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.5.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||
<classpathentry excluding="**" kind="src" output="target/news-feed-2.6.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.5.1-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/news-feed-2.6.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<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>
|
||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||
<property name="context-root" value="news-feed"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -1,14 +1,23 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-user.news-feed.2-5-1"
|
||||
date="2018-02-14">
|
||||
<Changeset component="org.gcube.portlets-user.news-feed.2-6-0"
|
||||
date="2018-03-07">
|
||||
<Change>Ported to GWT 2.8.2</Change>
|
||||
<Change>Fix for Incident #11187 citing a people (with '@') in comments
|
||||
is not working anymore</Change>
|
||||
<Change>
|
||||
Feature #11189: Social-Networking - citing a people (with '@')
|
||||
in comments loses the focus.
|
||||
</Change>
|
||||
<Change>Support for ticket #11139</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.news-feed.2-5-0"
|
||||
date="2017-11-13">
|
||||
<Change>fixes for Incident #10262: Cannot see who liked posts on VREs
|
||||
of Parthenos</Change>
|
||||
of Parthenos
|
||||
</Change>
|
||||
<Change>Feature #10242: add comment taking up to 3 seconds sometime to
|
||||
be delivered in the UI now shows a loader</Change>
|
||||
be delivered in the UI now shows a loader
|
||||
</Change>
|
||||
<Change>Ported to GWT 2.8.1</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.news-feed.2-3-0"
|
||||
|
|
87
pom.xml
87
pom.xml
|
@ -12,7 +12,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>news-feed</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.5.1-SNAPSHOT</version>
|
||||
<version>2.6.0-SNAPSHOT</version>
|
||||
|
||||
<name>gCube News Feed Portlet</name>
|
||||
<description>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</scm>
|
||||
<properties>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwtVersion>2.8.1</gwtVersion>
|
||||
<gwtVersion>2.8.2</gwtVersion>
|
||||
<guavaVersion>18.0</guavaVersion>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
|
@ -37,6 +37,7 @@
|
|||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
|
@ -52,25 +53,37 @@
|
|||
<artifactId>gwt-user</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-dev</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-codeserver</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
|
@ -105,9 +118,30 @@
|
|||
<artifactId>aslsocial</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.resources.discovery</groupId>
|
||||
<artifactId>ic-client</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>authorization-client</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google</groupId>
|
||||
<artifactId>gwt-jsonmaker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>common-authorization</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>social-networking-library</artifactId>
|
||||
<version>[1.16.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -187,7 +221,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-scope-maps</artifactId>
|
||||
<scope>provided</scope>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
@ -202,18 +236,7 @@
|
|||
<version>1.0.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.gwt-jsonmaker/gwt-jsonmaker -->
|
||||
<dependency>
|
||||
<groupId>org.gwt-jsonmaker</groupId>
|
||||
<artifactId>gwt-jsonmaker</artifactId>
|
||||
<version>1.3.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.eliasbalasis</groupId>
|
||||
<artifactId>tibcopagebus4gwt</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
|
@ -223,6 +246,18 @@
|
|||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.5.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
|
@ -238,16 +273,6 @@
|
|||
<artifactId>portlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
|
|
|
@ -1,72 +1,61 @@
|
|||
package org.gcube.portlets.user.newsfeed.client;
|
||||
|
||||
import org.gcube.portal.databook.shared.ClientFeed;
|
||||
import org.gcube.portal.databook.shared.ClientFeed.ClientFeedJsonizer;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.PageBusEvents;
|
||||
import org.gcube.portal.databook.shared.ClientPost;
|
||||
import org.gcube.portal.databook.shared.JSON;
|
||||
import org.gcube.portlets.user.newsfeed.client.panels.NewsFeedPanel;
|
||||
import org.jsonmaker.gwt.client.Jsonizer;
|
||||
import org.jsonmaker.gwt.client.base.Defaults;
|
||||
|
||||
import com.google.gwt.core.client.EntryPoint;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
|
||||
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapter;
|
||||
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapterException;
|
||||
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusEvent;
|
||||
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusListener;
|
||||
|
||||
/**
|
||||
* Entry point classes define <code>onModuleLoad()</code>.
|
||||
*
|
||||
* @author Massimiliano Assante, CNR-ISTI
|
||||
*
|
||||
* This class uses Liferay's Client-side+Inter-Portlet-Communication for displaying post created in the Share Updates portlet
|
||||
* @see https://web.liferay.com/community/wiki/-/wiki/Main/Client-side+Inter-Portlet-Communication+%28IPC%29%20using+Java+Script
|
||||
*
|
||||
*/
|
||||
public class NewsFeed implements EntryPoint {
|
||||
|
||||
private final String UNIQUE_DIV = "newsfeedDIV";
|
||||
final public static PageBusAdapter pageBusAdapter = new PageBusAdapter();
|
||||
NewsFeedPanel mainPanel;
|
||||
|
||||
private NewsFeedPanel mainPanel;
|
||||
|
||||
public void onModuleLoad() {
|
||||
init();
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
mainPanel = new NewsFeedPanel();
|
||||
private static NewsFeedPanel instance;
|
||||
|
||||
public static NewsFeedPanel getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new NewsFeedPanel();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void onModuleLoad() {
|
||||
injectLiferayIPCEventReceiver();
|
||||
exportReceiveEventJavascriptFunction();
|
||||
mainPanel = getInstance();
|
||||
RootPanel.get(UNIQUE_DIV).add(mainPanel);
|
||||
|
||||
ClientFeed notification = new ClientFeed();
|
||||
//Subscribe to message and associate subsequent receptions with custom subscriber data
|
||||
try {
|
||||
pageBusAdapter.PageBusSubscribe(PageBusEvents.newPostCreated, null, null, notification, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
|
||||
}
|
||||
catch (PageBusAdapterException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
pageBusAdapter.addPageBusSubscriptionCallbackListener(new PageBusListener() {
|
||||
@Override
|
||||
public void onPageBusSubscriptionCallback(PageBusEvent event) {
|
||||
|
||||
if(event.getSubject().equals(this.getName())){
|
||||
// translate JavaScript message contents and subscriber data to their Java equivalents
|
||||
try {
|
||||
ClientFeed feed = (ClientFeed)event.getMessage((Jsonizer)GWT.create(ClientFeedJsonizer.class));
|
||||
mainPanel.addJustAddedFeed(feed);
|
||||
|
||||
// alert the User statistics portlet to increment the number of user's posts
|
||||
pageBusAdapter.PageBusPublish(PageBusEvents.postIncrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
} catch (PageBusAdapterException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return PageBusEvents.newPostCreated;
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* this is a JSNI method that injects the Liferay Javascript function listening for events from ShareUpdates
|
||||
*/
|
||||
public static native void injectLiferayIPCEventReceiver() /*-{
|
||||
$wnd.Liferay.on('newPostCreated',function(event) {
|
||||
$wnd.handleReceiveEvent(event.payload);
|
||||
});
|
||||
}-*/;
|
||||
/**
|
||||
* this is a JSNI method mapping the Javascript function handleReceiveEvent to the Java method handleReceiveEvent
|
||||
*/
|
||||
public static native void exportReceiveEventJavascriptFunction()/*-{
|
||||
$wnd.handleReceiveEvent = @org.gcube.portlets.user.newsfeed.client.NewsFeed::handleReceiveEvent(*);
|
||||
}-*/;
|
||||
/**
|
||||
* the Java method handleReceiveEvent
|
||||
* @param jsonizedClientPostInstance the jsonized {@link ClientPost} sent by ShareUpdates
|
||||
*/
|
||||
public static void handleReceiveEvent(String jsonizedClientPostInstance) {
|
||||
ClientPost cp = (ClientPost) JSON.parse(jsonizedClientPostInstance);
|
||||
getInstance().addJustAddedFeed(cp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,8 @@ import org.gcube.common.portal.GCubePortalConstants;
|
|||
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
||||
import org.gcube.portal.databook.client.util.Encoder;
|
||||
import org.gcube.portal.databook.shared.Attachment;
|
||||
import org.gcube.portal.databook.shared.ClientFeed;
|
||||
import org.gcube.portal.databook.shared.ClientAttachment;
|
||||
import org.gcube.portal.databook.shared.ClientPost;
|
||||
import org.gcube.portal.databook.shared.Comment;
|
||||
import org.gcube.portal.databook.shared.EnhancedFeed;
|
||||
import org.gcube.portal.databook.shared.Feed;
|
||||
|
@ -18,7 +19,6 @@ import org.gcube.portal.databook.shared.PrivacyLevel;
|
|||
import org.gcube.portal.databook.shared.ShowUserStatisticAction;
|
||||
import org.gcube.portal.databook.shared.UserInfo;
|
||||
import org.gcube.portlets.user.newsfeed.client.FilterType;
|
||||
import org.gcube.portlets.user.newsfeed.client.NewsFeed;
|
||||
import org.gcube.portlets.user.newsfeed.client.NewsService;
|
||||
import org.gcube.portlets.user.newsfeed.client.NewsServiceAsync;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.AddCommentEvent;
|
||||
|
@ -33,7 +33,6 @@ import org.gcube.portlets.user.newsfeed.client.event.EditCommentEvent;
|
|||
import org.gcube.portlets.user.newsfeed.client.event.EditCommentEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.PageBusEvents;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
||||
|
@ -60,7 +59,6 @@ import org.gcube.portlets.widgets.userselection.client.events.SelectedUserEvent;
|
|||
import org.gcube.portlets.widgets.userselection.client.events.SelectedUserEventHandler;
|
||||
import org.gcube.portlets.widgets.userselection.client.events.UsersFetchedEvent;
|
||||
import org.gcube.portlets.widgets.userselection.shared.ItemSelectableBean;
|
||||
import org.jsonmaker.gwt.client.base.Defaults;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Row;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -84,7 +82,6 @@ import com.google.gwt.user.client.ui.SimplePanel;
|
|||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapterException;
|
||||
/**
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
|
@ -762,35 +759,35 @@ public class NewsFeedPanel extends Composite {
|
|||
newsPanel.insert(tt, 0); //insert in the view
|
||||
allUpdates.add(0, feed); //insert in the model
|
||||
|
||||
//timer for the transition
|
||||
Timer t = new Timer() {
|
||||
@Override
|
||||
public void run() {
|
||||
tt.setcontentAreaStyle("visible");
|
||||
|
||||
// alert the user-statistics portlet to update statistics in case
|
||||
// one or more feed belongs to user himself
|
||||
if(tt.isUser()){
|
||||
try{
|
||||
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.postIncrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
int numComments = tt.numberOfComments();
|
||||
int numLikes = tt.numberOfLikes();
|
||||
|
||||
for(int i = 0; i < numComments; i++)
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsIncrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
for(int i = 0; i < numLikes; i++)
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.likesIncrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
}catch (PageBusAdapterException ex) {
|
||||
GWT.log(ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
t.schedule(100);
|
||||
// //timer for the transition
|
||||
// Timer t = new Timer() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// tt.setcontentAreaStyle("visible");
|
||||
//
|
||||
// // alert the user-statistics portlet to update statistics in case
|
||||
// // one or more feed belongs to user himself
|
||||
// if(tt.isUser()){
|
||||
// try{
|
||||
//
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.postIncrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// int numComments = tt.numberOfComments();
|
||||
// int numLikes = tt.numberOfLikes();
|
||||
//
|
||||
// for(int i = 0; i < numComments; i++)
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsIncrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// for(int i = 0; i < numLikes; i++)
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.likesIncrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// }catch (PageBusAdapterException ex) {
|
||||
// GWT.log(ex.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// t.schedule(100);
|
||||
}
|
||||
//after that I remove the ($updatesNo) from Window Title
|
||||
String currTitle = Document.get().getTitle();
|
||||
|
@ -804,35 +801,42 @@ public class NewsFeedPanel extends Composite {
|
|||
* @param thumbURL
|
||||
* @param description
|
||||
*/
|
||||
public void addJustAddedFeed(ClientFeed cFeed) {
|
||||
public void addJustAddedFeed(ClientPost cFeed) {
|
||||
|
||||
// build up the feed
|
||||
Feed feed = new Feed(
|
||||
cFeed.getKey(),
|
||||
cFeed.key,
|
||||
FeedType.SHARE,
|
||||
cFeed.getUserid(),
|
||||
cFeed.getTime(),
|
||||
cFeed.userid,
|
||||
cFeed.time,
|
||||
"",
|
||||
cFeed.getUri(),
|
||||
cFeed.getLinkUrlThumbnail(),
|
||||
cFeed.getDescription(),
|
||||
cFeed.uri,
|
||||
cFeed.linkUrlThumbnail,
|
||||
cFeed.description,
|
||||
PrivacyLevel.CONNECTION,
|
||||
cFeed.getFullName(),
|
||||
cFeed.getEmail(),
|
||||
cFeed.getThumbnailURL(),
|
||||
cFeed.getLinkTitle(),
|
||||
cFeed.getLinkDescription(),
|
||||
cFeed.getLinkHost());
|
||||
cFeed.fullName,
|
||||
cFeed.email,
|
||||
cFeed.thumbnailURL,
|
||||
cFeed.linkTitle,
|
||||
cFeed.linkDescription,
|
||||
cFeed.linkHost);
|
||||
|
||||
// set multi-attachments property
|
||||
boolean multiAttachments = cFeed.getAttachments() != null;
|
||||
boolean multiAttachments = (cFeed.attachments != null) ? cFeed.attachments.length > 0 : false;
|
||||
feed.setMultiFileUpload(multiAttachments);
|
||||
|
||||
//false because he could not have liked this yet and true because is the current user's
|
||||
EnhancedFeed toAdd = new EnhancedFeed(feed, false, true);
|
||||
|
||||
// be careful when converting from List<> to ArrayList<> ...
|
||||
ArrayList<Attachment> attachments = multiAttachments ? new ArrayList<Attachment>(cFeed.getAttachments()) : null;
|
||||
ArrayList<Attachment> attachments = null;
|
||||
if (multiAttachments) {
|
||||
attachments = new ArrayList<>(cFeed.attachments.length);
|
||||
for (int i = 0; i <cFeed.attachments.length; i++) {
|
||||
ClientAttachment ca = cFeed.attachments[i];
|
||||
attachments.add(new Attachment(ca.id, ca.uri, ca.name, ca.description, ca.thumbnailURL, ca.mimeType));
|
||||
}
|
||||
}
|
||||
|
||||
toAdd.setAttachments(attachments);
|
||||
|
||||
// build up the post template
|
||||
|
@ -1227,17 +1231,17 @@ public class NewsFeedPanel extends Composite {
|
|||
doShowSessionExpired();
|
||||
} else{
|
||||
|
||||
// alert the User statistics portlet to increment the number of likes got
|
||||
if(owner.isUser()){
|
||||
try {
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(
|
||||
PageBusEvents.likesIncrement
|
||||
, ""
|
||||
, Defaults.STRING_JSONIZER);
|
||||
} catch (PageBusAdapterException ex) {
|
||||
GWT.log(ex.toString());
|
||||
}
|
||||
}
|
||||
// // alert the User statistics portlet to increment the number of likes got
|
||||
// if(owner.isUser()){
|
||||
// try {
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(
|
||||
// PageBusEvents.likesIncrement
|
||||
// , ""
|
||||
// , Defaults.STRING_JSONIZER);
|
||||
// } catch (PageBusAdapterException ex) {
|
||||
// GWT.log(ex.toString());
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1255,16 +1259,16 @@ public class NewsFeedPanel extends Composite {
|
|||
}else{
|
||||
|
||||
// alert the User statistics portlet to decrement the number of likes got
|
||||
if(owner.isUser()){
|
||||
try {
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(
|
||||
PageBusEvents.likesDecrement
|
||||
, ""
|
||||
, Defaults.STRING_JSONIZER);
|
||||
} catch (PageBusAdapterException ex) {
|
||||
GWT.log(ex.toString());
|
||||
}
|
||||
}
|
||||
// if(owner.isUser()){
|
||||
// try {
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(
|
||||
// PageBusEvents.likesDecrement
|
||||
// , ""
|
||||
// , Defaults.STRING_JSONIZER);
|
||||
// } catch (PageBusAdapterException ex) {
|
||||
// GWT.log(ex.toString());
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1320,14 +1324,14 @@ public class NewsFeedPanel extends Composite {
|
|||
owner.updateCommentsNumberCount();
|
||||
owner.showAddCommentForm(false);
|
||||
|
||||
if(owner.isUser()){
|
||||
// alert the User statistics portlet to increment the number of comments got
|
||||
try {
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsIncrement, "", Defaults.STRING_JSONIZER);
|
||||
} catch (PageBusAdapterException e) {
|
||||
GWT.log(e.toString());
|
||||
}
|
||||
}
|
||||
// if(owner.isUser()){
|
||||
// // alert the User statistics portlet to increment the number of comments got
|
||||
// try {
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsIncrement, "", Defaults.STRING_JSONIZER);
|
||||
// } catch (PageBusAdapterException e) {
|
||||
// GWT.log(e.toString());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1403,14 +1407,14 @@ public class NewsFeedPanel extends Composite {
|
|||
doShowComments(owner, false);
|
||||
owner.updateCommentsNumberCount();
|
||||
|
||||
if(owner.isUser()){
|
||||
// alert the User statistics portlet to decrement the number of comments got
|
||||
try {
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsDecrement, "", Defaults.STRING_JSONIZER);
|
||||
} catch (PageBusAdapterException ex) {
|
||||
GWT.log(ex.toString());
|
||||
}
|
||||
}
|
||||
// if(owner.isUser()){
|
||||
// // alert the User statistics portlet to decrement the number of comments got
|
||||
// try {
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsDecrement, "", Defaults.STRING_JSONIZER);
|
||||
// } catch (PageBusAdapterException ex) {
|
||||
// GWT.log(ex.toString());
|
||||
// }
|
||||
// }
|
||||
} else
|
||||
Window.alert("Comment could not be deleted, please try again in a short while.");
|
||||
}
|
||||
|
@ -1433,23 +1437,23 @@ public class NewsFeedPanel extends Composite {
|
|||
toDelete.removeFromParent();
|
||||
|
||||
if(toDelete.isUser()){
|
||||
try{
|
||||
// alert the User statistics portlet to decrement the number of user's posts
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.postDecrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
// alert the same portlet to decrement the number of likes/replies, if any
|
||||
int numComments = toDelete.numberOfComments();
|
||||
int numLikes = toDelete.numberOfLikes();
|
||||
|
||||
for(int i = 0; i < numComments; i++)
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsDecrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
for(int i = 0; i < numLikes; i++)
|
||||
NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.likesDecrement, "", Defaults.STRING_JSONIZER);
|
||||
|
||||
}catch (PageBusAdapterException ex) {
|
||||
GWT.log(ex.toString());
|
||||
}
|
||||
// try{
|
||||
// // alert the User statistics portlet to decrement the number of user's posts
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.postDecrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// // alert the same portlet to decrement the number of likes/replies, if any
|
||||
// int numComments = toDelete.numberOfComments();
|
||||
// int numLikes = toDelete.numberOfLikes();
|
||||
//
|
||||
// for(int i = 0; i < numComments; i++)
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.commentsDecrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// for(int i = 0; i < numLikes; i++)
|
||||
// NewsFeed.pageBusAdapter.PageBusPublish(PageBusEvents.likesDecrement, "", Defaults.STRING_JSONIZER);
|
||||
//
|
||||
// }catch (PageBusAdapterException ex) {
|
||||
// GWT.log(ex.toString());
|
||||
// }
|
||||
}
|
||||
} else
|
||||
Window.alert("Feed could not be deleted, please try again in a short while.");
|
||||
|
|
|
@ -73,8 +73,13 @@ public class SuperPosedTextArea extends TextArea {
|
|||
this.addKeyPressHandler(new KeyPressHandler() {
|
||||
@Override
|
||||
public void onKeyPress(KeyPressEvent event) {
|
||||
if (pickUserDlg != null)
|
||||
pickUserDlg.onKeyPress(getCursorPos(), event.getUnicodeCharCode(), getAbsoluteLeft(), getAbsoluteTop()+getOffsetHeight(), getText());
|
||||
if (pickUserDlg != null) {
|
||||
int top = getAbsoluteTop();
|
||||
int offset = getOffsetHeight();
|
||||
int y = getAbsoluteTop()+getOffsetHeight();
|
||||
GWT.log("top=" + top + " - offset = " +offset);
|
||||
pickUserDlg.onKeyPress(getCursorPos(), event.getUnicodeCharCode(), getAbsoluteLeft(), y, getText());
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addFocusHandler(new FocusHandler() {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
private ElasticSearchClient escl;
|
||||
|
||||
private final static int MAX_FEEDS_NO = 30;
|
||||
|
||||
|
||||
public void init() {
|
||||
store = new DBCassandraAstyanaxImpl();
|
||||
try {
|
||||
|
@ -972,8 +972,16 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
}
|
||||
}
|
||||
} else { //is a VRE
|
||||
users.addAll(um.listUsersByGroup(currentGroupId));
|
||||
teams = new LiferayRoleManager().listTeamsByGroup(currentGroupId);
|
||||
if (isWithinPortal()) {
|
||||
users.addAll(um.listUsersByGroup(currentGroupId));
|
||||
teams = new LiferayRoleManager().listTeamsByGroup(currentGroupId);
|
||||
} else {
|
||||
List<GCubeUser> forDev = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
forDev.add(new GCubeUser(1L, "username"+i, "email", "firstName"+i, "middleNam", "lastName"+i, "fullname test"+i, 0L, "url", true, "jobTitle", null));
|
||||
}
|
||||
users.addAll(forDev);
|
||||
}
|
||||
}
|
||||
} catch (UserManagementSystemException | GroupRetrievalFault | UserRetrievalFault | VirtualGroupNotExistingException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.gcube.portlets.user.newsfeed.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portal.databook.shared.UserInfo;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class UserSettings implements Serializable {
|
||||
public class UserSettings implements IsSerializable {
|
||||
private UserInfo userInfo;
|
||||
private int refreshingTimeInMillis;
|
||||
private String currentScope;
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
# gCube Portal custom log4j Logger
|
||||
#Author: Massimiliano Assante, ISTI-CNR
|
||||
|
||||
log4j.rootLogger=INFO, CA
|
||||
|
||||
log4j.appender.CA=org.apache.log4j.ConsoleAppender
|
||||
|
||||
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.CA.layout.ConversionPattern=[PORTAL] %-4r [%t] %-5p %c %x - %m%n
|
||||
|
||||
# Display any warnings generated by our code
|
||||
#log4j.category.org.globus=WARN
|
||||
|
||||
# Comment out the line below if you want to log every authorization
|
||||
# decision the notification consumer makes.
|
||||
#log4j.category.org.globus.wsrf.impl.security.authorization.ServiceAuthorizationChain=ERROR
|
||||
|
||||
log4j.logger.org.gcube=TRACE, GCUBE
|
||||
log4j.appender.GCUBE.threshold=DEBUG
|
||||
log4j.appender.GCUBE=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.GCUBE.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.GCUBE.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} [%t,%M:%L] %
|
||||
m%n
|
||||
|
||||
log4j.logger.org.apache.jasper.compiler.TldLocationsCache.level=ERROR, CA
|
||||
#AVOID LOGGING EHCACHE Hearbeat problem
|
||||
log4j.logger.net.sf.ehcache.distribution.PayloadUtil=OFF, CA
|
||||
|
||||
log4j.logger.org.gcube.portal.notifications=INFO, CA
|
||||
log4j.logger.org.gcube.common.scope.impl=INFO, CA
|
||||
log4j.logger.org.gcube.common.core.utils.events=INFO, CA
|
||||
log4j.logger.org.gcube.portlets.user.homelibrary=INFO CA
|
||||
log4j.logger.org.gcube.common.resources.kxml=ERROR, CA
|
||||
log4j.logger.org.gcube.application.aquamaps.enhabling.Impl.ISCrawler=ERROR, CA
|
||||
log4j.logger.com.netflix.astyanax.connectionpool.impl=ERROR, CA
|
||||
log4j.logger.org.gcube.common.scope.impl=INFO, CA
|
||||
log4j.logger.com.couchbase.client=ERROR, CA
|
||||
log4j.logger.org.gcube.smartgears.handlers=INFO, CA
|
||||
log4j.logger.org.gcube.informationsystem.publisher=INFO, CA
|
||||
log4j.logger.org.gcube.application.framework.core.session=INFO, CA
|
|
@ -7,10 +7,11 @@
|
|||
<!-- <set-property name="user.agent" value="safari" /> -->
|
||||
|
||||
<!-- Other module inherits -->
|
||||
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
|
||||
<!-- <inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" /> -->
|
||||
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
|
||||
<inherits
|
||||
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
|
||||
<!-- <inherits -->
|
||||
<!-- name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" /> -->
|
||||
<inherits name="com.google.gwt.json.JSON" />
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
<!-- inherits gCube Widgets Library -->
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
|
Loading…
Reference in New Issue