async callbacks onto Plugin (via IClientPlugin)

Hello all.

I am writing a real-time media capture and playback plugin.

I want to make asynchronous callbacks onto my plugin, and it seemed most suitable to utilize the IClientPluginAccess instance which is used to initialize the plugin instance (I assume there is just a single instance created). I want to have a data outcome take place with the callback.

Assuming the async callback onto the plugin carried a URL argument, for example, and I wanted to set the value of a field on a form with such a value, how could I do it ?

I looked at the API and thought along these options:

_clientAccess.registerURLStreamHandler(String, URLStreamHandler);
I don’t know what the String variabkle represents - a field name ?
I guess I could easilt write a URLStreamHandler if a default impl is not provided with Servoy.

_clientAccess.output(Object);
I don’t know what output does;
I don’t know what it would do with a URL

_clientAccess.getFormManager().getCurrentForm().getTable()…
Try to do some table manipulation.
How could I use a URL here ?

Your thoughts appreciated.

regards
julian

  1. URLStreamHandler is a concept from java, see the java.net.URLStreamHandler for more details. (I think its useless in your senario)
  2. output is just a debug method, which puts the output in the .log.txt
  3. table manupilations? DML ? DDL?

If you are writing a “real-time media capture and playback plugin”, you are best off with building a plugin and a bean with methods like: (to be used from Servoy javascript)

plugins.moviecapture.startRecording()

//via other method 
var binaryMovieData = plugins.moviecapture.stopRecording();
elements.moviePlayerBean.playMovie(binaryMovieData)

//you also could store the movie in the database
myBlobColumn = binaryMovieData 
controller.saveData()

Thanks Jan.

I believe “startRecording” as you define it would block the servoy UI…which I think is bad.

(my assumption here is that the invocation you propose is synchronous and would block - if it does not then please tell me so).

The plug-in should allow a user to initiate a capture and edit session - without blocking the Servoy UI. The user should be able to swap back to Servoy and perform other functions.

The capture session might take as long as a user thinks he needs to capture something…wthether it’s his camera, audio-input, or simply his file dialog to locate a file from disk.

  1. table manipulations…er, sorry, data updates

ps: i am a java developer :)

thanx
julian

sorry…i just re-read what Jan wrote.

Of course there will be no blocking becaue the plugin.startRecording invocation returns immediately, and the 1st scipt ends(so, the UI is not blocked)

The 2nd script (at some later indeterminate time) is responsible for invoking plugin.stopRecording.

I agree that the solution works.

The issue with this, of course, is that the user needs to initiate the 2nd script which invokes plugin.stopRecording FROM within Servoy. This is (maybe…i need to think it thru…) not desirable since the control of the capture is out with the plugin ui.

thnaks again
j

Why whould you not build the UI in Servoy as form?

That’s a very good question.

The key reason for having the plugin provide its own UI’s is that the application has a life outside of Servoy (and some other applications we’re plugged into).

Your playback-bean is something we will probably implement; our current implementation of players should allow us to readily wrap it up in a bean.

The idea of having the capture-and-edit and playback processes embedded entirely within Servoy (via a bean ?) is compelling. I think I would first like to see the plugin work without showstoppers before investing time creating additional ui’s and beans.

Have I answered your question, or is there something that is ‘staring me in the face’ from a Servoy perspective that I do not yet understand ?

many thanks again
julian

ok, well you can do callbacks to servoy methods, see the schedule plugin (source), the source is included in the .jar file

Julian,

did you get any further with your audio plugin.

I was thinking about adding a digital dictation option to one of my report writing solutions.

It would be really neat to be able to have a record button on a form and record into a blob field?

David

hi david.

I think marcel should be able to give you that :)

Is that a standard feature of one of his plugins?

I couldnt see it as an obvious feature, but will drop him a line.

Thanks

David