eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties -text
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties -text
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties -text
+eu.etaxonomy.taxeditor.application/about.mappings -text
eu.etaxonomy.taxeditor.application/build.properties -text
eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif -text
eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif -text
eu.etaxonomy.taxeditor.application/icons/256color_48x48.ico -text
eu.etaxonomy.taxeditor.application/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.application/icons/specimen_derivate-16x16-32.png -text
-eu.etaxonomy.taxeditor.application/p2.inf -text
eu.etaxonomy.taxeditor.application/plugin.xml -text
eu.etaxonomy.taxeditor.application/plugin_customization.ini -text
eu.etaxonomy.taxeditor.application/pom.xml -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalAboutPlatformHandler.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalHelpHandler.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalParserHelpHandler.java -text
-eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/P2Util.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveAllHandler.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveHandler.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/TaxonomicEditorPlugin.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/PolytomousKey.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Taxonomic.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Uses.java -text
+eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/InstallNewSoftwareHandler.java -text
+eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/P2Util.java -text
+eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/PreloadingRepositoryHandler.java -text
+eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/UpdateHandler.java -text
eu.etaxonomy.taxeditor.application/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.bulkeditor/.classpath -text
eu.etaxonomy.taxeditor.bulkeditor/.project -text
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties -text
+eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties -text
+eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_en.properties -text
eu.etaxonomy.taxeditor.bulkeditor/build.properties -text
eu.etaxonomy.taxeditor.bulkeditor/icons/merge_candidate.gif -text
eu.etaxonomy.taxeditor.bulkeditor/icons/merge_target.gif -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/AddDerivedUnitFacadeMediaOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateDescriptionElementOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateSpecimenDescriptionOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateTaxonDescriptionOperation.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartChangeListener.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasDetails.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasFactualData.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasSupplementalData.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/LineSelection.java -text
org.eclipse.equinox.p2.ui.sdk,
org.eclipse.equinox.p2.updatechecker,
org.eclipse.equinox.p2.operations,
- org.eclipse.help.ui
+ org.eclipse.help.ui,
+ org.eclipse.equinox.p2.metadata;bundle-version="2.1.0",
+ org.eclipse.equinox.p2.engine;bundle-version="2.1.1"
productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\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
productName=EDIT Taxonomischer Editor
-productBlurb=EDIT Taxonomischer Editor\n\Version: 3.3\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
productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\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
--- /dev/null
+0=${version}
+1=${timestamp}
\ No newline at end of file
plugin_customization.ini,\
icons/,\
OSGI-INF/l10n/plugin.properties,\
- splash.bmp,\
- p2.inf,\
+ splash.bmp,\
OSGI-INF/l10n/plugin_de.properties,\
OSGI-INF/l10n/plugin_en.properties
+++ /dev/null
-instructions.configure=\
- addRepository(type:0,location:http${#58}//wp5.e-taxonomy.eu/taxeditor/update);\
- addRepository(type:1,location:http${#58}//wp5.e-taxonomy.eu/taxeditor/update);
\ No newline at end of file
name="eu.etaxonomy.taxeditor.ui.help.separator1"\r
visible="true">\r
</separator>\r
+ <!--command\r
+ commandId="eu.etaxonomy.taxeditor.install"\r
+ label="%command.label.18"\r
+ style="push"/-->\r
<command\r
- commandId="org.eclipse.equinox.p2.ui.sdk.update"\r
+ commandId="eu.etaxonomy.taxeditor.update"\r
label="%command.label.17"\r
- style="push">\r
- </command>\r
- <command\r
- commandId="org.eclipse.equinox.p2.ui.sdk.install"\r
- label="%command.label.18"\r
- style="push">\r
- </command>\r
+ style="push"/> \r
<separator\r
name="eu.etaxonomy.taxeditor.ui.help.separator2"\r
visible="true">\r
id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
name="%command.name.0">\r
</command>\r
+ <command\r
+ defaultHandler="eu.etaxonomy.taxeditor.update.UpdateHandler"\r
+ id="eu.etaxonomy.taxeditor.update"\r
+ name="%command.label.17">\r
+ </command>\r
+ <command\r
+ defaultHandler="eu.etaxonomy.taxeditor.update.InstallNewSoftwareHandler"\r
+ id="eu.etaxonomy.taxeditor.install"\r
+ name="%command.label.18">\r
+ </command>\r
</extension>\r
-\r
+ \r
+ \r
<extension\r
point="org.eclipse.ui.activities">\r
<activity\r
point="org.eclipse.core.runtime.products">\r
<product\r
application="eu.etaxonomy.taxeditor.application.application"\r
- name="%product.name.0">\r
+ name="EDIT Taxonomic Editor">\r
<property\r
name="appName"\r
value="EDIT Taxonomic Editor">\r
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-parent</artifactId>
+ <version>3.3.8-SNAPSHOT</version>
+ </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>eu.etaxonomy.taxeditor.application</artifactId>
- <packaging>eclipse-plugin</packaging>
-
- <name>Application</name>
- <description>All plugins are combined into this application.</description>
- <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditor</url>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eu.etaxonomy.taxeditor.application</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Application</name>
+ <description>All plugins are combined into this application.</description>
+ <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditor</url>
+
+ <properties>
+ <timestamp>${maven.build.timestamp}</timestamp>
+ <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
+</properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>about.mappings</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
</project>
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.taxeditor;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
import eu.etaxonomy.taxeditor.model.AbstractUtility;
/**
*/
public class ApplicationUtil extends AbstractUtility {
+
+ /**
+ * Prefix to declare the version as beta
+ */
+ private static final String BETA_PREFIX = "[BETA]";
+
+ /**
+ * @return
+ */
+ public static String getVersion() {
+ Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.application");
+ String version = bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
+ // Checking if this is a beta (snapshot) version
+ if(version ==null || version.isEmpty()) {
+ return "";
+ }
+ String[] parts = version.split("\\.");
+ if(parts.length <= 3) {
+ // this is a stable version
+ return version;
+ } else {
+ return BETA_PREFIX + version;
+ }
+
+ }
+
+ /**
+ * @return
+ */
+ public static boolean isStable() {
+ return !getVersion().startsWith("[");
+ }
/**
* <p>getPluginId</p>
*
public static String getPluginId(){
return TaxonomicEditorPlugin.PLUGIN_ID;
}
-
+
+
+
}
package eu.etaxonomy.taxeditor;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.rmi.activation.Activator;
-
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.eclipse.ui.statushandlers.AbstractStatusHandler;
import org.eclipse.ui.statushandlers.StatusAdapter;
-import org.eclipse.ui.statushandlers.StatusManager;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
* @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
*/
/** {@inheritDoc} */
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+ @Override
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
*
* @return a {@link java.lang.String} object.
*/
- public String getInitialWindowPerspectiveId() {
+ @Override
+ public String getInitialWindowPerspectiveId() {
return "eu.etaxonomy.taxeditor.application.perspective.taxonomic";
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
*/
/** {@inheritDoc} */
- public void initialize(IWorkbenchConfigurer configurer) {
+ @Override
+ public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
-
+
// Remembers the user's view layout, window size, window location etc.
// for the next time application is started
configurer.setSaveAndRestore(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
- */
- /** {@inheritDoc} */
- @Override
- public void preStartup() {
- // TODO Auto-generated method stub
- super.preStartup();
- // XXX check for updates before starting up.
- // If an update is performed, restart.
-// if (P2Util.checkForUpdates())
-// PlatformUI.getWorkbench().restart();
}
-
-/**
- * see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
- */
-// public void initialize(IWorkbenchConfigurer configurer) {
-//
-// WorkbenchAdapterBuilder.registerAdapters();
-//
-// final String ICONS_PATH = "icons/full/";
-// final String PATH_OBJECT = ICONS_PATH + "obj16/";
-// Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
-// declareWorkbenchImage(configurer, ideBundle,
-// IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
-// true);
-// declareWorkbenchImage(configurer, ideBundle,
-// IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
-// + "cprj_obj.gif", true);
-//
-// }
-//
-// private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
-// Bundle ideBundle, String symbolicName, String path, boolean shared) {
-// URL url = ideBundle.getEntry(path);
-// ImageDescriptor desc = ImageDescriptor.createFromURL(url);
-// configurer_p.declareImage(symbolicName, desc, shared);
-// }
-//
-// public IAdaptable getDefaultPageInput() {
-// IWorkspace workspace = ResourcesPlugin.getWorkspace();
-// return workspace.getRoot();
-// }
-
-// @Override
-// public void eventLoopException(Throwable exception) {
-// super.eventLoopException(exception);
-// StoreUtil.messageDialog("Unexpected error", null, exception.getMessage(), exception);
-// }
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#getWorkbenchErrorHandler()
*/
}
return cdmStatusHandler;
}
-
+
/**
- * Custom status handler for handling scenarios which are
+ * Custom status handler for handling scenarios which are
* not handled by the editor (e.g. runtime exceptions).
- *
+ *
* The default {@link org.eclipse.ui.statushandlers.WorkbenchErrorHandler}
* is not used or extended because we need a handler for specific scenarios
* which displays a custom built error dialog.
- *
+ *
* @author cmathew
*
*/
class CdmStatusHandler extends AbstractStatusHandler {
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handle(org.eclipse.ui.statushandlers.StatusAdapter, int)
*/
public void handle(StatusAdapter statusAdapter, int style)
{
if(statusAdapter.getStatus().matches(IStatus.ERROR)) {
-
- IStatus status = statusAdapter.getStatus();
- Throwable t = statusAdapter.getStatus().getException();
+
+ IStatus status = statusAdapter.getStatus();
+ Throwable t = statusAdapter.getStatus().getException();
// NOTE : Currently we only allow RuntimeExceptions since
- // allowing all kinds of exceptions would also include
- // those in generated status objects coming from from logging triggers
+ // allowing all kinds of exceptions would also include
+ // those in generated status objects coming from from logging triggers
// leading to a recursive infinite loop of :
- // initial exception thrown -> status handling -> dialog opening + logging of status ->
+ // initial exception thrown -> status handling -> dialog opening + logging of status ->
// status handling -> dialog opening + logging of status ... and so on
- if(t != null && t instanceof RuntimeException) {
- MessagingUtils.errorDialog("Unexpected error",
- null,
- MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
- statusAdapter.getStatus().getPlugin(),
+ if(t != null && t instanceof RuntimeException) {
+ MessagingUtils.errorDialog("Unexpected error",
+ null,
+ MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
+ statusAdapter.getStatus().getPlugin(),
t,
- true);
- }
+ true);
+ }
}
}
}
-
-
+
+
}
package eu.etaxonomy.taxeditor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.equinox.internal.p2.core.Activator;
-import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
-import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-import org.osgi.framework.ServiceReference;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
+import eu.etaxonomy.taxeditor.update.P2Util;
/**
* <p>ApplicationWorkbenchWindowAdvisor class.</p>
configurer.setShowCoolBar(true);
configurer.setShowStatusLine(true);
configurer.setShowPerspectiveBar(true);
- configurer.setTitle("EDIT Taxonomic Editor");
+ configurer.setTitle("EDIT Taxonomic Editor " + ApplicationUtil.getVersion());
configurer.setShowProgressIndicator(true);
}
CdmStore.connect();
}
- PreferencesUtil.checkDefaultLanguage();
+ P2Util.setDefaultUpdateRepositories();
}
LoginDialog loginDialog = new LoginDialog(shell);
return loginDialog.open();
}
-
- private void automaticUpdate(){
-
- ServiceReference sr = Activator.context.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME);
- IProvisioningAgentProvider agentProvider = null;
- if (sr == null) {
- return;
- }
- agentProvider = (IProvisioningAgentProvider) Activator.context.getService(sr);
- IProvisioningAgent agent = null;
- try {
- agent = agentProvider.createAgent(null);//new URI("file:/Applications/eclipse36/p2"));
- if (agent == null) {
- MessagingUtils.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
- return;
- }
-
- IStatus status = P2Util.checkForUpdates(agent, null);
-
- MessagingUtils.info(status);
- } catch (ProvisionException e) {
- MessagingUtils.error(getClass(), e);
- } finally {
- if(agent != null) {
- agent.stop();
- }
- }
- }
}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package eu.etaxonomy.taxeditor;
-
-import org.apache.log4j.Logger;
-import org.eclipse.core.internal.runtime.Log;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-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.UpdateOperation;
-
-import eu.etaxonomy.taxeditor.store.StoreUtil;
-
-/**
- * This class shows an example for checking for updates and performing the
- * update synchronously. It is up to the caller to run this in a job if
- * a background update check is desired. This is a reasonable way to run an
- * operation when user intervention is not required. Another approach is
- * to separately perform the resolution and provisioning steps, deciding
- * whether to perform these synchronously or in a job.
- *
- * Any p2 operation can be run modally (synchronously), or the job
- * can be requested and scheduled by the caller.
- *
- * @see UpdateOperation#resolveModal(IProgressMonitor)
- * @see UpdateOperation#getResolveJob(IProgressMonitor)
- * @see UpdateOperation#getProvisioningJob(IProgressMonitor)
- * @see UpdateOperation#resolveModal(IProgressMonitor)
- * @see UpdateOperation#getResolveJob(IProgressMonitor)
- * @see UpdateOperation#getProvisioningJob(IProgressMonitor)
- * @see UpdateOperation#resolveModal(IProgressMonitor)
- * @see UpdateOperation#getResolveJob(IProgressMonitor)
- * @see UpdateOperation#getProvisioningJob(IProgressMonitor)
- * @author n.hoffmann
- * @version $Id: $
- */
-public class P2Util {
-
- private static final Logger logger = Logger.getLogger(P2Util.class);
-
- // XXX Check for updates to this application and return a status.
- static IStatus checkForUpdates(IProvisioningAgent agent, IProgressMonitor monitor) throws OperationCanceledException {
- ProvisioningSession session = new ProvisioningSession(agent);
-
- // the default update operation looks for updates to the currently
- // running profile, using the default profile root marker. To change
- // which installable units are being updated, use the more detailed
- // constructors.
- UpdateOperation operation = new UpdateOperation(session);
- SubMonitor sub = SubMonitor.convert(monitor,
- "Checking for application updates...", 200);
- IStatus status = operation.resolveModal(sub.newChild(100));
-
- if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
- return status;
- }
- if (status.getSeverity() == IStatus.CANCEL)
- throw new OperationCanceledException();
-
- if (status.getSeverity() != IStatus.ERROR) {
- // More complex status handling might include showing the user what updates
- // are available if there are multiples, differentiating patches vs. updates, etc.
- // In this example, we simply update as suggested by the operation.
- ProvisioningJob job = operation.getProvisioningJob(null);
- if(job == null){
- return status;
- }
-
- status = job.runModal(sub.newChild(100));
- if (status.getSeverity() == IStatus.CANCEL)
- throw new OperationCanceledException();
- }
- return status;
- }
-}
package eu.etaxonomy.taxeditor;
import org.apache.log4j.Logger;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.operations.ProvisioningSession;
+import org.eclipse.equinox.p2.ui.Policy;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
private ServiceRegistration policyRegistration;
+ private ProvisioningSession session;
+ private ProvisioningUI ui;
+
// private CloudPolicy policy;
-
+
/**
* The constructor
*/
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
/** {@inheritDoc} */
- public void start(BundleContext context) throws Exception {
+ @Override
+ public void start(BundleContext context) throws Exception {
super.start(context);
-
+
plugin = this;
bundleContext = context;
-
+
packageAdminRef = bundleContext.getServiceReference(PackageAdmin.class.getName());
packageAdmin = (PackageAdmin) bundleContext.getService(packageAdminRef);
-
+
logger.debug("Taxonomic Editor started.");
}
private Bundle getBundle(String symbolicName) {
- if (packageAdmin == null)
- return null;
+ if (packageAdmin == null) {
+ return null;
+ }
Bundle[] bundles = packageAdmin.getBundles(symbolicName, null);
- if (bundles == null)
- return null;
+ if (bundles == null) {
+ return null;
+ }
// Return the first bundle that is not installed or uninstalled
for (int i = 0; i < bundles.length; i++) {
if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
}
return null;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
/** {@inheritDoc} */
+ @Override
public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- MessagingUtils.info("Taxonomic Editor stopped.");
+ plugin = null;
+ super.stop(context);
+ MessagingUtils.info("Taxonomic Editor stopped.");
}
/**
* @return the shared instance
*/
public static TaxonomicEditorPlugin getDefault() {
- return plugin;
+ return plugin;
}
-
-
-
+
+ public static BundleContext getContext() {
+ return bundleContext;
+ }
+
+ public ProvisioningUI getProvisioningUI() {
+
+ if (ui == null) {
+ ServiceReference reference = bundleContext.getServiceReference(IProvisioningAgent.SERVICE_NAME);
+ IProvisioningAgent agent = (IProvisioningAgent) bundleContext.getService(reference);
+ session = new ProvisioningSession(agent);
+ Policy policy = null;// = (Policy) ServiceHelper.getService(ProvUIActivator.getContext(), Policy.class.getName());
+ if (policy == null) {
+ policy = new Policy();
+ }
+ ui = new ProvisioningUI(session, IProfileRegistry.SELF, policy);
+ }
+ return ui;
+ }
+
+
}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package eu.etaxonomy.taxeditor.update;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
+
+/**
+ * InstallNewSoftwareHandler invokes the install wizard
+ *
+ * @since 3.5
+ */
+public class InstallNewSoftwareHandler extends PreloadingRepositoryHandler {
+
+ /**
+ * The constructor.
+ */
+ public InstallNewSoftwareHandler() {
+ super();
+ }
+
+ protected void doExecute(LoadMetadataRepositoryJob job) {
+ getProvisioningUI().openInstallWizard(null, null, job);
+ }
+
+ protected boolean waitForPreload() {
+ // If the user cannot see repositories, then we may as well wait
+ // for existing repos to load so that content is available.
+ // If the user can manipulate the repositories, then we don't wait,
+ // because we don't know which ones they want to work with.
+ return !getProvisioningUI().getPolicy().getRepositoriesVisible();
+ }
+
+ protected void setLoadJobProperties(Job loadJob) {
+ super.setLoadJobProperties(loadJob);
+ // If we are doing a background load, we do not wish to authenticate, as the
+ // user is unaware that loading was needed
+ if (!waitForPreload()) {
+ loadJob.setProperty(LoadMetadataRepositoryJob.SUPPRESS_AUTHENTICATION_JOB_MARKER, Boolean.toString(true));
+ loadJob.setProperty(LoadMetadataRepositoryJob.SUPPRESS_REPOSITORY_EVENTS, Boolean.toString(true));
+ }
+ }
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.update;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+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;
+import org.osgi.framework.ServiceReference;
+
+import eu.etaxonomy.taxeditor.ApplicationUtil;
+import eu.etaxonomy.taxeditor.TaxonomicEditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+/**
+ * This class is a utility class for updating the editor from a p2 update site,
+ * greatly inspired by the links given below.
+ *
+ *
+ * To Do :
+ * - Allow configurable update sites
+ *
+ * Notes :
+ * - tried to get rid of the popup dialog which warns about unsigned jars using
+ * -Declipse.p2.unsignedPolicy=allow but this does not work due to
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=391399, so the only solution
+ * is to sign the jars with an official certificate.
+ *
+ * @see http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_Application
+ * @see http://bugs.eclipse.org/281226
+ * @see http://www.vogella.com/tutorials/EclipseP2Update/article.html
+ */
+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";
+
+ @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;
+ }
+ 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);
+ }
+ }
+
+ /**
+ *
+ *
+ */
+ public static void checkForUpdates() {
+ // the main job which performs the update
+ Job updateJob = new Job("Update Job") {
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ return doCheckForUpdates(monitor);
+ }
+ };
+ updateJob.schedule();
+ }
+
+ /**
+ * @param monitor
+ * @return
+ */
+ private static IStatus doCheckForUpdates(IProgressMonitor monitor) {
+
+ BundleContext bundleContext = TaxonomicEditorPlugin.getContext();
+ ServiceReference reference = bundleContext.getServiceReference(IProvisioningAgent.SERVICE_NAME);
+ if (reference == null) {
+ IStatus errorStatus = new Status(IStatus.ERROR, TaxonomicEditorPlugin.PLUGIN_ID,
+ "No provisioning agent found. This application is not set up for updates.");
+ return errorStatus;
+ }
+
+ final IProvisioningAgent agent = (IProvisioningAgent) bundleContext.getService(reference);
+ IStatus updateStatus;
+ try {
+ updateStatus = P2Util.checkForUpdates(agent, monitor);
+ MessagingUtils.info(updateStatus);
+ } finally {
+ bundleContext.ungetService(reference);
+ }
+ return updateStatus;
+ }
+
+ /**
+ * @param agent
+ * @param monitor
+ * @return
+ * @throws OperationCanceledException
+ */
+ static IStatus checkForUpdates(IProvisioningAgent agent, final IProgressMonitor monitor) {
+ ProvisioningSession session = new ProvisioningSession(agent);
+ // the default update operation looks for updates to the currently
+ // running profile, using the default profile root marker. To change
+ // 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;
+// }
+
+ final IStatus status = operation.resolveModal(monitor);
+
+ if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
+ return status;
+ }
+
+ if (status.isOK() && status.getSeverity() != IStatus.ERROR) {
+ // We need this block of code to be in async execution
+ // since the confirm dialogs work only on the UI thread
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ String updates = "";
+ Update[] possibleUpdates = operation
+ .getPossibleUpdates();
+ for (Update update : possibleUpdates) {
+ updates += update + "\n";
+ }
+
+ boolean doInstall = MessagingUtils.confirmDialog("Updates available", "Do you want to install the available updates ?");
+ // We may need to think whether we still run in async mode once
+ // the user agrees to update. Maybe be reasonable to change to blocking
+ // from this point until the update is complete.
+
+ // More complex status handling might include showing the user what
+ // updates are available if there are multiples, differentiating
+ // patches vs. updates, etc. In this example, we simply update as
+ // suggested by the operation.
+ if(doInstall) {
+ ProvisioningJob provisioningJob = operation.getProvisioningJob(monitor);
+ if (provisioningJob == null) {
+ MessagingUtils.messageDialog("Error in performing update",
+ operation,
+ "ProvisioningJob could not be created." + System.getProperty("line.separator") +
+ "Either this application does not support p2 software installation or this application has been launched from within the Eclipse IDE",
+ null,
+ false);
+
+ } else {
+ // register a job change listener to track
+ // installation progress and notify user upon success
+ provisioningJob
+ .addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ if (event.getResult().isOK()) {
+ // We need this block of code to be in async execution
+ // since the confirm dialogs work only on the UI thread
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ boolean restart = MessagingUtils.confirmDialog(
+ "Updates installed, restart?",
+ "Updates have been installed successfully, do you want to restart?");
+ if (restart) {
+ PlatformUI.getWorkbench().restart();
+ }
+ }
+ });
+ }
+ super.done(event);
+ }
+ });
+ provisioningJob.schedule();
+ }
+ }
+ }
+ });
+ }
+ return status;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package eu.etaxonomy.taxeditor.update;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+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.p2.ui.LoadMetadataRepositoryJob;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * PreloadingRepositoryHandler provides background loading of
+ * repositories before executing the provisioning handler.
+ *
+ * @since 3.5
+ */
+abstract class PreloadingRepositoryHandler extends AbstractHandler {
+
+ /**
+ * The constructor.
+ */
+ public PreloadingRepositoryHandler() {
+ // constructor
+ }
+
+ /**
+ * Execute the command.
+ */
+ public Object execute(ExecutionEvent event) {
+ doExecuteAndLoad();
+ return null;
+ }
+
+ void doExecuteAndLoad() {
+ if (preloadRepositories()) {
+ //cancel any load that is already running
+ Job.getJobManager().cancel(LoadMetadataRepositoryJob.LOAD_FAMILY);
+ final LoadMetadataRepositoryJob loadJob = new LoadMetadataRepositoryJob(getProvisioningUI());
+ setLoadJobProperties(loadJob);
+ if (waitForPreload()) {
+ loadJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ if (PlatformUI.isWorkbenchRunning())
+ if (event.getResult().isOK()) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ doExecute(loadJob);
+ }
+ });
+ }
+ }
+ });
+ loadJob.setUser(true);
+ loadJob.schedule();
+
+ } else {
+ loadJob.setSystem(true);
+ loadJob.setUser(false);
+ loadJob.schedule();
+ doExecute(null);
+ }
+ } else {
+ doExecute(null);
+ }
+ }
+
+ protected abstract void doExecute(LoadMetadataRepositoryJob job);
+
+ protected boolean preloadRepositories() {
+ return true;
+ }
+
+ protected boolean waitForPreload() {
+ return true;
+ }
+
+ protected void setLoadJobProperties(Job loadJob) {
+ loadJob.setProperty(LoadMetadataRepositoryJob.ACCUMULATE_LOAD_ERRORS, Boolean.toString(true));
+ }
+
+ protected ProvisioningUI getProvisioningUI() {
+ return ProvisioningUI.getDefaultUI();
+ }
+
+ /**
+ * Return a shell appropriate for parenting dialogs of this handler.
+ * @return a Shell
+ */
+ protected Shell getShell() {
+ return PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package eu.etaxonomy.taxeditor.update;
+
+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;
+
+/**
+ * UpdateHandler invokes the check for updates UI
+ *
+ * @since 3.4
+ */
+public class UpdateHandler extends PreloadingRepositoryHandler {
+
+ boolean hasNoRepos = false;
+
+ @Override
+ protected void doExecute(LoadMetadataRepositoryJob job) {
+ if (hasNoRepos) {
+ return;
+ }
+ UpdateOperation operation = getProvisioningUI().getUpdateOperation(null, null);
+
+
+ // check for updates
+ operation.resolveModal(null);
+ if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation, getShell())) {
+ if (UpdateSingleIUWizard.validFor(operation)) {
+ // Special case for only updating a single root
+ UpdateSingleIUWizard wizard = new UpdateSingleIUWizard(getProvisioningUI(), operation);
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.create();
+ dialog.open();
+ } else {
+ // Open the normal version of the update wizard
+ getProvisioningUI().openUpdateWizard(false, operation, job);
+ }
+ }
+ }
+
+ @Override
+ protected boolean preloadRepositories() {
+ hasNoRepos = false;
+ RepositoryTracker repoMan = getProvisioningUI().getRepositoryTracker();
+ if (repoMan.getKnownRepositories(getProvisioningUI().getSession()).length == 0) {
+ hasNoRepos = true;
+ return false;
+ }
+ return super.preloadRepositories();
+ }
+}
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.bulkeditor
+editor.name = Bulk Editor
+editor.name.0 = Name Editor
+editor.name.1 = Data Import Editor
+menu.label = Bulk Editor
+menu.label.0 = Search Specimen
+menu.label.1 = New
+menu.label.2 = Set Marker Type
+view.name = Referencing Objects
+page.name = Marker Types
+page.name.0 = Bulk Editor
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.bulkeditor
+editor.name = Bulk Editor
+editor.name.0 = Namen Editor
+editor.name.1 = Daten-Import Editor
+menu.label = Bulk Editor
+menu.label.0 = Suche Specimen
+menu.label.1 = Neu
+menu.label.2 = W\u00e4hle Markertyp
+view.name = Referenzierende Objekte
+page.name = Markertyp
+page.name.0 = Bulk Editor
\ No newline at end of file
--- /dev/null
+#Properties file for eu.etaxonomy.taxeditor.bulkeditor
+editor.name = Bulk Editor
+editor.name.0 = Name Editor
+editor.name.1 = Data Import Editor
+menu.label = Bulk Editor
+menu.label.0 = Search Specimen
+menu.label.1 = New
+menu.label.2 = Set Marker Type
+view.name = Referencing Objects
+page.name = Marker Types
+page.name.0 = Bulk Editor
\ No newline at end of file
.,\\r
icons/,\\r
plugin.xml,\\r
- p2.inf\r
+ p2.inf,\\r
+ OSGI-INF/l10n/bundle.properties\r
class="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor"\r
default="false"\r
id="bulkeditor.editor"\r
- name="Bulk Editor">\r
+ name="%editor.name">\r
</editor>\r
<editor\r
class="eu.etaxonomy.taxeditor.nameditor.TaxonNameEditor"\r
default="false"\r
id="nameeditor.editor"\r
- name="Name Editor">\r
+ name="%editor.name.0">\r
</editor>\r
<editor\r
class="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
default="false"\r
id="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
- name="Data Import Editor">\r
+ name="%editor.name.1">\r
</editor>\r
</extension>\r
<extension\r
locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">\r
<menu\r
id="bulkeditor.menus.openmenu"\r
- label="Bulk Editor">\r
+ label="%menu.label">\r
</menu>\r
<menu\r
- label="Search Specimen">\r
+ label="%menu.label.0">\r
</menu>\r
</menuContribution>\r
<menuContribution\r
<menuContribution\r
locationURI="popup:#BulkEditorContext">\r
<menu\r
- label="New">\r
+ label="%menu.label.1">\r
<dynamic\r
class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicNewObjectMenu"\r
id="eu.etaxonomy.taxeditor.bulkeditor.dynamicNewMenu">\r
visible="true">\r
</separator>\r
<menu\r
- label="Set Marker Type">\r
+ label="%menu.label.2">\r
<dynamic\r
class="eu.etaxonomy.taxeditor.bulkeditor.command.DynamicMarkerTypeEditingMenu"\r
id="eu.etaxonomy.taxeditor.bulkeditor.dynamicMarkerTypeEditingMenu">\r
style="push">\r
</command>\r
</menuContribution>\r
- <menuContribution\r
- allPopups="false"\r
- locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
- label="Add Derived Unit Media"\r
- style="push">\r
- <visibleWhen>\r
- <not>\r
- <reference\r
- definitionId="isTaxonEditor">\r
- </reference>\r
- </not>\r
- </visibleWhen>\r
- </command>\r
- <command\r
- commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
- label="Add Field Object Media"\r
- style="push">\r
- <visibleWhen>\r
- <not>\r
- <reference\r
- definitionId="isTaxonEditor">\r
- </reference>\r
- </not>\r
- </visibleWhen>\r
- </command>\r
- </menuContribution>\r
<menuContribution\r
allPopups="false"\r
locationURI="popup:#DataImportEditorContext">\r
<view\r
class="eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView"\r
id="eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects"\r
- name="Referencing Objects"\r
+ name="%view.name"\r
restorable="false">\r
</view>\r
</extension> \r
properties="isMergingEnabled"\r
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
</propertyTester>\r
+ <propertyTester\r
+ class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+ namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+ properties="isDerivedUnitEditor"\r
+ type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
+ </propertyTester>\r
</extension>\r
<extension\r
point="org.eclipse.ui.handlers">\r
category="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"\r
class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorMarkerPreferencePage"\r
id="eu.etaxonomy.taxeditor.preferences.bulkeditor.markerTypes"\r
- name="Marker Types">\r
+ name="%page.name">\r
</page>\r
<page\r
category="eu.etaxonomy.taxeditor.preferences.general"\r
class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorGeneralPreferencePage"\r
id="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"\r
- name="Bulk Editor">\r
+ name="%page.name.0">\r
</page>\r
</extension>\r
- <extension\r
- point="org.eclipse.core.expressions.propertyTesters">\r
- <propertyTester\r
- class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- properties="isDerivedUnitEditor"\r
- type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
- </propertyTester>\r
- </extension>\r
<extension\r
point="org.eclipse.ui.perspectiveExtensions">\r
<perspectiveExtension\r
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * <p>BulkEditor class.</p>
+ * <p>
+ * BulkEditor class.
+ * </p>
*
* @author p.ciardelli
* @created 07.07.2009
* @version 1.0
*/
-public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IDirtyMarkableSelectionProvider{
+public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IPartContentHasMedia,
+ IDirtyMarkableSelectionProvider {
/** Constant <code>ID="bulkeditor.editor"</code> */
public static final String ID = "bulkeditor.editor";
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public abstract class AbstractAddDerivedUnitFacadeMediaHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-
-
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- IEditorInput input = editor.getEditorInput();
-
-
- if(input instanceof OccurrenceEditorInput){
- BulkEditor bulkEditor = (BulkEditor) editor;
- ISelection selection = bulkEditor.getSelectionProvider().getSelection();
-
- if(selection instanceof IStructuredSelection){
- Object element = ((IStructuredSelection) selection).getFirstElement();
- if(element instanceof DerivedUnit){
-
- try{
- AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
- BulkEditorUtil.executeOperation(operation);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set.");
- }
- }
- }
- }
- return null;
- }
-
- /**
- * @return
- */
- protected abstract int getMode();
-
-}
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-
-/**
- * @author n.hoffmann
- * @created Feb 7, 2011
- * @version 1.0
- */
-public class AddDerivedUnitMediaHandler extends AbstractAddDerivedUnitFacadeMediaHandler {
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
- */
- @Override
- protected int getMode() {
- return AddDerivedUnitFacadeMediaOperation.DERIVED_UNIT_MEDIA;
- }
-
-
-}
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public class AddFieldObjectMediaHandler extends
- AbstractAddDerivedUnitFacadeMediaHandler {
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
- */
- @Override
- protected int getMode() {
- return AddDerivedUnitFacadeMediaOperation.FIELD_OBJECT_MEDIA;
- }
-
-}
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
- <name>eu.etaxonomy.taxeditor.editor</name>\r
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>\r
- <projects>\r
- </projects>\r
- <buildSpec>\r
- <buildCommand>\r
- <name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.eclipse.pde.ManifestBuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- <buildCommand>\r
- <name>org.eclipse.pde.SchemaBuilder</name>\r
- <arguments>\r
- </arguments>\r
- </buildCommand>\r
- </buildSpec>\r
- <natures>\r
- <nature>org.eclipse.jdt.core.javanature</nature>\r
- <nature>org.eclipse.pde.PluginNature</nature>\r
- </natures>\r
- <linkedResources>\r
- <link>\r
- <name>lib/LibrAlign</name>\r
- <type>2</type>\r
- <locationURI>WORKSPACE_LOC/LibrAlign/bin</locationURI>\r
- </link>\r
- <link>\r
- <name>lib/bioinfweb.commons</name>\r
- <type>2</type>\r
- <locationURI>WORKSPACE_LOC/_Lib/bin</locationURI>\r
- </link>\r
- </linkedResources>\r
-</projectDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>eu.etaxonomy.taxeditor.editor</name>
+ <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>lib/LibrAlign</name>
+ <type>2</type>
+ <location>/home/pplitzner/svn/LibrAlign/LibrAlign/main/bin</location>
+ </link>
+ <link>
+ <name>lib/bioinfweb.commons</name>
+ <type>2</type>
+ <location>/home/pplitzner/svn/LibrAlign/commons/main/bin</location>
+ </link>
+ </linkedResources>
+</projectDescription>
command.name.34 = Edit CDM Authorities\r
command.name.35 = Open Derivate View\r
scheme.description = The default key binding scheme for the Taxonomic Editor\r
-scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
+scheme.name = Taxonomic Editor Default Key Bindings\r
+editor.name.6 = Specimen Import Editor\r
+editor.name.7 = Gbif Import Editor\r
+editor.name.8 = Checklist Editor\r
+view.name.4 = Specimen Import\r
+view.name.5 = GBIF Specimen Import\r
+command.label.46 = Name\r
+command.label.47 = Reference\r
+command.label.48 = Datasource\r
+command.label.49 = Misapplication\r
+command.label.50 = Use Existing Image\r
+command.name.36 = Create Misapplication\r
+command.name.37 = Use Existing Image\r
+command.name.38 = Open Checklist Editor\r
+command.name.39 = New Datasource\r
+wizard.name = Specimen Search/Import\r
+wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.
\ No newline at end of file
command.name.35 = \u00d6ffne Derivate Ansicht
scheme.description = Die Standard Tastenbindungsschema f\u00fcr den Taxonomischen Editor
scheme.name = Taxonomic Editor Standard Tastenbindung
+editor.name.7 = Gbif Import Editor
+editor.name.8 = Checklist Editor
+view.name.4 = Specimen Import
+view.name.5 = GBIF Specimen Import
+command.label.46 = Name
+command.label.47 = Referenz
+command.label.48 = Datenquelle
+command.label.49 = Misapplication
+command.label.50 = Benutze vorhandenes Bild
+command.name.36 = Erstelle Misapplication
+command.name.37 = Benutze vorhandenes Bild
+command.name.38 = \u00d6ffne Checklist Editor
+command.name.39 = Neue Datenquelle
+wizard.name = Specimen Suche/Import
+wizard.description = Sendet eine Anfrage mit den eingegebenen Parametern an den Datenprovider.\nHinweis: Die Anzahl der Anfrageergebnisse sind auf 100 begrenzt.
\ No newline at end of file
command.name.34 = Edit CDM Authorities\r
command.name.35 = Open Derivate View\r
scheme.description = The default key binding scheme for the Taxonomic Editor\r
-scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
+scheme.name = Taxonomic Editor Default Key Bindingseditor.name.6 = Specimen Import Editor\r
+editor.name.7 = Gbif Import Editor\r
+editor.name.8 = Checklist Editor\r
+view.name.4 = Specimen Import\r
+view.name.5 = GBIF Specimen Import\r
+command.label.46 = Name\r
+command.label.47 = Reference\r
+command.label.48 = Datasource\r
+command.label.49 = Misapplication\r
+command.label.50 = Use Existing Image\r
+command.name.36 = Create Misapplication\r
+command.name.37 = Use Existing Image\r
+command.name.38 = Open Checklist Editor\r
+command.name.39 = New Datasource\r
+wizard.name = Specimen Search/Import\r
+wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.
\ No newline at end of file
class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor"
- name="Specimen Import Editor">
+ name="%editor.name.6">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor"
default="false"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor"
- name="Gbif Import Editor">
+ name="%editor.name.7">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
icon="icons/address-book-new.png"
id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
- name="Checklist Editor">
+ name="%editor.name.8">
</editor>
<editor
class="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
allowMultiple="true"
class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView"
- name="Specimen Import">
+ name="%view.name.4">
</view>
<view
allowMultiple="true"
class="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView"
- name="GBIF Specimen Import">
+ name="%view.name.5">
</view>
</extension>
<extension
locationURI="menu:eu.etaxonomy.navigation.menu.new?after=eu.etaxonomy.navigation.menu.new.separator1">
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.name"
- label="Name"
+ label="%command.label.46"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.reference"
- label="Reference"
+ label="%command.label.47"
style="push">
</command>
<command
</separator>
<command
commandId="eu.etaxonomy.taxeditor.editor.command.new.datasource"
- label="Datasource"
+ label="%command.label.48"
style="push">
</command>
</menuContribution>
</separator>
<command
commandId="eu.etaxonomy.taxeditor.editor.name.createMisapplication"
- label="Misapplication"
+ label="%command.label.49"
style="push">
<visibleWhen>
<or>
commandId="taxeditor-editor.command.newimagegallery"
label="%command.label.37"
style="push">
+ <visibleWhen>
+ <or>
+ <reference
+ definitionId="isBulkEditor">
+ </reference>
+ <reference
+ definitionId="isTaxonEditor">
+ </reference>
+ <reference
+ definitionId="isDerivateEditor">
+ </reference>
+ </or>
+ </visibleWhen>
</command>
<separator
name="taxeditor-editor.separator1"
</command>
<command
commandId="taxeditor-editor.useExistingImage"
- label="Use Existing Image"
+ label="%command.label.50"
style="push">
<visibleWhen
checkEnabled="false">
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateMisapplicationHandler"
id="eu.etaxonomy.taxeditor.editor.name.createMisapplication"
- name="Create Misapplication">
+ name="%command.name.36">
</command>
<!--command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.MoveTaxonHandler"
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.AddExistingMediaHandler"
id="taxeditor-editor.useExistingImage"
- name="Use Existing Image">
+ name="%command.name.37">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
id="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
- name="Open Checklist Editor">
+ name="%command.name.38">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.datasource"
- name="New Datasource">
+ name="%command.name.39">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
</test>
</with>
</definition>
+ <definition
+ id="isBulkEditor">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isBulkEditor">
+ </test>
+ </with>
+ </definition>
+ <definition
+ id="isDerivateEditor">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isDerivateEditor">
+ </test>
+ </with>
+ </definition>
<definition
id="isDescription">
<with
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
- properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor"
+ properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
<propertyTester
category="eu.etaxonomy.taxeditor.import.category.cdm"
class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenSearchWizard"
id="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenSearchWizard"
- name="Specimen Search/Import">
+ name="%wizard.name">
<description>
- Queries data provider for specimens with specified parameters.
-Note: Query results are currently limited to 100.
+ %wizard.description
</description>
</wizard>
</extension>
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
monitor.worked(1);
} catch (Exception e) {
setFocus();
- MessagingUtils.operationDialog(this, e, "saving a taxon", " Please close and reopen the taxon again.");
+ MessagingUtils.operationDialog(this, e, TaxeditorEditorPlugin.PLUGIN_ID,"saving a taxon", " Please close and reopen the taxon again.");
disableEditor(true);
} finally {
monitor.done();
*/
package eu.etaxonomy.taxeditor.editor.view.dataimport;
+import java.util.ArrayList;
import java.util.Collection;
import org.apache.log4j.Logger;
protected final Logger logger = Logger.getLogger(DataImportView.class);
- protected Collection<T> results;
+ protected Collection<T> results = new ArrayList<T>();
protected OccurenceQuery query;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.store.CdmStore;
data = ((GbifResponse) item.getData()).getDerivedUnitFacade().innerFieldUnit();
}
if(data instanceof SpecimenOrObservationBase){
-// dataImportView.getConversationHolder().bind();
-// CdmStore.getService(IReferenceService.class).saveOrUpdate(((SpecimenOrObservationBase) data).getSources());
- CdmStore.getService(IOccurrenceService.class).saveOrUpdate((SpecimenOrObservationBase<?>) data);
+ ConversationHolder conversation = dataImportView.getConversationHolder();
+ SpecimenOrObservationBase<?> specimen = (SpecimenOrObservationBase<?>) data;
+ conversation.bind();
+ IOccurrenceService occurrenceService = CdmStore.getService(IOccurrenceService.class);
+ for(ICdmBase cdmEntity:occurrenceService.getNonCascadedAssociatedElements(specimen)){
+ if(cdmEntity instanceof DefinedTermBase){
+ persistTerm((DefinedTermBase<?>) cdmEntity, CdmStore.getService(ITermService.class), conversation);
+ }
+ else if(cdmEntity instanceof TaxonNameBase){
+ //user interaction
+ }
+ }
+ occurrenceService.saveOrUpdate(specimen);
dataImportView.getConversationHolder().commit(true);
}
}
}
}
+ private void persistTerm(DefinedTermBase<?> term, ITermService termService, ConversationHolder conversation){
+ if(term!=null){
+ //if the term does not exist in the DB save it
+ if(termService.find(term.getUuid())==null){
+ termService.saveOrUpdate(term);
+ }
+ }
+ }
+
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getText()
*/
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.ISourceable;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.LSID;
return defaultService.findWithoutFlush(uuid);
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getNonCascadedAssociatedElements(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.api.conversation.ConversationHolder)
+ */
+ @Override
+ public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen) {
+ return defaultService.getNonCascadedAssociatedElements(specimen);
+ }
+
}
return true;
}
else{
- MessagingUtils.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+DerivateLabelProvider.getDerivateText(draggednode)+"\" to \""+DerivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
+ DerivateLabelProvider derivateLabelProvider = new DerivateLabelProvider();
+ derivateLabelProvider.setConversation(derivateView.getConversationHolder());
+ MessagingUtils.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+derivateLabelProvider.getDerivateText(draggednode)+"\" to \""+derivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
}
}
}
Object draggedNodeValue = draggedNode.getValue();
Object targetNodeValue = targetNode.getValue();
TreeNode fromParentNode = draggedNode.getParent();
- Object fromParentSpecimen = fromParentNode.getValue();
+ Object fromParentSpecimen = null;
+ if(fromParentNode!=null){
+ fromParentNode.getValue();
+ }
// drag'n'drop for SpecimenOrObservationBase
IOccurrenceService occurrenceService = CdmStore.getService(IOccurrenceService.class);
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeViewer;
import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
import eu.etaxonomy.cdm.model.molecular.Sequence;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
/**
- * Displays the derivate hierarchy of all derivates having one single {@link FieldUnit} as root.
+ * Displays the derivate hierarchy of the specimen specified in the editor input.
*
*/
public class DerivateView extends EditorPart implements IPartContentHasFactualData, IDirtyMarkableSelectionProvider,
- IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener {
+ IConversationEnabled, IPartContentHasDetails, IPartContentHasMedia, IPartContentHasSupplementalData,
+ IContextListener, ISelectionChangedListener {
/**
* Key used for storing a single DerivateView in a memento
private Set<SingleRead> multiLinkSingleReads;
+ private ISelection selection = null;
+
/**
* Default constructor
*/
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
viewer.setContentProvider(new DerivateContentProvider());
labelProvider = new DerivateLabelProvider();
+ labelProvider.setConversation(conversation);
viewer.setLabelProvider(labelProvider);
viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
// Propagate selection from viewer
getSite().setSelectionProvider(viewer);
+ //listen to selection changes
+ viewer.addSelectionChangedListener(this);
//create context menu
MenuManager menuManager = new MenuManager();
if(editorInput instanceof DerivateViewEditorInput){
SpecimenOrObservationBase<?> specimen = ((DerivateViewEditorInput) editorInput).getDerivate();
SpecimenOrObservationBase<?> rootElement = ((DerivateViewEditorInput) editorInput).getRootElement();
- setPartName(DerivateLabelProvider.getDerivateText(rootElement));
+ setPartName(labelProvider.getDerivateText(rootElement));
viewer.setSelection(new StructuredSelection(new TreeNode(specimen)));
}
// }
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ this.selection = event.getSelection();
+ }
+
+ /**
+ * @return the selection
+ */
+ public ISelection getSelection() {
+ return selection;
+ }
+
}
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
private static final String DELETABLE = "isDeletable";
private static final String IMAGE_GALLERY = "isImageGallery";
private static final String TAXON_EDITOR = "isTaxonEditor";
+ private static final String BULK_EDITOR = "isBulkEditor";
+ private static final String DERIVATE_EDITOR = "isDerivateEditor";
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
if(TAXON_EDITOR.equals(property)){
return isTaxonEditor();
}
+ else if(BULK_EDITOR.equals(property)){
+ return isBulkEditor();
+ }
+ else if(DERIVATE_EDITOR.equals(property)){
+ return isDerivateEditor();
+ }
Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
}
return false;
}
+
+ private boolean isBulkEditor() {
+ if(AbstractUtility.getActiveEditor() instanceof BulkEditor){
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isDerivateEditor() {
+ if(AbstractUtility.getActiveEditor() instanceof DerivateView){
+ return true;
+ }
+ return false;
+ }
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation;
+package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
* @created Feb 11, 2011
* @version 1.0
*/
-public class AddDerivedUnitFacadeMediaOperation extends
- AbstractPostTaxonOperation {
+public class AddDerivedUnitFacadeMediaOperation extends AbstractPostTaxonOperation {
+
+ private final SpecimenOrObservationBase<?> specimen;
- public static final int DERIVED_UNIT_MEDIA = 0;
- public static final int FIELD_OBJECT_MEDIA = 1;
-
- private DerivedUnit derivedUnit;
- private int mode;
-
/**
* @param label
* @param undoContext
* @param postOperationEnabled
*/
- public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, DerivedUnit derivedUnit,
- int mode, IPostOperationEnabled postOperationEnabled) {
+ public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, SpecimenOrObservationBase<?> specimen,
+ IPostOperationEnabled postOperationEnabled) {
super(label, undoContext, postOperationEnabled);
-
- this.derivedUnit = derivedUnit;
- this.mode = mode;
+
+ this.specimen = specimen;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
DerivedUnitFacade facade;
try {
- facade = DerivedUnitFacade.NewInstance(derivedUnit);
-
- createImageGallery(facade);
+ if(specimen instanceof FieldUnit){
+ facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) specimen);
+ if(facade.hasFieldObjectImageGallery()){
+ MessagingUtils.informationDialog("Image gallery creation failed", "Only one image gallery is possible.");
+ return Status.CANCEL_STATUS;
+ }
+ else{
+ facade.getFieldObjectImageGallery(true);
+ }
+ }
+ else if(specimen instanceof DerivedUnit){
+ facade = DerivedUnitFacade.NewInstance((DerivedUnit)specimen);
+ if(facade.hasDerivedUnitImageGallery()){
+ MessagingUtils.informationDialog("Image gallery creation failed", "Only one image gallery is possible.");
+ return Status.CANCEL_STATUS;
+ }
+ else{
+ facade.getDerivedUnitImageGallery(true);
+ }
+ }
} catch (DerivedUnitFacadeNotSupportedException e) {
MessagingUtils.error(getClass(), e);
}
-
- return postExecute(derivedUnit);
- }
-
-
- /**
- * @param facade
- * @return
- */
- protected void createImageGallery(DerivedUnitFacade facade){
- if(mode == DERIVED_UNIT_MEDIA){
- facade.getDerivedUnitImageGallery(true);
- }
- else if(mode == FIELD_OBJECT_MEDIA){
- facade.getFieldObjectImageGallery(true);
- }
- else{
- throw new IllegalArgumentException("Mode not supported: " + mode);
- }
+ return postExecute(specimen);
}
+
/* (non-Javadoc)
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.taxeditor.editor.view.media;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
public class MediaContentProvider implements ITreeContentProvider{
private static final Object[] NO_CHILDREN = new Object[0];
-
+
/** {@inheritDoc} */
- public Object[] getChildren(Object parentElement) {
-
+ @Override
+ public Object[] getChildren(Object parentElement) {
+
if (parentElement instanceof TaxonEditorInput) {
Taxon taxon = ((TaxonEditorInput) parentElement).getTaxon();
if(taxon == null){
if(description.isImageGallery()){
imageGalleries.add(description);
}
- }
- return imageGalleries.toArray();
+ }
+ return imageGalleries.toArray();
}
else if (parentElement instanceof DescriptionBase) {
if (((DescriptionBase) parentElement).isImageGallery()) {
return getImages((DescriptionBase) parentElement).toArray();
- }
+ }
}
else if (parentElement instanceof DerivedUnit){
try {
DerivedUnitFacade facade = DerivedUnitFacade.NewInstance((DerivedUnit) parentElement);
-
- // TODO at the moment we always create image galleries because the facade is like so.
- // this should definitely change and we want to use normal getters and setters here
- List<DescriptionBase> derivedUnitFacadeImageGalleries = new ArrayList<DescriptionBase>(2);
-
+
SpecimenDescription derivedUnitImageGallery = facade.getDerivedUnitImageGallery(false);
- SpecimenDescription fieldObjectImageGallery = facade.getFieldObjectImageGallery(false);
-
+
if(derivedUnitImageGallery != null){
- derivedUnitFacadeImageGalleries.add(derivedUnitImageGallery);
- }
-
- if(fieldObjectImageGallery != null){
- derivedUnitFacadeImageGalleries.add(fieldObjectImageGallery);
+ return Collections.singleton(derivedUnitImageGallery).toArray();
}
-
- return derivedUnitFacadeImageGalleries.toArray();
-
+
} catch (DerivedUnitFacadeNotSupportedException e) {
MessagingUtils.error(this.getClass(), "DerivedUnitFacadeNotSupportedException when trying to instantiate DerivedUnitFacade", e);
}
}
-
+ else if (parentElement instanceof FieldUnit){
+ DerivedUnitFacade facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) parentElement);
+
+ SpecimenDescription fieldObjectImageGallery = facade.getFieldObjectImageGallery(false);
+
+ if(fieldObjectImageGallery != null){
+ return Collections.singleton(fieldObjectImageGallery).toArray();
+ }
+ }
return NO_CHILDREN;
}
/** {@inheritDoc} */
- public Object getParent(Object element) {
+ @Override
+ public Object getParent(Object element) {
// TODO Auto-generated method stub
return null;
}
/** {@inheritDoc} */
- public boolean hasChildren(Object element) {
+ @Override
+ public boolean hasChildren(Object element) {
return (getChildren(element).length > 0);
}
/** {@inheritDoc} */
- public Object[] getElements(Object inputElement) {
+ @Override
+ public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
/**
* <p>dispose</p>
*/
- public void dispose() {}
+ @Override
+ public void dispose() {}
/** {@inheritDoc} */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
private List<Media> getImages(DescriptionBase description){
Assert.isTrue(description.isImageGallery(), "Description should have the imageGallery flag set.");
-
+
Set<DescriptionElementBase> elements = description.getElements();
if (elements != null) {
// by definition, image galleries have only one description element
if(elements.size() > 1){
MessagingUtils.error(this.getClass(), "There should be one and only one description element to hold the images. Found: " + elements.size() + " InDescription ID: " + description.getUuid(), null);
}
-
+
DescriptionElementBase element = elements.iterator().next();
-
+
return element.getMedia();
}
return null;
}
-
+
private SpecimenDescription createDerivedUnitFacadeImageGallery(DerivedUnitFacade facade){
SpecimenDescription description = SpecimenDescription.NewInstance();
description.setImageGallery(true);
-
-
-
+
+
+
return description;
}
}
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
+import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
+import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
/**
* <p>MediaViewPart class.</p>
return;
}
- if(part instanceof MultiPageTaxonEditor){
- IEditorInput input = ((IEditorPart) part).getEditorInput();
- showViewer(part, new StructuredSelection(input));
+ if(part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart){
+ // do not show empty page as these views are also used to edit the description selected in this view
+ return;
+ }
+
+ if(part instanceof IPartContentHasMedia){
+ if(part instanceof MultiPageTaxonEditor){
+ IEditorInput input = ((IEditorPart) part).getEditorInput();
+ showViewer(part, new StructuredSelection(input));
+ }
+ else if(selection instanceof IStructuredSelection){
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if(firstElement instanceof TreeNode){
+ showViewer(part, new StructuredSelection(((TreeNode) firstElement).getValue()));
+ }
+ else{
+ showViewer(part, (IStructuredSelection) selection);
+ }
+ }
}
-
- if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
- showViewer(part, (IStructuredSelection) selection);
+ else{
+ showEmptyPage();
}
}
DescriptionBase description) {
AbstractPostOperation operation = null;
try {
-
//select media
Media media = MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
- // TODO use undo context specific to editor
- operation = new AddExistingMediaToImageGalleryOperation(media, event.getCommand().getName(),
- EditorUtil.getUndoContext(), description, postOperationEnabled);
- AbstractUtility.executeOperation(operation);
+ if(media!=null){
+ // TODO use undo context specific to editor
+ operation = new AddExistingMediaToImageGalleryOperation(media, event.getCommand().getName(),
+ EditorUtil.getUndoContext(), description, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ }
} catch (NotDefinedException e) {
MessagingUtils.warn(getClass(), "Command name not set.");
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.editor.view.media.handler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.AddDerivedUnitFacadeMediaOperation;
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
/** {@inheritDoc} */
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = HandlerUtil.getActivePart(event);
IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-
-
+
+
IEditorPart editor = HandlerUtil.getActiveEditor(event);
IEditorInput input = editor.getEditorInput();
+
if (input instanceof TaxonEditorInput) {
- Taxon taxon = ((TaxonEditorInput) input).getTaxon();
- AbstractPostOperation operation;
+ Taxon taxon = ((TaxonEditorInput) input).getTaxon();
+ AbstractPostOperation<?> operation;
try {
// TODO use undo context specific to editor
- operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
+ operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
- EditorUtil.executeOperation(operation);
+ AbstractUtility.executeOperation(operation);
} catch (NotDefinedException e) {
MessagingUtils.warn(getClass(), "Command name not set.");
}
- }
+ }
+ else if(input instanceof OccurrenceEditorInput){
+ BulkEditor bulkEditor = (BulkEditor) editor;
+ ISelection selection = bulkEditor.getSelectionProvider().getSelection();
+ invokeOperation(event, postOperationEnabled, selection);
+ }
+ else if(input instanceof DerivateViewEditorInput){
+ ISelection selection = ((DerivateView)editor).getSelection();
+ invokeOperation(event, postOperationEnabled, selection);
+ }
return null;
}
+ /**
+ * @param event
+ * @param postOperationEnabled
+ * @param selection
+ */
+ private void invokeOperation(ExecutionEvent event, IPostOperationEnabled postOperationEnabled, ISelection selection) {
+ if(selection instanceof IStructuredSelection){
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if(element instanceof TreeNode){
+ element = ((TreeNode) element).getValue();
+ }
+ if(element instanceof SpecimenOrObservationBase<?>){
+ try {
+ AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(),
+ BulkEditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>)element, postOperationEnabled);
+ AbstractUtility.executeOperation(operation);
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set.");
+ }
+ }
+ }
+ }
+
}
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 "License"); 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 "AS IS" 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"/>
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.update.configurator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
<plugin
id="org.eclipse.update.core"
download-size="0"
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.equinox.p2.transport.ecf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.commons.httpclient"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.httpcomponents.httpclient"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ecf.provider.filetransfer.httpclient"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.touchpoint.eclipse"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.frameworkadmin"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.frameworkadmin.equinox"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.console"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.simpleconfigurator.manipulator"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.ui.sdk.scheduler"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.garbagecollector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.directorywatcher"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.updatesite"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.extensionlocation"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.director.app"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.publisher"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.repository.tools"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ecf.provider.filetransfer.ssl"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ecf.ssl"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.commons.codec"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.p2.touchpoint.natives"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
[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 "License"); 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 "AS IS" 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"/>
+ <update label="EDIT Taxonomic Editor" url="http://cybertaxonomy.eu/download/taxeditor/update/"/>
</url>
<includes
if (result.isError()){
MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());
- }else if(!result.getExceptions().isEmpty()){
- //TODO:Warning!
+ }else if(result.isAbort()){
+ MessageDialog.openWarning(null, "Delete abort", "The object could not be deleted, maybe there was no object selected.");
}
return postExecute(null);
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
-import java.util.List;
import java.util.Set;
-import java.util.UUID;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
}*/
} else {
- List<UUID> result =service.deleteTaxonNodes(treeNodes, config);
-
+ DeleteResult result =service.deleteTaxonNodes(treeNodes, config);
+ if (result.isError()){
+ //TODO:Error message!
+ MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());
+ }
}
monitor.worked(40);
fontDefinition.description.1 = The font used by default in the search result list.\r
colorDefinition.label.13 = Parse Error\r
colorDefinition.label.14 = Disabled Name Editor Field\r
-colorDefinition.label.15 = Editor On Error
\ No newline at end of file
+colorDefinition.label.15 = Editor On Error\r
+page.name.26 = Specimens and FieldUnits\r
+page.name.27 = Media\r
+page.name.28 = Checklist Editor\r
+page.name.29 = Editor Profile\r
+page.name.30 = Default Language
\ No newline at end of file
colorDefinition.label.13 = Fehler beim Parsing
colorDefinition.label.14 = Gesperrtes Namenseditierfeld
colorDefinition.label.15 = Editor fehlerhaft
+page.name.26 = Specimens und FieldUnits
+page.name.27 = Media
+page.name.28 = Checklist Editor
+page.name.29 = Editor Profil
+page.name.30 = Standardsprache
\ No newline at end of file
fontDefinition.description.1 = The font used by default in the search result list.\r
colorDefinition.label.13 = Parse Error\r
colorDefinition.label.14 = Disabled Name Editor Field\r
-colorDefinition.label.15 = Editor On Error
\ No newline at end of file
+colorDefinition.label.15 = Editor On Error\r
+page.name.26 = Specimens and FieldUnits\r
+page.name.27 = Media\r
+page.name.28 = Checklist Editor\r
+page.name.29 = Editor Profile\r
+page.name.30 = Default Language
\ No newline at end of file
plugin.xml,\
icons/,\
p2.inf,\
- OSGI-INF/
+ OSGI-INF/,\
+ OSGI-INF/l10n/bundle.properties
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.SpecimenOrObservationPreferences"
id="eu.etaxonomy.taxeditor.preference.SpecimenOrObservationPreferences"
- name="Specimens and FieldUnits">
+ name="%page.name.26">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.MediaPreferences"
id="eu.etaxonomy.taxeditor.preference.MediaPreferences"
- name="Media">
+ name="%page.name.27">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreference"
id="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreferencePage"
- name="Checklist Editor">
+ name="%page.name.28">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
id="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
- name="Editor Profile">
+ name="%page.name.29">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.DefaultLanguageEditorPreferencePage"
id="eu.etaxonomy.taxeditor.preference.defaultlanguagepditorpreferencePage"
- name="Default Language">
+ name="%page.name.30">
</page>
</extension>
<extension
// $Id$\r
/**\r
* Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy \r
+ * European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
- * \r
+ *\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
try {\r
activePage.openEditor(new TermEditorInput(TermType.getByUuid(UUID.fromString(termTypeUuid))), DefinedTermEditor.ID);\r
} catch (PartInitException e) {\r
- \r
+\r
String PID = "eu.etaxonomy.taxeditor.application";\r
MultiStatus info = new MultiStatus(PID, 1, "You might be missing sufficient permissions to open the Defined Term Editor", null);\r
info.add(new Status(IStatus.WARNING, PID, 1, e.getMessage(), null));\r
- MessagingUtils.errorDialog("Cannot open Defined Term Editor", getClass(), info);\r
- MessagingUtils.error(getClass(), e);\r
+ MessagingUtils.warningDialog("Cannot open Defined Term Editor", getClass(), info);\r
}\r
\r
return null;\r
package eu.etaxonomy.taxeditor.model;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.themes.IThemeManager;
import eu.etaxonomy.cdm.model.common.IEnumTerm;
-import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
*/
public abstract class AbstractUtility {
- /** Constant <code>statusLineManager</code> */
- protected static IStatusLineManager statusLineManager;
+ /** Constant <code>statusLineManager</code> */
+ protected static IStatusLineManager statusLineManager;
+
/**
* <p>
uiInfoAdapter);
} catch (ExecutionException e) {
- MessagingUtils.operationDialog(this, e, operationlabel, null);
+ MessagingUtils.operationDialog(this, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
} finally {
monitor.done();
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
/**
* Error dialog class specifically implemented for the editor.
* The main difference with {@link org.eclipse.jface.dialogs.ErrorDialog} is that
* this dialog has a fixed max height.
- *
+ *
* @author cmathew
*
*/
public class CdmErrorDialog extends ErrorDialog {
private static final int DIALOG_MAX_HEIGHT = 500;
-
- public CdmErrorDialog(Shell parentShell, String dialogTitle,
- String message, IStatus status) {
- super(parentShell,
- dialogTitle,
- message, status,
- IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
- }
-
+
+ private Button copyButton;
+ private final String stackTrace;
+
+ /**
+ * The current clipboard. To be disposed when closing the dialog.
+ */
+ private Clipboard clipboard;
+
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param message
+ * @param status
+ * @param stackTrace
+ */
+ public CdmErrorDialog(Shell parentShell,
+ String dialogTitle,
+ String message,
+ IStatus status,
+ String stackTrace) {
+ super(parentShell,
+ dialogTitle,
+ message, status,
+ IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
+ this.stackTrace = stackTrace;
+ }
+
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param message
+ * @param status
+ */
+ public CdmErrorDialog(Shell parentShell,
+ String dialogTitle,
+ String message,
+ IStatus status) {
+ this(parentShell, dialogTitle, message, status, "");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
+ */
@Override
- protected void buttonPressed(int id) {
+ protected void buttonPressed(int id) {
super.buttonPressed(id);
if (id == IDialogConstants.DETAILS_ID) {
Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
getShell().setSize(getShell().getSize().x, oldSize.y);
}
}
-
- }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.ErrorDialog#createDropDownList(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected List createDropDownList(Composite parent) {
+ List list = super.createDropDownList(parent);
+ list.getMenu().getItem(0).setText(JFaceResources.getString("copy all"));
+ return list;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.ErrorDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ copyButton = createButton(parent, 2000,"Copy Error", false);
+ copyButton.addSelectionListener(new SelectionListener() {
+ /*
+ * @see SelectionListener.widgetSelected (SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ copyStackTraceToClipboard();
+ }
+ /*
+ * @see SelectionListener.widgetDefaultSelected(SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ copyStackTraceToClipboard();
+ }
+ });
+ super.createButtonsForButtonBar(parent);
+ }
+
+
+ /**
+ * Copies the stack trace to the clipboard
+ *
+ */
+ private void copyStackTraceToClipboard() {
+ if(stackTrace != null && !stackTrace.isEmpty()) {
+ if (clipboard != null) {
+ clipboard.dispose();
+ }
+ clipboard = new Clipboard(copyButton.getDisplay());
+ clipboard.setContents(new Object[] { stackTrace },
+ new Transfer[] { TextTransfer.getInstance() });
+ }
+ }
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.model;
+
+
+/**
+ *
+ * Clients implementing this interface indicate, that the data they present is suitable for the media view
+ * and that the media view should handle selection from the implementing part.
+ *
+ * @author pplitzner
+ * @date Sep 16, 2014
+ *
+ */
+public interface IPartContentHasMedia {
+
+}
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
/**
* Utility class which handles all the messaging information generated by the
* Editor.
- *
+ *
* This includes logging as well as dialogs.
- *
+ *
* @author cmathew
*
*/
public class MessagingUtils {
- public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
- public final static String CONTACT_MESSAGE = System.getProperty("line.separator") + "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
-
- /**
- * Gets the Log4J logger for a given class
- *
- * @param clazz
- * a {@link java.lang.Class} object.
- * @return a {@link org.apache.log4j.Logger} object.
- */
- public static Logger getLog4JLogger(Class clazz) {
- return Logger.getLogger(clazz);
- }
-
- /**
- * Logs details from a given Status object
- *
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- private static void log(IStatus status) {
- TaxeditorStorePlugin.getDefault().getLog().log(status);
- }
-
- /**
- * Logs a status object as information.
- *
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void info(IStatus status) {
- log(status);
- }
-
- /**
- * Logs a string as information.
- *
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void info(String message) {
- IStatus status = new Status(IStatus.INFO, AbstractUtility.getPluginId(), message);
- info(status);
- }
-
- /**
- * Logs an exception from a given source as a warning.
- *
- * @param source
- * @param t
- */
- public static void warn(Class source, Throwable t) {
- IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), t.getMessage(), t);
- MessagingUtils.getLog4JLogger(source).warn(t);
- log(status);
- }
-
- /**
- * Logs a status object from a given source as a warning.
- *
- * @param source
- * @param status
- */
- public static void warn(Class source, IStatus status) {
- MessagingUtils.getLog4JLogger(source).warn(status.getMessage(), status.getException());
- log(status);
- }
-
- /**
- * Logs a string from a given source as a warning.
- *
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void warn(Class source, String message) {
- IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), message);
- MessagingUtils.getLog4JLogger(source).warn(message);
- log(status);
- }
-
- /**
- * Logs a status object from a given source as an error.
- *
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void error(Class source, IStatus status) {
- getLog4JLogger(source)
- .error(status.getMessage(), status.getException());
- log(status);
- }
-
- /**
- * Logs a string and exception from a given source as an error.
- *
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param message
- * a {@link java.lang.String} object.
- * @param t
- * a {@link java.lang.Throwable} object.
- */
- public static void error(Class source, String message, Throwable t) {
- IStatus status = new Status(IStatus.ERROR, AbstractUtility.getPluginId(), message, t);
- error(source, status);
- }
-
-
-
- /**
- * Logs an exception from a given source as an error.
- *
- *
- * @param source
- * a {@link java.lang.Class} object.
- * @param t
- * a {@link java.lang.Throwable} object.
- */
- public static void error(Class source, Throwable t) {
- error(source.getClass(), t.getMessage(), t);
- }
-
- /**
- * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param source
- * a {@link java.lang.Object} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void errorDialog(final String title,
- final Object source,
- final String message,
- final IStatus status) {
-
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
- ced.open();
- Class<? extends Object> clazz = source != null ? source
- .getClass() : this.getClass();
- error(clazz, status);
- }
- });
- }
-
- /**
- * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
- *
- * @param title
- * @param source
- * @param message
- * @param pluginId
- * @param t
- */
- public static void errorDialog(final String title,
- final Object source,
- final String message,
- final String pluginId,
- final Throwable t,
- boolean addContactMesg) {
- // Usually the status contains only the first line of the stack trace.
- // For the unexpected messages we need the entire stack trace so we
- // create a new status with the entire stacktrace
- StringWriter sw = new StringWriter();
- t.printStackTrace(new PrintWriter(sw));
- String finalMessage = t.getMessage();
- if(addContactMesg) {
- finalMessage += MessagingUtils.CONTACT_MESSAGE;
- }
- IStatus status = new Status(IStatus.ERROR,
- pluginId,
- finalMessage,
- new Exception(sw.toString()));
- errorDialog(title, source, message, status);
- }
-
-
-
- /**
- * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param source
- * a {@link java.lang.Object} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void errorDialog(final String title,
- final Object source,
- final String message,
- final IStatus status,
- final boolean showStackTrace) {
- if(showStackTrace && status.getException() != null) {
- errorDialog(title, source, status.getPlugin(), message, status.getException(),true);
- } else {
- errorDialog(title, source, message, status);
- }
- }
-
-
- /**
- * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param source
- * a {@link java.lang.Object} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void errorDialog(final String title, final Object source,
- final IStatus status) {
- errorDialog(title, source, null, status);
- }
-
- /**
- * Displays a dialog for an exception occurring in an operation.
- *
- * This will be either a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog} in case of a
- * security runtime exception or a warning {@link org.eclipse.jface.dialogs.MessageDialog} in
- * case of any other exception.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param source
- * a {@link java.lang.Object} object.
- * @param status
- * a {@link org.eclipse.core.runtime.IStatus} object.
- */
- public static void operationDialog(final Object source,
- final Exception ex,
- final String operationlabel,
- final String hint) {
-
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MultiStatus info = null;
- String title = null;
-
- // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
- // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
- String PID = "eu.etaxonomy.taxeditor.application";
-
- // checking security exceptions for every operation
- RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(ex);
-
- // in case of a security exception it is a warning, else it is an error
- if(securityRuntimeException != null){
- title = "Your changes could not be saved!";
- warningDialog(title, source, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint));
- } else {
- title = "Error executing operation";
- errorDialog(title, source, String.format("An error occured while executing %s. %s", operationlabel, hint), PID, ex, true);
-
- }
-
-
- }
- });
- }
-
-
-
-
- /**
- * Displays a question {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param message
- * a {@link java.lang.String} object.
- * @return a boolean.
- */
- public static boolean confirmDialog(String title, String message) {
- return MessageDialog.openQuestion(AbstractUtility.getShell(), title, message);
- }
-
- /**
- * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * @param source
- * @param message
- */
- public static void messageDialog(final String title, final Object source, final String message) {
- MessagingUtils.messageDialog(title, source, message, null);
- }
-
- /**
- * Displays an error {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * The dialogs title
- * @param source
- * The object where the warning was generated (used by log4j)
- * @param message
- * An informative String to be presented to the user
- * @param title
- * The dialogs title
- * @param t
- * a Throwable if one exists or null
- */
- public static void messageDialog(final String title, final Object source,
- final String message, final Throwable t) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(AbstractUtility.getShell(), title, message + getCauseRecursively(t));
- Class<? extends Object> clazz = source != null ? source
- .getClass() : this.getClass();
- error(clazz, message, t);
- }
-
- private String getCauseRecursively(Throwable t) {
- if(t == null){
- return "";
- }
-
- if(t.getCause() != null){
- return getCauseRecursively(t.getCause());
- }else{
- return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
- }
-
- }
- });
- }
-
- /**
- * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * @param termBase
- * @param status
- */
- public static void warningDialog(String title, Object source,
- IStatus status) {
- MessagingUtils.warningDialog(title, source, status.getMessage());
- }
-
- /**
- * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * The dialogs title
- * @param source
- * The object where the warning was generated (used by log4j)
- * @param message
- * An informative String to be presented to the user
- */
- public static void warningDialog(final String title, final Object source, final String message) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openWarning(AbstractUtility.getShell(), title, message);
- Class<? extends Object> clazz = source != null ? source
- .getClass() : AbstractUtility.class;
- warn(clazz, message);
- }
- });
- }
-
- /**
- * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * @param status
- */
- public static void informationDialog(final String title, final IStatus status) {
- MessagingUtils.informationDialog(title, status.getMessage());
- }
-
- /**
- * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
- *
- * @param title
- * a {@link java.lang.String} object.
- * @param message
- * a {@link java.lang.String} object.
- */
- public static void informationDialog(final String title,
- final String message) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openInformation(AbstractUtility.getShell(), title, message);
- }
- });
- }
-
- /**
- * Open a message box that informs the user about unimplemented
- * functionality. This method is for developer convenience.
- *
- * @param source
- * a {@link java.lang.Object} object.
- */
- public static void notImplementedMessage(Object source) {
- warningDialog("Not yet implemented", source,
- "This functionality is not yet implemented.");
- }
+ public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
+ public final static String CONTACT_MESSAGE = System.getProperty("line.separator") + "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
+
+ /**
+ * Gets the Log4J logger for a given class
+ *
+ * @param clazz
+ * a {@link java.lang.Class} object.
+ * @return a {@link org.apache.log4j.Logger} object.
+ */
+ public static Logger getLog4JLogger(Class clazz) {
+ return Logger.getLogger(clazz);
+ }
+
+ /**
+ * Logs details from a given Status object
+ *
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ private static void log(IStatus status) {
+ TaxeditorStorePlugin.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Logs a status object as information.
+ *
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void info(IStatus status) {
+ log(status);
+ }
+
+ /**
+ * Logs a string as information.
+ *
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void info(String message) {
+ IStatus status = new Status(IStatus.INFO, AbstractUtility.getPluginId(), message);
+ info(status);
+ }
+
+ /**
+ * Logs an exception from a given source as a warning.
+ *
+ * @param source
+ * @param t
+ */
+ public static void warn(Class source, Throwable t) {
+ IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), t.getMessage(), t);
+ MessagingUtils.getLog4JLogger(source).warn(t);
+ log(status);
+ }
+
+ /**
+ * Logs a status object from a given source as a warning.
+ *
+ * @param source
+ * @param status
+ */
+ public static void warn(Class source, IStatus status) {
+ MessagingUtils.getLog4JLogger(source).warn(status.getMessage(), status.getException());
+ log(status);
+ }
+
+ /**
+ * Logs a string from a given source as a warning.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void warn(Class source, String message) {
+ IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), message);
+ MessagingUtils.getLog4JLogger(source).warn(message);
+ log(status);
+ }
+
+ /**
+ * Logs a status object from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void error(Class source, IStatus status) {
+ getLog4JLogger(source)
+ .error(status.getMessage(), status.getException());
+ log(status);
+ }
+
+ /**
+ * Logs a string and exception from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ * @param t
+ * a {@link java.lang.Throwable} object.
+ */
+ public static void error(Class source, String message, Throwable t) {
+ IStatus status = new Status(IStatus.ERROR, AbstractUtility.getPluginId(), message, t);
+ error(source, status);
+ }
+
+
+
+ /**
+ * Logs an exception from a given source as an error.
+ *
+ *
+ * @param source
+ * a {@link java.lang.Class} object.
+ * @param t
+ * a {@link java.lang.Throwable} object.
+ */
+ public static void error(Class source, Throwable t) {
+ error(source.getClass(), t.getMessage(), t);
+ }
+
+
+
+ /**
+ * Returns a list of strings, providing info on,
+ * - login
+ * - editor version
+ * - server (address + source name)
+ * - db schema version
+ *
+ * @return
+ */
+ public static List<String> getContextInfo() {
+ List<String> contextInfo = new ArrayList<String>();
+ String name = "";
+ String schemaVersion = "";
+ String server = "";
+ String version = "";
+ String login = "";
+ try {
+ version = Platform.getBundle("eu.etaxonomy.taxeditor.application").getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
+
+ if(CdmStore.getActiveCdmSource() != null ) {
+ login = CdmStore.getLoginManager().getAuthenticatedUser().getUsername();
+ name = CdmStore.getActiveCdmSource().getName();
+ schemaVersion = CdmStore.getActiveCdmSource().getDbSchemaVersion();
+ server = CdmStore.getActiveCdmSource().getServer();
+ }
+
+ } catch (Exception e) {
+ // Nothing to do
+ }
+ contextInfo.add("login : " + login);
+ contextInfo.add("editor version : " + version);
+ contextInfo.add("server : " + server + " / " + name);
+ contextInfo.add("schema version : " + schemaVersion);
+
+ return contextInfo;
+ }
+
+ public static String getStackTraceAndContextInfo(Throwable t, List<String> contextInfo) {
+ StringBuffer stackTraceAndContextInfo = new StringBuffer();
+
+ for(String infoItem : contextInfo) {
+ stackTraceAndContextInfo.append(infoItem + System.getProperty("line.separator"));
+ }
+
+ StringWriter sw = new StringWriter();
+ t.printStackTrace(new PrintWriter(sw));
+
+ stackTraceAndContextInfo.append(sw.toString());
+
+ return stackTraceAndContextInfo.toString();
+ }
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * @param source
+ * @param t
+ * @param contextInfo
+ * @param message
+ * @param status
+ */
+ private static void errorDialog(final String title,
+ final Object source,
+ final Throwable t,
+ final List<String> contextInfo,
+ final String message,
+ final MultiStatus status) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ String stackTraceWithContext = getStackTraceAndContextInfo(t, contextInfo);
+ CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext);
+ ced.open();
+ Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
+
+
+ IStatus singleStatus = new Status(IStatus.ERROR,
+ status.getPlugin(),
+ message,
+ new Exception(stackTraceWithContext));
+
+ error(clazz, singleStatus);
+ }
+ });
+ }
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * @param source
+ * @param message
+ * @param pluginId
+ * @param t
+ */
+ public static void errorDialog(final String title,
+ final Object source,
+ final String message,
+ final String pluginId,
+ final Throwable t,
+ boolean addContactMesg) {
+
+
+ StringBuffer sbStackTrace = new StringBuffer();
+
+ // We need to build a MultiStatus object since the simple
+ // idea of writing out the stack trace as a single string
+ // leads to a single line on windows
+ List<Status> childStatuses = new ArrayList<Status>();
+
+ // add context info
+ List<String> contextInfo = getContextInfo();
+ for(String infoItem : contextInfo) {
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, infoItem));
+ }
+
+ // add main execption
+ for (StackTraceElement ste : t.getStackTrace()) {
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, "at " + ste.toString()));
+ }
+
+ // add cause
+ if(t.getCause() != null) {
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, ""));
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, "Caused by : " + t.getCause().toString()));
+ for (StackTraceElement ste : t.getCause().getStackTrace()) {
+ // build & add status
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, "at " + ste.toString()));
+ }
+ }
+
+ String finalMessage = message;
+
+ if(finalMessage == null || finalMessage.isEmpty()) {
+ finalMessage = "";
+ }
+
+ if(addContactMesg) {
+ // add edit support contact info to message
+ finalMessage += MessagingUtils.CONTACT_MESSAGE;
+ }
+
+ MultiStatus ms = new MultiStatus(pluginId,
+ IStatus.ERROR,
+ childStatuses.toArray(new Status[] {}),
+ t.toString(),
+ t);
+
+ errorDialog(title, source, t, contextInfo, finalMessage, ms);
+ }
+
+ /**
+ * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ private static void errorDialog(final String title,
+ final Object source,
+ final String message,
+ final IStatus status) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
+ ced.open();
+ Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
+ error(clazz, status);
+ }
+ });
+ }
+
+ /**
+ * Displays a dialog for an exception occurring in an operation.
+ *
+ * This will be either a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog} in case of a
+ * security runtime exception or a warning {@link org.eclipse.jface.dialogs.MessageDialog} in
+ * case of any other exception.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param source
+ * a {@link java.lang.Object} object.
+ * @param status
+ * a {@link org.eclipse.core.runtime.IStatus} object.
+ */
+ public static void operationDialog(final Object source,
+ final Exception ex,
+ final String pluginId,
+ final String operationlabel,
+ final String hint) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MultiStatus info = null;
+ String title = null;
+
+ // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
+ // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
+ String PID = "eu.etaxonomy.taxeditor.application";
+
+ // checking security exceptions for every operation
+ RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(ex);
+
+ // in case of a security exception it is a warning, else it is an error
+ if(securityRuntimeException != null){
+ title = "Your changes could not be saved!";
+ warningDialog(title, source, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint));
+ } else {
+ title = "Error executing operation";
+ errorDialog(title, source, String.format("An error occured while executing %s. %s", operationlabel, hint), pluginId, ex, true);
+
+ }
+
+
+ }
+ });
+ }
+
+
+
+
+ /**
+ * Displays a question {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ * @return a boolean.
+ */
+ public static boolean confirmDialog(String title, String message) {
+ return MessageDialog.openQuestion(AbstractUtility.getShell(), title, message);
+ }
+
+ /**
+ * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param source
+ * @param message
+ */
+ public static void messageDialog(final String title, final Object source, final String message) {
+ MessagingUtils.messageDialog(title, source, message, null, true);
+ }
+
+
+
+ /**
+ * Displays an error {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * The dialogs title
+ * @param source
+ * The object where the warning was generated (used by log4j)
+ * @param message
+ * An informative String to be presented to the user
+ * @param title
+ * The dialogs title
+ * @param t
+ * a Throwable if one exists or null
+ */
+ public static void messageDialog(final String title,
+ final Object source,
+ final String message,
+ final Throwable t) {
+ MessagingUtils.messageDialog(title, source, message, t, true);
+ }
+
+ /**
+ * Displays an error {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * The dialogs title
+ * @param source
+ * The object where the warning was generated (used by log4j)
+ * @param message
+ * An informative String to be presented to the user
+ * @param title
+ * The dialogs title
+ * @param t
+ * a Throwable if one exists or null
+ */
+ public static void messageDialog(final String title,
+ final Object source,
+ final String message,
+ final Throwable t,
+ boolean async) {
+ if(async) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(AbstractUtility.getShell(), title, message + getCauseRecursively(t));
+ Class<? extends Object> clazz = source != null ? source
+ .getClass() : this.getClass();
+ error(clazz, message, t);
+ }
+
+
+ });
+ } else {
+ MessageDialog.openError(AbstractUtility.getShell(), title, message + getCauseRecursively(t));
+ Class<? extends Object> clazz = source != null ? source.getClass() : TaxeditorStorePlugin.class;
+ error(clazz, message, t);
+ }
+ }
+
+ public static String getCauseRecursively(Throwable t) {
+ if(t == null){
+ return "";
+ }
+
+ if(t.getCause() != null){
+ return getCauseRecursively(t.getCause());
+ }else{
+ return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
+ }
+
+ }
+ /**
+ * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param termBase
+ * @param status
+ */
+ public static void warningDialog(String title, Object source,
+ IStatus status) {
+ MessagingUtils.warningDialog(title, source, status.getMessage());
+ }
+
+ /**
+ * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * The dialogs title
+ * @param source
+ * The object where the warning was generated (used by log4j)
+ * @param message
+ * An informative String to be presented to the user
+ */
+ public static void warningDialog(final String title, final Object source, final String message) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openWarning(AbstractUtility.getShell(), title, message);
+ Class<? extends Object> clazz = source != null ? source
+ .getClass() : AbstractUtility.class;
+ warn(clazz, message);
+ }
+ });
+ }
+
+ /**
+ * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * @param status
+ */
+ public static void informationDialog(final String title, final IStatus status) {
+ MessagingUtils.informationDialog(title, status.getMessage());
+ }
+
+ /**
+ * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+ *
+ * @param title
+ * a {@link java.lang.String} object.
+ * @param message
+ * a {@link java.lang.String} object.
+ */
+ public static void informationDialog(final String title,
+ final String message) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openInformation(AbstractUtility.getShell(), title, message);
+ }
+ });
+ }
+
+ /**
+ * Open a message box that informs the user about unimplemented
+ * functionality. This method is for developer convenience.
+ *
+ * @param source
+ * a {@link java.lang.Object} object.
+ */
+ public static void notImplementedMessage(Object source) {
+ warningDialog("Not yet implemented", source,
+ "This functionality is not yet implemented.");
+ }
}
IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES,
"Show experimental features", getFieldEditorParent()));
addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
- "Open search results in separate windows",
- getFieldEditorParent()));
-
+ "Open search results in separate windows",
+ getFieldEditorParent()));
}
/*
public void setEntity(T entity) {
this.entity = entity;
// the id is always 0 if the entity was not yet saved, so it is new in this case
- if(StoreUtil.getCdmEntity(getEntity()).getId() == 0) {
+ if(getEntity() == null || StoreUtil.getCdmEntity(getEntity()).getId() == 0) {
// new entity, not yet saved
requiredCrud = EnumSet.of(CRUD.CREATE);
} else {
* <b>Note:</b> If you use this label provider you need to assure that you
* created a {@link ConversationHolder} resp. have an open session because
* the labels are generated from various fields of the derivate hierarchy which
- * are lazy loaded and could therefore throw a {@link LazyInitializationException}.
+ * are lazy loaded and could therefore throw a {@link LazyInitializationException}.<br>
+ * Use <b>{@link #setConversation(ConversationHolder)}</b> to assign the session to this provider.
*/
public class DerivateLabelProvider extends ColumnLabelProvider {
private Set<SingleRead> multiLinkSingleReads;
+ private ConversationHolder conversation;
+
private static DefinedTerm photoTerm = null;
private static DefinedTerm drawingTerm = null;
private static DefinedTerm specimenScanTerm = null;
return getDerivateText(element);
}
+ /**
+ * @param conversation the conversation to set
+ */
+ public void setConversation(ConversationHolder conversation) {
+ this.conversation = conversation;
+ }
+
/**
*
* @param element
* @return
*/
- public static String getDerivateText(Object element){
+ public String getDerivateText(Object element){
if(element instanceof TreeNode){
//unwrap specimen from TreeNode
element = ((TreeNode) element).getValue();
}
+ conversation.bind();
+
String label = "";
if(element instanceof FieldUnit){
FieldUnit fieldUnit = (FieldUnit)element;
- GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
- if(gatheringEvent!=null){
+ if(fieldUnit.getGatheringEvent()!=null){
+ GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
+ if(!conversation.getSession().contains(gatheringEvent)){
+ fieldUnit = (FieldUnit) CdmStore.getService(IOccurrenceService.class).load(fieldUnit.getUuid());
+ gatheringEvent = fieldUnit.getGatheringEvent();
+ }
label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+", ":"";
label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+", ":"";
label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+", ":"";
}
else if(element instanceof MediaSpecimen){
MediaSpecimen mediaSpecimen = (MediaSpecimen)element;
- label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
- label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
+ if(mediaSpecimen.getMediaSpecimen()!=null){
+ label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
+ label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
+ }
label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+", ":"";
Collection collection = mediaSpecimen.getCollection();
if(collection!=null){
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.handlers.IHandlerService;
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
private final DerivateSearchComposite derivateSearchComposite;
private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>> configurator;
private EnumTermComboController<SpecimenOrObservationType> enumTermComboController;
+ private DerivateLabelProvider labelProvider;
/**
* @param parent
TableViewer resultViewer = derivateSearchComposite.getResultViewer();
resultViewer.setContentProvider(new ArrayContentProvider());
- resultViewer.setLabelProvider(new DerivateLabelProvider());
+ labelProvider = new DerivateLabelProvider();
+ resultViewer.setLabelProvider(labelProvider);
resultViewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
derivateSearchComposite.getResultViewer().getControl().setFocus();
}
+ /**
+ * @param conversationHolder
+ */
+ public void setConversation(ConversationHolder conversationHolder) {
+ labelProvider.setConversation(conversationHolder);
+ }
+
}
private void initConversation(){
if(conversationHolder==null){
conversationHolder = CdmStore.createConversation();
+ derivateSearchCompositeController.setConversation(conversationHolder);
}
}
<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="3.3.8.SNAPSHOT">
- <aboutInfo>
- <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
- <text>
+<?pde version="3.5"?>
+
+<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="3.3.8.qualifier" useFeatures="true" includeLaunchers="true">
+
+ <aboutInfo>
+ <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
+ <text>
%productBlurb
</text>
- </aboutInfo>
- <configIni use="default"></configIni>
- <launcherArgs>
- <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080</programArgs>
- <vmArgs>-Xmx512M -XX:MaxPermSize=256M</vmArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
- <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
- <splash location="eu.etaxonomy.taxeditor.application" startupForegroundColor="000000" startupMessageRect="7,432,360,20" startupProgressRect="5,447,366,15"/>
- <launcher name="TaxonomicEditor">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
- <vm></vm>
- <license>
- <url>http://www.mozilla.org/MPL/</url>
- <text>
+ </aboutInfo>
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080</programArgs>
+ <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow</vmArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
+
+ <splash
+ location="eu.etaxonomy.taxeditor.application"
+ startupProgressRect="5,447,366,15"
+ startupMessageRect="7,432,360,20"
+ startupForegroundColor="000000" />
+ <launcher name="TaxonomicEditor">
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ </vm>
+
+ <!--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 &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.
</text>
- </license>
- <plugins></plugins>
- <features>
- <feature id="eu.etaxonomy.taxeditor.feature"/>
- </features>
- <configurations>
- <plugin autoStart="true" id="eu.etaxonomy.taxeditor.application" startLevel="4"/>
- </configurations>
+ </license -->
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="eu.etaxonomy.taxeditor.feature"/>
+ </features>
+
+ <configurations>
+ <plugin id="eu.etaxonomy.taxeditor.application" autoStart="true" startLevel="5" />
+ <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.p2.transport.ecf" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
+ </configurations>
+
</product>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
- </parent>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-parent</artifactId>
+ <version>3.3.8-SNAPSHOT</version>
+ </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>eu.etaxonomy.taxeditor</artifactId>
- <packaging>eclipse-repository</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eu.etaxonomy.taxeditor</artifactId>
+ <packaging>eclipse-repository</packaging>
- <name>EDIT Taxonomic Editor Product</name>
- <description>The EDIT Taxonomic Desktop Editor</description>
- <url>http://wp5.e-taxonomy.eu/taxeditor</url>
+ <name>EDIT Taxonomic Editor Product</name>
+ <description>The EDIT Taxonomic Desktop Editor</description>
+ <url>http://wp5.e-taxonomy.eu/taxeditor</url>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-p2-director-plugin</artifactId>
- <version>${tycho.version}</version>
- <executions>
- <execution>
- <id>materialize-products</id>
- <goals>
- <goal>materialize-products</goal>
- </goals>
- </execution>
- <execution>
- <id>archive-products</id>
- <goals>
- <goal>archive-products</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <products>
- <product>
- <id>eu.etaxonomy.taxeditor.product</id>
- <rootFolder>EDIT Taxonomic Editor</rootFolder>
- </product>
- </products>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-director-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <executions>
+ <execution>
+ <id>materialize-products</id>
+ <goals>
+ <goal>materialize-products</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>archive-products</id>
+ <goals>
+ <goal>archive-products</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <products>
+ <product>
+ <id>eu.etaxonomy.taxeditor.product</id>
+ <rootFolder>EDIT Taxonomic Editor</rootFolder>
+ </product>
+ </products>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>signJars</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jarsigner-plugin</artifactId>
+ <version>1.3.2</version>
+ <configuration>
+ <alias>editor</alias>
+ <removeExistingSignatures>true</removeExistingSignatures>
+ <!-- keystore properties should be set in the ~/.m2/settings.xml -->
+ <keystore>${keystore.path}</keystore>
+ <storepass>${keystore.store.password}</storepass>
+ <keypass>${keystore.key.password}</keypass>
+
+ <archiveDirectory>${project.build.directory}/repository</archiveDirectory>
+ <!-- Following two settings are to ensure that the product
+ .zip files are not signed -->
+ <processMainArtifact>false</processMainArtifact>
+ <processAttachedArtifacts>false</processAttachedArtifacts>
+ <includes>
+ <include>plugins/eu.etaxonomy.taxeditor*.jar</include>
+ <include>features/eu.etaxonomy.taxeditor*.jar</include>
+ </includes>
+ <arguments>
+ <!-- Due to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=378155
+ we need to force the signature / digest algorithm to SHA1 since this is the
+ only one which plays well with Eclipse 3.x -->
+ <argument>-sigalg</argument>
+ <argument>SHA1withDSA</argument>
+ <argument>-digestalg</argument>
+ <argument>SHA1</argument>
+ </arguments>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign</id>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!-- Upload the repo to the server -->
+ <id>uploadRepo</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>wagon-maven-plugin</artifactId>
+ <version>1.0-beta-3</version>
+ <!-- Problems with the wagon-maven-plugin have been encounterd
+ on Windows, it should work properly on linux though. -->
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>upload</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <fromDir>${project.build.directory}/repository</fromDir>
+ <url>scpexe://wp5.e-taxonomy.eu/var/www/download/taxeditor/update/${update.dir}</url>
+ <includes>binary/*,content.jar,artifacts.jar,**/eu.etaxonomy.*.jar</includes>
+ <!-- Comment out the above and uncomment the below to upload
+ all jars -->
+ <!-- <includes>**/*</includes> -->
+ <serverId>wp5.e-taxonomy.eu</serverId>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.0</maven>
<artifactId>taxeditor-parent</artifactId>
<version>3.3.8-SNAPSHOT</version>
<name>EDIT Taxonomic Editor</name>
- <description>The Taxonomic Editor for EDIT's platform for cybertaxonomy</description>
+ <description>The Taxonomic Editor for EDIT's platform for
+ cybertaxonomy</description>
<url>http://cybertaxonomy.eu/taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor/</url>
<inceptionYear>2007</inceptionYear>
<packaging>pom</packaging>
<!-- TODO can we use project.version ????? -->
<tycho.version>0.14.0</tycho.version>
<taxeditor.version>3.3.8-SNAPSHOT</taxeditor.version>
+ <update.dir>snapshot</update.dir>
</properties>
<modules>
<module>eu.etaxonomy.taxeditor.cdmlib</module>
<module>eu.etaxonomy.taxeditor.editor</module>
<module>eu.etaxonomy.taxeditor.bulkeditor</module>
<module>eu.etaxonomy.taxeditor.printpublisher</module>
- <!--module>eu.etaxonomy.taxeditor.annotatedlineeditor</module-->
<module>eu.etaxonomy.taxeditor.help</module>
<module>eu.etaxonomy.taxeditor.application</module>
<module>eu.etaxonomy.taxeditor.feature.platform</module>
<module>eu.etaxonomy.taxeditor.feature</module>
<module>eu.etaxonomy.taxeditor</module>
+
</modules>
<scm>
<connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/taxeditor/</connection>
<mailingList>
<name>EDIT Taxonomic Editor</name>
<subscribe>
- edit-taxonomic-editor+subscribe@googlegroups.com
- </subscribe>
+ edit-taxonomic-editor+subscribe@googlegroups.com
+ </subscribe>
<unsubscribe>
- edit-taxonomic-editor+unsubscribe@googlegroups.com
- </unsubscribe>
+ edit-taxonomic-editor+unsubscribe@googlegroups.com
+ </unsubscribe>
<post>edit-taxonomic-editor@googlegroups.com</post>
<archive>http://groups.google.com/group/edit-taxonomic-editor/topics</archive>
</mailingList>
<!-- your SVN account id please! -->
<id>a.kohlbecker</id>
<name>
- Andreas Kohlbecker
- </name>
+ Andreas Kohlbecker
+ </name>
<email>a.kohlbecker [at] bgbm.org</email>
<organization>
- Botanic Garden Botanical Museum Berlin
- </organization>
+ Botanic Garden Botanical Museum Berlin
+ </organization>
<organizationUrl>http://www.bgbm.org/BioDivInf/</organizationUrl>
<timezone>+1</timezone>
<roles>
<role>Java Developer</role>
<role>Architect</role>
</roles>
- <url/>
+ <url />
</developer>
<developer>
<!-- your SVN account id please! -->
<id>a.mueller</id>
<name>
- Andreas Müller
- </name>
+ Andreas Müller
+ </name>
<email>a.mueller [at] bgbm.org</email>
<organization>
- Botanic Garden Botanical Museum Berlin
- </organization>
+ Botanic Garden Botanical Museum Berlin
+ </organization>
<organizationUrl>http://www.bgbm.org/BioDivInf/</organizationUrl>
<timezone>+1</timezone>
<roles>
<role>Java Developer</role>
<role>Architect</role>
</roles>
- <url/>
+ <url />
</developer>
</developers>
<issueManagement>
<strictVersions>true</strictVersions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <includeAllDependencies>true</includeAllDependencies>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
<autoVersionSubmodules>false</autoVersionSubmodules>
- <!--preparationGoals>clean verify install</preparationGoals-->
- <!--goals>deploy</goals-->
+ <!--preparationGoals>clean verify install</preparationGoals -->
+ <!--goals>deploy</goals -->
<!-- skipping site-deploy by explicitly configuring the goal here -->
<tagBase>http://dev.e-taxonomy.eu/svn/tags/taxeditor</tagBase>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <version>1.0-beta-3</version>
- <!--
- Problems with the wagon-maven-plugin have been encounterd on Windows,
- it should work properly on linux though.
- -->
- <executions>
- <execution>
- <phase>deploy</phase>
- <goals>
- <goal>upload</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <fromDir>eu.etaxonomy.taxeditor/target/products</fromDir>
- <includes>*.zip</includes>
- <url>scpexe://wp5.e-taxonomy.eu/var/www/download/taxeditor/${project.version}</url>
- <serverId>wp5.e-taxonomy.eu</serverId>
- </configuration>
- </plugin>
+
</plugins>
<extensions>
<extension>
</configuration>
</plugin>
<plugin>
- <!-- this will generate an indexed and cross-referenced HTML version of your source code -->
+ <!-- this will generate an indexed and cross-referenced HTML version
+ of your source code -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</reporting>
- <!-- DISTRIBUTION MANAGEMENT -->
+ <!-- DISTRIBUTION MANAGEMENT -->
<distributionManagement>
<site>
<id>wp5.e-taxonomy.eu</id>
<url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/mavenrepo/</url>
</repository>
</distributionManagement>
+
</project>