Skip to content

Commit

Permalink
Recovered from Michael's past check-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
keiono committed Nov 13, 2012
1 parent 035c62d commit a55d7f7
Show file tree
Hide file tree
Showing 16 changed files with 346 additions and 664 deletions.
4 changes: 0 additions & 4 deletions META-INF/MANIFEST.MF

This file was deleted.

8 changes: 8 additions & 0 deletions R/cytoBridge/Read-and-delete-me
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Edit the help file skeletons in 'man', possibly combining help files for multiple functions.
* Edit the exports in 'NAMESPACE', and add necessary imports.
* Put any C/C++/Fortran code in 'src'.
* If you have compiled code, add a useDynLib() directive to 'NAMESPACE'.
* Run R CMD build to build the package tarball.
* Run R CMD check to check the package tarball.

Read "Writing R Extensions" for more information.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
cyto-bridge
===========

## Introduction
# Introduction
Plugin to transfer data between Cytoscape and R, MATLAB, and other tools.

## How to Use

### R
### MATLAB
### Python
### Ruby
# How to Use

## R
## MATLAB
## Python
114 changes: 5 additions & 109 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

<properties>
<bundle.symbolicName>CytoBridgeRest</bundle.symbolicName>
<bundle.namespace>org.cytoscape.rest</bundle.namespace>
<bundle.namespace>org.cytoscape.rest.internal</bundle.namespace>

<!-- Cytoscape Module Versions: This should be release version -->
<cytoscape.api.version>3.0.0-beta3</cytoscape.api.version>

<maven-compiler-plugin.version>2.5.1</maven-compiler-plugin.version>
<maven-bundle-plugin.version>2.3.4</maven-bundle-plugin.version>
<osgi.api.version>4.2.0</osgi.api.version>
<junit.version>4.10</junit.version>
</properties>

<groupId>org.cytoscape.rest.internal</groupId>
Expand Down Expand Up @@ -47,32 +45,8 @@
</repository>
</repositories>


<!-- SCM Information. Currently hosted at GitHub. -->
<scm>
<connection>scm:git:git@github.com:idekerlab/cyto-bridge.git</connection>
<developerConnection>scm:git:git@github.com:idekerlab/cyto-bridge.git</developerConnection>
</scm>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<compilerArguments>
<Xmaxwarns>10000</Xmaxwarns>
<Xmaxerrs>10000</Xmaxerrs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Expand All @@ -82,56 +56,33 @@
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>!${bundle.namespace}.internal.*,${bundle.namespace}.*;version="${project.version}"</Export-Package>
<Private-Package>${bundle.namespace}.internal.*</Private-Package>
<Bundle-Activator>${bundle.namespace}.internal.CyActivator</Bundle-Activator>
<Export-Package>!${bundle.namespace}.*</Export-Package>
<Private-Package>${bundle.namespace}.*</Private-Package>
<Bundle-Activator>${bundle.namespace}.CyActivator</Bundle-Activator>
<Embed-Dependency>*;scope=!provided;groupId=!org.cytoscape</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>*;resolution:=optional</Import-Package>
<Import-Package>org.cytoscape.*,*;resolution:=optional</Import-Package>
</instructions>
</configuration>
</plugin>

<!-- For release -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<goals>deploy</goals>
<!-- Avoid to push changed to upstream -->
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<!-- Cytoscape 3 Dependencies -->
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>event-api</artifactId>
<version>${cytoscape.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>swing-application-api</artifactId>
<version>${cytoscape.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>layout-api</artifactId>
<version>${cytoscape.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>core-task-api</artifactId>
<version>${cytoscape.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
Expand All @@ -145,23 +96,12 @@
<version>${cytoscape.api.version}</version>
<scope>provided</scope>
</dependency>

<!-- OSGi core dependency -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>${osgi.api.version}</version>
<scope>provided</scope>
</dependency>


<!-- 3rd party libraries -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand All @@ -177,50 +117,6 @@
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
</dependency>

<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>model-impl</artifactId>
<version>3.0.0-beta1</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>model-impl</artifactId>
<version>3.0.0-beta1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>event-api</artifactId>
<version>3.0.0-beta3</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

</dependencies>

</project>
10 changes: 0 additions & 10 deletions src/main/java/org/cytoscape/rest/GetCytoscapeObjectTask.java

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/java/org/cytoscape/rest/Translator.java

This file was deleted.

93 changes: 26 additions & 67 deletions src/main/java/org/cytoscape/rest/internal/CyActivator.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package org.cytoscape.rest.internal;

import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Properties;
import java.util.concurrent.Executors;

import javax.servlet.ServletException;

import org.cytoscape.application.CyApplicationManager;
//import org.cytoscape.rest.internal.net.server.CytoBridgePostResponder;
import org.cytoscape.application.swing.CyAction;
import org.cytoscape.application.swing.CySwingApplication;
import org.cytoscape.model.CyNetworkFactory;
Expand All @@ -18,19 +11,18 @@
import org.cytoscape.rest.internal.net.server.CytoBridgeGetResponder;
import org.cytoscape.rest.internal.net.server.CytoBridgePostResponder;
import org.cytoscape.rest.internal.net.server.LocalHttpServer;
import org.cytoscape.rest.internal.servlet.SampleServlet;
import org.cytoscape.service.util.AbstractCyActivator;
import org.cytoscape.view.layout.CyLayoutAlgorithmManager;
import org.cytoscape.view.model.CyNetworkViewFactory;
import org.cytoscape.view.model.CyNetworkViewManager;
import org.cytoscape.view.model.events.AddedNodeViewsListener;
import org.cytoscape.view.vizmap.VisualMappingManager;
import org.cytoscape.work.TaskManager;
import org.cytoscape.service.util.AbstractCyActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException;


import java.util.Properties;
import java.util.concurrent.Executors;

public class CyActivator extends AbstractCyActivator {
public CyActivator() {
Expand All @@ -39,28 +31,26 @@ public CyActivator() {

public void start(BundleContext bc) {

// Importing Services:
CyNetworkFactory netFact = getService(bc, CyNetworkFactory.class);
CyNetworkManager netMan = getService(bc, CyNetworkManager.class);
CyNetworkViewFactory netViewFact = getService(bc, CyNetworkViewFactory.class);
CyNetworkViewManager netViewMan = getService(bc, CyNetworkViewManager.class);
VisualMappingManager visMan = getService(bc, VisualMappingManager.class);
CyApplicationManager applicationManager = getService(bc, CyApplicationManager.class);

CyTableFactory tabFact = getService(bc, CyTableFactory.class);
CyTableManager tabMan = getService(bc, CyTableManager.class);

CyLayoutAlgorithmManager layMan = getService(bc, CyLayoutAlgorithmManager.class);

// Create instance of NetworkManager with the factories/managers
CyNetworkFactory netFact = getService(bc,CyNetworkFactory.class);
CyNetworkManager netMan = getService(bc,CyNetworkManager.class);
CyNetworkViewFactory netViewFact = getService(bc,CyNetworkViewFactory.class);
CyNetworkViewManager netViewMan = getService(bc,CyNetworkViewManager.class);
VisualMappingManager visMan = getService(bc,VisualMappingManager.class);

CyTableFactory tabFact = getService(bc,CyTableFactory.class);
CyTableManager tabMan = getService(bc,CyTableManager.class);

CyLayoutAlgorithmManager layMan = getService(bc,CyLayoutAlgorithmManager.class);

//Create instance of NetworkManager with the factories/managers
NetworkManager myManager = new NetworkManager(netFact, netViewFact, netMan, netViewMan, tabFact, tabMan);

TaskManager tm = getService(bc, TaskManager.class);
CyProperty cyPropertyServiceRef = getService(bc, CyProperty.class, "(cyPropertyName=cytoscape3.props)");

CyProperty cyPropertyServiceRef = getService(bc,CyProperty.class,"(cyPropertyName=cytoscape3.props)");
NodeViewListener listen = new NodeViewListener(visMan, layMan, tm, cyPropertyServiceRef);
registerService(bc, listen, AddedNodeViewsListener.class, new Properties());

registerService(bc,listen,AddedNodeViewsListener.class, new Properties());
final CytoBridgeGetResponder cytoGetResp = new CytoBridgeGetResponder(myManager);
final CytoBridgePostResponder cytoPostResp = new CytoBridgePostResponder(myManager);

Expand All @@ -71,9 +61,9 @@ public void start(BundleContext bc) {
myManager.setListener(cytoBridgeAction);

Thread serverThread = new Thread() {

private LocalHttpServer server;

@Override
public void run() {
server = new LocalHttpServer(2609, Executors.newSingleThreadExecutor());
Expand All @@ -84,37 +74,6 @@ public void run() {
};
serverThread.setDaemon(true);
Executors.newSingleThreadExecutor().execute(serverThread);

// try {
// startServer(bc, applicationManager);
// } catch (ServletException e) {
// e.printStackTrace();
// } catch (NamespaceException e) {
// e.printStackTrace();
// }

}

private final void startServer(BundleContext bc, CyApplicationManager applicationManager) throws ServletException,
NamespaceException {
final ServiceReference m_httpServiceRef = bc.getServiceReference(HttpService.class.getName());
if (m_httpServiceRef != null) {
final HttpService httpService = (HttpService) bc.getService(m_httpServiceRef);
if (httpService != null) {
// create a default context to share between registrations
final HttpContext httpContext = httpService.createDefaultHttpContext();
// register the hello world servlet
final Dictionary initParams = new Hashtable();
initParams.put("from", "HttpService");
httpService.registerServlet("/helloworld/hs", new SampleServlet("/helloworld/hs", applicationManager), initParams,
httpContext);
httpService.registerServlet("/", new SampleServlet("/", applicationManager), initParams, httpContext);
// register images as resources
httpService.registerResources("/images", "/images", httpContext);

System.out.println("Servlet Start!");
}
}

}

}
Loading

0 comments on commit a55d7f7

Please sign in to comment.