Removed depcreated TIBCO Pagebus library and replaces with Liferay's IPC Client Side

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@164773 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2018-03-07 13:30:54 +00:00
parent c3187bfb7b
commit d8c5513572
6 changed files with 26 additions and 32 deletions

View File

@ -8,9 +8,6 @@
<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="switch-button-widget-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/switch-button-widget/switch-button-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="share-updates"/>
</wb-module>

View File

@ -2,6 +2,7 @@
<Changeset component="org.gcube.portlets-user.shareupdates.2-6-0"
date="2018-02-07">
<Change>restyled checkbox for notifications</Change>
<Change>Removed depcreated TIBCO Pagebus library and replaces with Liferay's IPC Client Side</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.shareupdates.2-5-0"
date="2017-12-07">

View File

@ -190,11 +190,7 @@
<artifactId>htmlcleaner</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>net.eliasbalasis</groupId>
<artifactId>tibcopagebus4gwt</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>

View File

@ -15,4 +15,14 @@ public class ShareUpdates implements EntryPoint {
public void onModuleLoad() {
RootPanel.get("shareUpdateDiv").add(new ShareUpdateForm());
}
/**
* fire the event to the News Feed portlet
* @param json
*/
public static native void sendLiferayIPCEvent(String json) /*-{
$wnd.Liferay.fire('newPostCreated',{
payload: json
});
}-*/;
}

View File

@ -10,6 +10,7 @@ import org.gcube.portal.databook.shared.PrivacyLevel;
import org.gcube.portal.databook.shared.UserInfo;
import org.gcube.portlets.user.shareupdates.client.ShareUpdateService;
import org.gcube.portlets.user.shareupdates.client.ShareUpdateServiceAsync;
import org.gcube.portlets.user.shareupdates.client.ShareUpdates;
import org.gcube.portlets.user.shareupdates.shared.LinkPreview;
import org.gcube.portlets.user.shareupdates.shared.UploadedFile;
import org.gcube.portlets.user.shareupdates.shared.UserSettings;
@ -20,7 +21,6 @@ import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEve
import org.gcube.portlets.widgets.fileupload.client.view.FileSubmit;
import org.gcube.portlets.widgets.fileupload.client.view.UploadProgressPanel;
import org.gcube.portlets.widgets.switchbutton.client.SwitchButton;
import org.jsonmaker.gwt.client.Jsonizer;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ListBox;
@ -52,9 +52,6 @@ import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment;
import com.google.gwt.user.client.ui.Widget;
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapter;
import net.eliasbalasis.tibcopagebus4gwt.client.PageBusAdapterException;
/**
* The main share update class.
* @author Massimiliano Assante at ISTI CNR
@ -66,7 +63,6 @@ public class ShareUpdateForm extends Composite {
private final ShareUpdateServiceAsync shareupdateService = GWT
.create(ShareUpdateService.class);
final PageBusAdapter pageBusAdapter = new PageBusAdapter();
// the label for all Vres/channels
private final static String ALL_VRES = "Share with: your Virtual Research Environments";
@ -546,14 +542,9 @@ public class ShareUpdateForm extends Composite {
if (post == null)
Window.alert("Ops! we encountered some problems delivering your message, please try again in a short while.");
else {
// publish a message with the refresh notification
try {
pageBusAdapter.PageBusPublish("org.gcube.portal.databook.shared", post, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
} catch (PageBusAdapterException ex) {
GWT.log(ex.getMessage());
}
ClientFeedJsonizer cJsonizer = (ClientFeedJsonizer) GWT.create(ClientFeedJsonizer.class);
String json = cJsonizer.asString(post);
ShareUpdates.sendLiferayIPCEvent(json);
}
//needed when posting long texts otherwise it stays with the current height
@ -600,12 +591,15 @@ public class ShareUpdateForm extends Composite {
Window.alert("Ops! we encountered some problems delivering your message, please try again in a short while.");
else {
// publish a message with the refresh notification
try {
pageBusAdapter.PageBusPublish("org.gcube.portal.databook.shared", feed, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
GWT.log("SENT");
} catch (PageBusAdapterException ex) {
GWT.log(ex.getMessage());
}
// try {
// pageBusAdapter.PageBusPublish("org.gcube.portal.databook.shared", feed, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
// GWT.log("SENT");
// } catch (PageBusAdapterException ex) {
// GWT.log(ex.getMessage());
// }
ClientFeedJsonizer cJsonizer = (ClientFeedJsonizer) GWT.create(ClientFeedJsonizer.class);
String json = cJsonizer.asString(feed);
ShareUpdates.sendLiferayIPCEvent(json);
}
//needed when posting long texts otherwise it stays with the current height

View File

@ -3,16 +3,12 @@
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
<inherits name="com.github.gwtbootstrap.Bootstrap" />
<!-- inherits GCUBE Widgets -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
<inherits
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
<!-- Responsive design -->
<set-property name="bootstrap.responsiveDesign" value="true" />