eu.etaxonomy.taxeditor.product, eu.etaxonomy.taxeditor.feature/feature.xml, eu.etaxon...
authorCherian Mathew <c.mathew@bgbm.org>
Tue, 23 Sep 2014 11:14:59 +0000 (11:14 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Tue, 23 Sep 2014 11:14:59 +0000 (11:14 +0000)
plugin(_de,_en).properties : added license info to productBlurb used in the About popup
ApplicationWorkbenchWindowAdvisor, IPreferenceKeys, TaxonomicEditorGeneralPreferences : removed preference for allowing update checks on startup as this is already provided by rcp
ApplicationWorkbenchWindowAdvisor, ApplicationUtil, P2Util, UpdateHandler : changed setting of default repositories to make sure that they are set on startup

12 files changed:
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationUtil.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/P2Util.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/UpdateHandler.java
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.feature/feature.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product

index 31330aa5377320d36495de4e6e89fe9082a4413d..8db829129667b94fe710bd503643e4d25bcbc03a 100644 (file)
@@ -1,6 +1,14 @@
 productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
-\r
+productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\\r
+Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\\r
+http://cybertaxonomy.eu/ \n\n\\r
+The contents of this product are subject to the Mozilla Public License Version 1.1,  \n\\r
+you may not use this product except in compliance with the License. \n\\r
+You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\\r
+Software distributed under the License is distributed on an 'AS IS' basis, \n\\r
+WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\\r
+See the License for the specific language governing rights and limitations under \n\\r
+the License.\r
 extension.name = Taxonomic Editor\r
 perspective.name = Taxonomic\r
 perspective.name.0 = Polytomous Key\r
index baa8b89f8fb3b7e6c861df6c253cfee0492a1012..125f69ee8adc1f27f9e7892ce0de754465b0d7e7 100644 (file)
@@ -1,6 +1,14 @@
 productName=EDIT Taxonomischer Editor
-productBlurb=EDIT Taxonomischer Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu
-
+productBlurb=EDIT Taxonomischer Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\
+Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\
+http://cybertaxonomy.eu/ \n\n\
+The contents of this product are subject to the Mozilla Public License Version 1.1  \n\
+you may not use this product except in compliance with the License. \n\
+You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\
+Software distributed under the License is distributed on an 'AS IS' basis, \n\
+WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\
+See the License for the specific language governing rights and limitations under \n\
+the License.
 extension.name = Taxonomischer Editor
 perspective.name = Taxonomisch
 perspective.name.0 = Polytomer Key
index 31330aa5377320d36495de4e6e89fe9082a4413d..47bd90cc36259313ee6134623caba9206de7c2c5 100644 (file)
@@ -1,6 +1,14 @@
 productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
-\r
+productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\\r
+Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\\r
+http://cybertaxonomy.eu/ \n\n\\r
+The contents of this product are subject to the Mozilla Public License Version 1.1  \n\\r
+you may not use this product except in compliance with the License. \n\\r
+You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\\r
+Software distributed under the License is distributed on an 'AS IS' basis, \n\\r
+WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\\r
+See the License for the specific language governing rights and limitations under \n\\r
+the License.\r
 extension.name = Taxonomic Editor\r
 perspective.name = Taxonomic\r
 perspective.name.0 = Polytomous Key\r
index 62194cb5a9e572c664b6d2923c5a3f2299263865..105be8f47d934e6c023f96f3ed106ca83e6a5912 100644 (file)
@@ -54,7 +54,7 @@ public class ApplicationUtil extends AbstractUtility {
      * @return
      */
     public static boolean isStable() {
-        return !getVersion().startsWith(BETA_PREFIX);
+        return !getVersion().startsWith("[");
     }
        /**
         * <p>getPluginId</p>
index a15b83e5fe4b131f42abbfd5265fa9b9ccf236ed..99f3432ff90fc4e51aa825534f61651b68c2b10e 100644 (file)
@@ -7,8 +7,6 @@ import org.eclipse.ui.application.IActionBarConfigurer;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
@@ -63,14 +61,8 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
             CdmStore.connect();
         }
 
+               P2Util.setDefaultUpdateRepositories();
 
-               try {
-                   if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_AUTO_UPDATE_AT_STARTUP)) {
-                       P2Util.checkForUpdates();
-                   }
-               } catch (Exception e) {
-                   MessagingUtils.error(this.getClass(), e);
-               }
        }
 
        private int authenticate(){
index f73213854e72a1acd50b58567735a5a93e2038e2..e666929acc0b96365cf295874c7fdef93a2c2738 100644 (file)
@@ -10,11 +10,14 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.IJobChangeEvent;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
+import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
 import org.eclipse.equinox.p2.core.IProvisioningAgent;
 import org.eclipse.equinox.p2.operations.ProvisioningJob;
 import org.eclipse.equinox.p2.operations.ProvisioningSession;
 import org.eclipse.equinox.p2.operations.Update;
 import org.eclipse.equinox.p2.operations.UpdateOperation;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PlatformUI;
 import org.osgi.framework.BundleContext;
@@ -46,17 +49,37 @@ public class P2Util {
 
     //private static String LOCAL_UPDATE_SITE = "file:///path/.../to/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor/target/repository/";
     private static String EDIT_NIGHTLY_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/nightly/";
+    private static String EDIT_NIGHTLY_UPDATE_SITE_NAME = "Taxonomic Editor Nightly";
+
     private static String EDIT_SNAPSHOT_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/snapshot/";
+    private static String EDIT_SNAPSHOT_UPDATE_SITE_NAME = "Taxonomic Editor Snapshot";
+
     private static String EDIT_STABLE_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/stable/";
+    private static String EDIT_STABLE_UPDATE_SITE_NAME = "Taxonomic Editor Stable";
 
-    public static void setUpdateRepositories(UpdateOperation operation) throws URISyntaxException {
+    @SuppressWarnings("restriction")
+    public static void setDefaultUpdateRepositories() {
         String updateSite = EDIT_NIGHTLY_UPDATE_SITE;
+        String updateSiteName = EDIT_NIGHTLY_UPDATE_SITE_NAME;
+
         if(ApplicationUtil.isStable()) {
             updateSite = EDIT_STABLE_UPDATE_SITE;
+            updateSiteName = EDIT_STABLE_UPDATE_SITE_NAME;
         }
-        operation.getProvisioningContext().setMetadataRepositories(new URI[]{new URI(updateSite)});
-        operation.getProvisioningContext().setArtifactRepositories(new URI[]{new URI(updateSite)});
-    }
+        try {
+          final MetadataRepositoryElement element = new MetadataRepositoryElement(null, new URI(updateSite), true);
+          element.setNickname(updateSiteName);
+          ElementUtils.updateRepositoryUsingElements(ProvisioningUI.getDefaultUI(),new MetadataRepositoryElement[] {element}, null);
+        } catch (URISyntaxException e) {
+            MessagingUtils.errorDialog("Invalid update site URI",
+                    P2Util.class,
+                    "The update site URI has an invalid syntax",
+                    TaxonomicEditorPlugin.PLUGIN_ID,
+                    e,
+                    false);
+        }
+      }
+
     /**
      *
      *
@@ -110,17 +133,17 @@ public class P2Util {
         // which installable units are being updated, use the more detailed
         // constructors.
         final UpdateOperation operation = new UpdateOperation(session);
-        try {
-            setUpdateRepositories(operation);
-        } catch (URISyntaxException e) {
-            MessagingUtils.errorDialog("Invalid update site URI",
-                    operation,
-                    "The update site URI has an invalid syntax",
-                    TaxonomicEditorPlugin.PLUGIN_ID,
-                    e,
-                    false);
-            return null;
-        }
+//        try {
+//            setUpdateRepositories(operation);
+//        } catch (URISyntaxException e) {
+//            MessagingUtils.errorDialog("Invalid update site URI",
+//                    operation,
+//                    "The update site URI has an invalid syntax",
+//                    TaxonomicEditorPlugin.PLUGIN_ID,
+//                    e,
+//                    false);
+//            return null;
+//        }
 
         final IStatus status = operation.resolveModal(monitor);
 
index 27db567c568da78dd99be42f5d55750bbfa48fe1..bca8c9923b8b59811899f2d03ae56b73559a7953 100644 (file)
  *******************************************************************************/
 package eu.etaxonomy.taxeditor.update;
 
-import java.net.URISyntaxException;
-
 import org.eclipse.equinox.internal.p2.ui.dialogs.UpdateSingleIUWizard;
 import org.eclipse.equinox.p2.operations.RepositoryTracker;
 import org.eclipse.equinox.p2.operations.UpdateOperation;
 import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
 import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.taxeditor.TaxonomicEditorPlugin;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-
 /**
  * UpdateHandler invokes the check for updates UI
  *
@@ -32,21 +27,11 @@ public class UpdateHandler extends PreloadingRepositoryHandler {
 
        @Override
     protected void doExecute(LoadMetadataRepositoryJob job) {
-//             if (hasNoRepos) {
-//                     return;
-//             }
+               if (hasNoRepos) {
+                       return;
+               }
                UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
-        try {
-            P2Util.setUpdateRepositories(operation);
-        } catch (URISyntaxException e) {
-            MessagingUtils.errorDialog("Invalid update site URI",
-                    operation,
-                    "The update site URI has an invalid syntax",
-                    TaxonomicEditorPlugin.PLUGIN_ID,
-                    e,
-                    false);
-            return;
-        }
+
 
                // check for updates
                operation.resolveModal(null);
index c9e4f2148fa6a47993c2ec2b79b196c52ffd877a..21e0de374261e6dca5b2368943d8c95d95e2cccd 100644 (file)
@@ -7,12 +7,12 @@
       ws="cocoa,gtk,win32"
       arch="x86,x86_64">
 
-   <license url="http://www.eclipse.org/legal/epl-v10.html">
+   <!--license url="http://www.eclipse.org/legal/epl-v10.html">
       The contents of this file are subject to the Eclipse Public License Version 1.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 http://www.eclipse.org/legal/epl-v10.html
 
 Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
-   </license>
+   </license-->
 
    <url>
       <update label="EDIT Taxonomic Editor" url="http://wp5.e-taxonomy.eu/taxeditor/update"/>
index 431e360ed2ac74d871c60fe4ce62bcf42872dcc5..e16cb13673bd132098479969c5a3aaa917593e30 100644 (file)
       [Enter Copyright Description here.]
    </copyright>
 
-   <license url="http://www.mozilla.org/MPL/">
+   <!--license url="http://www.mozilla.org/MPL/">
       The contents of this file are subject to the Mozilla Public License Version 1.1 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
 Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
-   </license>
+   </license-->
 
    <url>
       <update label="EDIT Taxonomic Editor" url="http://cybertaxonomy.eu/download/taxeditor/update/"/>
index 49d3e7abf4cd3c3200beef2f4c36db10c0ebeb50..21362429332a36fa710448964c15c271b59f6b7d 100644 (file)
@@ -50,8 +50,6 @@ public interface IPreferenceKeys {
         */
        public static final String SHOW_DEBUG_INFORMATION = "eu.etaxonomy.taxeditor.showDebugInformation";
 
-       public static final String ALLOW_AUTO_UPDATE_AT_STARTUP = "eu.etaxonomy.taxeditor.allowAutoUpdateAtStartup";
-
        /**
         *
         */
index 034ab540ee8bbc8c6868a6d525aef3713086cdd3..08a1a367308c19c7c7334415fbdc312c69a4cb93 100644 (file)
@@ -57,10 +57,6 @@ public class TaxonomicEditorGeneralPreferences extends
                addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
                        "Open search results in separate windows",
                        getFieldEditorParent()));
-               addField(new BooleanFieldEditor(IPreferenceKeys.ALLOW_AUTO_UPDATE_AT_STARTUP,
-                       "Check for updates when the Editor starts up",
-                       getFieldEditorParent()));
-
        }
 
        /*
index fde6b85b6f52bae645fdefc8db12c01ed5798644..cf45cfff69b70d223a2e9bc504587751ce523394 100644 (file)
@@ -36,7 +36,7 @@
    <vm>
    </vm>
 
-   <license>
+   <!--license>
         <url>http://www.mozilla.org/MPL/</url>
         <text>
    The contents of this file are subject to the Mozilla Public License Version 1.1 (the &amp;quot;License&amp;quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
@@ -44,7 +44,7 @@ http://www.mozilla.org/MPL/
 
 Software distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
          </text>
-   </license>
+   </license -->
 
    <plugins>
    </plugins>