-
Notifications
You must be signed in to change notification settings - Fork 58
App Developers: Cytoscape Command Best Practices
When developing Apps that enable automation, observing best practices in coding and design can greatly improve the accessibility of that automation, its interaction with other Apps and services, and aid in tracing any errors during testing and in runtime.
This page documents best practices for App developers who are enabling automation features as Cytoscape Commands. For Cytoscape Functions, see JAX RS Best Practices for and Swagger Best Practices.
The namespace you choose for your command via the ServiceProperties.COMMAND_NAMESPACE
property should succinctly and uniquely describe its place among all other commands. For example, all layout commands are registered with the layout namespace.
When creating a task that contains Tunables, it is important to be aware of the context field in the Tunable annotation.
@Tunable (description="Example Input Parameter", context=Tunable.BOTH_CONTEXT)
The above code snippet specifies that the Tunable field is intended for inclusion in both the Cytoscape GUI and in the Cytoscape Command Line. Options exist for Tunables that are in the GUI only (Tunable.GUI_CONTEXT) and non-GUI (Tunable.NOGUI_CONTEXT). It is important that no Tunables required for the execution of the Task via automation are of the Tunable.GUI_CONTEXT type.
Several fields and parameters exist to provide users with documentation about commands. This documentation becomes available in both the Command Line, and in the CyREST Command API Swagger.