Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Moved webserver to compbio server
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim committed May 13, 2014
1 parent 1309e91 commit 5f1f3cb
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
import com.jidesoft.wizard.DefaultWizardPage;
import com.jidesoft.wizard.WizardDialog;
import com.jidesoft.wizard.WizardStyle;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand All @@ -53,6 +50,7 @@
import org.ut.biolab.medsavant.client.view.util.DialogUtils;
import org.ut.biolab.medsavant.client.view.util.ViewUtil;
import org.ut.biolab.medsavant.shared.model.SessionExpiredException;
import org.ut.biolab.medsavant.shared.util.WebResources;

/**
*
Expand Down Expand Up @@ -131,16 +129,16 @@ public void actionPerformed(ActionEvent ae) {
type = ((OntologyListItem)typeCombo.getSelectedItem()).getType();
switch (type) {
case GO:
oboField.setText(OntologyManagerAdapter.GO_OBO_URL.toString());
mappingField.setText(OntologyManagerAdapter.GO_TO_GENES_URL.toString());
oboField.setText(WebResources.GO_OBO_URL.toString());
mappingField.setText(WebResources.GO_TO_GENES_URL.toString());
break;
case HPO:
oboField.setText(OntologyManagerAdapter.HPO_OBO_URL.toString());
mappingField.setText(OntologyManagerAdapter.HPO_TO_GENES_URL.toString());
oboField.setText(WebResources.HPO_OBO_URL.toString());
mappingField.setText(WebResources.HPO_TO_GENES_URL.toString());
break;
case OMIM:
oboField.setText(OntologyManagerAdapter.OMIM_OBO_URL.toString());
mappingField.setText(OntologyManagerAdapter.OMIM_TO_HPO_URL.toString());
oboField.setText(WebResources.OMIM_OBO_URL.toString());
mappingField.setText(WebResources.OMIM_TO_HPO_URL.toString());
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.genemania.util.NullProgressReporter;
import org.ut.biolab.medsavant.client.settings.DirectorySettings;
import org.ut.biolab.medsavant.client.view.MedSavantFrame;
import org.ut.biolab.medsavant.shared.util.WebResources;
import org.xml.sax.SAXException;

/**
Expand Down Expand Up @@ -99,7 +100,7 @@ public NoRelatedGenesInfoException() {
private SearchResult options;
private static Map<Long, Integer> sequenceNumbers;
private RelatedGenesEngineResponseDto response;
private static String GM_URL = "http://compbio.cs.toronto.edu/savant/data/dropbox/genemania/gmdata.zip";
//private static String GM_URL = "http://compbio.cs.toronto.edu/savant/data/dropbox/genemania/gmdata.zip";
private static final Log LOG = LogFactory.getLog(GenemaniaInfoRetriever.class);
private static GeneManiaDownloadTask geneManiaDownloadTask;

Expand Down Expand Up @@ -170,7 +171,7 @@ public static synchronized DownloadTask getGeneManiaDownloadTask() throws IOExce

if (geneManiaDownloadTask == null || geneManiaDownloadTask.isCancelled()) {
String dstPath = DirectorySettings.getCacheDirectory().getAbsolutePath();
geneManiaDownloadTask = new GeneManiaDownloadTask(GM_URL, dstPath, "Downloading GeneMANIA...");
geneManiaDownloadTask = new GeneManiaDownloadTask(WebResources.GENEMANIA_DATA_URL.toString(), dstPath, "Downloading GeneMANIA...");
}
return geneManiaDownloadTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void finishLogin(String un, String pw) {
String serverVersion = MedSavantClient.SettingsManager.getServerVersion();

if (!VersionSettings.isClientCompatibleWithServer(clientVersion, serverVersion)) {
LoginEvent e = new LoginEvent(new Exception("<html>Your client version (" + clientVersion + ") is not compatible with the server (" + serverVersion + ").<br>Visit " + WebResources.URL + " to get the correct version.</html>"));
LoginEvent e = new LoginEvent(new Exception("<html>Your client version (" + clientVersion + ") is not compatible with the server (" + serverVersion + ").<br>Visit " + WebResources.WEB_URL + " to get the correct version.</html>"));
fireEvent(e);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.ut.biolab.medsavant.client.api.Listener;
import org.ut.biolab.medsavant.client.controller.ServerController;
import org.ut.biolab.medsavant.client.controller.SettingsController;
import org.ut.biolab.medsavant.client.util.CryptoUtils;
import org.ut.biolab.medsavant.client.util.MedSavantWorker;
import org.ut.biolab.medsavant.client.view.MedSavantFrame;
import org.ut.biolab.medsavant.client.view.component.PlaceHolderPasswordField;
Expand Down Expand Up @@ -388,9 +389,10 @@ public void actionPerformed(ActionEvent e) {
}

private void doSignIntoServer(MedSavantServerInfo server) {
System.out.println("Logging in with "+usernameField.getText()+"/"+String.copyValueOf(passwordField.getPassword()));
// save username
server.setUsername(usernameField.getText());

// save password
server.setPassword(new String(passwordField.getPassword()));

Expand Down Expand Up @@ -437,11 +439,14 @@ public void setServer(MedSavantServerInfo server) {
if (server == null) {
return;
}

if(server.getPassword() == null){
return;
}
this.server = server;

usernameField.setText(server.getUsername());
passwordField.setText(server.getPassword());
//System.out.println("Setting server with username "+server.getUsername()+" and pw "+server.getPassword());
usernameField.setText(server.getUsername());
passwordField.setText(server.getPassword());
rememberPasswordCheckbox.setSelected(server.isRememberPassword());
serverNameLabel.setText(ViewUtil.ellipsize(server.getNickname(), 23));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.ut.biolab.medsavant.shared.model.SessionExpiredException;
import org.ut.biolab.medsavant.shared.util.MiscUtils;
import org.ut.biolab.medsavant.shared.util.RemoteFileCache;
import org.ut.biolab.medsavant.shared.util.WebResources;


/**
Expand Down Expand Up @@ -482,11 +483,11 @@ public boolean run(){
try {
LOG.info("dbname for connection: " + ConnectionController.getDBName(sessID));
LOG.info("Adding GO Ontology");
addOntology(sessID, OntologyType.GO.toString(), OntologyType.GO, GO_OBO_URL, GO_TO_GENES_URL);
addOntology(sessID, OntologyType.GO.toString(), OntologyType.GO, WebResources.GO_OBO_URL, WebResources.GO_TO_GENES_URL);
LOG.info("Adding HPO Ontology");
addOntology(sessID, OntologyType.HPO.toString(), OntologyType.HPO, HPO_OBO_URL, HPO_TO_GENES_URL);
addOntology(sessID, OntologyType.HPO.toString(), OntologyType.HPO, WebResources.HPO_OBO_URL, WebResources.HPO_TO_GENES_URL);
LOG.info("Adding OMIM Ontology");
addOntology(sessID, OntologyType.OMIM.toString(), OntologyType.OMIM, OMIM_OBO_URL, OMIM_TO_HPO_URL);
addOntology(sessID, OntologyType.OMIM.toString(), OntologyType.OMIM, WebResources.OMIM_OBO_URL, WebResources.OMIM_TO_HPO_URL);
SessionManager.getInstance().unregisterSession(sessID);
return true;
} catch (Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import org.ut.biolab.medsavant.shared.util.DirectorySettings;
import org.ut.biolab.medsavant.shared.util.NetworkUtils;
import org.ut.biolab.medsavant.shared.util.WebResources;


/**
Expand Down Expand Up @@ -102,13 +103,13 @@ public String toString() {
* Static helper variables / methods
*/

private static final String databaseURL = "http://compbio.cs.toronto.edu/savant/data/dropbox/newAnnotationDirectory.xml";
//private static final String databaseURL = "http://compbio.cs.toronto.edu/savant/data/dropbox/newAnnotationDirectory.xml";
private static File downloadAnnotationDatabase() throws IOException {
String targetFileName = "AnnotationDatabase.xml";
File targetDir = DirectorySettings.getTmpDirectory();
File tgt = new File(targetDir, targetFileName);
//if(!tgt.exists()){
NetworkUtils.downloadFile(new URL(databaseURL), targetDir, targetFileName);
NetworkUtils.downloadFile(WebResources.ANNOTATION_DIRECTORY_URL, targetDir, targetFileName);
//}
return tgt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,6 @@
*/
public interface OntologyManagerAdapter extends Remote {


public static final String basePath = "http://medsavant.com/serve/ontology/";

public static final URL GO_OBO_URL = NetworkUtils.getKnownGoodURL(basePath + "gene_ontology.1_2.obo");
public static final URL HPO_OBO_URL = NetworkUtils.getKnownGoodURL(basePath + "human-phenotype-ontology.obo");
public static final URL OMIM_OBO_URL = NetworkUtils.getKnownGoodURL(basePath + "omim.obo");

public static final URL GO_TO_GENES_URL = NetworkUtils.getKnownGoodURL(basePath + "gene_association.goa_human.gz");
public static final URL HPO_TO_GENES_URL = NetworkUtils.getKnownGoodURL(basePath + "phenotype_to_genes.txt");
public static final URL OMIM_TO_HPO_URL = NetworkUtils.getKnownGoodURL(basePath + "phenotype_annotation.tab");


/*
public static final URL GO_OBO_URL = NetworkUtils.getKnownGoodURL("http://geneontology.org/ontology/obo_format_1_2/gene_ontology.1_2.obo");
public static final URL HPO_OBO_URL = NetworkUtils.getKnownGoodURL("http://compbio.charite.de/svn/hpo/trunk/src/ontology/human-phenotype-ontology.obo");
public static final URL OMIM_OBO_URL = NetworkUtils.getKnownGoodURL("http://obo.svn.sourceforge.net/viewvc/obo/phenotype-commons/annotations/OMIM/omim.obo");
public static final URL GO_TO_GENES_URL = NetworkUtils.getKnownGoodURL("http://www.geneontology.org/gene-associations/gene_association.goa_human.gz");
public static final URL HPO_TO_GENES_URL = NetworkUtils.getKnownGoodURL("http://compbio.charite.de/svn/hpo/trunk/src/annotation/phenotype_to_genes.txt");
public static final URL OMIM_TO_HPO_URL = NetworkUtils.getKnownGoodURL("http://compbio.charite.de/svn/hpo/trunk/src/annotation/phenotype_annotation.tab");
*
*/
/**
* Check the status of a lengthy process, giving the user the option to cancel.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,57 @@ public class WebResources {
/*
* Website URLs
*/
private static final String BASE_DOMAIN = "genomesavant.com";
private static final String BASE_WWW = "http://"+BASE_DOMAIN;
public static final URL FEEDBACK_URL = NetworkUtils.getKnownGoodURL("mailto:feedback@"+BASE_DOMAIN+"?subject=MedSavant%20Feedback");
public static final URL URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/p/medsavant");
public static final URL USERGUIDE_URL = NetworkUtils.getKnownGoodURL(URL, "learn");

public static final URL GENEMANIA_DATA_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/serve/data/genemania/gmdata.zip");
public static final URL CLIENT_SERVER_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(URL, "serve/version/compatibility/client_server_compatibility.xml");
public static final URL DATABASE_SERVER_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(URL, "serve/version/compatibility/db_server_compatibility.xml");
public static final URL APPSDK_CLIENT_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(URL, "serve/version/compatibility/appsdk_client_compatibility.xml");
public static final URL LOG_USAGE_STATS_URL = NetworkUtils.getKnownGoodURL(URL, "scripts/logUsageStats.cgi");

public static final URL BUGREPORT_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/p/assets/include/form/both/bugreport-post.php");
public static final URL FEEDBACK_FORM_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/p/assets/include/form/both/feedbackreport-post.php");
//p/assets
//p/medsavant
//scripts/logUsageStats.cgi
//learn
//serve

//Email address
private static final String EMAIL_DOMAIN ="genomesavant.com";
public static final URL FEEDBACK_URL = NetworkUtils.getKnownGoodURL("mailto:feedback@"+EMAIL_DOMAIN+"?subject=MedSavant%20Feedback");

private static final URL BASE_URL = NetworkUtils.getKnownGoodURL("http://compbio.cs.toronto.edu/savant/data/dropbox/medsavant");

//Links to the website.
public static final URL WEB_URL = NetworkUtils.getKnownGoodURL("http://genomesavant.com/p/medsavant");
public static final URL USERGUIDE_URL = NetworkUtils.getKnownGoodURL(WEB_URL, "learn");

public static final URL REFGENE_HG18_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/data/hg18/hg18.refGene.gz");
public static final URL REFGENE_HG19_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/data/medsavant/hg19/refGene.txt.gz");
//Links to xml files.
private static final URL XML_BASE = NetworkUtils.getKnownGoodURL(BASE_URL, "xml");
public static final URL ANNOTATION_DIRECTORY_URL = NetworkUtils.getKnownGoodURL(XML_BASE, "annotationDirectory.xml");
public static final URL CLIENT_SERVER_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(XML_BASE, "client_server_compatibility.xml");
public static final URL DATABASE_SERVER_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(XML_BASE, "db_server_compatibility.xml");
public static final URL APPSDK_CLIENT_VERSION_COMPATIBILITY_URL = NetworkUtils.getKnownGoodURL(XML_BASE, "xml/appsdk_client_compatibility.xml");
public static final String[] PLUGIN_REPOSITORY_URLS
= new String[]{BASE_WWW+"/p/medsavant/serve/plugin/pluginDirectory.xml"};

public static final URL JANNOVAR_HG19_SERFILE_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/p/medsavant/serve/annotation/jannovar/refseq_hg19.ser");
public static final URL SAVANT_ROOTREQUEST_URL = NetworkUtils.getKnownGoodURL(BASE_WWW+"/q/medsavant");

= new String[]{NetworkUtils.getKnownGoodURL(XML_BASE, "pluginDirectory.xml").toString()};

//Links to data files.
private static final URL DATA_BASE = NetworkUtils.getKnownGoodURL(BASE_URL, "data");
private static final URL HG18_BASE = NetworkUtils.getKnownGoodURL(DATA_BASE, "hg18");
private static final URL HG19_BASE = NetworkUtils.getKnownGoodURL(DATA_BASE, "hg19");
private static final URL ONTOLOGY_BASE = NetworkUtils.getKnownGoodURL(DATA_BASE, "ontology");
public static final URL GENEMANIA_DATA_URL = NetworkUtils.getKnownGoodURL(DATA_BASE, "gmdata.zip");
public static final URL REFGENE_HG19_URL = NetworkUtils.getKnownGoodURL(HG19_BASE, "refGene.txt.gz");
public static final URL JANNOVAR_HG19_SERFILE_URL = NetworkUtils.getKnownGoodURL(HG19_BASE, "jannovar/refseq_hg19.ser");
public static final URL REFGENE_HG18_URL = NetworkUtils.getKnownGoodURL(HG18_BASE, "hg18.refGene.gz");
public static final URL GO_OBO_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "gene_ontology.1_2.obo");
public static final URL HPO_OBO_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "human-phenotype-ontology.obo");
public static final URL OMIM_OBO_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "omim.obo");
public static final URL GO_TO_GENES_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "gene_association.goa_human.gz");
public static final URL HPO_TO_GENES_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "phenotype_to_genes.txt");
public static final URL OMIM_TO_HPO_URL = NetworkUtils.getKnownGoodURL(ONTOLOGY_BASE, "phenotype_annotation.tab");

//Links to scripts
private static final URL SCRIPT_BASE = NetworkUtils.getKnownGoodURL(BASE_URL, "scripts");
public static final URL LOG_USAGE_STATS_URL = NetworkUtils.getKnownGoodURL(SCRIPT_BASE, "logUsageStats.cgi");
public static final URL BUGREPORT_URL = NetworkUtils.getKnownGoodURL(SCRIPT_BASE, "bugreport-post.php");
public static final URL FEEDBACK_FORM_URL = NetworkUtils.getKnownGoodURL(SCRIPT_BASE, "feedbackreport-post.php");

//MISC.
public static final URL SAVANT_ROOTREQUEST_URL = NetworkUtils.getKnownGoodURL(BASE_URL+"savant");


//public_base: genomesavant.com/medsavant
//server_base: genomesvant.com/serve
//userguide: public_base, learn
Expand Down

0 comments on commit 5f1f3cb

Please sign in to comment.