name="Descriptive">\r
</perspective>\r
</extension>\r
- <extension\r
- point="org.eclipse.ui.editors">\r
- <editor\r
- class="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor"\r
- default="false"\r
- id="eu.etaxonomy.taxeditor.editor.multipagetaxoneditor"\r
- name="Multitabbed Taxon Editor">\r
- </editor>\r
- </extension>\r
<!--extension\r
point="org.eclipse.ui.views">\r
<view\r
locationURI="menu:org.eclipse.ui.main.menu">\r
<menu\r
id="org.eclipse.ui.main.menu.file"\r
- label="File">\r
+ label="General">\r
</menu>\r
<menu\r
id="org.eclipse.ui.main.menu.edit"\r
</menuContribution>\r
<menuContribution\r
locationURI="menu:org.eclipse.ui.main.menu.window">\r
+ <separator\r
+ name="taxeditor-application.windowMenu.last"\r
+ visible="true">\r
+ </separator>\r
<command\r
commandId="org.eclipse.ui.window.preferences"\r
label="Preferences"\r
point="org.eclipse.ui.activities">\r
<activity\r
description="Disable unwanted eclipse UI"\r
- id="com.test.ui.disable"\r
+ id="eu.etaxonomy.taxeditor.disable"\r
name="Disable">\r
</activity>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.project">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.file">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.folder">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
pattern="org\.eclipse\.ui\.editors/org\.eclipse\.ui\.editors\.wizards\.UntitledTextFileWizard">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
- pattern="org\.eclipse\.search.*">\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\..*externaltools.*">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
- pattern="org\.eclipse\..*externaltools.*">\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.debug.*">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
- pattern="org\.eclipse\.ui\.run">\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.team.*">\r
</activityPatternBinding>\r
<activityPatternBinding\r
- activityId="com.test.ui.disable"\r
- pattern="org\.eclipse\.debug.*">\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.ant.*">\r
+ </activityPatternBinding>\r
+ <activityPatternBinding\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.pde.*">\r
+ </activityPatternBinding>\r
+ <activityPatternBinding\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.jdt.*">\r
+ </activityPatternBinding>\r
+ <activityPatternBinding\r
+ activityId="eu.etaxonomy.taxeditor.disable"\r
+ pattern="org\.eclipse\.search.*">\r
</activityPatternBinding>\r
</extension>\r
- <extension\r
- point="org.eclipse.ui.views">\r
- <view\r
- category="org.eclipse.ui"\r
- class="org.eclipse.ui.ExtensionFactory:progressView"\r
- id="org.eclipse.ui.views.ProgressView"\r
- name="Progress View"\r
- restorable="true">\r
- </view>\r
- </extension>\r
\r
</plugin>\r
package eu.etaxonomy.taxeditor;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+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.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.operations.UpdateOperation;
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.dialogs.LoginDialog;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
configurer.setTitle("EDIT Taxonomic Editor");
configurer.setShowProgressIndicator(true);
}
-
+
/**
* <p>postWindowOpen</p>
*/
if(PreferencesUtil.shouldConnectAtStartUp())
CdmStore.connect();
-
+
automaticUpdate();
-
+
}
-
+
private int authenticate(){
Shell shell = TaxonomicEditorPlugin.getDefault().getWorkbench()
- .getActiveWorkbenchWindow().getShell();
-
+ .getActiveWorkbenchWindow().getShell();
+
LoginDialog loginDialog = new LoginDialog(shell);
return loginDialog.open();
}
-
+
private void automaticUpdate(){
- final IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(TaxonomicEditorPlugin.bundleContext,
- IProvisioningAgent.SERVICE_NAME);
- if (agent == null) {
- ApplicationUtil.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
+
+ ServiceReference sr = Activator.context.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME);
+ IProvisioningAgentProvider agentProvider = null;
+ if (sr == null)
return;
- }
-
- //StoreUtil.warningDialog("Updates", "Searching for updates");
- // check for updates before starting up.
- // If an update is performed, restart. Otherwise log
- // the status.
-
-
-
-
-// IRunnableWithProgress runnable = new IRunnableWithProgress() {
-// public void run(IProgressMonitor monitor)
-// throws InvocationTargetException, InterruptedException {
-//
- UpdateOperation operation = null;
- try{
- 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.
- operation = new UpdateOperation(session);
-// SubMonitor sub = SubMonitor.convert(monitor,
-// "Checking for application updates...", 200);
- IStatus status = operation.resolveModal(null);//sub.newChild(100));
-
- if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
- PlatformUI.getWorkbench().getDisplay()
- .asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openInformation(null,
- "Updates", "No updates were found");
- }
- });
- }
- if (status.getSeverity() == IStatus.CANCEL){
- ApplicationUtil.info(status);
-// 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){
- ApplicationUtil.info(status);
-// StoreUtil.warningDialog("Updates", status.toString());
- return;
-// throw new OperationCanceledException();
- }
-
- status = job.runModal(null);//sub.newChild(100));
- if (status.getSeverity() == IStatus.CANCEL){
- ApplicationUtil.info(status);
-// throw new OperationCanceledException();
- }
- }
-
-// StoreUtil.warningDialog("Performing update", "");
-
-// StoreUtil.warningDialog("Updates", status.toString());
-
- }catch(Exception e){
- ApplicationUtil.error(this.getClass(), e);
- }
+ agentProvider = (IProvisioningAgentProvider) Activator.context.getService(sr);
+ IProvisioningAgent agent = null;
+ try {
+ agent = agentProvider.createAgent(null);//new URI("file:/Applications/eclipse36/p2"));
+ if (agent == null) {
+ ApplicationUtil.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
+ return;
}
-// };
-// try {
-// new ProgressMonitorDialog(null).run(true, true, runnable);
-// } catch (InvocationTargetException e) {
-// e.printStackTrace();
-// } catch (InterruptedException e) {
-// }
-
+ IStatus status = P2Util.checkForUpdates(agent, null);
+
+ ApplicationUtil.info(status);
+ } catch (ProvisionException e) {
+ ApplicationUtil.error(getClass(), e);
+ } finally {
+ if(agent != null) agent.stop();
+ }
}
+}
-
<extension\r
point="org.eclipse.ui.menus">\r
<menuContribution\r
- locationURI="menu:org.eclipse.ui.main.menu?before=org.eclipse.ui.main.menu.window">\r
+ locationURI="menu:org.eclipse.ui.main.menu.window?before=taxeditor-application.windowMenu.last">\r
<menu\r
id="bulkeditor.menus.openmenu"\r
label="Bulk Editor">\r
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.PaintEvent;
}
});
return Status.OK_STATUS;
- }catch (IOException e) {
- EditorUtil.error(getClass(), e);
- } catch (HttpException e) {
- EditorUtil.error(getClass(), e);
+ }catch (Exception e) {
+ EditorUtil.errorDialog("Could not load image", getClass(), e.getMessage(), e);
}
return Status.CANCEL_STATUS;
}
ws="cocoa,gtk,win32"
arch="x86">
- <license url="http://www.example.com/license">
- [Enter License Description here.]
+ <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>
<url>
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.pde.runtime"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
#
# Where all the output should go
-buckminster.output.root=${user.home}/taxeditor
+buckminster.output.root=${user.home}/tmp
# Where the temp files should go
buckminster.temp.root=${user.home}/tmp/taxeditor.tmp
# local.sign=true
# Should source bundles be built and included
-cbi.include.source=false
+#cbi.include.source=false
# What platforms should be built, * for "all"
-#target.os=*
-#target.ws=*
-#target.arch=*
+target.os=*
+target.ws=*
+target.arch=*
-bin.includes = feature.xml,\
- plugin_customization.ini
-category.id.taxeditor = EDIT Taxonomic Editor
+bin.includes = feature.xml
category.members.taxeditor = eu.etaxonomy.taxeditor.product.feature
+category.id.taxeditor = EDIT Taxonomic Editor
category.description.taxeditor = Demo build of RCP taxeditor with p2 managment
<project>
- <pathconvert property="equinox.launcher.jar">
+ <property name="eclipse.home" value="/Applications/eclipse-helios"/>
+
+ <pathconvert property="equinox.launcher.jar">
<first count="1">
<sort>
<fileset dir="${eclipse.home}/plugins" includes="**/org.eclipse.equinox.launcher_*.jar"/>
id="eu.etaxonomy.taxeditor.feature.platform"
version="0.0.0"/>
- <plugin
- id="eu.etaxonomy.cdmlib"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.equinox.ds"/>
+ <import plugin="org.eclipse.equinox.util"/>
+ <import plugin="org.eclipse.equinox.p2.core"/>
+ <import plugin="org.eclipse.equinox.p2.ui"/>
+ <import plugin="org.eclipse.equinox.p2.ui.sdk"/>
+ <import plugin="org.eclipse.equinox.p2.updatechecker"/>
+ <import plugin="org.eclipse.equinox.p2.operations"/>
+ <import plugin="org.eclipse.equinox.app"/>
+ <import plugin="org.eclipse.osgi"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.core.expressions"/>
+ <import plugin="eu.etaxonomy.taxeditor.cdmlib" version="3.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.ui.forms"/>
+ <import plugin="org.eclipse.core.databinding.beans"/>
+ <import plugin="org.eclipse.core.databinding.observable"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.jface.databinding"/>
+ <import plugin="org.eclipse.ui.navigator"/>
+ <import plugin="org.eclipse.ui.navigator.resources"/>
+ <import plugin="org.eclipse.core.jobs"/>
+ <import plugin="org.eclipse.pde.runtime"/>
+ <import plugin="org.junit"/>
+ <import plugin="org.eclipse.core.commands"/>
+ <import plugin="org.eclipse.jface"/>
+ <import plugin="org.eclipse.swt"/>
+ <import plugin="org.eclipse.equinox.common" version="3.6.0" match="greaterOrEqual"/>
+ </requires>
<plugin
id="eu.etaxonomy.taxeditor.application"
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="eu.etaxonomy.taxeditor.cdmlib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
-<product name="%productName" uid="eu.etaxonomy.taxeditor" id="eu.etaxonomy.taxeditor.application.product" application="eu.etaxonomy.taxeditor.application.application" version="3.0" useFeatures="true" includeLaunchers="true">
+<product name="%productName" uid="eu.etaxonomy.taxeditor" id="eu.etaxonomy.taxeditor.application.product" application="eu.etaxonomy.taxeditor.application.application" version="3.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<aboutInfo>
<text>
<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>
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.navigator.IDescriptionProvider;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.taxon.Classification;
/**
package eu.etaxonomy.taxeditor.navigation.navigator;
+import java.util.Arrays;
import java.util.List;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.ui.IElementFactory;
*/
public class Root extends PlatformObject implements IAdaptable, IPersistableElement, IElementFactory {
- private static final Logger logger = Logger.getLogger(Root.class);
-
private ConversationHolder conversation;
/**
* @return a {@link java.util.List} object.
*/
public List<Classification> getParentBeans() {
- List<Classification> classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
+ List<String> propertyPaths = Arrays.asList(new String[]{"name"});
+
+ List<Classification> classifications = CdmStore.getClassificationService().list(null, null, null, null, propertyPaths);
if(classifications.size() == 0){
CdmStore.createDefaultClassification(conversation);
- classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
+ classifications = CdmStore.getClassificationService().list(null, null, null, null, propertyPaths);
}
return classifications;
<extension
point="org.eclipse.ui.menus">
<menuContribution
- locationURI="menu:org.eclipse.ui.main.menu.window">
+ locationURI="menu:org.eclipse.ui.main.menu.window?before=taxeditor-application.windowMenu.last">
<menu
id="eu.etaxonomy.taxeditor.menu.showView"
label="Show View">
+ <separator
+ name="eu.etaxonomy.taxeditor.store.showViewMenu.internal"
+ visible="true">
+ </separator>
<command
commandId="eu.etaxonomy.taxeditor.store.operations.showDatasourceView"
label="Datasource"
style="push">
</command>
</menu>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
<command
commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
label="Login"
style="push">
</command>
+ <separator
+ name="eu.etaxonomy.taxeditor.application.filemenu.login"
+ visible="true">
+ </separator>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.store.datasource.datasourceView">
name="SDD">
</wizard>
</extension>
- <extension
- point="org.eclipse.ui.activities">
- <activity
- description="Test"
- id="test.Export"
- name="Test"/>
- <activityPatternBinding
- activityId="test.Export"
- pattern="org\.eclipse\.ui\.wizard\.export\.*/org\.eclipse\.ui\.wizard\.import\.*"/>
- <categoryActivityBinding
- activityId="test.Export"
- categoryId="test.category"/>
- <category
- id="test.category"
- name="testCategory">
- </category>
- </extension>
<extension
point="org.eclipse.ui.themes">
<themeElementCategory
public void run() {
MessageDialog.openWarning(getShell(), title, message);
- warn(source.getClass(), message);
+ Class<? extends Object> clazz = source != null ? source.getClass() : AbstractUtility.class;
+ warn(clazz, message);
}
});
}
public void run() {
MessageDialog.openError(getShell(), title, message);
- error(source.getClass(), message, t);
+ Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
+ error(clazz, message, t);
}
});
}
private TaxonNameBase taxonNameBase;
- private List<INomenclaturalReference> duplicateReferences;
- private List<INomenclaturalReference> duplicateInReferences;
-
- private List<TaxonNameBase> duplicateNames;
+ private class MatchMatrix {
+ List<TaxonNameBase> duplicateNames = new ArrayList<TaxonNameBase>();
+
+ List<INomenclaturalReference> duplicateReferences = new ArrayList<INomenclaturalReference>();
+ List<INomenclaturalReference> duplicateInReferences = new ArrayList<INomenclaturalReference>();
- private List<TeamOrPersonBase> duplicateCombinationAuthorTeams;
- private List<TeamOrPersonBase> duplicateExCombinationAuthorTeams;
- private List<TeamOrPersonBase> duplicateBasionymAuthorTeams;
- private List<TeamOrPersonBase> duplicateExBasionymAuthorTeams;
+ List<TeamOrPersonBase> duplicateCombinationAuthorTeams = new ArrayList<TeamOrPersonBase>();
+ List<TeamOrPersonBase> duplicateExCombinationAuthorTeams = new ArrayList<TeamOrPersonBase>();
+ List<TeamOrPersonBase> duplicateBasionymAuthorTeams = new ArrayList<TeamOrPersonBase>();
+ List<TeamOrPersonBase> duplicateExBasionymAuthorTeams = new ArrayList<TeamOrPersonBase>();
+ }
private static NonViralNameParserImpl nonViralNameParser = NonViralNameParserImpl.NewInstance();
/**
* Parses a given string and returns a <code>TaxonNameBase</code> instance with the
- * reuslts of the parsing.
+ * results of the parsing.
*
* This method should be used to quickly create a new name from a string.
* Wherever the string will be parsed again in subsequent editing, an instance
*/
public NonViralName parse(){
-
String unparsedNameString = "";
try {
Method getText;
*/
public NonViralName parseAndResolveDuplicates(){
- parse();
+ NonViralName parsedName = parse();
- findMatches(name);
+ MatchMatrix matchMatrix = findMatches(parsedName);
- resolveDuplicates(name);
+ resolveDuplicates(parsedName, matchMatrix);
- return name;
+ return parsedName;
}
/**
* @param name The name to resolve duplicates for.
*/
- private void resolveDuplicates(NonViralName name) {
- resolveDuplicateNames(name);
+ private void resolveDuplicates(NonViralName name, MatchMatrix matchMatrix) {
+ resolveDuplicateNames(name, matchMatrix);
- resolveAllDuplicateAuthors(name);
+ resolveAllDuplicateAuthors(name, matchMatrix);
- resolveDuplicateReferences(name);
+ resolveDuplicateReferences(name, matchMatrix);
- if(duplicateInReferences != null)
- resolveDuplicateInReferences(name);
+ if(matchMatrix.duplicateInReferences != null)
+ resolveDuplicateInReferences(name, matchMatrix);
}
/**
* @param name The name to resolve duplicates for.
*/
- private void resolveDuplicateNames(NonViralName name) {
+ private void resolveDuplicateNames(NonViralName name, MatchMatrix matchMatrix) {
- if (duplicateNames.size() == 1){
- name = (NonViralName) duplicateNames.iterator().next();
- }else if(duplicateNames.size() > 1){
+ if (matchMatrix.duplicateNames.size() == 1){
+ name = (NonViralName) matchMatrix.duplicateNames.iterator().next();
+ }else if(matchMatrix.duplicateNames.size() > 1){
// FIXME TODO resolve multiple duplications. Use first match for a start
- name = (NonViralName) duplicateNames.iterator().next();
+ name = (NonViralName) matchMatrix.duplicateNames.iterator().next();
}
}
/**
* @param name The name to resolve duplicates for.
*/
- private void resolveDuplicateReferences(NonViralName name) {
- if(duplicateReferences.size() == 1){
+ private void resolveDuplicateReferences(NonViralName name, MatchMatrix matchMatrix) {
+ if(matchMatrix.duplicateReferences.size() == 1){
// exactly one match. We assume that the user wants this reference
- INomenclaturalReference duplicate = duplicateReferences.iterator().next();
+ INomenclaturalReference duplicate = matchMatrix.duplicateReferences.iterator().next();
name.setNomenclaturalReference(duplicate);
- }else if(duplicateReferences.size() > 1){
+ }else if(matchMatrix.duplicateReferences.size() > 1){
// FIXME TODO resolve multiple duplications. Use first match for a start
- INomenclaturalReference duplicate = duplicateReferences.iterator().next();
+ INomenclaturalReference duplicate = matchMatrix.duplicateReferences.iterator().next();
name.setNomenclaturalReference(duplicate);
}
}
/**
* @param name The name to resolve duplicates for.
*/
- private void resolveDuplicateInReferences(NonViralName name) {
+ private void resolveDuplicateInReferences(NonViralName name, MatchMatrix matchMatrix) {
Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
- if(duplicateInReferences.size() > 0){
- Reference inReference = (Reference) duplicateInReferences.iterator().next();
+ if(matchMatrix.duplicateInReferences.size() > 0){
+ Reference inReference = (Reference) matchMatrix.duplicateInReferences.iterator().next();
reference.setInReference(inReference);
StoreUtil.warn(this.getClass(), reference.generateTitle());
// FIXME TODO resolve multiple duplications. We use first match for a start
/**
* @param name The name to resolve duplicates for.
*/
- private void resolveAllDuplicateAuthors(NonViralName name) {
+ private void resolveAllDuplicateAuthors(NonViralName name, MatchMatrix matchMatrix) {
- if(duplicateCombinationAuthorTeams.size() > 0){
- name.setCombinationAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
+ if(matchMatrix.duplicateCombinationAuthorTeams.size() > 0){
+ name.setCombinationAuthorTeam(matchMatrix.duplicateCombinationAuthorTeams.iterator().next());
Reference reference = (Reference) name.getNomenclaturalReference();
if(reference != null){
- reference.setAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
+ reference.setAuthorTeam(matchMatrix.duplicateCombinationAuthorTeams.iterator().next());
}
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
- if(duplicateExCombinationAuthorTeams.size() > 0){
- name.setExCombinationAuthorTeam(duplicateExCombinationAuthorTeams.iterator().next());
+ if(matchMatrix.duplicateExCombinationAuthorTeams.size() > 0){
+ name.setExCombinationAuthorTeam(matchMatrix.duplicateExCombinationAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
- if(duplicateBasionymAuthorTeams.size() > 0){
- name.setBasionymAuthorTeam(duplicateBasionymAuthorTeams.iterator().next());
+ if(matchMatrix.duplicateBasionymAuthorTeams.size() > 0){
+ name.setBasionymAuthorTeam(matchMatrix.duplicateBasionymAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
- if(duplicateExBasionymAuthorTeams.size() > 0){
- name.setExBasionymAuthorTeam(duplicateExBasionymAuthorTeams.iterator().next());
+ if(matchMatrix.duplicateExBasionymAuthorTeams.size() > 0){
+ name.setExBasionymAuthorTeam(matchMatrix.duplicateExBasionymAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
}
*
* @param name The NonViralName to find matches for.
*/
- private void findMatches(NonViralName name){
+ private MatchMatrix findMatches(NonViralName name){
+
+ MatchMatrix matchMatrix = new MatchMatrix();
- duplicateNames = findMatchingLatinNames(name);
+ matchMatrix.duplicateNames = findMatchingLatinNames(name);
- duplicateCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getCombinationAuthorTeam());
- duplicateExCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExCombinationAuthorTeam());
- duplicateBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getBasionymAuthorTeam());
- duplicateExBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExBasionymAuthorTeam());
+ matchMatrix.duplicateCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getCombinationAuthorTeam());
+ matchMatrix.duplicateExCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExCombinationAuthorTeam());
+ matchMatrix.duplicateBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getBasionymAuthorTeam());
+ matchMatrix.duplicateExBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExBasionymAuthorTeam());
INomenclaturalReference nomenclaturalReference = name.getNomenclaturalReference();
Reference inReference = ((Reference)nomenclaturalReference).getInReference();
if(inReference != null){
doResolveInReferences = true;
- duplicateInReferences = findMatchingNomenclaturalReference(inReference);
+ matchMatrix.duplicateInReferences = findMatchingNomenclaturalReference(inReference);
}
}
- duplicateReferences = findMatchingNomenclaturalReference(nomenclaturalReference);
+ matchMatrix.duplicateReferences = findMatchingNomenclaturalReference(nomenclaturalReference);
+
+ return matchMatrix;
}
/**