archimatetool / archimatetool/archi-scripting-plugin
Idea - Make it possible to call jArchi's API from a browser window
- Dominant language
- Java
- Stars
- 171
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
_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](http://ramkulkarni.com/blog/using-java-objects-in-javascript-in-eclipse-swt-browser-control/) explains how to do it with code samples.
This involves extending [BrowserFunction](https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fbrowser%2FBrowserFunction.html).
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...
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked BrowserFunction API documentation and JavaScript example, then inspect the code that creates jArchi browser tabs. Determine how JavaScript could return information to the calling script and invoke jArchi functions, accounting for the supported data types. Done means a browser page can query or edit the model through the scripting API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- api, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100