New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an API for modules in Java side declared by dynamic Javascript files #282

Closed
hdsdi3g opened this Issue Jul 13, 2017 · 0 comments

Comments

@hdsdi3g
Owner

hdsdi3g commented Jul 13, 2017

With #281 and Nashorn API.

Usage in Java side:

MyDMAM.factory.getInterfaceDeclaredByJSModule(MyInterface.class, "module name", () -> {
 return (class manually crafted);
});

With MyInterface.class:

public interface MyInterface {
  public String helloWorld(String me);
  public String toto();
  public Collection<String> arr();
  public Map<String, String> amap();
}

And, in JS side:

module.register({
  name: "module name",
  vendor: "Meeee",
  version: "0.1",
  content: {
    helloWorld: function(e) {
      return "Hello world, " + e;
    },
    toto: "aa",
    arr: ["Merci", "Test"],
    amap: {
      aaa: "bbb",
      ccc: "ddd",
    },
  },
});
console.log("Done");

The JS file must be set in conf/app.d directory.

@hdsdi3g hdsdi3g added the enhancement label Jul 13, 2017

@hdsdi3g hdsdi3g added this to the v0 Beta version milestone Jul 13, 2017

@hdsdi3g hdsdi3g self-assigned this Jul 13, 2017

@hdsdi3g hdsdi3g changed the title from Create an API for modules in Java-side declared by some Javascript files to Create an API for modules in Java side declared by dynamic Javascript files Jul 13, 2017

hdsdi3g added a commit that referenced this issue Jul 13, 2017

hdsdi3g added a commit that referenced this issue Jul 14, 2017

hdsdi3g added a commit that referenced this issue Jul 16, 2017

Update #286, correct #282 if boolean, rename module.* to universalmod…
…ule.*, and system ClassLoader don't works with play...

@hdsdi3g hdsdi3g moved this from Staged in dvl and ready to run to Done, but needs to checks in Refactoring and consolidate alpha version Aug 1, 2017

@hdsdi3g hdsdi3g closed this Aug 1, 2017

@hdsdi3g hdsdi3g moved this from Done, but needs to checks to Ready to run in Refactoring and consolidate alpha version Aug 1, 2017

@hdsdi3g hdsdi3g moved this from Ready to run to Done in Master in Refactoring and consolidate alpha version Aug 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment