Revision 5da1d38c
Added by Patrick Plitzner about 9 years ago
- implemented unstable DataImportView which will replace DataImportEditor
.gitattributes | ||
---|---|---|
510 | 510 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditor.java -text |
511 | 511 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorContextMenu.java -text |
512 | 512 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorInput.java -text |
513 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportView.java -text |
|
513 | 514 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditor.java -text |
514 | 515 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditorInput.java -text |
516 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifResponseImportView.java -text |
|
515 | 517 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/QueryType.java -text |
518 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SaveImportedSpecimenAction.java -text |
|
516 | 519 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportEditor.java -text |
520 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportView.java -text |
|
517 | 521 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenProviderSelectionWizardPage.java -text |
518 | 522 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizard.java -text |
519 | 523 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizardPage.java -text |
520 | 524 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java -text |
521 | 525 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCdmRepository.java -text |
522 | 526 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java -text |
527 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCollectionService.java -text |
|
523 | 528 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientDescriptionService.java -text |
524 | 529 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientNameService.java -text |
525 | 530 |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java -text |
eu.etaxonomy.taxeditor.editor/plugin.xml | ||
---|---|---|
132 | 132 |
id="eu.etaxonomy.taxeditor.editor.category" |
133 | 133 |
name="%category.name"> |
134 | 134 |
</category> |
135 |
<view |
|
136 |
allowMultiple="true" |
|
137 |
class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView" |
|
138 |
id="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView" |
|
139 |
name="Specimen Import"> |
|
140 |
</view> |
|
141 |
<view |
|
142 |
allowMultiple="true" |
|
143 |
class="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView" |
|
144 |
id="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView" |
|
145 |
name="GBIF Specimen Import"> |
|
146 |
</view> |
|
135 | 147 |
</extension> |
136 | 148 |
<extension |
137 | 149 |
point="org.eclipse.ui.elementFactories"> |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditor.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.Collection; |
13 | 13 |
|
14 |
import org.apache.log4j.Logger; |
|
14 | 15 |
import org.eclipse.core.runtime.IProgressMonitor; |
15 | 16 |
import org.eclipse.jface.action.MenuManager; |
16 | 17 |
import org.eclipse.jface.viewers.TableViewer; |
... | ... | |
45 | 46 |
public abstract class DataImportEditor<T> extends EditorPart implements IPartContentHasFactualData, IDirtyMarkableSelectionProvider, |
46 | 47 |
IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener{ |
47 | 48 |
|
49 |
protected Logger logger = Logger.getLogger(DataImportEditor.class); |
|
50 |
|
|
48 | 51 |
private ConversationHolder conversation; |
49 | 52 |
|
50 | 53 |
private TableViewer tableViewer; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportView.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2013 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.editor.view.dataimport; |
|
11 |
|
|
12 |
import java.util.Collection; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
16 |
import org.eclipse.jface.action.IMenuManager; |
|
17 |
import org.eclipse.jface.action.IToolBarManager; |
|
18 |
import org.eclipse.jface.viewers.CheckboxTableViewer; |
|
19 |
import org.eclipse.swt.SWT; |
|
20 |
import org.eclipse.swt.widgets.Composite; |
|
21 |
import org.eclipse.swt.widgets.Display; |
|
22 |
import org.eclipse.swt.widgets.Table; |
|
23 |
import org.eclipse.swt.widgets.TableItem; |
|
24 |
import org.eclipse.ui.IMemento; |
|
25 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
26 |
import org.eclipse.ui.part.ViewPart; |
|
27 |
|
|
28 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
29 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
30 |
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery; |
|
31 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
|
32 |
import eu.etaxonomy.taxeditor.model.IContextListener; |
|
33 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
|
34 |
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData; |
|
35 |
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData; |
|
36 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
37 |
|
|
38 |
/** |
|
39 |
* View which shows a list of "data" that can be imported into the CDM |
|
40 |
* @author pplitzner |
|
41 |
* @date Sep 3, 2014 |
|
42 |
* |
|
43 |
* @param <T> the CDM type that will be handled by this view |
|
44 |
*/ |
|
45 |
|
|
46 |
public abstract class DataImportView<T> extends ViewPart implements IPartContentHasFactualData, |
|
47 |
IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener{ |
|
48 |
|
|
49 |
protected final Logger logger = Logger.getLogger(DataImportView.class); |
|
50 |
|
|
51 |
protected Collection<T> results; |
|
52 |
|
|
53 |
protected OccurenceQuery query; |
|
54 |
|
|
55 |
private static ConversationHolder conversationHolder; |
|
56 |
|
|
57 |
private SaveImportedSpecimenAction saveImportedSpecimenAction; |
|
58 |
|
|
59 |
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); |
|
60 |
|
|
61 |
private Table table; |
|
62 |
|
|
63 |
/** |
|
64 |
* Constructs a new DataImportEditor and registers it to listen to context changes |
|
65 |
*/ |
|
66 |
public DataImportView() { |
|
67 |
CdmStore.getContextManager().addContextListener(this); |
|
68 |
if(CdmStore.isActive()){ |
|
69 |
initConversation(); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Create contents of the view part. |
|
75 |
* @param parent |
|
76 |
*/ |
|
77 |
@Override |
|
78 |
public void createPartControl(Composite parent) { |
|
79 |
|
|
80 |
CheckboxTableViewer checkboxTableViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.FULL_SELECTION); |
|
81 |
table = checkboxTableViewer.getTable(); |
|
82 |
toolkit.paintBordersFor(table); |
|
83 |
|
|
84 |
createActions(); |
|
85 |
initializeToolBar(); |
|
86 |
initializeMenu(); |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* Create the actions. |
|
91 |
*/ |
|
92 |
private void createActions() { |
|
93 |
saveImportedSpecimenAction = new SaveImportedSpecimenAction(); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* Initialize the toolbar. |
|
98 |
*/ |
|
99 |
private void initializeToolBar() { |
|
100 |
IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager(); |
|
101 |
tbm.add(saveImportedSpecimenAction); |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* Initialize the menu. |
|
106 |
*/ |
|
107 |
private void initializeMenu() { |
|
108 |
IMenuManager manager = getViewSite().getActionBars().getMenuManager(); |
|
109 |
} |
|
110 |
|
|
111 |
public Table getTable() { |
|
112 |
return table; |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* @param query the query to set |
|
117 |
*/ |
|
118 |
public void setQuery(OccurenceQuery query) { |
|
119 |
this.query = query; |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* @param results the results to set |
|
124 |
*/ |
|
125 |
public void setResults(Collection<T> results) { |
|
126 |
this.results = results; |
|
127 |
} |
|
128 |
|
|
129 |
/* (non-Javadoc) |
|
130 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#dispose() |
|
131 |
*/ |
|
132 |
@Override |
|
133 |
public void dispose() { |
|
134 |
super.dispose(); |
|
135 |
CdmStore.getContextManager().removeContextListener(this); |
|
136 |
} |
|
137 |
|
|
138 |
/* (non-Javadoc) |
|
139 |
* @see eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse.core.runtime.IProgressMonitor) |
|
140 |
*/ |
|
141 |
@Override |
|
142 |
public void contextRefresh(IProgressMonitor monitor) { |
|
143 |
refresh(); |
|
144 |
} |
|
145 |
|
|
146 |
protected void refresh(){ |
|
147 |
getTable().removeAll(); |
|
148 |
for(T item:results){ |
|
149 |
TableItem tableItem = new TableItem(getTable(), SWT.NONE); |
|
150 |
tableItem.setText(getTextForTableItem(item)); |
|
151 |
tableItem.setData(item); |
|
152 |
} |
|
153 |
} |
|
154 |
|
|
155 |
public abstract void query(); |
|
156 |
|
|
157 |
|
|
158 |
/* (non-Javadoc) |
|
159 |
* @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap) |
|
160 |
*/ |
|
161 |
@Override |
|
162 |
public void update(CdmDataChangeMap changeEvents) { |
|
163 |
//nothing |
|
164 |
} |
|
165 |
|
|
166 |
/** |
|
167 |
* Returns the text label of the given item. |
|
168 |
* @param item the item for which the label should be returns |
|
169 |
* @return the label of the item |
|
170 |
*/ |
|
171 |
protected abstract String getTextForTableItem(T item); |
|
172 |
|
|
173 |
/* (non-Javadoc) |
|
174 |
* @see org.eclipse.ui.part.WorkbenchPart#setFocus() |
|
175 |
*/ |
|
176 |
@Override |
|
177 |
public void setFocus() { |
|
178 |
getTable().setFocus(); |
|
179 |
//make sure to bind again if maybe in another view the conversation was unbound |
|
180 |
if(getConversationHolder()!=null && !getConversationHolder().isBound()){ |
|
181 |
getConversationHolder().bind(); |
|
182 |
} |
|
183 |
} |
|
184 |
|
|
185 |
/* (non-Javadoc) |
|
186 |
* @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor) |
|
187 |
*/ |
|
188 |
@Override |
|
189 |
public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) { |
|
190 |
} |
|
191 |
|
|
192 |
/* (non-Javadoc) |
|
193 |
* @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor) |
|
194 |
*/ |
|
195 |
@Override |
|
196 |
public void contextStop(IMemento memento, IProgressMonitor monitor) { |
|
197 |
// derivateSearchCompositeController.setEnabled(false); |
|
198 |
// derivateSearchCompositeController.reset(); |
|
199 |
} |
|
200 |
|
|
201 |
/* (non-Javadoc) |
|
202 |
* @see eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor) |
|
203 |
*/ |
|
204 |
@Override |
|
205 |
public void contextStart(IMemento memento, IProgressMonitor monitor) { |
|
206 |
initConversation(); |
|
207 |
// derivateSearchCompositeController.setEnabled(true); |
|
208 |
} |
|
209 |
|
|
210 |
private void initConversation(){ |
|
211 |
if(conversationHolder==null){ |
|
212 |
conversationHolder = CdmStore.createConversation(); |
|
213 |
} |
|
214 |
} |
|
215 |
|
|
216 |
/* (non-Javadoc) |
|
217 |
* @see eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor) |
|
218 |
*/ |
|
219 |
@Override |
|
220 |
public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) { |
|
221 |
if(getConversationHolder()!=null && getConversationHolder().isBound() && !getConversationHolder().isClosed()) { |
|
222 |
getConversationHolder().close(); |
|
223 |
} |
|
224 |
} |
|
225 |
|
|
226 |
/** |
|
227 |
* @return the conversationHolder |
|
228 |
*/ |
|
229 |
@Override |
|
230 |
public ConversationHolder getConversationHolder() { |
|
231 |
if(CdmStore.isActive() && conversationHolder==null){ |
|
232 |
initConversation(); |
|
233 |
} |
|
234 |
return conversationHolder; |
|
235 |
} |
|
236 |
|
|
237 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifResponseImportView.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2014 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.editor.view.dataimport; |
|
11 |
|
|
12 |
import java.io.IOException; |
|
13 |
import java.net.URISyntaxException; |
|
14 |
import java.util.Collection; |
|
15 |
|
|
16 |
import org.apache.http.client.ClientProtocolException; |
|
17 |
|
|
18 |
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifQueryServiceWrapper; |
|
19 |
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse; |
|
20 |
|
|
21 |
/** |
|
22 |
* @author pplitzner |
|
23 |
* @date Sep 5, 2014 |
|
24 |
* |
|
25 |
*/ |
|
26 |
public class GbifResponseImportView extends DataImportView<GbifResponse> { |
|
27 |
|
|
28 |
|
|
29 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView"; |
|
30 |
|
|
31 |
/* (non-Javadoc) |
|
32 |
* @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object) |
|
33 |
*/ |
|
34 |
@Override |
|
35 |
protected String getTextForTableItem(GbifResponse item) { |
|
36 |
String text = ""; |
|
37 |
if(item.getDataSetProtocol()!=null){ |
|
38 |
text += "["+item.getDataSetProtocol()+"] "; |
|
39 |
} |
|
40 |
text += item.getDerivedUnitFacade().innerDerivedUnit().generateTitle(); |
|
41 |
return text; |
|
42 |
} |
|
43 |
|
|
44 |
/* (non-Javadoc) |
|
45 |
* @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query() |
|
46 |
*/ |
|
47 |
@Override |
|
48 |
public void query() { |
|
49 |
String errorMessage = "Could not execute query " + query; |
|
50 |
try{ |
|
51 |
Collection<GbifResponse> results = new GbifQueryServiceWrapper().query(query); |
|
52 |
setResults(results); |
|
53 |
} catch (ClientProtocolException e) { |
|
54 |
logger.error(errorMessage, e); |
|
55 |
} catch (IOException e) { |
|
56 |
logger.error(errorMessage, e); |
|
57 |
} catch (URISyntaxException e) { |
|
58 |
logger.error(errorMessage, e); |
|
59 |
} |
|
60 |
|
|
61 |
} |
|
62 |
|
|
63 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SaveImportedSpecimenAction.java | ||
---|---|---|
1 |
package eu.etaxonomy.taxeditor.editor.view.dataimport; |
|
2 |
|
|
3 |
import org.apache.log4j.Logger; |
|
4 |
import org.eclipse.jface.action.Action; |
|
5 |
import org.eclipse.swt.widgets.Table; |
|
6 |
import org.eclipse.swt.widgets.TableItem; |
|
7 |
import org.eclipse.ui.IWorkbenchPart; |
|
8 |
import org.eclipse.ui.IWorkbenchWindow; |
|
9 |
import org.eclipse.ui.PlatformUI; |
|
10 |
|
|
11 |
import eu.etaxonomy.cdm.api.service.IOccurrenceService; |
|
12 |
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse; |
|
13 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
14 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
15 |
|
|
16 |
public class SaveImportedSpecimenAction extends Action { |
|
17 |
|
|
18 |
private final Logger logger = Logger.getLogger(SaveImportedSpecimenAction.class); |
|
19 |
|
|
20 |
/* (non-Javadoc) |
|
21 |
* @see org.eclipse.jface.action.Action#run() |
|
22 |
*/ |
|
23 |
@Override |
|
24 |
public void run() { |
|
25 |
final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
|
26 |
IWorkbenchPart activePart = window.getActivePage().getActivePart(); |
|
27 |
if(activePart instanceof DataImportView<?>){ |
|
28 |
DataImportView<?> dataImportView = (DataImportView<?>)activePart; |
|
29 |
Table table = dataImportView.getTable(); |
|
30 |
for(TableItem item:table.getItems()){ |
|
31 |
if(item.getChecked()){ |
|
32 |
//Save Specimen |
|
33 |
Object data = item.getData(); |
|
34 |
if(data instanceof GbifResponse){ |
|
35 |
data = ((GbifResponse) item.getData()).getDerivedUnitFacade().innerFieldUnit(); |
|
36 |
} |
|
37 |
if(data instanceof SpecimenOrObservationBase){ |
|
38 |
// dataImportView.getConversationHolder().bind(); |
|
39 |
// CdmStore.getService(IReferenceService.class).saveOrUpdate(((SpecimenOrObservationBase) data).getSources()); |
|
40 |
CdmStore.getService(IOccurrenceService.class).saveOrUpdate((SpecimenOrObservationBase<?>) data); |
|
41 |
dataImportView.getConversationHolder().commit(true); |
|
42 |
} |
|
43 |
} |
|
44 |
} |
|
45 |
} |
|
46 |
} |
|
47 |
|
|
48 |
/* (non-Javadoc) |
|
49 |
* @see org.eclipse.jface.action.Action#getText() |
|
50 |
*/ |
|
51 |
@Override |
|
52 |
public String getText() { |
|
53 |
return "Import"; |
|
54 |
} |
|
55 |
|
|
56 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenImportView.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2014 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.editor.view.dataimport; |
|
11 |
|
|
12 |
import java.io.IOException; |
|
13 |
import java.io.InputStream; |
|
14 |
import java.net.URI; |
|
15 |
import java.util.ArrayList; |
|
16 |
import java.util.Collection; |
|
17 |
|
|
18 |
import org.apache.http.client.ClientProtocolException; |
|
19 |
|
|
20 |
import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper; |
|
21 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
|
22 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
|
23 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
24 |
import eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices.TransientCdmRepository; |
|
25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
26 |
|
|
27 |
/** |
|
28 |
* @author pplitzner |
|
29 |
* @date Sep 3, 2014 |
|
30 |
* |
|
31 |
*/ |
|
32 |
public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase<?>> { |
|
33 |
|
|
34 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView"; //$NON-NLS-1$ |
|
35 |
|
|
36 |
private URI endPoint; |
|
37 |
|
|
38 |
public SpecimenImportView() { |
|
39 |
} |
|
40 |
|
|
41 |
/** |
|
42 |
* @param endPoint |
|
43 |
*/ |
|
44 |
public void setEndpoint(URI endPoint) { |
|
45 |
this.endPoint = endPoint; |
|
46 |
} |
|
47 |
|
|
48 |
/* (non-Javadoc) |
|
49 |
* @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object) |
|
50 |
*/ |
|
51 |
@Override |
|
52 |
protected String getTextForTableItem(SpecimenOrObservationBase<?> item) { |
|
53 |
return item.getTitleCache(); |
|
54 |
} |
|
55 |
|
|
56 |
/* (non-Javadoc) |
|
57 |
* @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query() |
|
58 |
*/ |
|
59 |
@Override |
|
60 |
public void query() { |
|
61 |
String errorMessage = "Could not execute query " + query; |
|
62 |
|
|
63 |
Collection<SpecimenOrObservationBase<?>> results = new ArrayList<SpecimenOrObservationBase<?>>(); |
|
64 |
try { |
|
65 |
//FIXME move ABCD import to cdmlib -> this will also get rid of the transient services |
|
66 |
InputStream resultStream; |
|
67 |
resultStream = new BioCaseQueryServiceWrapper().query(query, endPoint); |
|
68 |
Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false); |
|
69 |
TransientCdmRepository repo = |
|
70 |
new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration()); |
|
71 |
configurator.setCdmAppController(repo); |
|
72 |
|
|
73 |
CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>(); |
|
74 |
importer.invoke(configurator); |
|
75 |
results = repo.getUnits(); |
|
76 |
setResults(results); |
|
77 |
} catch (ClientProtocolException e) { |
|
78 |
logger.error(errorMessage, e); |
|
79 |
} catch (IOException e) { |
|
80 |
logger.error(errorMessage, e); |
|
81 |
} |
|
82 |
|
|
83 |
setResults(results); |
|
84 |
|
|
85 |
} |
|
86 |
|
|
87 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/SpecimenSearchWizard.java | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.widgets.Display; |
20 | 20 |
import org.eclipse.ui.IImportWizard; |
21 | 21 |
import org.eclipse.ui.IWorkbench; |
22 |
import org.eclipse.ui.IWorkbenchPage; |
|
22 | 23 |
import org.eclipse.ui.PartInitException; |
23 | 24 |
|
24 | 25 |
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery; |
25 |
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
|
26 |
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
|
|
26 | 27 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
27 | 28 |
|
28 | 29 |
/** |
... | ... | |
32 | 33 |
* |
33 | 34 |
*/ |
34 | 35 |
public class SpecimenSearchWizard extends Wizard implements IImportWizard { |
35 |
@SuppressWarnings("unused") |
|
36 | 36 |
private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class); |
37 | 37 |
|
38 | 38 |
private OccurenceQuery query = null; |
... | ... | |
59 | 59 |
searchPage.getController().saveLastSate(); |
60 | 60 |
providerSelectionPage.getController().saveLastState(); |
61 | 61 |
|
62 |
DataImportEditorInput<?> input = null;
|
|
62 |
DataImportView<?> dataImportView = null;
|
|
63 | 63 |
query = searchPage.getQuery(); |
64 |
switch (providerSelectionPage.getQueryType()) { |
|
65 |
case BIOCASE: |
|
66 |
input = new BioCaseEditorInput(query, providerSelectionPage.getEndPoint()); |
|
67 |
break; |
|
68 |
case GBIF: |
|
69 |
input = new GbifImportEditorInput(query); |
|
70 |
break; |
|
71 |
} |
|
72 | 64 |
try { |
73 |
EditorUtil.open(input); |
|
65 |
switch (providerSelectionPage.getQueryType()) { |
|
66 |
case BIOCASE: |
|
67 |
SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage() |
|
68 |
.showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE); |
|
69 |
specimenImportView.setEndpoint(providerSelectionPage.getEndPoint()); |
|
70 |
dataImportView = specimenImportView; |
|
71 |
break; |
|
72 |
case GBIF: |
|
73 |
dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage() |
|
74 |
.showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE); |
|
75 |
break; |
|
76 |
} |
|
74 | 77 |
} catch ( PartInitException e ) { |
75 |
//Put your exception handler here if you wish to |
|
78 |
logger.error("Could not open import view for query: " + query.toString(), e); |
|
79 |
} |
|
80 |
if(dataImportView!=null){ |
|
81 |
dataImportView.setQuery(query); |
|
82 |
// dataImportView.query(); |
|
83 |
// Display.getDefault().asyncExec(new Runnable() { |
|
84 |
// |
|
85 |
// @Override |
|
86 |
// public void run() { |
|
87 |
// CdmStore.getContextManager().notifyContextRefresh(); |
|
88 |
// } |
|
89 |
// }); |
|
90 |
Job queryJob = new QueryJob("Query specimen provider", dataImportView); |
|
91 |
queryJob.schedule(); |
|
76 | 92 |
} |
77 |
Job queryJob = new QueryJob("Query specimen provider", input); |
|
78 |
queryJob.schedule(); |
|
79 | 93 |
return true; |
80 | 94 |
} |
81 | 95 |
|
... | ... | |
99 | 113 |
|
100 | 114 |
private class QueryJob extends Job{ |
101 | 115 |
|
102 |
private final DataImportEditorInput<?> input;
|
|
116 |
private final DataImportView<?> view;
|
|
103 | 117 |
|
104 | 118 |
/** |
105 | 119 |
* @param name |
106 | 120 |
*/ |
107 |
public QueryJob(String name, DataImportEditorInput<?> input) {
|
|
121 |
public QueryJob(String name, DataImportView<?> view) {
|
|
108 | 122 |
super(name); |
109 |
this.input = input;
|
|
123 |
this.view = view;
|
|
110 | 124 |
} |
111 | 125 |
|
112 | 126 |
/* (non-Javadoc) |
... | ... | |
114 | 128 |
*/ |
115 | 129 |
@Override |
116 | 130 |
protected IStatus run(IProgressMonitor monitor) { |
117 |
input.query(); |
|
131 |
view.getConversationHolder().bind(); |
|
132 |
view.query(); |
|
118 | 133 |
Display.getDefault().asyncExec(new Runnable() { |
119 | 134 |
|
120 | 135 |
@Override |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCdmRepository.java | ||
---|---|---|
142 | 142 |
*/ |
143 | 143 |
@Override |
144 | 144 |
public ICollectionService getCollectionService() { |
145 |
return defaultApplicationConfiguration.getCollectionService(); |
|
146 |
// return new TransientCollectionService(defaultApplicationConfiguration.getCollectionService()); |
|
145 |
return new TransientCollectionService(defaultApplicationConfiguration.getCollectionService()); |
|
147 | 146 |
} |
148 | 147 |
|
149 | 148 |
/** |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientCollectionService.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2014 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
import java.util.Map; |
|
14 |
import java.util.Set; |
|
15 |
import java.util.UUID; |
|
16 |
|
|
17 |
import org.hibernate.LockOptions; |
|
18 |
import org.hibernate.Session; |
|
19 |
import org.hibernate.criterion.Criterion; |
|
20 |
import org.hibernate.envers.query.criteria.AuditCriterion; |
|
21 |
|
|
22 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
|
23 |
import eu.etaxonomy.cdm.api.service.ICollectionService; |
|
24 |
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; |
|
25 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
|
26 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
|
27 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
|
28 |
import eu.etaxonomy.cdm.model.common.Annotation; |
|
29 |
import eu.etaxonomy.cdm.model.common.ISourceable; |
|
30 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
|
31 |
import eu.etaxonomy.cdm.model.common.LSID; |
|
32 |
import eu.etaxonomy.cdm.model.common.Marker; |
|
33 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
34 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
|
35 |
import eu.etaxonomy.cdm.model.media.Rights; |
|
36 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
|
37 |
import eu.etaxonomy.cdm.model.view.AuditEvent; |
|
38 |
import eu.etaxonomy.cdm.model.view.AuditEventRecord; |
|
39 |
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort; |
|
40 |
import eu.etaxonomy.cdm.persistence.query.Grouping; |
|
41 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
42 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
|
43 |
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy; |
|
44 |
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy; |
|
45 |
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy; |
|
46 |
|
|
47 |
/** |
|
48 |
* @author pplitzner |
|
49 |
* @date Sep 8, 2014 |
|
50 |
* |
|
51 |
*/ |
|
52 |
public class TransientCollectionService implements ICollectionService { |
|
53 |
|
|
54 |
private final ICollectionService defaultService; |
|
55 |
|
|
56 |
/* (non-Javadoc) |
|
57 |
* @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
58 |
*/ |
|
59 |
@Override |
|
60 |
public UUID save(Collection newInstance) { |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
/* (non-Javadoc) |
|
65 |
* @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection) |
|
66 |
*/ |
|
67 |
@Override |
|
68 |
public Map<UUID, Collection> save(java.util.Collection<Collection> newInstances) { |
|
69 |
return null; |
|
70 |
} |
|
71 |
|
|
72 |
/* (non-Javadoc) |
|
73 |
* @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
74 |
*/ |
|
75 |
@Override |
|
76 |
public UUID saveOrUpdate(Collection transientObject) { |
|
77 |
return null; |
|
78 |
} |
|
79 |
|
|
80 |
/* (non-Javadoc) |
|
81 |
* @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection) |
|
82 |
*/ |
|
83 |
@Override |
|
84 |
public Map<UUID, Collection> saveOrUpdate(java.util.Collection<Collection> transientObjects) { |
|
85 |
return null; |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* @param defaultService |
|
90 |
*/ |
|
91 |
public TransientCollectionService(ICollectionService defaultService) { |
|
92 |
this.defaultService = defaultService; |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* @param clazz |
|
97 |
* @param query |
|
98 |
* @param pageSize |
|
99 |
* @param pageNumber |
|
100 |
* @param orderHints |
|
101 |
* @param propertyPaths |
|
102 |
* @return |
|
103 |
* @see eu.etaxonomy.cdm.api.service.ICollectionService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
104 |
*/ |
|
105 |
@Override |
|
106 |
public Pager<Collection> search(Class<? extends Collection> clazz, String query, Integer pageSize, |
|
107 |
Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
108 |
return defaultService.search(clazz, query, pageSize, pageNumber, orderHints, propertyPaths); |
|
109 |
} |
|
110 |
|
|
111 |
/** |
|
112 |
* @param annotatedObj |
|
113 |
* @param status |
|
114 |
* @param pageSize |
|
115 |
* @param pageNumber |
|
116 |
* @param orderHints |
|
117 |
* @param propertyPaths |
|
118 |
* @return |
|
119 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
120 |
*/ |
|
121 |
@Override |
|
122 |
public Pager<Annotation> getAnnotations(Collection annotatedObj, MarkerType status, Integer pageSize, |
|
123 |
Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
124 |
return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths); |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @param t |
|
129 |
* @param pageSize |
|
130 |
* @param pageNumber |
|
131 |
* @param sort |
|
132 |
* @param propertyPaths |
|
133 |
* @return |
|
134 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List) |
|
135 |
*/ |
|
136 |
@Override |
|
137 |
public Pager<AuditEventRecord<Collection>> pageAuditEvents(Collection t, Integer pageSize, Integer pageNumber, |
|
138 |
AuditEventSort sort, List<String> propertyPaths) { |
|
139 |
return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths); |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* |
|
144 |
* @see eu.etaxonomy.cdm.api.service.IService#clear() |
|
145 |
*/ |
|
146 |
@Override |
|
147 |
public void clear() { |
|
148 |
defaultService.clear(); |
|
149 |
} |
|
150 |
|
|
151 |
/** |
|
152 |
* @param t |
|
153 |
* @param lockOptions |
|
154 |
* @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockOptions) |
|
155 |
*/ |
|
156 |
@Override |
|
157 |
public void lock(Collection t, LockOptions lockOptions) { |
|
158 |
defaultService.lock(t, lockOptions); |
|
159 |
} |
|
160 |
|
|
161 |
/** |
|
162 |
* @param t |
|
163 |
* @param lockOptions |
|
164 |
* @param propertyPaths |
|
165 |
* @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockOptions, java.util.List) |
|
166 |
*/ |
|
167 |
@Override |
|
168 |
public void refresh(Collection t, LockOptions lockOptions, List<String> propertyPaths) { |
|
169 |
defaultService.refresh(t, lockOptions, propertyPaths); |
|
170 |
} |
|
171 |
|
|
172 |
/** |
|
173 |
* |
|
174 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache() |
|
175 |
*/ |
|
176 |
@Override |
|
177 |
public void updateTitleCache() { |
|
178 |
defaultService.updateTitleCache(); |
|
179 |
} |
|
180 |
|
|
181 |
/** |
|
182 |
* @param code |
|
183 |
* @return |
|
184 |
* @see eu.etaxonomy.cdm.api.service.ICollectionService#searchByCode(java.lang.String) |
|
185 |
*/ |
|
186 |
@Override |
|
187 |
public List<Collection> searchByCode(String code) { |
|
188 |
return defaultService.searchByCode(code); |
|
189 |
} |
|
190 |
|
|
191 |
/** |
|
192 |
* @param t |
|
193 |
* @return |
|
194 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity) |
|
195 |
*/ |
|
196 |
@Override |
|
197 |
public AuditEventRecord<Collection> getNextAuditEvent(Collection t) { |
|
198 |
return defaultService.getNextAuditEvent(t); |
|
199 |
} |
|
200 |
|
|
201 |
/** |
|
202 |
* @param clazz |
|
203 |
* @param stepSize |
|
204 |
* @param cacheStrategy |
|
205 |
* @param monitor |
|
206 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor) |
|
207 |
*/ |
|
208 |
@Override |
|
209 |
public void updateTitleCache(Class<? extends Collection> clazz, Integer stepSize, |
|
210 |
IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) { |
|
211 |
defaultService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor); |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* @param annotatableEntity |
|
216 |
* @param technical |
|
217 |
* @param pageSize |
|
218 |
* @param pageNumber |
|
219 |
* @param orderHints |
|
220 |
* @param propertyPaths |
|
221 |
* @return |
|
222 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
223 |
*/ |
|
224 |
@Override |
|
225 |
public Pager<Marker> getMarkers(Collection annotatableEntity, Boolean technical, Integer pageSize, |
|
226 |
Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
227 |
return defaultService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths); |
|
228 |
} |
|
229 |
|
|
230 |
/** |
|
231 |
* @param t |
|
232 |
* @return |
|
233 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity) |
|
234 |
*/ |
|
235 |
@Override |
|
236 |
public AuditEventRecord<Collection> getPreviousAuditEvent(Collection t) { |
|
237 |
return defaultService.getPreviousAuditEvent(t); |
|
238 |
} |
|
239 |
|
|
240 |
/** |
|
241 |
* @param clazz |
|
242 |
* @return |
|
243 |
* @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class) |
|
244 |
*/ |
|
245 |
@Override |
|
246 |
public int count(Class<? extends Collection> clazz) { |
|
247 |
return defaultService.count(clazz); |
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
* @param lsid |
|
252 |
* @return |
|
253 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID) |
|
254 |
*/ |
|
255 |
@Override |
|
256 |
public Collection find(LSID lsid) { |
|
257 |
return defaultService.find(lsid); |
|
258 |
} |
|
259 |
|
|
260 |
/** |
|
261 |
* @param clazz |
|
262 |
* @param from |
|
263 |
* @param to |
|
264 |
* @param criteria |
|
265 |
* @param pageSize |
|
266 |
* @param pageValue |
|
267 |
* @param sort |
|
268 |
* @param propertyPaths |
|
269 |
* @return |
|
270 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List) |
|
271 |
*/ |
|
272 |
@Override |
|
273 |
public Pager<AuditEventRecord<Collection>> pageAuditEvents(Class<? extends Collection> clazz, AuditEvent from, |
|
274 |
AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, |
|
275 |
List<String> propertyPaths) { |
|
276 |
return defaultService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths); |
|
277 |
} |
|
278 |
|
|
279 |
/** |
|
280 |
* @param persistentObject |
|
281 |
* @return |
|
282 |
* @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
283 |
*/ |
|
284 |
@Override |
|
285 |
public DeleteResult delete(Collection persistentObject) { |
|
286 |
return defaultService.delete(persistentObject); |
|
287 |
} |
|
288 |
|
|
289 |
/** |
|
290 |
* @param clazz |
|
291 |
* @param technical |
|
292 |
* @param pageSize |
|
293 |
* @param pageNumber |
|
294 |
* @param propertyPaths |
|
295 |
* @return |
|
296 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List) |
|
297 |
*/ |
|
298 |
@Override |
|
299 |
public List<Object[]> groupMarkers(Class<? extends Collection> clazz, Boolean technical, Integer pageSize, |
|
300 |
Integer pageNumber, List<String> propertyPaths) { |
|
301 |
return defaultService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths); |
|
302 |
} |
|
303 |
|
|
304 |
/** |
|
305 |
* @param x |
|
306 |
* @param y |
|
307 |
* @return |
|
308 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity) |
|
309 |
*/ |
|
310 |
@Override |
|
311 |
public Collection replace(Collection x, Collection y) { |
|
312 |
return defaultService.replace(x, y); |
|
313 |
} |
|
314 |
|
|
315 |
/** |
|
316 |
* @param uuid |
|
317 |
* @return |
|
318 |
* @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID) |
|
319 |
*/ |
|
320 |
@Override |
|
321 |
public boolean exists(UUID uuid) { |
|
322 |
return defaultService.exists(uuid); |
|
323 |
} |
|
324 |
|
|
325 |
/** |
|
326 |
* @param t |
|
327 |
* @param pageSize |
|
328 |
* @param pageNumber |
|
329 |
* @param propertyPaths |
|
330 |
* @return |
|
331 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List) |
|
332 |
*/ |
|
333 |
@Override |
|
334 |
public Pager<IdentifiableSource> getSources(Collection t, Integer pageSize, Integer pageNumber, |
|
335 |
List<String> propertyPaths) { |
|
336 |
return defaultService.getSources(t, pageSize, pageNumber, propertyPaths); |
|
337 |
} |
|
338 |
|
|
339 |
/** |
|
340 |
* @param uuidSet |
|
341 |
* @return |
|
342 |
* @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set) |
|
343 |
*/ |
|
344 |
@Override |
|
345 |
public List<Collection> find(Set<UUID> uuidSet) { |
|
346 |
return defaultService.find(uuidSet); |
|
347 |
} |
|
348 |
|
|
349 |
/** |
|
350 |
* @param uuid |
|
351 |
* @return |
|
352 |
* @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID) |
|
353 |
*/ |
|
354 |
@Override |
|
355 |
public Collection find(UUID uuid) { |
|
356 |
return defaultService.find(uuid); |
|
357 |
} |
|
358 |
|
|
359 |
/** |
|
360 |
* @param t |
|
361 |
* @param pageSize |
|
362 |
* @param pageNumber |
|
363 |
* @param propertyPaths |
|
364 |
* @return |
|
365 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List) |
|
366 |
*/ |
|
367 |
@Override |
|
368 |
public Pager<Rights> getRights(Collection t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
|
369 |
return defaultService.getRights(t, pageSize, pageNumber, propertyPaths); |
|
370 |
} |
|
371 |
|
|
372 |
/** |
|
373 |
* @param object |
|
374 |
* @param config |
|
375 |
* @return |
|
376 |
* @see eu.etaxonomy.cdm.api.service.IVersionableService#isDeletable(eu.etaxonomy.cdm.model.common.VersionableEntity, eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase) |
|
377 |
*/ |
|
378 |
@Override |
|
379 |
public List<String> isDeletable(Collection object, DeleteConfiguratorBase config) { |
|
380 |
return defaultService.isDeletable(object, config); |
|
381 |
} |
|
382 |
|
|
383 |
/** |
|
384 |
* @param clazz |
|
385 |
* @param technical |
|
386 |
* @return |
|
387 |
* @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean) |
|
388 |
*/ |
|
389 |
@Override |
|
390 |
public int countMarkers(Class<? extends Collection> clazz, Boolean technical) { |
|
391 |
return defaultService.countMarkers(clazz, technical); |
|
392 |
} |
|
393 |
|
|
394 |
/** |
|
395 |
* @param uuid |
|
396 |
* @return |
|
397 |
* @see eu.etaxonomy.cdm.api.service.IService#findWithoutFlush(java.util.UUID) |
|
398 |
*/ |
|
399 |
@Override |
|
400 |
public Collection findWithoutFlush(UUID uuid) { |
|
401 |
return defaultService.findWithoutFlush(uuid); |
|
402 |
} |
|
403 |
|
|
404 |
/** |
|
405 |
* @param clazz |
|
406 |
* @param idInSource |
|
407 |
* @param idNamespace |
|
408 |
* @return |
|
409 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String) |
|
410 |
*/ |
|
411 |
@Override |
|
412 |
public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) { |
|
413 |
return defaultService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace); |
|
414 |
} |
|
415 |
|
|
416 |
/** |
|
417 |
* @return |
|
418 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache() |
|
419 |
*/ |
|
420 |
@Override |
|
421 |
public List<UuidAndTitleCache<Collection>> getUuidAndTitleCache() { |
|
422 |
return defaultService.getUuidAndTitleCache(); |
|
423 |
} |
|
424 |
|
|
425 |
/** |
|
426 |
* @param clazz |
|
427 |
* @param queryString |
|
428 |
* @param matchmode |
|
429 |
* @param criteria |
|
430 |
* @param pageSize |
|
431 |
* @param pageNumber |
|
432 |
* @param orderHints |
|
433 |
* @param propertyPaths |
|
434 |
* @return |
|
435 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
436 |
*/ |
|
437 |
@Override |
|
438 |
public Pager<Collection> findByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, |
|
439 |
List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, |
|
440 |
List<String> propertyPaths) { |
|
441 |
return defaultService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, |
|
442 |
propertyPaths); |
|
443 |
} |
|
444 |
|
|
445 |
/** |
|
446 |
* @param id |
|
447 |
* @return |
|
448 |
* @see eu.etaxonomy.cdm.api.service.IService#find(int) |
|
449 |
*/ |
|
450 |
@Override |
|
451 |
public Collection find(int id) { |
|
452 |
return defaultService.find(id); |
|
453 |
} |
|
454 |
|
|
455 |
/** |
|
456 |
* @param idSet |
|
457 |
* @return |
|
458 |
* @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set) |
|
459 |
*/ |
|
460 |
@Override |
|
461 |
public List<Collection> findById(Set<Integer> idSet) { |
|
462 |
return defaultService.findById(idSet); |
|
463 |
} |
|
464 |
|
|
465 |
/** |
|
466 |
* @return |
|
467 |
* @see eu.etaxonomy.cdm.api.service.IService#getSession() |
|
468 |
*/ |
|
469 |
@Override |
|
470 |
public Session getSession() { |
|
471 |
return defaultService.getSession(); |
|
472 |
} |
|
473 |
|
|
474 |
/** |
|
475 |
* @param configurator |
|
476 |
* @return |
|
477 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator) |
|
478 |
*/ |
|
479 |
@Override |
|
480 |
public Pager<Collection> findByTitle(IIdentifiableEntityServiceConfigurator<Collection> configurator) { |
|
481 |
return defaultService.findByTitle(configurator); |
|
482 |
} |
|
483 |
|
|
484 |
/** |
|
485 |
* @param clazz |
|
486 |
* @param limit |
|
487 |
* @param start |
|
488 |
* @param groups |
|
489 |
* @param propertyPaths |
|
490 |
* @return |
|
491 |
* @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
492 |
*/ |
|
493 |
@Override |
|
494 |
public List<Object[]> group(Class<? extends Collection> clazz, Integer limit, Integer start, List<Grouping> groups, |
|
495 |
List<String> propertyPaths) { |
|
496 |
return defaultService.group(clazz, limit, start, groups, propertyPaths); |
|
497 |
} |
|
498 |
|
|
499 |
/** |
|
500 |
* @param clazz |
|
501 |
* @param queryString |
|
502 |
* @param matchmode |
|
503 |
* @param criteria |
|
504 |
* @return |
|
505 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List) |
|
506 |
*/ |
|
507 |
@Override |
|
508 |
public Integer countByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, |
|
509 |
List<Criterion> criteria) { |
|
510 |
return defaultService.countByTitle(clazz, queryString, matchmode, criteria); |
|
511 |
} |
|
512 |
|
|
513 |
/** |
|
514 |
* @param configurator |
|
515 |
* @return |
|
516 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator) |
|
517 |
*/ |
|
518 |
@Override |
|
519 |
public Integer countByTitle(IIdentifiableEntityServiceConfigurator<Collection> configurator) { |
|
520 |
return defaultService.countByTitle(configurator); |
|
521 |
} |
|
522 |
|
|
523 |
/** |
|
524 |
* @param type |
|
525 |
* @param limit |
|
526 |
* @param start |
|
527 |
* @param orderHints |
|
528 |
* @param propertyPaths |
|
529 |
* @return |
|
530 |
* @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
531 |
*/ |
|
532 |
@Override |
|
533 |
public <S extends Collection> List<S> list(Class<S> type, Integer limit, Integer start, List<OrderHint> orderHints, |
|
534 |
List<String> propertyPaths) { |
|
535 |
return defaultService.list(type, limit, start, orderHints, propertyPaths); |
|
536 |
} |
|
537 |
|
|
538 |
/** |
|
539 |
* @param clazz |
|
540 |
* @param queryString |
|
541 |
* @param matchmode |
|
542 |
* @param criteria |
|
543 |
* @param pageSize |
|
544 |
* @param pageNumber |
|
545 |
* @param orderHints |
|
546 |
* @param propertyPaths |
|
547 |
* @return |
|
548 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
549 |
*/ |
|
550 |
@Override |
|
551 |
public List<Collection> listByTitle(Class<? extends Collection> clazz, String queryString, MatchMode matchmode, |
|
552 |
List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, |
|
553 |
List<String> propertyPaths) { |
|
554 |
return defaultService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, |
|
555 |
propertyPaths); |
|
556 |
} |
|
557 |
|
|
558 |
/** |
|
559 |
* @param uuid |
|
560 |
* @return |
|
561 |
* @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID) |
|
562 |
*/ |
|
563 |
@Override |
|
564 |
public Collection load(UUID uuid) { |
|
565 |
return defaultService.load(uuid); |
|
566 |
} |
|
567 |
|
|
568 |
/** |
|
569 |
* @param clazz |
|
570 |
* @param queryString |
|
571 |
* @param matchmode |
|
572 |
* @param criteria |
|
573 |
* @param pageSize |
|
574 |
* @param pageNumber |
|
575 |
* @param orderHints |
|
576 |
* @param propertyPaths |
|
577 |
* @return |
|
578 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
579 |
*/ |
|
580 |
@Override |
|
581 |
public List<Collection> listByReferenceTitle(Class<? extends Collection> clazz, String queryString, |
|
582 |
MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, |
|
583 |
List<OrderHint> orderHints, List<String> propertyPaths) { |
|
584 |
return defaultService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, |
|
585 |
orderHints, propertyPaths); |
|
586 |
} |
|
587 |
|
|
588 |
/** |
|
589 |
* @param uuid |
|
590 |
* @param propertyPaths |
|
591 |
* @return |
|
592 |
* @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List) |
|
593 |
*/ |
|
594 |
@Override |
|
595 |
public Collection load(UUID uuid, List<String> propertyPaths) { |
|
596 |
return defaultService.load(uuid, propertyPaths); |
|
597 |
} |
|
598 |
|
|
599 |
/** |
|
600 |
* @param transientObject |
|
601 |
* @return |
|
602 |
* @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
603 |
*/ |
|
604 |
@Override |
|
605 |
public Collection merge(Collection transientObject) { |
|
606 |
return defaultService.merge(transientObject); |
|
607 |
} |
|
608 |
|
|
609 |
/** |
|
610 |
* @param type |
|
611 |
* @param pageSize |
|
612 |
* @param pageNumber |
|
613 |
* @param orderHints |
|
614 |
* @param propertyPaths |
|
615 |
* @return |
|
616 |
* @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
617 |
*/ |
|
618 |
@Override |
|
619 |
public <S extends Collection> Pager<S> page(Class<S> type, Integer pageSize, Integer pageNumber, |
|
620 |
List<OrderHint> orderHints, List<String> propertyPaths) { |
|
621 |
return defaultService.page(type, pageSize, pageNumber, orderHints, propertyPaths); |
|
622 |
} |
|
623 |
|
|
624 |
/** |
|
625 |
* @param persistentObject |
|
626 |
* @return |
|
627 |
* @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
628 |
*/ |
|
629 |
@Override |
|
630 |
public UUID refresh(Collection persistentObject) { |
|
631 |
return defaultService.refresh(persistentObject); |
|
632 |
} |
|
633 |
|
|
634 |
/** |
|
635 |
* @param tableName |
|
636 |
* @param limit |
|
637 |
* @param start |
|
638 |
* @return |
|
639 |
* @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int) |
|
640 |
*/ |
|
641 |
@Override |
|
642 |
public List<Collection> rows(String tableName, int limit, int start) { |
|
643 |
return defaultService.rows(tableName, limit, start); |
|
644 |
} |
|
645 |
|
|
646 |
/** |
|
647 |
* @param clazz |
|
648 |
* @param matchStrategy |
|
649 |
* @param mergeStrategy |
|
650 |
* @return |
|
651 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy) |
|
652 |
*/ |
|
653 |
@Override |
|
654 |
public int deduplicate(Class<? extends Collection> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) { |
|
655 |
return defaultService.deduplicate(clazz, matchStrategy, mergeStrategy); |
|
656 |
} |
|
657 |
|
|
658 |
/** |
|
659 |
* @param clazz |
|
660 |
* @param queryString |
|
661 |
* @param pageSize |
|
662 |
* @param pageNumber |
|
663 |
* @param orderHints |
|
664 |
* @param matchMode |
|
665 |
* @return |
|
666 |
* @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode) |
|
667 |
*/ |
|
668 |
@Override |
|
669 |
public Pager<Collection> findTitleCache(Class<? extends Collection> clazz, String queryString, Integer pageSize, |
|
670 |
Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) { |
|
671 |
return defaultService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode); |
|
672 |
} |
|
673 |
|
|
674 |
/** |
|
675 |
* @param transientObject |
|
676 |
* @return |
|
677 |
* @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
678 |
*/ |
|
679 |
@Override |
|
680 |
public UUID update(Collection transientObject) { |
|
681 |
return defaultService.update(transientObject); |
|
682 |
} |
|
683 |
|
|
684 |
/** |
|
685 |
* @param example |
|
686 |
* @param includeProperties |
|
687 |
* @param limit |
|
688 |
* @param start |
|
689 |
* @param orderHints |
|
690 |
* @param propertyPaths |
|
691 |
* @return |
|
692 |
* @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List) |
|
693 |
*/ |
|
694 |
@Override |
|
695 |
public List<Collection> list(Collection example, Set<String> includeProperties, Integer limit, Integer start, |
|
696 |
List<OrderHint> orderHints, List<String> propertyPaths) { |
|
697 |
return defaultService.list(example, includeProperties, limit, start, orderHints, propertyPaths); |
|
698 |
} |
|
699 |
|
|
700 |
|
|
701 |
} |
Also available in: Unified diff