Revision c4f150b9
Added by Jürgen Koch almost 13 years ago
.gitattributes | ||
---|---|---|
777 | 777 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java -text |
778 | 778 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CommonHelper.java -text |
779 | 779 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ContextListenerAdapter.java -text |
780 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ConversationHolderMock.java -text |
|
780 | 781 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DataChangeBridge.java -text |
781 | 782 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java -text |
782 | 783 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/FeatureNodeContainer.java -text |
... | ... | |
1179 | 1180 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/reporting/ReportingViewPart.java -text |
1180 | 1181 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java -text |
1181 | 1182 |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewer.java -text |
1183 |
eu.etaxonomy.taxeditor.store/src/main/resources/config.properties -text |
|
1182 | 1184 |
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml -text |
1183 | 1185 |
eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties -text |
1184 | 1186 |
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/CdmStoreTest.java -text |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java | ||
---|---|---|
231 | 231 |
*/ |
232 | 232 |
protected void setPartName() { |
233 | 233 |
|
234 |
String partName = null; |
|
235 |
TaxonNameBase<?, ?> name = getTaxon().getName(); |
|
236 |
|
|
237 |
if (name != null) { |
|
238 |
partName = name.getTitleCache(); |
|
239 |
} |
|
234 |
String partName = null;
|
|
235 |
// TaxonNameBase<?, ?> name = getTaxon().getName();
|
|
236 |
// |
|
237 |
// if (name != null) {
|
|
238 |
// partName = name.getTitleCache();
|
|
239 |
// }
|
|
240 | 240 |
|
241 | 241 |
if (partName == null || partName.equals("")) { |
242 | 242 |
partName = ("New taxon"); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor; |
11 | 11 |
|
12 |
import java.util.Arrays; |
|
12 | 13 |
import java.util.HashSet; |
14 |
import java.util.List; |
|
13 | 15 |
import java.util.Set; |
14 | 16 |
import java.util.UUID; |
15 | 17 |
|
... | ... | |
44 | 46 |
* @version 1.0 |
45 | 47 |
*/ |
46 | 48 |
public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPersistableElement { |
47 |
|
|
49 |
|
|
48 | 50 |
private ConversationHolder conversation; |
49 | 51 |
|
50 | 52 |
private TaxonNode taxonNode; |
... | ... | |
52 | 54 |
private TaxonEditorInputDataChangeBehaviour dataChangeBehavior; |
53 | 55 |
|
54 | 56 |
private TaxonBase initiallySelectedTaxonBase; |
57 |
|
|
58 |
private Taxon taxon; |
|
55 | 59 |
|
56 | 60 |
private TaxonEditorInput(TaxonNode taxonNode, ConversationHolder conversation){ |
57 | 61 |
this.conversation = conversation; |
... | ... | |
83 | 87 |
* @return |
84 | 88 |
*/ |
85 | 89 |
private static TaxonEditorInput NewInstance(UUID taxonNodeUuid, ConversationHolder conversation){ |
90 |
// List<String> propertyPaths = Arrays.asList(new String[]{ |
|
91 |
// "taxon.sec", |
|
92 |
// "taxon.name" |
|
93 |
// }); |
|
86 | 94 |
|
87 |
|
|
88 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null); |
|
95 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid);//), propertyPaths); |
|
89 | 96 |
|
90 | 97 |
if(taxonNode == null){ |
91 | 98 |
EditorUtil.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase."); |
... | ... | |
277 | 284 |
public Object getAdapter(Class adapter) { |
278 | 285 |
|
279 | 286 |
if (adapter == Taxon.class) { |
280 |
return taxonNode.getTaxon();
|
|
287 |
return getTaxon(); |
|
281 | 288 |
} |
282 | 289 |
|
283 | 290 |
if (adapter == TaxonNode.class) { |
... | ... | |
311 | 318 |
* @return the taxon |
312 | 319 |
*/ |
313 | 320 |
public Taxon getTaxon(){ |
314 |
return taxonNode.getTaxon(); |
|
321 |
if(taxon == null){ |
|
322 |
List<String> TAXON_INIT_STRATEGY = Arrays.asList(new String []{ |
|
323 |
"*", |
|
324 |
"synonymRelations", |
|
325 |
"relationsToThisTaxon", |
|
326 |
"relationsFromThisTaxon", |
|
327 |
// taxon relations |
|
328 |
"relationsToThisName.fromTaxon.name", |
|
329 |
// the name |
|
330 |
"name", |
|
331 |
"name.homotypicalGroup", |
|
332 |
"name.homotypicalGroup.typifiedNames", |
|
333 |
"name.rank.representations", |
|
334 |
"name.status.type.representations", |
|
335 |
|
|
336 |
// taxon descriptions |
|
337 |
"descriptions.elements.area.$", |
|
338 |
"descriptions.elements.multilanguageText", |
|
339 |
"descriptions.elements.media.representations.parts", |
|
340 |
"descriptions.elements.media.title", |
|
341 |
|
|
342 |
}); |
|
343 |
|
|
344 |
taxon = (Taxon) CdmStore.getService(ITaxonService.class).load(taxonNode.getTaxon().getUuid(), TAXON_INIT_STRATEGY); |
|
345 |
} |
|
346 |
|
|
347 |
return taxon; |
|
315 | 348 |
} |
316 | 349 |
|
317 | 350 |
/** |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.navigation; |
11 | 11 |
|
12 |
import java.util.Arrays; |
|
13 |
import java.util.List; |
|
12 | 14 |
import java.util.Set; |
13 | 15 |
import java.util.UUID; |
14 | 16 |
|
... | ... | |
28 | 30 |
import org.eclipse.ui.handlers.IHandlerService; |
29 | 31 |
import org.eclipse.ui.navigator.CommonViewer; |
30 | 32 |
|
33 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
31 | 34 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
32 | 35 |
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; |
33 | 36 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
... | ... | |
43 | 46 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
44 | 47 |
import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin; |
45 | 48 |
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator; |
49 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
46 | 50 |
|
47 | 51 |
/** |
48 | 52 |
* <p>NavigationUtil class.</p> |
... | ... | |
321 | 325 |
return TaxeditorNavigationPlugin.PLUGIN_ID; |
322 | 326 |
} |
323 | 327 |
|
328 |
public static TaxonNode getTaxonNode(Object element){ |
|
329 |
if (element instanceof TaxonNode){ |
|
330 |
List<String> propertyPaths = Arrays.asList(new String[]{ |
|
331 |
"taxon.sec", |
|
332 |
"taxon.name", |
|
333 |
"childNodes" |
|
334 |
}); |
|
335 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(((ICdmBase) element).getUuid(), propertyPaths); |
|
336 |
return taxonNode; |
|
337 |
} |
|
338 |
return null; |
|
339 |
} |
|
324 | 340 |
} |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/ClassificationContentProvider.java | ||
---|---|---|
14 | 14 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
15 | 15 |
import org.eclipse.jface.viewers.Viewer; |
16 | 16 |
|
17 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
|
18 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
17 | 19 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
20 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
|
21 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
18 | 22 |
|
19 | 23 |
/** |
20 | 24 |
* <p>ClassificationContentProvider class.</p> |
... | ... | |
35 | 39 |
if (parentElement instanceof Root) { |
36 | 40 |
return ((Root) parentElement).getParentBeans().toArray(); |
37 | 41 |
}else if(parentElement instanceof Classification){ |
38 |
return ((Classification) parentElement).getChildNodes().toArray(); |
|
42 |
Classification classification = (Classification) parentElement; |
|
43 |
classification = CdmStore.getService(IClassificationService.class).load(classification.getUuid()); |
|
44 |
|
|
45 |
return classification.getChildNodes().toArray(); |
|
46 |
|
|
47 |
// classification.getChildNodes(); |
|
48 |
// List<String> propertyPaths = null; |
|
49 |
// |
|
50 |
// CdmStore.getService(ITaxonNodeService.class).loadChildNodesOfTaxonNode(taxonNode, propertyPaths); |
|
51 |
// return ((Classification) parentElement).getChildNodes().toArray(); |
|
39 | 52 |
} |
40 | 53 |
|
41 | 54 |
|
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeContentProvider.java | ||
---|---|---|
17 | 17 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
18 | 18 |
import eu.etaxonomy.cdm.model.taxon.ITreeNode; |
19 | 19 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
20 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
|
20 | 21 |
|
21 | 22 |
/** |
22 | 23 |
* <p>TaxonNodeContentProvider class.</p> |
... | ... | |
36 | 37 |
Object[] children = null; |
37 | 38 |
|
38 | 39 |
if(parentElement instanceof ITreeNode){ |
39 |
ITreeNode treeNode = (ITreeNode) HibernateProxyHelper.deproxy(parentElement);
|
|
40 |
children = treeNode.getChildNodes().toArray();
|
|
40 |
TaxonNode taxonNode = NavigationUtil.getTaxonNode(parentElement);
|
|
41 |
children = taxonNode.getChildNodes().toArray();
|
|
41 | 42 |
} |
42 | 43 |
|
43 | 44 |
return children != null ? children : NO_CHILDREN; |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.navigation.navigator; |
12 | 12 |
|
13 |
import org.apache.log4j.Logger; |
|
13 |
import java.util.Arrays; |
|
14 |
import java.util.List; |
|
15 |
|
|
14 | 16 |
import org.eclipse.jface.viewers.ColumnLabelProvider; |
17 |
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; |
|
15 | 18 |
import org.eclipse.jface.viewers.ILabelProvider; |
16 | 19 |
import org.eclipse.jface.viewers.StyledString; |
17 |
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; |
|
18 | 20 |
import org.eclipse.swt.graphics.Image; |
19 | 21 |
import org.eclipse.ui.navigator.IDescriptionProvider; |
20 | 22 |
import org.hibernate.LazyInitializationException; |
21 | 23 |
|
24 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
|
22 | 25 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
26 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
|
23 | 27 |
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity; |
24 | 28 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
25 | 29 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
26 | 30 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
31 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
27 | 32 |
|
28 | 33 |
/** |
29 | 34 |
* <p>TaxonNodeLabelProvider class.</p> |
... | ... | |
44 | 49 |
/** {@inheritDoc} */ |
45 | 50 |
@Override |
46 | 51 |
public String getText(Object element) { |
47 |
if (element instanceof TaxonNode){ |
|
48 |
TaxonNode taxonNode = (TaxonNode) HibernateProxyHelper.deproxy(element); |
|
49 |
|
|
50 |
try{ |
|
51 |
Taxon taxon = (Taxon) HibernateProxyHelper.deproxy(taxonNode.getTaxon()); |
|
52 |
if(taxon == null){ |
|
53 |
NavigationUtil.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null); |
|
54 |
// throw new RuntimeException("The data your are trying to view is corrupt. Please check your import."); |
|
55 |
}else{ |
|
56 |
try{ |
|
57 |
return taxon.getName() != null ? ((IIdentifiableEntity) HibernateProxyHelper.deproxy(taxon.getName())).getTitleCache() : new String(); |
|
58 |
}catch(Exception e){ |
|
59 |
NavigationUtil.error(getClass(), e); |
|
60 |
} |
|
61 |
} |
|
62 |
}catch (LazyInitializationException e){ |
|
52 |
Taxon taxon = getTaxon(element); |
|
53 |
|
|
54 |
if(taxon == null){ |
|
55 |
NavigationUtil.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null); |
|
56 |
}else{ |
|
57 |
try{ |
|
58 |
return taxon.getName() != null ? ((IIdentifiableEntity) HibernateProxyHelper.deproxy(taxon.getName())).getTitleCache() : new String(); |
|
59 |
}catch(Exception e){ |
|
63 | 60 |
NavigationUtil.error(getClass(), e); |
64 | 61 |
} |
65 |
|
|
66 | 62 |
} |
67 | 63 |
return new String(); |
68 | 64 |
} |
69 | 65 |
|
66 |
private Taxon getTaxon(Object element){ |
|
67 |
TaxonNode taxonNode = NavigationUtil.getTaxonNode(element); |
|
68 |
if (taxonNode != null){ |
|
69 |
return taxonNode.getTaxon(); |
|
70 |
} |
|
71 |
return null; |
|
72 |
} |
|
73 |
|
|
70 | 74 |
/* (non-Javadoc) |
71 | 75 |
* @see org.eclipse.ui.navigator.IDescriptionProvider#getDescription(java.lang.Object) |
72 | 76 |
*/ |
73 | 77 |
/** {@inheritDoc} */ |
74 |
public String getDescription(Object anElement) {
|
|
75 |
if (anElement instanceof TaxonNode) {
|
|
76 |
Taxon data = ((TaxonNode) anElement).getTaxon();
|
|
77 |
return "Taxon: " + data.getTitleCache(); //$NON-NLS-1$
|
|
78 |
public String getDescription(Object element) {
|
|
79 |
Taxon taxon = getTaxon(element);
|
|
80 |
if (taxon != null) {
|
|
81 |
return "Taxon: " + taxon.getTitleCache(); //$NON-NLS-1$
|
|
78 | 82 |
} |
79 | 83 |
return null; |
80 | 84 |
} |
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java | ||
---|---|---|
55 | 55 |
return null; |
56 | 56 |
} |
57 | 57 |
|
58 |
configurator = PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationController()); |
|
58 |
configurator = PublishConfigurator.NewLocalInstance(null);//CdmStore.getCurrentApplicationController());
|
|
59 | 59 |
|
60 | 60 |
Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInput) input); |
61 | 61 |
configurator.addSelectedTaxonNodeElements(taxonNodeElement); |
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java | ||
---|---|---|
148 | 148 |
label_serviceUrl.setEnabled(false); |
149 | 149 |
text_serviceUrl.setEnabled(false); |
150 | 150 |
|
151 |
setConfigurator(PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationController())); |
|
151 |
setConfigurator(PublishConfigurator.NewLocalInstance(null));//CdmStore.getCurrentApplicationController()));
|
|
152 | 152 |
getConfigurator().addOutputModule(getOutputModule()); |
153 | 153 |
} |
154 | 154 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ConversationHolderMock.java | ||
---|---|---|
1 |
package eu.etaxonomy.taxeditor.model; |
|
2 |
|
|
3 |
import javax.sql.DataSource; |
|
4 |
|
|
5 |
import org.hibernate.FlushMode; |
|
6 |
import org.hibernate.LockMode; |
|
7 |
import org.hibernate.Session; |
|
8 |
import org.hibernate.SessionFactory; |
|
9 |
import org.springframework.orm.hibernate3.SessionFactoryUtils; |
|
10 |
import org.springframework.orm.hibernate3.SessionHolder; |
|
11 |
import org.springframework.transaction.PlatformTransactionManager; |
|
12 |
import org.springframework.transaction.TransactionDefinition; |
|
13 |
import org.springframework.transaction.TransactionStatus; |
|
14 |
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
|
17 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
18 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener; |
|
19 |
|
|
20 |
public class ConversationHolderMock extends ConversationHolder { |
|
21 |
|
|
22 |
|
|
23 |
/** |
|
24 |
* This method has to be called when starting a new unit-of-work. All required resources are |
|
25 |
* bound so that SessionFactory.getCurrentSession() returns the right session for this conversation |
|
26 |
*/ |
|
27 |
public void bind() { |
|
28 |
|
|
29 |
} |
|
30 |
// |
|
31 |
// public SessionHolder getSessionHolder(){ |
|
32 |
// return null; |
|
33 |
// } |
|
34 |
// |
|
35 |
// /** |
|
36 |
// * @return |
|
37 |
// */ |
|
38 |
// private DataSource getDataSource() { |
|
39 |
// return null; |
|
40 |
// } |
|
41 |
// |
|
42 |
// /** |
|
43 |
// * @return true if this longSession is bound to the session factory. |
|
44 |
// */ |
|
45 |
// public boolean isBound(){ |
|
46 |
// return false; |
|
47 |
// } |
|
48 |
// |
|
49 |
/** |
|
50 |
* Creates an instance of TransactionStatus and binds it to this conversation manager. |
|
51 |
* At the moment we allow only on transaction per conversation holder. |
|
52 |
* |
|
53 |
* @return the transaction status bound to this conversation holder |
|
54 |
*/ |
|
55 |
public TransactionStatus startTransaction(){ |
|
56 |
return null; |
|
57 |
} |
|
58 |
// |
|
59 |
// /** |
|
60 |
// * @return if there is a running transaction |
|
61 |
// */ |
|
62 |
// public boolean isTransactionActive(){ |
|
63 |
// return false; |
|
64 |
// } |
|
65 |
// |
|
66 |
// /* (non-Javadoc) |
|
67 |
// * @see org.hibernate.Session#evict(java.lang.Object object) |
|
68 |
// */ |
|
69 |
// public void evict(Object object){ |
|
70 |
// |
|
71 |
// } |
|
72 |
// |
|
73 |
// /* (non-Javadoc) |
|
74 |
// * @see org.hibernate.Session#refresh(java.lang.Object object) |
|
75 |
// */ |
|
76 |
// public void refresh(Object object){ |
|
77 |
// |
|
78 |
// } |
|
79 |
// |
|
80 |
// /* (non-Javadoc) |
|
81 |
// * @see org.hibernate.Session#clear() |
|
82 |
// */ |
|
83 |
// public void clear(){ |
|
84 |
// |
|
85 |
// } |
|
86 |
// |
|
87 |
/** |
|
88 |
* Commit the running transaction. |
|
89 |
*/ |
|
90 |
public void commit(){ |
|
91 |
|
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* Commit the running transaction but optionally start a |
|
96 |
* new one right away. |
|
97 |
* |
|
98 |
* @param restartTransaction whether to start a new transaction |
|
99 |
*/ |
|
100 |
public TransactionStatus commit(boolean restartTransaction){ |
|
101 |
return null; |
|
102 |
} |
|
103 |
// |
|
104 |
// /** |
|
105 |
// * @return the session associated with this conversation manager |
|
106 |
// */ |
|
107 |
// private Session getSession() { |
|
108 |
// return null; |
|
109 |
// } |
|
110 |
// |
|
111 |
// /** |
|
112 |
// * @return the session factory that is bound to this conversation manager |
|
113 |
// */ |
|
114 |
// private SessionFactory getSessionFactory() { |
|
115 |
// return null; |
|
116 |
// } |
|
117 |
// |
|
118 |
// public void delete(Object object){ |
|
119 |
// |
|
120 |
// } |
|
121 |
// |
|
122 |
// /** |
|
123 |
// * Facades Session.lock() |
|
124 |
// */ |
|
125 |
// public void lock(Object persistentObject, LockMode lockMode) { |
|
126 |
// |
|
127 |
// } |
|
128 |
// |
|
129 |
// public void lock(String entityName, Object persistentObject, LockMode lockMode){ |
|
130 |
// getSession().lock(entityName, persistentObject, lockMode); |
|
131 |
// } |
|
132 |
// |
|
133 |
// /** |
|
134 |
// * @return the definition |
|
135 |
// */ |
|
136 |
// public TransactionDefinition getDefinition() { |
|
137 |
// return null; |
|
138 |
// } |
|
139 |
// |
|
140 |
// /** |
|
141 |
// * @param definition the definition to set |
|
142 |
// */ |
|
143 |
// public void setDefinition(TransactionDefinition definition) { |
|
144 |
// |
|
145 |
// } |
|
146 |
// |
|
147 |
// /** |
|
148 |
// * Register to get updated after any interaction with the datastore |
|
149 |
// */ |
|
150 |
// public void registerForDataStoreChanges(IConversationEnabled observer) { |
|
151 |
// |
|
152 |
// } |
|
153 |
// |
|
154 |
// /** |
|
155 |
// * Register to get updated after any interaction with the datastore |
|
156 |
// */ |
|
157 |
// public void unregisterForDataStoreChanges(IConversationEnabled observer) { |
|
158 |
// |
|
159 |
// } |
|
160 |
// |
|
161 |
// /** |
|
162 |
// * Free resources bound to this conversationHolder |
|
163 |
// */ |
|
164 |
// public void close(){ |
|
165 |
// |
|
166 |
// } |
|
167 |
// |
|
168 |
// public boolean isClosed(){ |
|
169 |
// return false; |
|
170 |
// } |
|
171 |
|
|
172 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java | ||
---|---|---|
22 | 22 |
|
23 | 23 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
24 | 24 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
25 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationRemoteConfiguration; |
|
25 | 26 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
26 | 27 |
import eu.etaxonomy.cdm.api.service.IService; |
27 | 28 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
... | ... | |
31 | 32 |
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository; |
32 | 33 |
import eu.etaxonomy.taxeditor.io.ExportManager; |
33 | 34 |
import eu.etaxonomy.taxeditor.io.ImportManager; |
35 |
import eu.etaxonomy.taxeditor.model.ConversationHolderMock; |
|
34 | 36 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
35 | 37 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
36 | 38 |
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart; |
... | ... | |
56 | 58 |
|
57 | 59 |
private static CdmStore instance; |
58 | 60 |
|
59 |
private final CdmApplicationController applicationController;
|
|
61 |
private final ICdmApplicationRemoteConfiguration applicationController;
|
|
60 | 62 |
|
61 | 63 |
private static LoginManager loginManager = new LoginManager(); |
62 | 64 |
|
... | ... | |
167 | 169 |
if ((monitor == null || (!monitor.isCanceled()) && isActive())) { |
168 | 170 |
getContextManager().notifyContextStop(monitor); |
169 | 171 |
if (instance.getApplicationController() != null) { |
170 |
instance.getApplicationController().close(); |
|
172 |
// instance.getApplicationController().close();
|
|
171 | 173 |
} |
172 | 174 |
instance.close(); |
173 | 175 |
} |
... | ... | |
180 | 182 |
cdmDatasource = null; |
181 | 183 |
} |
182 | 184 |
|
183 |
static void setInstance(CdmApplicationController applicationController,
|
|
185 |
static void setInstance(ICdmApplicationRemoteConfiguration applicationController,
|
|
184 | 186 |
ICdmDataSource dataSource) { |
185 | 187 |
instance = new CdmStore(applicationController, dataSource); |
186 | 188 |
} |
187 | 189 |
|
188 |
private CdmStore(CdmApplicationController applicationController,
|
|
190 |
private CdmStore(ICdmApplicationRemoteConfiguration applicationController,
|
|
189 | 191 |
ICdmDataSource dataSource) { |
190 | 192 |
this.applicationController = applicationController; |
191 | 193 |
this.cdmDatasource = dataSource; |
... | ... | |
197 | 199 |
* |
198 | 200 |
* @return |
199 | 201 |
*/ |
200 |
private CdmApplicationController getApplicationController() {
|
|
202 |
private ICdmApplicationRemoteConfiguration getApplicationController() {
|
|
201 | 203 |
try { |
202 | 204 |
return applicationController; |
203 | 205 |
} catch (Exception e) { |
... | ... | |
215 | 217 |
* {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} |
216 | 218 |
* object. |
217 | 219 |
*/ |
218 |
public static CdmApplicationController getCurrentApplicationController() {
|
|
220 |
public static ICdmApplicationRemoteConfiguration getCurrentApplicationController() {
|
|
219 | 221 |
if (getDefault() != null) { |
220 | 222 |
return getDefault().getApplicationController(); |
221 | 223 |
} |
... | ... | |
234 | 236 |
* object. |
235 | 237 |
*/ |
236 | 238 |
public static ConversationHolder createConversation() { |
237 |
ConversationHolder conversation = getCurrentApplicationController() |
|
238 |
.NewConversation(); |
|
239 |
// ConversationHolder conversation = getCurrentApplicationController() |
|
240 |
// .NewConversation(); |
|
241 |
ConversationHolder conversation = new ConversationHolderMock(); |
|
239 | 242 |
|
240 | 243 |
conversation.startTransaction(); |
241 | 244 |
return conversation; |
... | ... | |
250 | 253 |
* @return |
251 | 254 |
*/ |
252 | 255 |
public static <T extends IService> T getService(Class<T> serviceClass) { |
253 |
ICdmApplicationConfiguration configuration = getCurrentApplicationController(); |
|
256 |
ICdmApplicationRemoteConfiguration configuration = getCurrentApplicationController();
|
|
254 | 257 |
|
255 | 258 |
Method[] methods = ICdmApplicationConfiguration.class |
256 | 259 |
.getDeclaredMethods(); |
... | ... | |
287 | 290 |
* object. |
288 | 291 |
*/ |
289 | 292 |
public static ProviderManager getAuthenticationManager() { |
290 |
return getCurrentApplicationController().getAuthenticationManager(); |
|
293 |
return null; //getCurrentApplicationController().getAuthenticationManager();
|
|
291 | 294 |
} |
292 | 295 |
|
293 | 296 |
/** |
... | ... | |
298 | 301 |
* @return a {@link eu.etaxonomy.cdm.ext.geo.IEditGeoService} object. |
299 | 302 |
*/ |
300 | 303 |
public static IEditGeoService getGeoService() { |
301 |
return (IEditGeoService) getCurrentApplicationController().getBean( |
|
302 |
"editGeoService"); |
|
304 |
return null;// (IEditGeoService) getCurrentApplicationController().getBean("editGeoService"); |
|
303 | 305 |
} |
304 | 306 |
|
305 | 307 |
/* |
... | ... | |
397 | 399 |
* @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object. |
398 | 400 |
*/ |
399 | 401 |
public static ImportManager getImportManager() { |
400 |
return ImportManager.NewInstance(getCurrentApplicationController()); |
|
402 |
return ImportManager.NewInstance(null);//getCurrentApplicationController());
|
|
401 | 403 |
} |
402 | 404 |
|
403 | 405 |
/** |
... | ... | |
408 | 410 |
* @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object. |
409 | 411 |
*/ |
410 | 412 |
public static ExportManager getExportManager() { |
411 |
return ExportManager.NewInstance(getCurrentApplicationController()); |
|
413 |
return ExportManager.NewInstance(null);//getCurrentApplicationController());
|
|
412 | 414 |
} |
413 | 415 |
|
414 | 416 |
/** |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java | ||
---|---|---|
20 | 20 |
import org.springframework.core.io.Resource; |
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
23 |
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController; |
|
24 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationRemoteConfiguration; |
|
23 | 25 |
import eu.etaxonomy.cdm.database.DatabaseTypeEnum; |
24 | 26 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
25 | 27 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
... | ... | |
82 | 84 |
CdmStore.close(monitor); |
83 | 85 |
} |
84 | 86 |
|
85 |
CdmApplicationController applicationController = null;
|
|
87 |
ICdmApplicationRemoteConfiguration applicationController = null;
|
|
86 | 88 |
|
87 | 89 |
if (!monitor.isCanceled()) { |
88 | 90 |
CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter |
89 | 91 |
.CreateSubMonitor(monitor, IProgressMonitor.UNKNOWN); |
90 | 92 |
// This is where we instantiate the application controller |
91 | 93 |
try { |
92 |
applicationController = CdmApplicationController.NewInstance( |
|
93 |
applicationContextBean, dataSource, dbSchemaValidation, |
|
94 |
false, subprogressMonitor); |
|
94 |
// applicationController = CdmApplicationController.NewInstance( |
|
95 |
// applicationContextBean, dataSource, dbSchemaValidation, |
|
96 |
// false, subprogressMonitor); |
|
97 |
applicationController = CdmApplicationRemoteController.NewInstance(applicationContextBean, subprogressMonitor); |
|
95 | 98 |
} catch (Exception e) { |
96 | 99 |
StoreUtil.error(this.getClass(), e.getMessage(), e); |
97 | 100 |
} |
eu.etaxonomy.taxeditor.store/src/main/resources/config.properties | ||
---|---|---|
1 |
serverName=localhost:8080 |
|
2 |
contextPath= |
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml | ||
---|---|---|
7 | 7 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd |
8 | 8 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> |
9 | 9 |
|
10 |
<import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/>
|
|
11 |
<!-- <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/> -->
|
|
12 |
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer"> |
|
10 |
<!-- <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/> -->
|
|
11 |
<import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/>
|
|
12 |
<!-- <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
|
|
13 | 13 |
<property name="omit" value="false" /> |
14 |
</bean>--> |
|
15 |
<bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer"> |
|
16 |
<!-- <property name="omit" value="false" /> --> |
|
14 | 17 |
</bean> |
15 | 18 |
|
19 |
<!-- |
|
16 | 20 |
<import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/> |
17 | 21 |
<import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml"/> |
22 |
--> |
|
18 | 23 |
|
19 |
<context:component-scan base-package="eu/etaxonomy/cdm/ext"/>
|
|
24 |
<!-- <context:component-scan base-package="eu/etaxonomy/cdm/ext"/> -->
|
|
20 | 25 |
|
26 |
<!-- |
|
21 | 27 |
<context:component-scan base-package="eu/etaxonomy/cdm/remote"> |
22 | 28 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.config\.DataSourceConfigurer" /> |
23 | 29 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.config\.LoggingConfigurer" /> |
24 | 30 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.remote\.view\.PatternViewResolver" /> |
25 | 31 |
</context:component-scan> |
26 |
|
|
27 |
|
|
32 |
--> |
|
28 | 33 |
</beans> |
eu.etaxonomy.taxeditor.test/.classpath | ||
---|---|---|
4 | 4 |
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
5 | 5 |
<classpathentry kind="src" path="src/test/java"/> |
6 | 6 |
<classpathentry kind="src" path="src/main/resources"/> |
7 |
<classpathentry kind="src" path="src_/"/> |
|
7 | 8 |
<classpathentry kind="output" path="bin"/> |
8 | 9 |
</classpath> |
Also available in: Unified diff