use of org.cytoscape.application.CyVersion in project cytoscape-impl by cytoscape.
the class HelpReportABugTask method run.
@Override
public void run(TaskMonitor tm) {
// get OS string
String os_str = System.getProperty("os.name") + "_" + System.getProperty("os.version");
os_str = os_str.replace(" ", "_");
final OpenBrowser openBrowser = serviceRegistrar.getService(OpenBrowser.class);
final CyVersion cyVersion = serviceRegistrar.getService(CyVersion.class);
openBrowser.openURL(BUG_REPORT_URL + "?cyversion=" + cyVersion.getVersion() + "&os=" + os_str);
}
use of org.cytoscape.application.CyVersion in project cytoscape-impl by cytoscape.
the class HelpUserManualTask method run.
@Override
public void run(TaskMonitor tm) {
final OpenBrowser openBrowser = serviceRegistrar.getService(OpenBrowser.class);
final CyVersion cyVersion = serviceRegistrar.getService(CyVersion.class);
openBrowser.openURL(MANUAL_URL + cyVersion.getMajorVersion() + "." + cyVersion.getMinorVersion() + "." + cyVersion.getBugFixVersion());
}
use of org.cytoscape.application.CyVersion in project cytoscape-impl by cytoscape.
the class CyActivator method start.
public void start(BundleContext bc) {
CommandLineArgs args = getService(bc, CommandLineArgs.class);
CyVersion cyVersion = getService(bc, CyVersion.class);
CyShutdown cyShutdown = getService(bc, CyShutdown.class);
StreamUtil streamUtil = getService(bc, StreamUtil.class);
OpenSessionTaskFactory loadSession = getService(bc, OpenSessionTaskFactory.class);
LoadNetworkFileTaskFactory networkFileLoader = getService(bc, LoadNetworkFileTaskFactory.class);
LoadNetworkURLTaskFactory networkURLLoader = getService(bc, LoadNetworkURLTaskFactory.class);
LoadVizmapFileTaskFactory visualStylesLoader = getService(bc, LoadVizmapFileTaskFactory.class);
TaskManager<?, ?> taskManager = getService(bc, TaskManager.class);
CyServiceRegistrar registrar = getService(bc, CyServiceRegistrar.class);
CyProperty<Properties> props = (CyProperty<Properties>) getService(bc, CyProperty.class, "(cyPropertyName=cytoscape3.props)");
StartupConfig sc = new StartupConfig(props.getProperties(), streamUtil, loadSession, networkFileLoader, networkURLLoader, visualStylesLoader, taskManager, registrar);
Parser p = new Parser(args.getArgs(), cyShutdown, cyVersion, sc, props.getProperties());
sc.start();
}
use of org.cytoscape.application.CyVersion in project cytoscape-impl by cytoscape.
the class ResolveAppDependenciesTask method resolveAppDependencies.
private void resolveAppDependencies(App appToInstall) throws Exception {
CyVersion version = appManager.getCyVersion();
if (!appToInstall.isCompatible(version))
throw new Exception("Unable to install " + appToInstall.getAppName() + ".\nIt is incompatible with this version of Cytoscape (" + version.getVersion() + ").");
taskMonitor.setStatusMessage("Resolving dependencies for " + appToInstall.getAppName() + "...");
for (App installedApp : appManager.getInstalledApps()) {
if (installedApp.getAppName().equals(appToInstall.getAppName())) {
appsToReplace.put(appToInstall, installedApp);
break;
}
}
dependencyStack.push(appToInstall.getAppName());
if (appToInstall.getDependencies() != null)
for (App.Dependency dep : appToInstall.getDependencies()) {
if (dependencyStack.contains(dep.getName()))
throw new Exception("Invalid circular dependency: " + dep.getName());
else if (findAppForDep(dep, appsToInstall) != null)
continue;
else if (findAppForDep(dep, appManager.getInstalledApps()) != null)
continue;
else {
App dependencyApp = findAppForDep(dep, appQueue);
if (dependencyApp != null) {
appQueue.remove(dependencyApp);
} else {
Set<WebApp> webApps = appManager.getWebQuerier().getAllApps();
if (webApps == null)
throw new Exception("Cannot access the App Store to resolve dependencies. Please check your internet connection.");
WebApp webApp = findWebAppForDep(dep, webApps);
if (webApp == null)
throw new Exception("Cannot find dependency: " + dependencyStack.firstElement() + " requires " + dep.getName() + ", which is not available in the App Store");
List<Release> releases = webApp.getReleases();
Release latestRelease = releases.get(releases.size() - 1);
if (WebQuerier.compareVersions(dep.getVersion(), latestRelease.getReleaseVersion()) >= 0) {
taskMonitor.setStatusMessage("Downloading dependency for " + dependencyStack.firstElement() + ": " + webApp.getFullName());
File appFile = appManager.getWebQuerier().downloadApp(webApp, null, new File(appManager.getDownloadedAppsPath()), status);
dependencyApp = appManager.getAppParser().parseApp(appFile);
} else
throw new Exception("Cannot find dependency: " + dependencyStack.firstElement() + " requires " + dep.getName() + " " + dep.getVersion() + " or later, latest release in App Store is " + latestRelease.getReleaseVersion());
}
resolveAppDependencies(dependencyApp);
}
}
dependencyStack.pop();
appsToInstall.add(appToInstall);
}
use of org.cytoscape.application.CyVersion in project cytoscape-impl by cytoscape.
the class CyActivator method start.
public void start(BundleContext bc) {
final CommandLineArgs args = getService(bc, CommandLineArgs.class);
final CyVersion cyVersion = getService(bc, CyVersion.class);
final CyShutdown cyShutdown = getService(bc, CyShutdown.class);
final AvailableCommands availableCommands = getService(bc, AvailableCommands.class);
final CommandExecutorTaskFactory cmdExec = getService(bc, CommandExecutorTaskFactory.class);
final SynchronousTaskManager taskManager = getService(bc, SynchronousTaskManager.class);
new Thread(new Runnable() {
public void run() {
StartupConfig sc = new StartupConfig(cmdExec, taskManager);
Parser p = new Parser(args.getArgs(), cyShutdown, cyVersion, sc, availableCommands);
sc.start();
try {
Thread.sleep(200);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
cyShutdown.exit(0);
}
}).start();
}
Aggregations