Publishing Event from Java?

92 views
Skip to first unread message

michae...@gmail.com

unread,
Feb 25, 2015, 9:46:43 AM2/25/15
to ozoneplat...@googlegroups.com
Is it possible to publish an event to an OWF channel from my Java code running as a servlet in the same application server as OWF? My situation is that I have some Java code that provides an interface to an external system, and I'd like to bring that data in and pass it to my OWF widget.

Thanks.
Michael

Ross Pokorny

unread,
Feb 25, 2015, 9:52:26 AM2/25/15
to ozoneplat...@googlegroups.com
No, you cannot do that directly, as OWF events are a client-side construct
that happen within the browser instead of the server.

What you can do is create a "background widget" which is served from your Java
code. Background widgets are widgets that are not displayed visually, but
which can still interact with other widgets via the OWF JavaScript APIs. This
widget would be able to obtain the data from your server-side code and publish
it on a channel.

Ross Pokorny
OWF Developer

Tina Coleman

unread,
Feb 25, 2015, 9:52:38 AM2/25/15
to ozoneplat...@googlegroups.com

​All of OWF's eventing capabilities to-date rely on client-side processing.  The OWF application server is not actively participating in eventing. 


Presumably, your servlet code can make an AJAX call to something in your own application's client-side, which could then send data over the eventing channels.  Don't know if anyone's done such as yet in the community to post a link to a code snippet which demonstrates.  


Tina Coleman

NEXTCENTURYCORPORATION
7075 Samuel Morse Drive, Suite 250 | Columbia, MD 21046
m 443.545.3100 | f 443.285.0799 |www.nextcentury.com
 

From: ozoneplat...@googlegroups.com <ozoneplat...@googlegroups.com> on behalf of michae...@gmail.com <michae...@gmail.com>
Sent: Wednesday, February 25, 2015 9:46 AM
To: ozoneplat...@googlegroups.com
Subject: Publishing Event from Java?
 

Jason Wagner

unread,
Feb 26, 2015, 9:02:55 AM2/26/15
to ozoneplat...@googlegroups.com
The Ozone Platform Inter-Widget Communication is designed to allow for server-push onto the bus.  Development is ongoing, and this particular requirement has not been implemented yet.

I know this doesn't help resolve your problem, right now, but just let you know that we are aware of the need and are working toward addressing it.


--
You received this message because you are subscribed to the Google Groups "ozoneplatform-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ozoneplatform-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

François St-Arnaud

unread,
Feb 26, 2015, 10:38:52 PM2/26/15
to ozoneplat...@googlegroups.com
We've done something similar using JMS. We created a JavaScript background widget as a gateway between JMS messaging and OWF eventing. We used the stomp.js library to read/write to JMS using STOMP over WebSockets and ActiveMQ with the ws protocol enabled. This then allows us to send/receive OWF events from any language / platform for which a JMS client exists. We use this technique for Java/.NET/Web inter-application communications.

Tina Coleman

unread,
Feb 27, 2015, 9:43:42 AM2/27/15
to ozoneplat...@googlegroups.com

Curious: how have you determined when to route to JMS versus when to send out direct via OWF?  Do you basically just have different channels for each, and make explicit determinations of client or JMS in the sending widgets?  Or do you route to both client and server-side in pub/sub such that the server-side components are really just subscribers?  Differing latency patterns, and differing models of exposure of data...  


Tina Coleman

NEXTCENTURYCORPORATION
7075 Samuel Morse Drive, Suite 250 | Columbia, MD 21046
m 443.545.3100 | f 443.285.0799 |www.nextcentury.com
 

From: ozoneplat...@googlegroups.com <ozoneplat...@googlegroups.com> on behalf of François St-Arnaud <fsta...@gmail.com>
Sent: Thursday, February 26, 2015 10:38 PM
To: ozoneplat...@googlegroups.com
Subject: Re: Publishing Event from Java?
 

François St-Arnaud

unread,
Mar 1, 2015, 2:18:36 PM3/1/15
to ozoneplat...@googlegroups.com
Specifically, we used this technique to route Intents using JMS for inter-application communications. In actual fact, we did not use a background widget, but unfortunately a visible widget due to the fact that OWF, at least the 7.0.1 GA version, doesn't support Intents with background widgets (see Issue 28 https://github.com/ozoneplatform/owf-framework/issues/28).

We provide our widgets with a configuration UI that allows us to map user gestures to specific Intents. We further configure which Intents are to be exposed to external applications. Those intents are echoed to JMS , all on the same channel. External applications wishing to participate in the inter-application mechanism all use this same channel.

Down in the details of the implementation, we actually use one general channel on the sending end, and then one channel on the listening end, one per technology: .NET, Java and Web. We also have a service running outside of OWF which takes care of routing messages on the different channels, again by configuration: Intents are associated to applications and their underlying technology. This service can ensure the receiving application is running. If not, it can launch it. We have used a Windows Service for this, but could very well have used a Camel component running on a Karaf host under ServiceMix.

We use this mechanism, for example, to allow a user to click on an item in an OWF widget, triggering a View Intent, and have an external .NET viewer to be launched, allowing us to leverage existing legacy applications as we introduce new Web elements in our environment.

wassim...@gmail.com

unread,
Aug 8, 2019, 8:03:02 AM8/8/19
to ozoneplatform-users
It's possible to publish from external server not using owf, via postmessage as an example and catch the message in owf application via owf eventbg ? 
Reply all
Reply to author
Forward
0 new messages