Size: 530
Comment:
|
Size: 2546
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
Command layer contains mechanism to make Cytoscape functions easily accessible from application layer. This layer should be separated from application layer and can be used in any mode: Desktop application, server version, and command line version. | |
Line 13: | Line 13: |
==== Multiple Language Support ==== Commands should be easily accessible from dynamic (scripting) languages, including Python, Ruby, and JavaScript. === Functions Encapsulated as Command === In general, most of the classes in '''''cytoscape.actions''''' will be converted into Commands. In addition, some of the methods under the class ''cytoscape.Cytoscape'' will be encapsulated as command. Such as: * createNetwork() * createNewSession() * getNetwork() |
|
Line 14: | Line 24: |
attachment:commandLayer1.png |
|
Line 15: | Line 28: |
* Command executes the function through the OSGi service registory. * For easy access to commands, an utility class '''''CommandService''''' will be used. {{{#!java // Java CommandService.getCommand("command_name").execute(); // Ruby CommandService.getCommand("command_name").execute }}} We can use similar design to Felix ShellService: {{{#!java package org.apache.felix.shell; public interface ShellService { public String[] getCommands(); public String getCommandUsage(String name); public String getCommandDescription(String name); public ServiceReference getCommandReference(String name); public void executeCommand( String commandLine, PrintStream out, PrintStream err) throws Exception; } }}} |
|
Line 20: | Line 62: |
=== OSGi Service === * [http://neilbartlett.name/downloads/preview_intro_services.pdf Introduction to Services] * [http://www.knopflerfish.org/osgi_service_tutorial.html OSGi Service Tutorial] * [http://felix.apache.org/site/apache-felix-shell-service.html Felix ShellService] === Dynamic Language Support on JVM === * [http://www.jython.org/Project/index.html Jython] * [http://jruby.codehaus.org/ JRuby] * [http://www.mozilla.org/rhino/ Rhino (JavaScript)] |
(This page is under construction)
Command Layer Definition
Command layer contains mechanism to make Cytoscape functions easily accessible from application layer. This layer should be separated from application layer and can be used in any mode: Desktop application, server version, and command line version.
Requirments
- Command layer should be separated from application or UI.
- Commands should be accessible from scripting (dynamic) languages.
- Should be manageable by Undo manager (in application layer).
- Extensible. Plugin writers and developers use Cytoscape as library can add their own commands.
Multiple Language Support
Commands should be easily accessible from dynamic (scripting) languages, including Python, Ruby, and JavaScript.
Functions Encapsulated as Command
In general, most of the classes in cytoscape.actions will be converted into Commands. In addition, some of the methods under the class cytoscape.Cytoscape will be encapsulated as command. Such as:
- createNetwork()
- createNewSession()
- getNetwork()
Design
- attachment:commandLayer1.png
- Each command will be represented as an OSGi service.
- Command executes the function through the OSGi service registory.
For easy access to commands, an utility class CommandService will be used.
1 // Java
2 CommandService.getCommand("command_name").execute();
3
4 // Ruby
5 CommandService.getCommand("command_name").execute
6
We can use similar design to Felix ShellService:
1 package org.apache.felix.shell;
2
3 public interface ShellService
4 {
5 public String[] getCommands();
6 public String getCommandUsage(String name);
7 public String getCommandDescription(String name);
8 public ServiceReference getCommandReference(String name);
9 public void executeCommand(
10 String commandLine, PrintStream out, PrintStream err)
11 throws Exception;
12 }
13
Implementation
References and External Links
OSGi Service
[http://neilbartlett.name/downloads/preview_intro_services.pdf Introduction to Services]
[http://www.knopflerfish.org/osgi_service_tutorial.html OSGi Service Tutorial]
[http://felix.apache.org/site/apache-felix-shell-service.html Felix ShellService]
Dynamic Language Support on JVM
[http://jruby.codehaus.org/ JRuby]
[http://www.mozilla.org/rhino/ Rhino (JavaScript)]