Revision: 14737
          http://gate.svn.sourceforge.net/gate/?rev=14737&view=rev
Author:   markagreenwood
Date:     2011-12-12 12:41:18 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
a sensible(ish) way of listing known update sites, and Johann's site as the 
first example

Modified Paths:
--------------
    gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java

Modified: gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java
===================================================================
--- gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java     
2011-12-12 11:58:04 UTC (rev 14736)
+++ gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java     
2011-12-12 12:41:18 UTC (rev 14737)
@@ -132,6 +132,10 @@
   private static final String SUPPRESS_UPDATE_INSTALLED =
           "suppress.update.install";
 
+  private static final String[] defaultUpdateSites = new String[]{
+      "OFAI (Austrian Research Institute for AI)",
+      "http://www.ofai.at/~johann.petrak/GATE/gate-update-site.xml"};
+
   public static File getUserPluginsHome() {
     // TODO move this into gate.util.OptionaMap as a getFile() method
     if(userPluginDir == null) {
@@ -438,13 +442,23 @@
       }
     }
 
-    if(updateSites.size() == 0) {
-      /*
-       * try { // TODO we need to change this to something more sensible
-       * updateSites.add(new RemoteUpdateSite("Default Test Site", new URI(
-       * "http://greenwoodma.servehttp.com/gate-plugins/";), true)); }
-       * catch(URISyntaxException e) { // this can never happen! }
-       */
+    if(defaultUpdateSites.length % 2 == 0) {
+      // TODO the problem here is that we want to make sure new sites show up 
in
+      // the list, but this means that if a user deletes a site it will respawn
+      // next time they start GATE, not sure if ther is a better solution.
+
+      for(int i = 0; i < defaultUpdateSites.length; ++i) {
+        try {
+          RemoteUpdateSite rus =
+                  new RemoteUpdateSite(defaultUpdateSites[i], new URI(
+                          defaultUpdateSites[++i]), false);
+
+          if(!updateSites.contains(rus)) updateSites.add(rus);
+        } catch(URISyntaxException e) {
+          // this can never happen!
+          e.printStackTrace();
+        }
+      }
     }
 
     // set up the main window
@@ -677,7 +691,7 @@
         if(txtURL.getText().trim().equals("")) return;
 
         dialog.dispose();
-        
+
         try {
           updateSites.add(new RemoteUpdateSite(txtName.getText().trim(),
                   new URI(txtURL.getText().trim()), true));
@@ -965,7 +979,7 @@
 
     // now actually show/hide the window
     super.setVisible(visible);
-    
+
     dispose();
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to