Skip to content
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

Idea - Make it possible to call jArchi's API from a browser window #52

Open
jbsarrodie opened this issue May 17, 2019 · 2 comments
Open

Comments

@jbsarrodie
Copy link
Member

This is a note to self for my future experimentations

ATM it is possible to open a browser window (in fact a "Tab" in the UI) which either load an HTTP(S) resource or a local content (potentially a simple string created "on the fly" by a jArchi script).

This is very powerful but is "read only": even if the loaded HTML page can be interactive, it is impossible to return some information to the calling script, and also impossible to call some script functions from withing the browser. Changing this would allow to create even more powerful script that could leverage the best of both world: great UI created with HTML/JS/CSS, and ability to work (query/edit) the model.

It seems that this could be made possible by binding some Java objects to JS object inside the browser. This post explains how to do it with code samples.

This involves extending BrowserFunction.

Of course this is not as simple: this is limited in the number of types supported and this binds a Java function, not a jArchi one. Experimentation is needed...

@jbsarrodie jbsarrodie changed the title Idea - Make is possible to call jArchi's API from a browser window Idea - Make it possible to call jArchi's API from a browser window May 18, 2019
@jbsarrodie
Copy link
Member Author

Comment to self

A first step could be to expose the (SWT) Browser object or proxify its .evaluate() method. This would allow a jArchi script to execute code inside the browser and get the result.

@jbsarrodie
Copy link
Member Author

For later reference

Found this other example of a nice implementation: http://ramkulkarni.com/blog/webapprunner-run-your-web-applications-standalone/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant