// $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.
*/
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
-
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.INullSelectionListener;
-import org.eclipse.ui.ISelectionListener;
-
import org.eclipse.ui.IWorkbenchPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IAgentService;
-import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.IGroupService;
-
import eu.etaxonomy.cdm.api.service.INameService;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.api.service.IReferenceService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.api.service.IUserService;
-
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Group;
-
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
import eu.etaxonomy.taxeditor.model.LineSelection;
/** Constant <code>ID="eu.etaxonomy.taxeditor.bulkeditor.refer"{trunked}</code> */
public static final String ID = "eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects";
-
+
private TableViewer viewer;
private String referencedObjectTitleCache;
- private ConversationHolder conversation;
-
+ private ConversationHolder conversation;
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
*/
viewer.setLabelProvider(new ReferencingObjectsLabelProvider());
// viewer.setInput(new ArrayList<CdmBase>());
}
-
+
/**
* Create the columns for the table
* @param viewer
* @param entity a {@link eu.etaxonomy.cdm.model.common.IdentifiableEntity} object.
*/
public void updateReferencingObjects(final UUID entityUUID, final Class objectClass) {
-
+
final Display display = Display.getCurrent();
-
+
Job job = new Job("Update Referencing Objects") {
-
+
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Calculating referencing objects", 10);
-
+
monitor.worked(3);
-
+
display.asyncExec(new Runnable() {
-
+
@Override
public void run() {
if (entityUUID != null){
-
+
List<CdmBase> referencingObjects = getReferencingObjects(entityUUID, objectClass);
-
+
updateView(referencingObjects);
-
-
+
+
}
}
});
-
+
monitor.done();
-
-
+
+
return Status.OK_STATUS;
}
};
-
+
job.setPriority(Job.DECORATE);
job.schedule();
}
}
//referencedObject =(CdmBase) CdmStore.getService(IIdentifiableEntityService.class).load(referencedObject.getUuid());
Set<CdmBase> setOfReferencingObjects = null;
-
+
if (referencedObject != null){
referencedObjectTitleCache = ((IdentifiableEntity)referencedObject).getTitleCache();
setOfReferencingObjects = CdmStore.getCommonService().getReferencingObjects(referencedObject);
}
if (setOfReferencingObjects != null){
- List<CdmBase> referencingObjects = new ArrayList<CdmBase>(setOfReferencingObjects);
-
+ List<CdmBase> referencingObjects = new ArrayList<CdmBase>(setOfReferencingObjects);
+
Collections.sort(referencingObjects, new ReferencingClassComparator());
-
+
return referencingObjects;
-
+
}
} catch (Exception e) {
logger.error("Error retrieving referencing objects", e);
}
return null;
}
-
+
class ReferencingClassComparator implements Comparator<CdmBase> {
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
- public int compare(CdmBase o1, CdmBase o2) {
+ @Override
+ public int compare(CdmBase o1, CdmBase o2) {
String string1 = o1.getClass().getSimpleName();
String string2 = o2.getClass().getSimpleName();
int classCompare = string1.compareToIgnoreCase(string2);
}
}
}
-
+
/**
- *
+ *
*/
private void updateView(List<CdmBase> referencingObjects) {
if (viewer != null && !viewer.getControl().isDisposed()){
}
/** {@inheritDoc} */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if(! (part instanceof BulkEditor)){
setContentDescription("");
showEmptyPage();
return;
}
-
+
if(! (selection instanceof LineSelection)){
return;
}
LineSelection lineSelection = (LineSelection) selection;
-
+
if(lineSelection.size() != 1){
return;
}
-
+
if(! (lineSelection.getFirstElement() instanceof IdentifiableEntity)){
return;
}
-
+
showViewer(part, lineSelection);
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#showViewer(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
@Override
public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
// this.part = part;
-
+
updateReferencingObjects(((IdentifiableEntity) selection.getFirstElement()).getUuid(),selection.getFirstElement().getClass() );
}
-
+
/** {@inheritDoc} */
@Override
public void dispose() {
selectionService.removePostSelectionListener(this);
selectionService.removeSelectionListener(this);
super.dispose();
-
+
}
/* (non-Javadoc)
public void changed(Object object) {
// no editing in this view
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#onComplete()
*/
public boolean onComplete() {
return false;
}
-
+
public void refresh(){
-
+
selectionService.removePostSelectionListener(this);
selectionService.removeSelectionListener(this);
selectionService.addPostSelectionListener(this);
selectionService.addSelectionListener(this);
-
+
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.cdm.api.application;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmApplicationException extends Exception {
+
+ public CdmApplicationException(Exception ex) {
+ super(ex);
+ }
+
+}
*/
package eu.etaxonomy.cdm.api.application;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+
+import eu.etaxonomy.cdm.api.service.ICommonService;
+import eu.etaxonomy.cdm.api.service.IService;
+
/**
* @author cmathew
* @date 17 Jun 2015
private ICdmApplicationConfiguration appConfig;
+ private ICdmDataChangeService dataChangeService;
+
public static CdmApplicationState getInstance() {
if(cdmApplicationState == null) {
cdmApplicationState = new CdmApplicationState();
return getInstance().getAppConfig();
}
+ /**
+ * @return the dataChangeService
+ */
+ public ICdmDataChangeService getDataChangeService() {
+ return dataChangeService;
+ }
+
+ /**
+ * @param dataChangeService the dataChangeService to set
+ */
+ public void setDataChangeService(ICdmDataChangeService dataChangeService) {
+ this.dataChangeService = dataChangeService;
+ }
+
+ public static ICdmDataChangeService getCurrentDataChangeService() {
+ return getInstance().getDataChangeService();
+ }
+
+ public static void setCurrentDataChangeService(ICdmDataChangeService dataChangeService) {
+ getInstance().setDataChangeService(dataChangeService);
+ }
+
+ public static void dispose() {
+ getInstance().setCurrentDataChangeService(null);
+ getInstance().setAppConfig(null);
+ }
+
+ /**
+ * Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service
+ * interface. If a matching getter is found the according service implementation is returned by
+ * invoking the getter otherwise the method returns <code>null</code>.
+ *
+ * @param <T>
+ * @param serviceClass
+ * @return the configured implementation of <code>serviceClass</code> or <code>null</code>
+ * @throws CdmApplicationException
+ */
+ public static <T extends IService> T getService(Class<T> serviceClass) throws CdmApplicationException {
+ ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+ Method[] methods = ICdmApplicationConfiguration.class.getDeclaredMethods();
+
+ T service = null;
+
+ for (Method method : methods) {
+ Type type = method.getGenericReturnType();
+
+ if (type.equals(serviceClass)) {
+ try {
+ service = (T) method.invoke(configuration, null);
+ break;
+ } catch (IllegalArgumentException iae) {
+ throw new CdmApplicationException(iae);
+ } catch (IllegalAccessException iae) {
+ throw new CdmApplicationException(iae);
+ } catch (InvocationTargetException ite) {
+ throw new CdmApplicationException(ite);
+ }
+ }
+ }
+
+ return service;
+ }
+
+ /**
+ * @see #getService(Class)
+ * As ICommonService is not extending IService we need a specific request here
+ */
+ public static ICommonService getCommonService() {
+ ICdmApplicationConfiguration configuration = getCurrentAppConfig();
+
+ return configuration.getCommonService();
+
+ }
+
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.cdm.api.application;
+
+import java.util.Set;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author cmathew
+ * @date 7 Apr 2015
+ *
+ */
+public class CdmChangeEvent {
+
+ public enum Action {
+ Create,
+ Update,
+ Delete
+ }
+
+ private final Action action;
+ private final Set<? extends CdmBase> changedObjects;
+ private final Class sourceType;
+ private Object source;
+
+ public CdmChangeEvent(Action action, Set<? extends CdmBase> changedObjects, Class sourceType) {
+ this.action = action;
+ this.changedObjects = changedObjects;
+ this.sourceType = sourceType;
+ }
+
+ public CdmChangeEvent(Action action, Set<? extends CdmBase> changedObjects, Object source) {
+ this(action, changedObjects, source.getClass());
+ this.source = source;
+ }
+
+ /**
+ * @return the action
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * @return the changedObjects
+ */
+ public Set<? extends CdmBase> getChangedObjects() {
+ return changedObjects;
+ }
+
+ /**
+ * @return the sourceType
+ */
+ public Class getSourceType() {
+ return sourceType;
+ }
+
+
+ /**
+ * @return the source
+ */
+ public Object getSource() {
+ return source;
+ }
+
+ public boolean hasChanges() {
+ return changedObjects != null && !changedObjects.isEmpty();
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2015 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.cdm.api.application;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmDataChangeService implements ICdmDataChangeService {
+
+ protected final List<ICdmChangeListener> listeners;
+
+ private final List<CdmChangeEvent> currentEvents;
+
+ public CdmDataChangeService() {
+ listeners = new ArrayList<ICdmChangeListener>();
+ currentEvents = new ArrayList<CdmChangeEvent>();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#register(eu.etaxonomy.cdm.api.application.ICdmChangeListener)
+ */
+ @Override
+ public void register(ICdmChangeListener listener) {
+ listeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmDataChangeService#unregister(eu.etaxonomy.cdm.api.application.ICdmChangeListener)
+ */
+ @Override
+ public void unregister(ICdmChangeListener listener) {
+ listeners.remove(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#addEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void addEvent(CdmChangeEvent event) {
+ currentEvents.add(event);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireCurrentChangeEvents(boolean)
+ */
+ @Override
+ public void fireCurrentChangeEvents(boolean async) {
+ try {
+ for(CdmChangeEvent event : currentEvents) {
+ fireChangeEvent(event,async);
+ }
+ } finally {
+ currentEvents.clear();
+ }
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireChangeEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent, boolean)
+ */
+ @Override
+ public void fireChangeEvent(final CdmChangeEvent event, boolean async) {
+
+ for(final ICdmChangeListener listener : listeners) {
+ listener.onChange(event);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#clear()
+ */
+ @Override
+ public void clear() {
+ listeners.clear();
+ currentEvents.clear();
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.cdm.api.application;
+
+/**
+ * @author cmathew
+ * @date 7 Apr 2015
+ *
+ */
+public interface ICdmChangeListener {
+
+ public void onChange(CdmChangeEvent event);
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2015 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.cdm.api.application;
+
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public interface ICdmDataChangeService {
+
+ public abstract void register(ICdmChangeListener listener);
+
+ public abstract void unregister(ICdmChangeListener listener);
+
+ public abstract void addEvent(CdmChangeEvent event);
+
+ public abstract void fireCurrentChangeEvents(boolean async);
+
+ public abstract void fireChangeEvent(CdmChangeEvent event, boolean async);
+
+ public abstract void clear();
+
+}
\ No newline at end of file
// }
}
- /**
- * Register to get updated after any interaction with the datastore
- */
- @Override
- public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer) {
- CdmPostDataChangeObservableListener.getDefault().register(observer);
- }
-
- /**
- * Register to get updated after any interaction with the datastore
- */
- @Override
- public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer) {
- CdmPostDataChangeObservableListener.getDefault().unregister(observer);
- }
+// /**
+// * Register to get updated after any interaction with the datastore
+// */
+// @Override
+// public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer) {
+// CdmPostDataChangeObservableListener.getDefault().register(observer);
+// }
+//
+// /**
+// * Register to get updated after any interaction with the datastore
+// */
+// @Override
+// public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer) {
+// CdmPostDataChangeObservableListener.getDefault().unregister(observer);
+// }
public void dispose() {
cdmTransientEntityCacher.dispose();
- for(ICdmEntitySessionEnabled observer : changeObservers) {
- CdmPostDataChangeObservableListener.getDefault().unregister(observer);
- }
+// for(ICdmEntitySessionEnabled observer : changeObservers) {
+// CdmPostDataChangeObservableListener.getDefault().unregister(observer);
+// }
changeObservers.clear();
cdmEntitySessionManager.remove(sessionOwner);
}
public void bind();
- public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer);
-
- public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer);
+// public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer);
+//
+// public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer);
public void addEvent(ICdmBase cdmBase, Set<CdmBase> affectedObjects, EventType eventType);
import java.util.List;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver;
-public interface ICdmEntitySessionEnabled extends ICdmPostDataChangeObserver {
+public interface ICdmEntitySessionEnabled extends ICdmChangeListener {
public ICdmEntitySession getCdmEntitySession();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#registerForDataStoreChanges(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
- */
- @Override
- public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer) {
-
-
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#unregisterForDataStoreChanges(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
- */
- @Override
- public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer) {
-
- }
+// /* (non-Javadoc)
+// * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#registerForDataStoreChanges(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+// */
+// @Override
+// public void registerForDataStoreChanges(ICdmEntitySessionEnabled observer) {
+//
+//
+// }
+//
+// /* (non-Javadoc)
+// * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#unregisterForDataStoreChanges(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+// */
+// @Override
+// public void unregisterForDataStoreChanges(ICdmEntitySessionEnabled observer) {
+//
+// }
import eu.etaxonomy.cdm.api.service.IService;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
- */
- @Override
- public void update(CdmDataChangeMap changeEvents) {
- // do nothing
-
- }
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.editor.FormEditor;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.CdmBase;
input = (TaxonEditorInput) getEditorInput();
conversation = input.getConversationHolder();
conversation.registerForDataStoreChanges(this);
- cdmEntitySession.registerForDataStoreChanges(this);
+ CdmApplicationState.getCurrentDataChangeService().register(this);
try {
addPage(Page.NAME.getIndex(), new TaxonNameEditor(this),
getEditorInput());
editorPage.setDisabled();
}
}
- cdmEntitySession.unregisterForDataStoreChanges(this);
+ CdmApplicationState.getCurrentDataChangeService().unregister(this);
conversation.unregisterForDataStoreChanges(this);
conversation.close();
setDirty(false);
public List<TaxonNode> getRootEntities() {
return input.getRootEntities();
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPersistableElement;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.IClassificationService;
public <T extends CdmBase> void update() {
taxonNode = getCdmEntitySession().remoteUpdate(service, taxonNode);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
}
import java.util.List;
import java.util.UUID;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
public List<PolytomousKey> getRootEntities() {
return Arrays.asList(key);
}
+
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import org.eclipse.ui.part.EditorPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
return null;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
}
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
getViewer().refresh();
super.changed(object);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
import org.eclipse.zest.layouts.LayoutStyles;
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
return layoutAlgoritm;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
}
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
provider.toggleShowOnlyIndividualAssociations();
viewer.refresh();
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
public boolean onComplete() {
return true;
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
name="%command.name.4">
</command>
<command
- defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.ChangeAcceptedTaxonToSynonymHandler"
id="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
name="%command.name.5">
</command>
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.part.ViewPart;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
conversation = CdmStore.createConversation();
conversation.registerForDataStoreChanges(this);
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
- cdmEntitySession.registerForDataStoreChanges(this);
+ CdmApplicationState.getCurrentDataChangeService().register(this);
List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
if(!viewer.getControl().isDisposed()){
viewer.setInput(input);
return getKeys();
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
}
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.navigator.CommonNavigator;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.IClassificationService;
}
if (CdmStore.isActive() && cdmEntitySession == null) {
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
- cdmEntitySession.registerForDataStoreChanges(TaxonNavigator.this);
+ CdmApplicationState.getCurrentDataChangeService().register(this);
}
CdmStore.getLoginManager().addObserver(this);
}
}
return null;
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
package eu.etaxonomy.taxeditor.navigation.navigator.handler;
import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import java.util.UUID;
import org.apache.log4j.Logger;
import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.TreeSelection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
.getLogger(RemotingChangeAcceptedTaxonToSynonymHandler.class);
private static final String CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL = "Change Accepted Taxon to Synonym";
+ private static final String NO_TAXON_SELECTION_MESSAGE = "No taxon tree node selected for operation.";
private static final String SINGLE_TAXON_SELECTION_MESSAGE = "The operation move accepted taxon to synonymy is available only for a single taxon.";
private static final String SOURCE_TAXON_HAS_CHILDREN_MESSAGE = "The accepted taxon must not have any childen. You need to move all childen to " +
"another taxon node in the TaxonNavigator before attempting to turn the accepted " +
"taxon into a synonym.";
- private static final String RELATED_EDITORS_NOT_CLOSED_MESSAGE = "Could not close related taxon anme editors. " +
- "Please close them manually.";
+ private static final String RELATED_EDITOR_NOT_CLOSED_MESSAGE = "Could not close related taxon name editor " +
+ "Please close it manually and try again.";
+ private static final String SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE = "Selected object is not a taxon tree node";
+
+ private ITaxonTreeNode oldTaxonNode;
- private ITaxonTreeNode oldAcceptedTaxonNode;
/**
* @param label
*/
@Override
public IStatus allowOperations(ExecutionEvent event) {
TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
- // check that only a single taxon has been selected
+ // check that only a single taxon tree node has been selected
if(selection.size() > 1) {
return new Status(IStatus.ERROR,
"unknown",
SINGLE_TAXON_SELECTION_MESSAGE);
}
- Iterator selectionIterator = selection.iterator();
- Set<ITaxonTreeNode> treeNodes = new HashSet<ITaxonTreeNode>();
- ITaxonTreeNode treeNode = treeNodes.iterator().next();
- oldAcceptedTaxonNode = treeNode;
+ // check for no taxon tree node selected
+ if(selection.size() == 0) {
+ return new Status(IStatus.ERROR,
+ "unknown",
+ NO_TAXON_SELECTION_MESSAGE);
+ }
+ // check that selected object is a taxon node
+ Object obj = selection.iterator().next();
+ if(obj instanceof ITaxonTreeNode) {
+ oldTaxonNode = (ITaxonTreeNode)obj;
+ } else {
+ return new Status(IStatus.ERROR,
+ "unknown",
+ SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
+ }
// check that the source taxon node does not have children
- if(((TaxonNode)oldAcceptedTaxonNode).getCountChildren() > 0) {
+ if(((TaxonNode)oldTaxonNode).getCountChildren() > 0) {
return new Status(IStatus.ERROR,
"unknown",
SOURCE_TAXON_HAS_CHILDREN_MESSAGE);
}
- // check all editors related to this taxon node are closed
- boolean allEditorsClosed = true;
- for (ITaxonTreeNode tn : treeNodes){
- if(treeNode instanceof TaxonNode) {
- allEditorsClosed &= NavigatorHandlerUtils.closeObsoleteEditor(event, (TaxonNode) tn);
- }
- }
- if(allEditorsClosed != true) {
+ // check if corresponding name editor is closed
+ boolean editorClosed = NavigatorHandlerUtils.closeObsoleteEditor(event, (TaxonNode) oldTaxonNode);
+ if(editorClosed != true) {
return new Status(IStatus.ERROR,
"unknown",
- RELATED_EDITORS_NOT_CLOSED_MESSAGE);
+ RELATED_EDITOR_NOT_CLOSED_MESSAGE);
}
return Status.OK_STATUS;
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#doOperations(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
- public IStatus doOperations(ExecutionEvent event) {
+ public AbstractOperation prepareOperation(ExecutionEvent event) {
List<UUID> excludeTaxa = new ArrayList<UUID>();
- excludeTaxa.add(oldAcceptedTaxonNode.getUuid());
+ excludeTaxa.add(oldTaxonNode.getUuid());
TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
new ConversationHolderMock(),
"Choose the accepted taxon",
excludeTaxa,
null,
- ((TaxonNode)oldAcceptedTaxonNode).getClassification());
+ ((TaxonNode)oldTaxonNode).getClassification());
if (newAcceptedTaxonNode == null) {
return null;
}
- // run operation
- return Status.OK_STATUS;
+ RemotingChangeAcceptedTaxonToSynonymOperation rcattso =
+ new RemotingChangeAcceptedTaxonToSynonymOperation(event.getTrigger(),
+ false,
+ oldTaxonNode,
+ newAcceptedTaxonNode);
+
+ return rcattso;
}
+
/* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#postOperations(org.eclipse.core.commands.ExecutionEvent)
+ * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
- public void postOperations(ExecutionEvent event) {
+ public void onComplete() {
// TODO Auto-generated method stub
}
+
+
}
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
-import eu.etaxonomy.taxeditor.store.CdmStore;
/**
private final TaxonNode newAcceptedTaxonNode;
private final ITaxonTreeNode oldTaxonNode;
+ private final static String LABEL = "ChangeAcceptedTaxonToSynonymOperation";
+
/**
* @param label
*/
- public RemotingChangeAcceptedTaxonToSynonymOperation(String label,
+ public RemotingChangeAcceptedTaxonToSynonymOperation(Object source,
+ boolean async,
ITaxonTreeNode oldTaxonNode,
TaxonNode newAcceptedTaxonNode) {
- super(label);
+ super(LABEL, Action.Update, source, async);
this.oldTaxonNode = oldTaxonNode;
this.newAcceptedTaxonNode = newAcceptedTaxonNode;
}
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
- public UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) {
- return CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
+ protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+ return CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
}
}
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import eu.etaxonomy.cdm.model.common.IEnumTerm;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
return Status.OK_STATUS;
}
+ public static IStatus executeOperation(final AbstractOperation operation, final RemotingCdmHandler handler) {
+ if (getOperationHistory() == null) {
+ throw new IllegalArgumentException(
+ "There is no operation history for this context");
+ }
+
+ final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
+ .getUIInfoAdapter(getShell());
+
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ String operationlabel = operation.getLabel();
+ monitor.beginTask(operationlabel, 100);
+ IStatus status = Status.CANCEL_STATUS;
+ try {
+ operation.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
+ status = getOperationHistory().execute(operation, monitor,
+ uiInfoAdapter);
+ handler.postOperation(status);
+ } catch (ExecutionException e) {
+ MessagingUtils.operationDialog(this, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
+ } finally {
+ monitor.done();
+ }
+
+ String statusString = status.equals(Status.OK_STATUS) ? "completed"
+ : "cancelled";
+ setStatusLine(operationlabel + " " + statusString + ".");
+
+ }
+ };
+
+ try {
+ runInUI(runnable, null);
+ } catch (Exception e) {
+ MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
+ }
+
+ return Status.OK_STATUS;
+ }
/**
* <p>
* getOperationHistory
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
public Object execute(ExecutionEvent event) throws ExecutionException {
IStatus allowStatus = allowOperations(event);
if(allowStatus.isOK()) {
- IStatus opStatus = doOperations(event);
- onComplete(event, opStatus);
+ AbstractOperation op = prepareOperation(event);
+ if(op != null) {
+ AbstractUtility.executeOperation(op, this);
+ }
} else {
MessagingUtils.warningDialog("Can not perform " + label, event.getTrigger(), allowStatus);
}
return null;
}
- public void onComplete(ExecutionEvent event, IStatus status) {
+ public void postOperation(IStatus status) {
if(!status.isOK() && status.getException() != null) {
ErrorDialog.openError(null, "Error executing " + label, null, status);
}
- postOperations(event);
+ onComplete();
}
public abstract IStatus allowOperations(ExecutionEvent event);
- public abstract IStatus doOperations(ExecutionEvent event);
+ public abstract AbstractOperation prepareOperation(ExecutionEvent event);
- public abstract void postOperations(ExecutionEvent event);
+ public abstract void onComplete();
}
*/
package eu.etaxonomy.taxeditor.operation;
+import java.util.Set;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
/**
* @author cmathew
* @date 16 Jun 2015
*/
public abstract class RemotingCdmOperation extends AbstractOperation {
- public RemotingCdmOperation(String label) {
+ private final Object source;
+ private final Action action;
+ private final boolean async;
+
+ public RemotingCdmOperation(String label, Action action, Object source, boolean async) {
super(label);
+ this.source = source;
+ this.action = action;
+ this.async = async;
}
/* (non-Javadoc)
return onComplete(success);
}
- public abstract boolean doExecute(IProgressMonitor monitor, IAdaptable info);
+ protected abstract boolean doExecute(IProgressMonitor monitor, IAdaptable info);
+
+ protected void postExecute(boolean success) {}
- public void postExecute(boolean success) {}
+ protected abstract IStatus onComplete(boolean success);
- public abstract IStatus onComplete(boolean success);
+ protected void fireDataChangeEvent(Set<? extends CdmBase> changedObjects) {
+ if(changedObjects != null && !changedObjects.isEmpty()) {
+ CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, changedObjects, source.getClass()), async);
+ }
+ }
+
+ protected void fireDataChangeEvent(UpdateResult updateResult) {
+ Set<CdmBase> updatedObjects = updateResult.getUpdatedObjects();
+ if(updatedObjects != null && !updatedObjects.isEmpty()) {
+ CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, updatedObjects, source.getClass()), async);
+ }
+ }
/* (non-Javadoc)
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
import eu.etaxonomy.cdm.api.service.UpdateResult;
/**
/**
* @param label
*/
- public RemotingCdmUpdateOperation(String label) {
- super(label);
+ public RemotingCdmUpdateOperation(String label, Action action, Object source, boolean async) {
+ super(label, action, source, async);
}
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
*/
@Override
- public boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
- updateResult = doUpdateExecute(monitor, info);
+ protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) {
+ try {
+ updateResult = doUpdateExecute(monitor, info);
+ } catch (Exception e) {
+ UpdateResult exceptionResult = new UpdateResult();
+ exceptionResult.addException(e);
+ exceptionResult.setError();
+ updateResult = exceptionResult;
+ }
return updateResult.isOk();
}
- public abstract UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info);
+ protected abstract UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception;
+
+ @Override
+ protected void postExecute(boolean success) {
+ if(success && updateResult != null) {
+ fireDataChangeEvent(updateResult);
+ }
+
+ }
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
*/
@Override
- public IStatus onComplete(boolean success) {
+ protected IStatus onComplete(boolean success) {
if(updateResult != null) {
Collection<Exception> exceptions = updateResult.getExceptions();
}
Status[] childStatus = new Status[exceptions.size()];
-
+ int count = 0;
for(Exception ex : exceptions) {
Status status = new Status(IStatus.ERROR,
"unknown",
IStatus.ERROR,
ex.getLocalizedMessage(),
ex);
+ childStatus[count] = status;
+ count++;
}
MultiStatus multiStatus = new MultiStatus("unknown",
package eu.etaxonomy.taxeditor.store;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
import java.util.EnumSet;
import org.eclipse.core.runtime.IProgressMonitor;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
+import eu.etaxonomy.cdm.api.application.CdmApplicationException;
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
private void close() {
isConnected = false;
cdmSource = null;
+ CdmApplicationState.dispose();
}
static void setInstance(ICdmApplicationConfiguration applicationController,
private CdmStore(ICdmApplicationConfiguration applicationController,
ICdmSource cdmSource) {
CdmApplicationState.setCurrentAppConfig(applicationController);
+ CdmApplicationState.setCurrentDataChangeService(new CdmUIDataChangeService());
this.cdmSource = cdmSource;
isConnected = true;
}
* @return the configured implementation of <code>serviceClass</code> or <code>null</code>
*/
public static <T extends IService> T getService(Class<T> serviceClass) {
- ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
-
- Method[] methods = ICdmApplicationConfiguration.class.getDeclaredMethods();
-
- T service = null;
-
- for (Method method : methods) {
- Type type = method.getGenericReturnType();
-
- if (type.equals(serviceClass)) {
- try {
- service = (T) method.invoke(configuration, null);
- break;
- } catch (IllegalArgumentException e) {
- MessagingUtils.error(CdmStore.class, e);
- } catch (IllegalAccessException e) {
- MessagingUtils.error(CdmStore.class, e);
- } catch (InvocationTargetException e) {
- MessagingUtils.error(CdmStore.class, e);
- }
- }
- }
+ T service = null;
+ try {
+ service = CdmApplicationState.getService(serviceClass);
+ } catch (CdmApplicationException cae) {
+ MessagingUtils.error(CdmStore.class, cae);
+ }
- return service;
+ return service;
}
/**
* As ICommonService is not extending IService we need a specific request here
*/
public static ICommonService getCommonService() {
- ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
-
- return configuration.getCommonService();
+ return CdmApplicationState.getCommonService();
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.store;
+
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
+
+/**
+ * @author cmathew
+ * @date 18 Jun 2015
+ *
+ */
+public class CdmUIDataChangeService extends CdmDataChangeService {
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.store.ICdmDataChangeService#fireChangeEvent(eu.etaxonomy.cdm.api.application.CdmChangeEvent, boolean)
+ */
+ @Override
+ public void fireChangeEvent(final CdmChangeEvent event, boolean async) {
+ for(final ICdmChangeListener listener : listeners) {
+ // Update the user interface asynchronously
+ if(async) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ listener.onChange(event);
+ }
+ });
+ }
+ // Update the user interface synchronously
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ listener.onChange(event);
+ }
+ });
+ }
+ }
+
+}
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.Feature;
public boolean onComplete() {
return true;
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
}
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.EditorPart;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
import org.apache.log4j.Logger;
import org.eclipse.core.commands.ExecutionException;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
import org.unitils.dbunit.annotation.DataSet;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
import eu.etaxonomy.taxeditor.operations.BaseOperationTest;
/**
Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
- @Ignore
+
@Test
public void changeAcceptedTaxonToSynonymTest() throws ExecutionException {
- UUID oldTaxonNodeNodeUuid = UUID.fromString("168a4d09-a2b0-4206-b4cc-5d13199f9306");
- UUID newAcceptedTaxonNodeUuid = UUID.fromString("f5d97f8b-c673-4050-af06-bbfab33baaec");
+
+
+ UUID oldTaxonNodeNodeUuid = UUID.fromString("b85b5b78-6760-409f-ac91-bb89e95ff2a1");
+ UUID newAcceptedTaxonNodeUuid = UUID.fromString("6ad8e9e2-f5f6-41ad-aa30-f62a903650db");
TaxonNode oldTaxonNode = taxonNodeService.load(oldTaxonNodeNodeUuid);
+ TaxonNameBase name = oldTaxonNode.getTaxon().getName();
TaxonNode newAcceptedTaxonNode = taxonNodeService.load(newAcceptedTaxonNodeUuid);
+ sessionOwner.addUpdatedObject(oldTaxonNode.getParent());
Assert.assertEquals(0,newAcceptedTaxonNode.getTaxon().getSynonyms().size());
- operation = new ChangeAcceptedTaxonToSynonymOperation("changeAcceptedTaxonToSynonymTest",
- undoContext,
+ operation = new RemotingChangeAcceptedTaxonToSynonymOperation(sessionOwner,
+ false,
oldTaxonNode,
- newAcceptedTaxonNode,
- postOperation,
- conversationEnabled,
- sessionOwner);
+ newAcceptedTaxonNode);
operation.execute(monitor, info);
newAcceptedTaxonNode = taxonNodeService.load(newAcceptedTaxonNodeUuid);
+ sessionOwner.addUpdatedObject(newAcceptedTaxonNode);
+
+ oldTaxonNode = taxonNodeService.load(oldTaxonNodeNodeUuid);
+ Assert.assertNull(oldTaxonNode);
Assert.assertEquals(1,newAcceptedTaxonNode.getTaxon().getSynonyms().size());
+ Assert.assertEquals(name, newAcceptedTaxonNode.getTaxon().getSynonyms().iterator().next().getName());
}
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.taxeditor.remoting.cache.CdmRemoteCacheManager;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
}
cdmEntitySessionManager = getRemoteApplicationController().getCdmEntitySessionManager();
+ CdmApplicationState.setCurrentDataChangeService(new CdmDataChangeService());
+
//FIXME:Remoting the authentication code should be replaced by a method call which actually
// does the authentication in the editor code so that the 'real' authentication can be tested
SecurityContextHolder.clearContext();
import org.junit.Before;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.session.MockSessionOwner;
/**
public abstract class RemotingSessionAwareTest extends BaseRemotingTest {
protected CdmTransientEntityCacher cacher;
- protected ICdmEntitySessionEnabled sessionOwner;
+ protected MockSessionOwner sessionOwner;
protected ICdmEntitySession cdmEntitySession;
@Before
public void initializeSession() {
sessionOwner = new MockSessionOwner();
+ CdmApplicationState.getCurrentDataChangeService().register(sessionOwner);
cdmEntitySession = cdmEntitySessionManager.newSession(sessionOwner, true);
cacher = getCacher(sessionOwner);
}
package eu.etaxonomy.taxeditor.operations;
+import org.eclipse.core.commands.operations.AbstractOperation;
import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.test.MockConversationEnabled;
public static final IConversationEnabled conversationEnabled = new MockConversationEnabled();
public static final ICdmEntitySessionEnabled cdmEntitySessionEnabled = null;
- protected static AbstractPostOperation operation;
+ protected static AbstractOperation operation;
package eu.etaxonomy.taxeditor.session;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import org.junit.Assert;
+
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySession;
public class MockSessionOwner<T extends CdmBase> implements ICdmEntitySessionEnabled {
List<T> rootEntities;
-
+ Set<T> updatedObjects;
public MockSessionOwner() {
- rootEntities = null;
+ this.rootEntities = null;
+ }
+
+ public MockSessionOwner(Set<T> updatedObjects) {
+ this.rootEntities = null;
+ this.updatedObjects = updatedObjects;
}
public MockSessionOwner(List<T> rootEntities) {
this.rootEntities = rootEntities;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
- */
- @Override
- public void update(CdmDataChangeMap arg0) {
+ public void setUpdatedObjects(Set<T> updatedObjects) {
+ this.updatedObjects = updatedObjects;
+ }
+
+ public void addUpdatedObject(T updatedObject) {
+ if(updatedObjects == null) {
+ updatedObjects = new HashSet<T>();
+ }
+ updatedObjects.add(updatedObject);
}
/* (non-Javadoc)
return rootEntities;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+ */
+ @Override
+ public void onChange(CdmChangeEvent event) {
+ if(updatedObjects != null && !updatedObjects.isEmpty()) {
+ for(CdmBase cb : updatedObjects) {
+ Assert.assertTrue(event.getChangedObjects().contains(cb));
+ }
+ }
+ }
+
}
<?xml version="1.0" encoding="UTF-8"?><!--
- generated by Jailer 4.3, Mon Jun 15 17:20:26 CEST 2015 from cmathew@cmbgbm-t530
+ generated by Jailer 4.3, Fri Jun 19 09:13:03 CEST 2015 from cmathew@cmbgbm-t530
- Extraction Model: all rows from Classification (extractionmodel/by-example/SbE-Classification-17-20-15-292.csv)
+ Extraction Model: all rows from Classification (extractionmodel/by-example/SbE-Classification-09-10-20-259.csv)
Database URL: jdbc:mysql://127.0.0.1:3306/local-cyprus
Database User: root
- Exported Rows: 47
+ Exported Rows: 67
Classification 1
DescriptionBase 22
- TaxonBase 7
+ TaxonBase 14
+ TaxonNameBase 14
TaxonNode 16
- UserAccount 1
--><dataset>
- <TaxonNode id="46" created="2010-12-21 15:09:43.0" uuid="168a4d09-a2b0-4206-b4cc-5d13199f9306" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#47#46#" classification_id="10" parent_id="47" taxon_id="48"/>
- <TaxonNode id="47" created="2010-12-21 15:09:43.0" uuid="2f05d429-632d-4230-b9cb-70299360b470" countchildren="1" sortindex="0" treeindex="#t10#4032#49#48#47#" classification_id="10" parent_id="48" taxon_id="51"/>
- <TaxonNode id="48" created="2010-12-21 15:09:43.0" uuid="24773d3b-8f11-4400-99de-71658982b245" countchildren="6" sortindex="0" treeindex="#t10#4032#49#48#" classification_id="10" parent_id="49" taxon_id="50"/>
- <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10" sortindex="1" treeindex="#t10#4032#49#" classification_id="10" parent_id="4032" taxon_id="49"/>
- <TaxonNode id="236" created="2010-12-21 15:09:45.0" uuid="f5d97f8b-c673-4050-af06-bbfab33baaec" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#237#236#" classification_id="10" parent_id="237" taxon_id="264"/>
- <TaxonNode id="237" created="2010-12-21 15:09:45.0" uuid="4998de90-d0be-433b-a62f-0d57a1e399b0" countchildren="1" sortindex="1" treeindex="#t10#4032#49#48#237#" classification_id="10" parent_id="48" taxon_id="265"/>
- <TaxonNode id="714" created="2010-12-21 15:09:48.0" uuid="b85b5b78-6760-409f-ac91-bb89e95ff2a1" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#715#714#" classification_id="10" parent_id="715" taxon_id="812"/>
- <TaxonNode id="715" created="2010-12-21 15:09:48.0" uuid="91698cec-615f-4472-9002-feda1a6acded" countchildren="2" sortindex="2" treeindex="#t10#4032#49#48#715#" classification_id="10" parent_id="48" taxon_id="814"/>
- <TaxonNode id="716" created="2010-12-21 15:09:48.0" uuid="6ad8e9e2-f5f6-41ad-aa30-f62a903650db" countchildren="0" sortindex="1" treeindex="#t10#4032#49#48#715#716#" classification_id="10" parent_id="715" taxon_id="815"/>
- <TaxonNode id="828" created="2010-12-21 15:09:49.0" uuid="786622ba-cb2c-47f4-9eeb-65a6ebb7122b" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#829#828#" classification_id="10" parent_id="829" taxon_id="946"/>
- <TaxonNode id="829" created="2010-12-21 15:09:49.0" uuid="4fe03763-b966-4361-8334-352f6f777588" countchildren="1" sortindex="3" treeindex="#t10#4032#49#48#829#" classification_id="10" parent_id="48" taxon_id="948"/>
- <TaxonNode id="1915" created="2010-12-21 15:09:57.0" uuid="99f03b56-67cd-4e01-9ceb-2362d48f9d07" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#1916#1915#" classification_id="10" parent_id="1916" taxon_id="2203"/>
- <TaxonNode id="1916" created="2010-12-21 15:09:57.0" uuid="d8998200-500f-4312-90f4-2b60e6fd3a78" countchildren="1" sortindex="4" treeindex="#t10#4032#49#48#1916#" classification_id="10" parent_id="48" taxon_id="2205"/>
- <TaxonNode id="2354" created="2010-12-21 15:10:00.0" uuid="b8439f51-6b96-445a-b401-7a836ba1cf58" countchildren="0" sortindex="0" treeindex="#t10#4032#49#48#2355#2354#" classification_id="10" parent_id="2355" taxon_id="2737"/>
- <TaxonNode id="2355" created="2010-12-21 15:10:00.0" uuid="6da4e5b6-ebc3-4c46-bdce-24161b7bd0e2" countchildren="1" sortindex="5" treeindex="#t10#4032#49#48#2355#" classification_id="10" parent_id="48" taxon_id="2738"/>
- <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="2" treeindex="#t10#4032#" classification_id="10"/>
+ <TaxonNode id="46" created="2010-12-21 15:09:43.0" uuid="168a4d09-a2b0-4206-b4cc-5d13199f9306" countchildren="0" classification_id="10" parent_id="47" taxon_id="48" treeIndex="#t10#4032#49#48#47#46#" sortIndex="0"/>
+ <TaxonNode id="47" created="2010-12-21 15:09:43.0" uuid="2f05d429-632d-4230-b9cb-70299360b470" countchildren="1" classification_id="10" parent_id="48" taxon_id="51" treeIndex="#t10#4032#49#48#47#" sortIndex="0"/>
+ <TaxonNode id="48" created="2010-12-21 15:09:43.0" uuid="24773d3b-8f11-4400-99de-71658982b245" countchildren="6" classification_id="10" parent_id="49" treeIndex="#t10#4032#49#48#" sortIndex="0"/>
+ <TaxonNode id="49" created="2010-12-21 15:09:43.0" uuid="572290a9-7535-48c8-9f68-25ddbc9869ee" countchildren="10" classification_id="10" parent_id="4032" taxon_id="49" treeIndex="#t10#4032#49#" sortIndex="1"/>
+ <TaxonNode id="236" created="2010-12-21 15:09:45.0" uuid="f5d97f8b-c673-4050-af06-bbfab33baaec" countchildren="0" classification_id="10" parent_id="237" taxon_id="264" treeIndex="#t10#4032#49#48#237#236#" sortIndex="0"/>
+ <TaxonNode id="237" created="2010-12-21 15:09:45.0" uuid="4998de90-d0be-433b-a62f-0d57a1e399b0" countchildren="1" classification_id="10" parent_id="48" taxon_id="265" treeIndex="#t10#4032#49#48#237#" sortIndex="1"/>
+ <TaxonNode id="714" created="2010-12-21 15:09:48.0" uuid="b85b5b78-6760-409f-ac91-bb89e95ff2a1" countchildren="0" classification_id="10" parent_id="715" taxon_id="812" treeIndex="#t10#4032#49#48#715#714#" sortIndex="0"/>
+ <TaxonNode id="715" created="2010-12-21 15:09:48.0" uuid="91698cec-615f-4472-9002-feda1a6acded" countchildren="2" classification_id="10" parent_id="48" taxon_id="814" treeIndex="#t10#4032#49#48#715#" sortIndex="2"/>
+ <TaxonNode id="716" created="2010-12-21 15:09:48.0" uuid="6ad8e9e2-f5f6-41ad-aa30-f62a903650db" countchildren="0" classification_id="10" parent_id="715" taxon_id="815" treeIndex="#t10#4032#49#48#715#716#" sortIndex="1"/>
+ <TaxonNode id="828" created="2010-12-21 15:09:49.0" uuid="786622ba-cb2c-47f4-9eeb-65a6ebb7122b" countchildren="0" classification_id="10" parent_id="829" taxon_id="946" treeIndex="#t10#4032#49#48#829#828#" sortIndex="0"/>
+ <TaxonNode id="829" created="2010-12-21 15:09:49.0" uuid="4fe03763-b966-4361-8334-352f6f777588" countchildren="1" classification_id="10" parent_id="48" taxon_id="948" treeIndex="#t10#4032#49#48#829#" sortIndex="3"/>
+ <TaxonNode id="1915" created="2010-12-21 15:09:57.0" uuid="99f03b56-67cd-4e01-9ceb-2362d48f9d07" countchildren="0" classification_id="10" parent_id="1916" taxon_id="2203" treeIndex="#t10#4032#49#48#1916#1915#" sortIndex="0"/>
+ <TaxonNode id="1916" created="2010-12-21 15:09:57.0" uuid="d8998200-500f-4312-90f4-2b60e6fd3a78" countchildren="1" classification_id="10" parent_id="48" taxon_id="2205" treeIndex="#t10#4032#49#48#1916#" sortIndex="4"/>
+ <TaxonNode id="2354" created="2010-12-21 15:10:00.0" uuid="b8439f51-6b96-445a-b401-7a836ba1cf58" countchildren="0" classification_id="10" parent_id="2355" taxon_id="2737" treeIndex="#t10#4032#49#48#2355#2354#" sortIndex="0"/>
+ <TaxonNode id="2355" created="2010-12-21 15:10:00.0" uuid="6da4e5b6-ebc3-4c46-bdce-24161b7bd0e2" countchildren="1" classification_id="10" parent_id="48" taxon_id="2738" treeIndex="#t10#4032#49#48#2355#" sortIndex="5"/>
+ <TaxonNode id="4032" created="2014-01-16 10:24:29.0" uuid="29b3fd3f-29b4-4011-ab12-9c1ad1607dbd" countchildren="2" classification_id="10" treeIndex="#t10#4032#"/>
- <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus" updatedby_id="10" name_id="10" reference_id="1493" rootnode_id="4032"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="48" created="2010-12-21 15:09:43.0" uuid="7aceb517-2b91-46b9-a5a2-88b7e0fb3230" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L." fullTitleCache="Adiantum capillus-veneris L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum capillus-veneris" protectedauthorshipcache="false" protectednamecache="false" specificepithet="capillus-veneris" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="49" created="2010-12-21 15:09:43.0" uuid="079fff38-ff2d-426b-a49e-70b0f1db6c31" protectedtitlecache="false" titleCache="Pteridophyta" fullTitleCache="Pteridophyta" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteridophyta" hybridformula="false" monomhybrid="false" namecache="Pteridophyta" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="810"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="51" created="2010-12-21 15:09:43.0" uuid="c8af63e0-7bd4-4fad-aa2d-3777cbe1210a" protectedtitlecache="false" titleCache="Adiantum" fullTitleCache="Adiantum" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Adiantum" hybridformula="false" monomhybrid="false" namecache="Adiantum" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="264" created="2010-12-21 15:09:45.0" uuid="b976da6a-dd84-4fcd-9a1b-9847afba1da2" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link" fullTitleCache="Anogramma leptophylla (L.) Link" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Link" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma leptophylla" protectedauthorshipcache="false" protectednamecache="false" specificepithet="leptophylla" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="265" created="2010-12-21 15:09:45.0" uuid="c7f1db22-20fb-4eeb-810b-d37c5593b95d" protectedtitlecache="false" titleCache="Anogramma" fullTitleCache="Anogramma" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Anogramma" hybridformula="false" monomhybrid="false" namecache="Anogramma" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="812" created="2010-12-21 15:09:48.0" uuid="16450a2d-2085-471f-804a-defcd43c03e4" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod." fullTitleCache="Cheilanthes acrostica (Balb.) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Balb.) Tod." binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes acrostica" protectedauthorshipcache="false" protectednamecache="false" specificepithet="acrostica" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="814" created="2010-12-21 15:09:48.0" uuid="bbb1c5be-5a0c-45e2-b8af-f37a80ccf858" protectedtitlecache="false" titleCache="Cheilanthes" fullTitleCache="Cheilanthes" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="815" created="2010-12-21 15:09:48.0" uuid="f04a9283-f856-4d28-b469-4a222472862b" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe" fullTitleCache="Cheilanthes maderensis Lowe" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="Lowe" binomhybrid="false" genusoruninomial="Cheilanthes" hybridformula="false" monomhybrid="false" namecache="Cheilanthes maderensis" protectedauthorshipcache="false" protectednamecache="false" specificepithet="maderensis" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="946" created="2010-12-21 15:09:49.0" uuid="e30ef44b-52e4-41ff-a68d-9912d3c537f1" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod." fullTitleCache="Cosentinia vellea (Aiton) Tod." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(Aiton) Tod." binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia vellea" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vellea" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="948" created="2010-12-21 15:09:49.0" uuid="21fda99e-0425-4f29-b7b2-196f8a51b054" protectedtitlecache="false" titleCache="Cosentinia" fullTitleCache="Cosentinia" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Cosentinia" hybridformula="false" monomhybrid="false" namecache="Cosentinia" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="2203" created="2010-12-21 15:09:57.0" uuid="8fe0bb4b-7687-4d32-8ff2-94e690980f81" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv." fullTitleCache="Notholaena marantae (L.) Desv." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="(L.) Desv." binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena marantae" protectedauthorshipcache="false" protectednamecache="false" specificepithet="marantae" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="2205" created="2010-12-21 15:09:57.0" uuid="77b7934f-8f62-4798-b96a-f3d12bfd5ebf" protectedtitlecache="false" titleCache="Notholaena" fullTitleCache="Notholaena" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Notholaena" hybridformula="false" monomhybrid="false" namecache="Notholaena" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
+ <TaxonNameBase DTYPE="BotanicalName" id="2737" created="2010-12-21 15:10:00.0" uuid="25560d66-07a3-41ce-8244-36ca98638c71" protectedtitlecache="false" titleCache="Pteris vittata L." fullTitleCache="Pteris vittata L." parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="L." binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris vittata" protectedauthorshipcache="false" protectednamecache="false" specificepithet="vittata" trinomhybrid="false" anamorphic="false" rank_id="778" />
+ <TaxonNameBase DTYPE="BotanicalName" id="2738" created="2010-12-21 15:10:00.0" uuid="a40593ce-e8cc-43bb-a391-2de988b09039" protectedtitlecache="false" titleCache="Pteris" fullTitleCache="Pteris" parsingproblem="0" problemends="-1" problemstarts="-1" protectedfulltitlecache="false" authorshipcache="" binomhybrid="false" genusoruninomial="Pteris" hybridformula="false" monomhybrid="false" namecache="Pteris" protectedauthorshipcache="false" protectednamecache="false" trinomhybrid="false" anamorphic="false" rank_id="788"/>
- <TaxonBase DTYPE="Taxon" id="48" created="2011-03-01 20:11:26.0" uuid="b8402dc4-5050-4882-a147-01b71e0e47d6" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L. sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="48" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="264" created="2011-03-01 20:11:27.0" uuid="d679c5d0-53b3-40fc-97e1-0646aad7ed23" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="264" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="812" created="2011-03-01 20:11:29.0" uuid="e40854d7-143f-4054-b229-6ed4cedb4bff" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod. sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="812" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="815" created="2010-12-21 15:09:48.0" uuid="7ea2c74a-f2b2-41f6-acdf-1ca35f5d03f8" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="815" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="946" created="2011-03-01 20:11:30.0" uuid="ba21b018-97d2-42d7-af6c-5e8db8e495ff" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod. sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="946" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="2203" created="2011-03-01 20:11:36.0" uuid="d9a0c5d5-baee-4b6b-974a-a7de5affe748" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv. sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2203" sec_id="10"/>
- <TaxonBase DTYPE="Taxon" id="2737" created="2011-03-01 20:11:39.0" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" publish="true" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2737" sec_id="10"/>
+ <Classification id="10" created="2010-12-21 15:09:43.0" uuid="0c2b5d25-7b15-4401-8b51-dd4be0ee5cab" updated="2015-06-09 07:10:42.0" protectedtitlecache="false" titleCache="Cyprus" updatedby_id="10" name_id="10" rootnode_id="4032"/>
+
+ <TaxonBase DTYPE="Taxon" id="48" created="2011-03-01 20:11:26.0" uuid="b8402dc4-5050-4882-a147-01b71e0e47d6" protectedtitlecache="false" titleCache="Adiantum capillus-veneris L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="48" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="49" created="2010-12-21 15:09:43.0" uuid="1141a510-5ee8-4a59-ae60-7b4fea44872f" protectedtitlecache="false" titleCache="Pteridophyta sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="49" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="51" created="2010-12-21 15:09:43.0" uuid="233cac41-bb05-4925-bb9e-ab0bdf330973" protectedtitlecache="false" titleCache="Adiantum sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="51" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="264" created="2011-03-01 20:11:27.0" uuid="d679c5d0-53b3-40fc-97e1-0646aad7ed23" protectedtitlecache="false" titleCache="Anogramma leptophylla (L.) Link sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="264" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="265" created="2010-12-21 15:09:45.0" uuid="1fc1d927-1155-4282-a9f5-f07202f79ace" protectedtitlecache="false" titleCache="Anogramma sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="265" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="812" created="2011-03-01 20:11:29.0" uuid="e40854d7-143f-4054-b229-6ed4cedb4bff" protectedtitlecache="false" titleCache="Cheilanthes acrostica (Balb.) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="812" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="814" created="2010-12-21 15:09:48.0" uuid="433ad11a-b931-49a4-8128-d6f4d454914a" protectedtitlecache="false" titleCache="Cheilanthes sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="814" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="815" created="2010-12-21 15:09:48.0" uuid="7ea2c74a-f2b2-41f6-acdf-1ca35f5d03f8" protectedtitlecache="false" titleCache="Cheilanthes maderensis Lowe sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="815" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="946" created="2011-03-01 20:11:30.0" uuid="ba21b018-97d2-42d7-af6c-5e8db8e495ff" protectedtitlecache="false" titleCache="Cosentinia vellea (Aiton) Tod. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="946" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="948" created="2010-12-21 15:09:49.0" uuid="a2768f6d-80f2-4e0c-a6e3-99b7a9f3bc9d" protectedtitlecache="false" titleCache="Cosentinia sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="948" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="2203" created="2011-03-01 20:11:36.0" uuid="d9a0c5d5-baee-4b6b-974a-a7de5affe748" protectedtitlecache="false" titleCache="Notholaena marantae (L.) Desv. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2203" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="2205" created="2010-12-21 15:09:57.0" uuid="c221d34c-76b0-4fc7-9901-e72efd4c899b" protectedtitlecache="false" titleCache="Notholaena sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2205" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="2737" created="2011-03-01 20:11:39.0" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2737" sec_id="10" publish="true"/>
+ <TaxonBase DTYPE="Taxon" id="2738" created="2010-12-21 15:10:00.0" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" excluded="false" taxonstatusunknown="false" taxonomicchildrencount="0" unplaced="false" name_id="2738" sec_id="10" publish="true"/>
<DescriptionBase DTYPE="TaxonDescription" id="28" created="2010-12-21 15:09:43.0" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" updated="2011-03-01 19:20:45.0" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false" taxon_id="48"/>
<DescriptionBase DTYPE="TaxonDescription" id="149" created="2010-12-21 15:09:45.0" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" updated="2011-03-01 19:20:46.0" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false" taxon_id="264"/>
<DescriptionBase DTYPE="TaxonDescription" id="14101" created="2014-02-28 19:21:07.0" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" updated="2014-02-28 19:21:08.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946"/>
<DescriptionBase DTYPE="TaxonDescription" id="14658" created="2014-02-28 19:23:51.0" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" updated="2014-02-28 19:23:51.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203"/>
<DescriptionBase DTYPE="TaxonDescription" id="14864" created="2014-02-28 19:25:21.0" uuid="2d55f445-8e72-43d3-976a-133828e89599" updated="2014-02-28 19:25:21.0" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737"/>
-
+
+ <SynonymRelationship/>
</dataset>