Revision 84bff3eb
Added by Andreas Müller almost 4 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.ReferenceSortProvider; |
27 | 27 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
28 | 28 |
|
29 |
|
|
30 | 29 |
/** |
31 |
* |
|
32 | 30 |
* @author p.ciardelli |
33 | 31 |
* @created 25.06.2009 |
34 | 32 |
*/ |
... | ... | |
137 | 135 |
return BulkEditorInputType.REFERENCE.label; |
138 | 136 |
} |
139 | 137 |
|
140 |
public static AbstractBulkEditorInput getInstance() { |
|
138 |
public static AbstractBulkEditorInput<Reference> getInstance() {
|
|
141 | 139 |
if (instance == null) { |
142 | 140 |
instance = new ReferenceEditorInput(); |
143 | 141 |
} |
... | ... | |
163 | 161 |
} |
164 | 162 |
|
165 | 163 |
@Override |
166 |
public List listEntities(IIdentifiableEntityServiceConfigurator configurator) { |
|
164 |
public List<Reference> listEntities(IIdentifiableEntityServiceConfigurator configurator) {
|
|
167 | 165 |
return CdmStore.getSearchManager().findReferences(configurator); |
168 | 166 |
} |
169 | 167 |
|
170 |
// Entity persistence
|
|
168 |
//entity persistence
|
|
171 | 169 |
|
172 | 170 |
@Override |
173 | 171 |
public Reference loadEntity(UUID entityUuid) { |
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java | ||
---|---|---|
82 | 82 |
} |
83 | 83 |
} |
84 | 84 |
|
85 |
/** |
|
86 |
* @param invocation |
|
87 |
* @param originalInvocation |
|
88 |
* @return |
|
89 |
* @throws Exception |
|
90 |
*/ |
|
91 | 85 |
private RemoteInvocationResult handleGeneralRequest(RemoteInvocation invocation, |
92 | 86 |
MethodInvocation originalInvocation) throws Exception { |
93 | 87 |
RemoteInvocationResult invocationResult = doExecuteRequest(invocation, originalInvocation); |
... | ... | |
106 | 100 |
invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), false)); |
107 | 101 |
logger.debug("Entity cached without updating cached data" ); |
108 | 102 |
} |
109 |
|
|
110 | 103 |
} |
111 | 104 |
cache(invocation, invocationResult); |
112 | 105 |
return invocationResult; |
... | ... | |
116 | 109 |
|
117 | 110 |
} |
118 | 111 |
|
119 |
/** |
|
120 |
* @param invocation |
|
121 |
* @param originalInvocation |
|
122 |
* @return |
|
123 |
* @throws Exception |
|
124 |
*/ |
|
125 | 112 |
private RemoteInvocationResult handleTermRequest(RemoteInvocation invocation, MethodInvocation originalInvocation) |
126 | 113 |
throws Exception { |
127 | 114 |
RemoteInvocationResult invocationResult = null; |
... | ... | |
141 | 128 |
return invocationResult; |
142 | 129 |
} |
143 | 130 |
|
144 |
/** |
|
145 |
* @param invocation |
|
146 |
* @param originalInvocation |
|
147 |
* @return |
|
148 |
* @throws Exception |
|
149 |
*/ |
|
150 | 131 |
private RemoteInvocationResult doExecuteRequest(RemoteInvocation invocation, MethodInvocation originalInvocation) |
151 | 132 |
throws Exception { |
152 | 133 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperation.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
25 | 25 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
26 | 26 |
|
27 |
|
|
28 | 27 |
/** |
29 | 28 |
* @author cmathew |
30 | 29 |
* @date 16 Jun 2015 |
31 |
* |
|
32 | 30 |
*/ |
33 | 31 |
public abstract class RemotingCdmUpdateOperation extends RemotingCdmOperation { |
34 | 32 |
|
... | ... | |
39 | 37 |
protected MPart activePart = null; |
40 | 38 |
protected MApplication application = null; |
41 | 39 |
|
42 |
/** |
|
43 |
* @param label |
|
44 |
*/ |
|
45 | 40 |
public RemotingCdmUpdateOperation(String label, Action action, Object source, boolean async, |
46 | 41 |
EPartService partService, |
47 | 42 |
MPart activePart, |
... | ... | |
57 | 52 |
|
58 | 53 |
} |
59 | 54 |
|
60 |
/* (non-Javadoc) |
|
61 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
62 |
*/ |
|
63 | 55 |
@Override |
64 | 56 |
protected boolean doExecute(IProgressMonitor monitor, IAdaptable info) { |
65 | 57 |
updateResult = new UpdateResult(); |
... | ... | |
85 | 77 |
if(success && updateResult != null) { |
86 | 78 |
fireDataChangeEvent(updateResult); |
87 | 79 |
} |
88 |
|
|
89 | 80 |
} |
90 | 81 |
|
91 |
/* (non-Javadoc) |
|
92 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean) |
|
93 |
*/ |
|
94 | 82 |
@Override |
95 | 83 |
protected IStatus onComplete(boolean success) { |
96 | 84 |
|
... | ... | |
139 | 127 |
} |
140 | 128 |
return null; |
141 | 129 |
} |
142 |
|
|
143 |
|
|
144 | 130 |
} |
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/RemotingTestUpdateOperation.java | ||
---|---|---|
21 | 21 |
/** |
22 | 22 |
* @author cmathew |
23 | 23 |
* @date 26 Jun 2015 |
24 |
* |
|
25 | 24 |
*/ |
26 | 25 |
public class RemotingTestUpdateOperation extends RemotingCdmUpdateOperation { |
27 | 26 |
|
... | ... | |
31 | 30 |
private Exception exception; |
32 | 31 |
private CdmEntityIdentifier cei; |
33 | 32 |
|
34 |
|
|
35 |
/** |
|
36 |
* @param label |
|
37 |
* @param action |
|
38 |
* @param source |
|
39 |
* @param async |
|
40 |
*/ |
|
41 | 33 |
public RemotingTestUpdateOperation(UpdateResult result, |
42 | 34 |
Object source, |
43 | 35 |
boolean async) { |
... | ... | |
59 | 51 |
this.cei = cei; |
60 | 52 |
} |
61 | 53 |
|
62 |
/* (non-Javadoc) |
|
63 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
64 |
*/ |
|
65 | 54 |
@Override |
66 | 55 |
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
67 | 56 |
ITestService testService = CdmApplicationState.getTestService(); |
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.java | ||
---|---|---|
68 | 68 |
TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4)); |
69 | 69 |
TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5)); |
70 | 70 |
|
71 |
taxonNodes = new HashSet<TaxonNode>();
|
|
71 |
taxonNodes = new HashSet<>(); |
|
72 | 72 |
taxonNodes.add(taxonNode1); |
73 | 73 |
taxonNodes.add(taxonNode2); |
74 | 74 |
taxonNodes.add(taxonNode3); |
... | ... | |
95 | 95 |
TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4)); |
96 | 96 |
TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5)); |
97 | 97 |
|
98 |
taxonNodes = new HashSet<TaxonNode>();
|
|
98 |
taxonNodes = new HashSet<>(); |
|
99 | 99 |
taxonNodes.add(taxonNode1); |
100 | 100 |
taxonNodes.add(taxonNode2); |
101 | 101 |
taxonNodes.add(taxonNode3); |
102 | 102 |
taxonNodes.add(taxonNode4); |
103 | 103 |
taxonNodes.add(taxonNode5); |
104 | 104 |
|
105 |
ceis = new HashSet<CdmEntityIdentifier>();
|
|
105 |
ceis = new HashSet<>(); |
|
106 | 106 |
ceis.add(new CdmEntityIdentifier(taxonNode3.getId(),TaxonNode.class)); |
107 | 107 |
ceis.add(new CdmEntityIdentifier(taxonNode4.getId(),TaxonNode.class)); |
108 | 108 |
ceis.add(new CdmEntityIdentifier(taxonNode5.getId(),TaxonNode.class)); |
... | ... | |
128 | 128 |
TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4)); |
129 | 129 |
TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5)); |
130 | 130 |
|
131 |
taxonNodes = new HashSet<TaxonNode>();
|
|
131 |
taxonNodes = new HashSet<>(); |
|
132 | 132 |
taxonNodes.add(taxonNode1); |
133 | 133 |
taxonNodes.add(taxonNode2); |
134 | 134 |
taxonNodes.add(taxonNode3); |
135 | 135 |
taxonNodes.add(taxonNode4); |
136 | 136 |
taxonNodes.add(taxonNode5); |
137 | 137 |
|
138 |
ceis = new HashSet<CdmEntityIdentifier>();
|
|
138 |
ceis = new HashSet<>(); |
|
139 | 139 |
ceis.add(new CdmEntityIdentifier(taxonNode3.getId(),TaxonNode.class)); |
140 | 140 |
ceis.add(new CdmEntityIdentifier(taxonNode4.getId(),TaxonNode.class)); |
141 | 141 |
ceis.add(new CdmEntityIdentifier(taxonNode5.getId(),TaxonNode.class)); |
... | ... | |
160 | 160 |
TaxonNode taxonNode = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1)); |
161 | 161 |
CdmEntityIdentifier cei = new CdmEntityIdentifier(taxonNode.getId(), TaxonNode.class); |
162 | 162 |
|
163 |
taxonNodes = new HashSet<TaxonNode>();
|
|
163 |
taxonNodes = new HashSet<>(); |
|
164 | 164 |
taxonNodes.add(taxonNode); |
165 | 165 |
|
166 | 166 |
int taxonNodeCountChildren = taxonNode.getCountChildren(); |
Also available in: Unified diff
cleanup