How to make a plugin that using a third part sdk

Hi all,

I’m working on a project in wich I have to use an hardware.
This hardware has a related java sdk (a jar with all related class).
If I use this sdk under the java perspective by using a class with a static main,it works fine; I’ve imported it into a user libraries.
To use it in servoy I’m wrapping it into a servoy aware plugin by the schooling of Patrick Talbot guide. :)
However, I’ve maked two js_ method: in one I simply return a string (and works) in the other I’ve put only one line of code in wich I instantiate an object.
My final test plugin is signed but this sdk (.jar) not.

Other info:

  • my package is named “dinamo.servoy.finger”
  • I’ve into the “finger” I’ve put the property:“native library location” under “myServoyInstallation/application_server/plugin/”, offcourse I’ve copy/paste the sdk .jar under this path.
  • the property “native library location” of jar jar under the path of sdk installation.
    [attachment=0]configuration.PNG[/attachment]

The behavior that I obtain now is: nothing.No error,no dialog.
When I try to launch the js_ method the instantiate my sdk object nothing happen as result.
Into the java perspective I obtained this kind of behavior when the “native library location” property was null,but now that I’ve specify this paramether the class works.

My question is: Do I need to sign also the sdk jar ,even if it’s wrapped into a my signed plugin?
if yes: I need a particular .ks? Or can I use a selfcreated .ks?
Am I missing something to let it work as servoy plugin?

Thanks in advance.

Marco

I think it could be because Servoy does not find the native library. What happens if you put the native library into Servoy/application_server?

Hi Marco.

Did you wrote the jnlp under the plugins directory?

Best regards. Roberto Blasco.

Hi all,

Thanks for your answers!

@Patrick:

I think it could be because Servoy does not find the native library. What happens if you put the native library into Servoy/application_server?

I’ve tried to change the native path from Servoy/application_server/plugin to Servoy/application_server as you suggest but without results.

@Roberto:

Did you wrote the jnlp under the plugins directory?

No Roberto, can you explain me better what I’ve to do with this jnlp?
Into My plugin I’ve only two .java files,the libraries to make it Servoy Aware and the library with the third part sdk(a .jar file).

Thanks for your time

Marco

I’ve tried to change the native path from Servoy/application_server/plugin to Servoy/application_server as you suggest but without results.

The native path assignment in Eclipse is only useful if you run anything from inside Eclipse. What is important is that during runtime the library is found and runtime means that all your code is started from with Servoy application server.

I’ve set the native path as follow:

This is the native path for source folder (I don’t think it’s important but I’ve set this also)
[attachment=1]main native.PNG[/attachment]

This is the native path about library:
[attachment=0]library native.PNG[/attachment]

I’ve tried the path “servoy_location/application_server” and “servoy_location/application_server/plugins/Griaule/bin” (this last is in wich I’ve put the thirPart.jar)

But It doesn’t work jet :(
Into my plugin I’ve two test method,one without the third part usage(that works)

public String js_getPluginName(){		
		return this.MY_NAME;
}

And another one that doesn’t work:

public String js_getTemplatePrecision() throws ThirdPartFingerJavaException{				
		ThirdPartFingerJava.installLicense("WQFAI-PLWOY-BGDIB-UKDFJ");
		return "ok"; 					
}

In this last method nothing happens…no error throwed…nothing.

My plugin has two .java files to make it servoy-aware, the previous methods belong to “DinamofingerProvider” Class:

public class DinamofingerProvider implements IScriptObject {
.
.
.
}

If I run this package as Java Application by adding the following class (in another .java file):

public class TestDinamoFingerPrint {

	
	public static void main(String[] args){
		System.out.println("Hello");
		Dinamofinger test = new Dinamofinger();
		String a = "";
		try {
			a = test.provider.js_getTemplatePrecision();
		} catch (GrFingerJavaException e) {			
			e.printStackTrace();
		}
		System.out.println("A:"+a);			
	}
}

All works fine.
Each time I want to make the .jar export of my plugin, I remove this last java file.