Project

General

Profile

« Previous | Next » 

Revision e28d0ce1

Added by Cherian Mathew over 9 years ago

eu.etaxonomy.taxeditor.product, eu.etaxonomy.taxeditor.feature/feature.xml, eu.etaxonomy.taxeditor.feature.platform/feature.xml : commented out license text to prevent extra popup on update
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

View differences:

eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties
1 1
productName=EDIT Taxonomic Editor
2
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
3

  
2
productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\
3
Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\
4
http://cybertaxonomy.eu/ \n\n\
5
The contents of this product are subject to the Mozilla Public License Version 1.1,  \n\
6
you may not use this product except in compliance with the License. \n\
7
You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\
8
Software distributed under the License is distributed on an 'AS IS' basis, \n\
9
WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\
10
See the License for the specific language governing rights and limitations under \n\
11
the License.
4 12
extension.name = Taxonomic Editor
5 13
perspective.name = Taxonomic
6 14
perspective.name.0 = Polytomous Key
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties
1 1
productName=EDIT Taxonomischer Editor
2
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
3

  
2
productBlurb=EDIT Taxonomischer Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\
3
Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\
4
http://cybertaxonomy.eu/ \n\n\
5
The contents of this product are subject to the Mozilla Public License Version 1.1  \n\
6
you may not use this product except in compliance with the License. \n\
7
You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\
8
Software distributed under the License is distributed on an 'AS IS' basis, \n\
9
WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\
10
See the License for the specific language governing rights and limitations under \n\
11
the License.
4 12
extension.name = Taxonomischer Editor
5 13
perspective.name = Taxonomisch
6 14
perspective.name.0 = Polytomer Key
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties
1 1
productName=EDIT Taxonomic Editor
2
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
3

  
2
productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\
3
Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\
4
http://cybertaxonomy.eu/ \n\n\
5
The contents of this product are subject to the Mozilla Public License Version 1.1  \n\
6
you may not use this product except in compliance with the License. \n\
7
You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\
8
Software distributed under the License is distributed on an 'AS IS' basis, \n\
9
WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\
10
See the License for the specific language governing rights and limitations under \n\
11
the License.
4 12
extension.name = Taxonomic Editor
5 13
perspective.name = Taxonomic
6 14
perspective.name.0 = Polytomous Key
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationUtil.java
54 54
     * @return
55 55
     */
56 56
    public static boolean isStable() {
57
        return !getVersion().startsWith(BETA_PREFIX);
57
        return !getVersion().startsWith("[");
58 58
    }
59 59
	/**
60 60
	 * <p>getPluginId</p>
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
7 7
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
8 8
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
9 9

  
10
import eu.etaxonomy.taxeditor.model.MessagingUtils;
11
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
12 10
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
13 11
import eu.etaxonomy.taxeditor.store.CdmStore;
14 12
import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
......
63 61
            CdmStore.connect();
64 62
        }
65 63

  
64
		P2Util.setDefaultUpdateRepositories();
66 65

  
67
		try {
68
		    if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_AUTO_UPDATE_AT_STARTUP)) {
69
		        P2Util.checkForUpdates();
70
		    }
71
		} catch (Exception e) {
72
		    MessagingUtils.error(this.getClass(), e);
73
		}
74 66
	}
75 67

  
76 68
	private int authenticate(){
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/P2Util.java
10 10
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
11 11
import org.eclipse.core.runtime.jobs.Job;
12 12
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
13
import org.eclipse.equinox.internal.p2.ui.model.ElementUtils;
14
import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
13 15
import org.eclipse.equinox.p2.core.IProvisioningAgent;
14 16
import org.eclipse.equinox.p2.operations.ProvisioningJob;
15 17
import org.eclipse.equinox.p2.operations.ProvisioningSession;
16 18
import org.eclipse.equinox.p2.operations.Update;
17 19
import org.eclipse.equinox.p2.operations.UpdateOperation;
20
import org.eclipse.equinox.p2.ui.ProvisioningUI;
18 21
import org.eclipse.swt.widgets.Display;
19 22
import org.eclipse.ui.PlatformUI;
20 23
import org.osgi.framework.BundleContext;
......
46 49

  
47 50
    //private static String LOCAL_UPDATE_SITE = "file:///path/.../to/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor/target/repository/";
48 51
    private static String EDIT_NIGHTLY_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/nightly/";
52
    private static String EDIT_NIGHTLY_UPDATE_SITE_NAME = "Taxonomic Editor Nightly";
53

  
49 54
    private static String EDIT_SNAPSHOT_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/snapshot/";
55
    private static String EDIT_SNAPSHOT_UPDATE_SITE_NAME = "Taxonomic Editor Snapshot";
56

  
50 57
    private static String EDIT_STABLE_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/stable/";
58
    private static String EDIT_STABLE_UPDATE_SITE_NAME = "Taxonomic Editor Stable";
51 59

  
52
    public static void setUpdateRepositories(UpdateOperation operation) throws URISyntaxException {
60
    @SuppressWarnings("restriction")
61
    public static void setDefaultUpdateRepositories() {
53 62
        String updateSite = EDIT_NIGHTLY_UPDATE_SITE;
63
        String updateSiteName = EDIT_NIGHTLY_UPDATE_SITE_NAME;
64

  
54 65
        if(ApplicationUtil.isStable()) {
55 66
            updateSite = EDIT_STABLE_UPDATE_SITE;
67
            updateSiteName = EDIT_STABLE_UPDATE_SITE_NAME;
56 68
        }
57
        operation.getProvisioningContext().setMetadataRepositories(new URI[]{new URI(updateSite)});
58
        operation.getProvisioningContext().setArtifactRepositories(new URI[]{new URI(updateSite)});
59
    }
69
        try {
70
          final MetadataRepositoryElement element = new MetadataRepositoryElement(null, new URI(updateSite), true);
71
          element.setNickname(updateSiteName);
72
          ElementUtils.updateRepositoryUsingElements(ProvisioningUI.getDefaultUI(),new MetadataRepositoryElement[] {element}, null);
73
        } catch (URISyntaxException e) {
74
            MessagingUtils.errorDialog("Invalid update site URI",
75
                    P2Util.class,
76
                    "The update site URI has an invalid syntax",
77
                    TaxonomicEditorPlugin.PLUGIN_ID,
78
                    e,
79
                    false);
80
        }
81
      }
82

  
60 83
    /**
61 84
     *
62 85
     *
......
110 133
        // which installable units are being updated, use the more detailed
111 134
        // constructors.
112 135
        final UpdateOperation operation = new UpdateOperation(session);
113
        try {
114
            setUpdateRepositories(operation);
115
        } catch (URISyntaxException e) {
116
            MessagingUtils.errorDialog("Invalid update site URI",
117
                    operation,
118
                    "The update site URI has an invalid syntax",
119
                    TaxonomicEditorPlugin.PLUGIN_ID,
120
                    e,
121
                    false);
122
            return null;
123
        }
136
//        try {
137
//            setUpdateRepositories(operation);
138
//        } catch (URISyntaxException e) {
139
//            MessagingUtils.errorDialog("Invalid update site URI",
140
//                    operation,
141
//                    "The update site URI has an invalid syntax",
142
//                    TaxonomicEditorPlugin.PLUGIN_ID,
143
//                    e,
144
//                    false);
145
//            return null;
146
//        }
124 147

  
125 148
        final IStatus status = operation.resolveModal(monitor);
126 149

  
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/UpdateHandler.java
10 10
 *******************************************************************************/
11 11
package eu.etaxonomy.taxeditor.update;
12 12

  
13
import java.net.URISyntaxException;
14

  
15 13
import org.eclipse.equinox.internal.p2.ui.dialogs.UpdateSingleIUWizard;
16 14
import org.eclipse.equinox.p2.operations.RepositoryTracker;
17 15
import org.eclipse.equinox.p2.operations.UpdateOperation;
18 16
import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
19 17
import org.eclipse.jface.wizard.WizardDialog;
20 18

  
21
import eu.etaxonomy.taxeditor.TaxonomicEditorPlugin;
22
import eu.etaxonomy.taxeditor.model.MessagingUtils;
23

  
24 19
/**
25 20
 * UpdateHandler invokes the check for updates UI
26 21
 *
......
32 27

  
33 28
	@Override
34 29
    protected void doExecute(LoadMetadataRepositoryJob job) {
35
//		if (hasNoRepos) {
36
//			return;
37
//		}
30
		if (hasNoRepos) {
31
			return;
32
		}
38 33
		UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
39
        try {
40
            P2Util.setUpdateRepositories(operation);
41
        } catch (URISyntaxException e) {
42
            MessagingUtils.errorDialog("Invalid update site URI",
43
                    operation,
44
                    "The update site URI has an invalid syntax",
45
                    TaxonomicEditorPlugin.PLUGIN_ID,
46
                    e,
47
                    false);
48
            return;
49
        }
34

  
50 35

  
51 36
		// check for updates
52 37
		operation.resolveModal(null);
eu.etaxonomy.taxeditor.feature.platform/feature.xml
7 7
      ws="cocoa,gtk,win32"
8 8
      arch="x86,x86_64">
9 9

  
10
   <license url="http://www.eclipse.org/legal/epl-v10.html">
10
   <!--license url="http://www.eclipse.org/legal/epl-v10.html">
11 11
      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
12 12
http://www.eclipse.org/legal/epl-v10.html
13 13

  
14 14
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.
15
   </license>
15
   </license-->
16 16

  
17 17
   <url>
18 18
      <update label="EDIT Taxonomic Editor" url="http://wp5.e-taxonomy.eu/taxeditor/update"/>
eu.etaxonomy.taxeditor.feature/feature.xml
17 17
      [Enter Copyright Description here.]
18 18
   </copyright>
19 19

  
20
   <license url="http://www.mozilla.org/MPL/">
20
   <!--license url="http://www.mozilla.org/MPL/">
21 21
      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
22 22
http://www.mozilla.org/MPL/
23 23

  
24 24
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.
25
   </license>
25
   </license-->
26 26

  
27 27
   <url>
28 28
      <update label="EDIT Taxonomic Editor" url="http://cybertaxonomy.eu/download/taxeditor/update/"/>
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
50 50
	 */
51 51
	public static final String SHOW_DEBUG_INFORMATION = "eu.etaxonomy.taxeditor.showDebugInformation";
52 52

  
53
	public static final String ALLOW_AUTO_UPDATE_AT_STARTUP = "eu.etaxonomy.taxeditor.allowAutoUpdateAtStartup";
54

  
55 53
	/**
56 54
	 *
57 55
	 */
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java
57 57
		addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
58 58
		        "Open search results in separate windows",
59 59
		        getFieldEditorParent()));
60
		addField(new BooleanFieldEditor(IPreferenceKeys.ALLOW_AUTO_UPDATE_AT_STARTUP,
61
		        "Check for updates when the Editor starts up",
62
		        getFieldEditorParent()));
63

  
64 60
	}
65 61

  
66 62
	/*
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product
36 36
   <vm>
37 37
   </vm>
38 38

  
39
   <license>
39
   <!--license>
40 40
        <url>http://www.mozilla.org/MPL/</url>
41 41
        <text>
42 42
   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 44

  
45 45
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.
46 46
         </text>
47
   </license>
47
   </license -->
48 48

  
49 49
   <plugins>
50 50
   </plugins>

Also available in: Unified diff