Differences between revisions 5 and 6
Revision 5 as of 2008-05-30 22:37:00
Size: 1297
Editor: KeiichiroOno
Comment:
Revision 6 as of 2008-05-30 23:23:49
Size: 2546
Editor: KeiichiroOno
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
 Commands should be easily accessible dynamic (scripting) languages, including Python, Ruby, and JavaScript.  Commands should be easily accessible from dynamic (scripting) languages, including Python, Ruby, and JavaScript.
Line 16: Line 16:
=== Functions Encapcelated as Command ===
In general, most of the classes in '''''cytoscape.actions''''' will be converted into Commands.
=== 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 26: Line 30:
 * 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 32: Line 64:
 * [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]
Line 34: Line 70:
 * Jython
 * JRuby
 * Rhino (JavaScript)
 *
 * [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

OSGi Service

Dynamic Language Support on JVM

Outdated_Cytoscape_3.0/CommandDiscussions (last edited 2011-02-24 15:33:09 by PietMolenaar)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux