Author: paperwing
Date: 2012-12-10 13:13:27 -0800 (Mon, 10 Dec 2012)
New Revision: 30991

Modified:
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CurrentlyInstalledAppsPanel.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallAppsPanel.java
Log:
Updated file naming scheme for downloaded apps, no longer checks for updates of 
uninstalled apps, downloaded app names now contain version.

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
 2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
 2012-12-10 21:13:27 UTC (rev 30991)
@@ -123,6 +123,7 @@
                // Following above Javadoc, e.g. Completely uninstalled, and/or 
file is completely gone
                if ((status == AppStatus.UNINSTALLED && appInstance == null)
                                || status == AppStatus.FILE_MOVED && 
appInstance == null) {
+                       
                        return true;
                } else {
                        return false;

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-12-10 21:13:27 UTC (rev 30991)
@@ -227,6 +227,7 @@
                }
                
                Set<App> installedFolderApps = obtainAppsFromDirectory(new 
File(getInstalledAppsPath()), false);
+               DebugHelper.print(this, "Initializing.. obtained " + 
installedFolderApps.size() + " apps from apps directory.");
                for (App app: installedFolderApps) {
                        try {
                                boolean appRegistered = false;

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
      2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
      2012-12-10 21:13:27 UTC (rev 30991)
@@ -516,6 +516,9 @@
                                                // Replace spaces with 
underscores
                                                String outputFileBasename = 
webApp.getName().replaceAll("\\s", "_");
                                                
+                                               // Append version information
+                                               outputFileBasename += "-v" + 
releaseToDownload.getReleaseVersion();
+                                               
                                                // Strip disallowed characters
                                                outputFileBasename = 
OUTPUT_FILENAME_DISALLOWED_CHARACTERS.matcher(outputFileBasename).replaceAll("");
                                                
@@ -532,8 +535,6 @@
                                                
                                                outputFile.createNewFile();
                                                
-//                                             System.out.println("preparing 
to download");
-                                               
                                            FileOutputStream fileOutputStream = 
new FileOutputStream(outputFile);
                                            try {
                                                    FileChannel fileChannel = 
fileOutputStream.getChannel();
@@ -823,8 +824,11 @@
                                // in cases where multiple stores give the same 
hash.
                                if 
(checksum.indexOf(release.getSha512Checksum().toLowerCase()) != -1
                                                && app.getDescription() == 
null) {
-                                       
-                                       System.out.println("Found description: 
" + allReleases.get(release).getDescription());
+
+// WebQuerier obtains app information from app store because no description 
metadata is required
+// in the app zip file itself. This was to allow better App-Bundle 
interchangeability, not
+// imposing unneeded restrictions on OSGi bundles (from past discussion on 
mailing list, some time in 2012)
+//                                     System.out.println("Found description: 
" + allReleases.get(release).getDescription());
                                        
app.setDescription(allReleases.get(release).getDescription());
                                }
                        }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
     2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
     2012-12-10 21:13:27 UTC (rev 30991)
@@ -404,14 +404,18 @@
                                
                                DefaultTableModel tableModel = 
(DefaultTableModel) updatesTable.getModel();
                                
-                               for (Update update : 
updateManager.getUpdates()) {      
-                                       tableModel.addRow(new Object[]{
+                               for (Update update : 
updateManager.getUpdates()) {
+                                       if (!update.getApp().isDetached()) {
+                                       
+                                               tableModel.addRow(new Object[]{
                                                update,
                                                update.getApp().getVersion(),
                                                update.getUpdateVersion(),
                                                
(update.getRelease().getBaseUrl() 
-                                                               + 
update.getRelease().getRelativeUrl()).replaceAll("//+", "/").replaceFirst(":/", 
"://")
-                                       });
+                                                               + 
update.getRelease().getRelativeUrl()).replaceAll("//+", "/").replaceFirst(":/", 
"://")                                
+                                               });
+                                               
+                                       }
                        }
                        }
                

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CurrentlyInstalledAppsPanel.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CurrentlyInstalledAppsPanel.java
      2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CurrentlyInstalledAppsPanel.java
      2012-12-10 21:13:27 UTC (rev 30991)
@@ -22,6 +22,7 @@
 import org.cytoscape.app.internal.manager.AppManager;
 import org.cytoscape.app.internal.manager.BundleApp;
 import org.cytoscape.app.internal.manager.SimpleApp;
+import org.cytoscape.app.internal.util.DebugHelper;
 
 /**
  * This class represents the panel in the App Manager dialog's tab used for 
checking for currently installed apps.
@@ -320,6 +321,7 @@
                // Hide apps with certain statuses from the table, such as 
uninstalled ones.
                if (app.isDetached()) {
                        // Do nothing
+                       DebugHelper.print(this, "Detached app: " + 
app.getAppName() + ", status: " + app.getStatus());
                } else {
                        tableModel.addRow(new Object[]{
                                                app,
@@ -344,6 +346,8 @@
                // Count the number of displayed apps
                if (!app.isDetached()) {
                        listedCount++;
+               } else {
+                       DebugHelper.print(this, "Detached app: " + 
app.getAppName() + ", status: " + app.getStatus());
                }
        }
        

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallAppsPanel.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallAppsPanel.java
 2012-12-10 17:42:29 UTC (rev 30990)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallAppsPanel.java
 2012-12-10 21:13:27 UTC (rev 30991)
@@ -499,12 +499,12 @@
 
                        @Override
                        public void run(TaskMonitor taskMonitor) throws 
Exception {
-                               taskMonitor.setTitle("Installing app");
+                               taskMonitor.setTitle("Installing requested 
app");
                                
                                int installedAppCount = 0;
                                double progress = 0;
                                
-                               taskMonitor.setStatusMessage("Installing app");
+                               taskMonitor.setStatusMessage("Downloading 
app..");
                                
                                for (int index = 0; index < files.length; 
index++) {
                                AppParser appParser = appManager.getAppParser();

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to