我需要java插件開發(fā)
待服務(wù)商報(bào)價(jià)
API集成
需求類型
Developing application specific plugins
Demo
?
Procedure
Follow the instructions for a?Tersus Studio - Cross Platform Installation,?replacing the Eclipse?Platform Runtime Binary?build specified there, with an?Eclipse?SDK?build (or another build supporting Java development).
Start with a Java project and add a folder?models?to make it a Tersus project as well.
Create a Java class that extends?tersus.runtime.Plugin?(the attached demo project includes 3 such classes:?Factorial, Fibonacci, Transform).
Create a?TPD?file describing the plugin created in the previous step.?At a minimum, the TPD file should contain a reference to the Java class that implements the plugin (see in?models/Plugins?folder in the attached demo project).
Connect an action to the plugin, by dragging a?Basic/Action?to the model, and?changing its?plugin?property. Setting the property to?Plugins/X?means the?TPD?file is located in either?models/Plugins/X/X.tpd?or?models/Plugins/X.tpd?- whichever exists.?The folder?models/Plugins/X/?is typically used to hold icon files and/or documentation.
Add the necessa*****iggers and exits, per the plugin implementation.
(Optional)?Add icons (always nice, but time-consuming)
(Optional) Create a template/prototype (if the plugin is only used once this is redundant)
Notes
Whenever the?Java?implementation is changed, the?Tersus?application needs to be restarted in order to load the new version.
3rd party Jar files can be added to a?jars?folder in the project (as in the demo project)
The whole project can be packaged?as a?library?(.tersus) file, via?File > Export > Tersus > Tersus Project File,?and re-used in other Tersus projects.
The API for interacting with Tersus is somewhat complicated but results in relatively efficient access (all element access is using fixed array indices rather than hash lookups):
The plugin's?initializeFromModel?method is called when the application is started, and is used to initialize objects that represent?triggers,?exits,?data types?and?data elements.
All data structures are represented by abstracted Objects.?For atomic values, these are the actual data types.?For composite value (Data Structures), these are arrays (each element has a fixed position in the array).
Actual access to data structure components is done using?ElementHandlers?(each elements contains the relevant index) - see demo project.
Repetitive elements are represented by?java.util.List?objects
參考tersus項(xiàng)目介紹http://tersus.com/#Id=7987,開發(fā)一個(gè)插件;接收post請(qǐng)求的body部分傳值給Callable Service
進(jìn)行中 2025-06-23發(fā)布
招標(biāo)-按項(xiàng)目付費(fèi)