Search in sources :

Example 1 with CyVersion

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);
}
Also used : OpenBrowser(org.cytoscape.util.swing.OpenBrowser) CyVersion(org.cytoscape.application.CyVersion)

Example 2 with CyVersion

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());
}
Also used : OpenBrowser(org.cytoscape.util.swing.OpenBrowser) CyVersion(org.cytoscape.application.CyVersion)

Example 3 with CyVersion

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();
}
Also used : CyVersion(org.cytoscape.application.CyVersion) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) LoadVizmapFileTaskFactory(org.cytoscape.task.read.LoadVizmapFileTaskFactory) CyProperty(org.cytoscape.property.CyProperty) LoadNetworkURLTaskFactory(org.cytoscape.task.read.LoadNetworkURLTaskFactory) StreamUtil(org.cytoscape.io.util.StreamUtil) OpenSessionTaskFactory(org.cytoscape.task.read.OpenSessionTaskFactory) CommandLineArgs(org.cytoscape.cmdline.CommandLineArgs) LoadNetworkFileTaskFactory(org.cytoscape.task.read.LoadNetworkFileTaskFactory) CyShutdown(org.cytoscape.application.CyShutdown)

Example 4 with CyVersion

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);
}
Also used : App(org.cytoscape.app.internal.manager.App) WebApp(org.cytoscape.app.internal.net.WebApp) Set(java.util.Set) CyVersion(org.cytoscape.application.CyVersion) ArrayList(java.util.ArrayList) List(java.util.List) LinkedList(java.util.LinkedList) File(java.io.File) Release(org.cytoscape.app.internal.net.WebApp.Release) WebApp(org.cytoscape.app.internal.net.WebApp)

Example 5 with CyVersion

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();
}
Also used : CommandExecutorTaskFactory(org.cytoscape.command.CommandExecutorTaskFactory) SynchronousTaskManager(org.cytoscape.work.SynchronousTaskManager) CyVersion(org.cytoscape.application.CyVersion) AvailableCommands(org.cytoscape.command.AvailableCommands) CommandLineArgs(org.cytoscape.cmdline.CommandLineArgs) CyShutdown(org.cytoscape.application.CyShutdown)

Aggregations

CyVersion (org.cytoscape.application.CyVersion)6 Properties (java.util.Properties)2 AvailableCommands (org.cytoscape.command.AvailableCommands)2 CommandExecutorTaskFactory (org.cytoscape.command.CommandExecutorTaskFactory)2 OpenBrowser (org.cytoscape.util.swing.OpenBrowser)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Set (java.util.Set)1 AppManagerAction (org.cytoscape.app.internal.action.AppManagerAction)1 CitationsAction (org.cytoscape.app.internal.action.CitationsAction)1 App (org.cytoscape.app.internal.manager.App)1 AppManager (org.cytoscape.app.internal.manager.AppManager)1 UpdateManager (org.cytoscape.app.internal.net.UpdateManager)1 WebApp (org.cytoscape.app.internal.net.WebApp)1 Release (org.cytoscape.app.internal.net.WebApp.Release)1 WebQuerier (org.cytoscape.app.internal.net.WebQuerier)1 AddAllowOriginHeader (org.cytoscape.app.internal.net.server.AddAllowOriginHeader)1 AppGetResponder (org.cytoscape.app.internal.net.server.AppGetResponder)1