Revision d6bdb890
Added by Andreas Kohlbecker over 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java | ||
---|---|---|
116 | 116 |
TypeDesignationWorkingSet typeDesignationWorkingSet = regDTO.getTypeDesignationWorkingSet(idset.workingsetId); |
117 | 117 |
workingSetDto = regDTO.getSpecimenTypeDesignationWorkingSetDTO(typeDesignationWorkingSet.getBaseEntityReference()); |
118 | 118 |
citation = (Reference) regDTO.getCitation(); |
119 |
workingSetDto = fixMissingFieldUnit(workingSetDto); |
|
119 | 120 |
} else { |
120 | 121 |
// create a new workingset, for a new fieldunit which is the base for the workingset |
121 | 122 |
FieldUnit newfieldUnit = FieldUnit.NewInstance(); |
... | ... | |
209 | 210 |
}); |
210 | 211 |
} |
211 | 212 |
|
212 |
/** |
|
213 |
* {@inheritDoc} |
|
214 |
* |
|
215 |
* see also {@link SpecimenTypeDesignationWorkingsetPopupEditor#showInEditor()} |
|
216 |
*/ |
|
217 |
@Override |
|
218 |
protected SpecimenTypeDesignationWorkingSetDTO prepareAsFieldGroupDataSource(SpecimenTypeDesignationWorkingSetDTO bean) { |
|
213 |
|
|
214 |
private SpecimenTypeDesignationWorkingSetDTO fixMissingFieldUnit(SpecimenTypeDesignationWorkingSetDTO bean) { |
|
219 | 215 |
|
220 | 216 |
if(bean.getFieldUnit() == null){ |
221 | 217 |
// in case the base unit of the working set is not a FieldUnit all contained TypeDesignations must be modified |
... | ... | |
250 | 246 |
throw new RuntimeException("Usupported owner type " + bean.getOwner().getClass() + ", needs to be implemented."); |
251 | 247 |
} |
252 | 248 |
} |
253 |
return super.prepareAsFieldGroupDataSource(bean);
|
|
249 |
return bean;
|
|
254 | 250 |
} |
255 | 251 |
|
256 | 252 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java | ||
---|---|---|
59 | 59 |
getView().getBasionymCombobox().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<TaxonName>()); |
60 | 60 |
CdmFilterablePagingProvider<TaxonName> namePagingProvider = new CdmFilterablePagingProvider<TaxonName>(getRepo().getNameService()); |
61 | 61 |
getView().getBasionymCombobox().setPagingProviders(namePagingProvider, namePagingProvider, namePagingProvider.getPageSize()); |
62 |
|
|
63 | 62 |
} |
64 | 63 |
|
65 | 64 |
/** |
... | ... | |
72 | 71 |
|
73 | 72 |
"$", |
74 | 73 |
"rank.representations", |
74 |
"rank.vocabulary", // needed for comparing ranks |
|
75 | 75 |
|
76 | 76 |
"nomenclaturalReference.authorship", |
77 | 77 |
"nomenclaturalReference.inReference", |
src/main/java/eu/etaxonomy/cdm/vaadin/view/reference/ReferenceEditorPresenter.java | ||
---|---|---|
105 | 105 |
@Override |
106 | 106 |
protected Reference loadCdmEntityById(Integer identifier) { |
107 | 107 |
|
108 |
List<String> initStrategy = Arrays.asList(new String []{ |
|
109 |
|
|
110 |
"$", |
|
111 |
|
|
112 |
} |
|
113 |
); |
|
114 |
|
|
108 | 115 |
Reference reference; |
109 | 116 |
if(identifier != null){ |
110 |
reference = getRepo().getReferenceService().find(identifier);
|
|
117 |
reference = getRepo().getReferenceService().load(identifier, initStrategy);
|
|
111 | 118 |
} else { |
112 | 119 |
reference = ReferenceFactory.newGeneric(); |
113 | 120 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationEditorPresenter.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.cdm.vaadin.view.registration; |
10 | 10 |
|
11 |
import java.util.Arrays; |
|
12 |
import java.util.List; |
|
13 |
|
|
11 | 14 |
import eu.etaxonomy.cdm.api.service.IRegistrationService; |
12 | 15 |
import eu.etaxonomy.cdm.model.agent.Institution; |
13 | 16 |
import eu.etaxonomy.cdm.model.common.User; |
... | ... | |
41 | 44 |
|
42 | 45 |
Registration reg; |
43 | 46 |
if(identifier != null){ |
44 |
reg = getRepo().getRegistrationService().find(identifier); |
|
47 |
List<String> initStrategy = Arrays.asList(new String[] {"$"}); |
|
48 |
reg = getRepo().getRegistrationService().load(identifier, initStrategy ); |
|
45 | 49 |
} else { |
46 | 50 |
reg = Registration.NewInstance(); |
47 | 51 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java | ||
---|---|---|
262 | 262 |
} |
263 | 263 |
refreshView(false); |
264 | 264 |
} else if(event.getReason().equals(Reason.CANCEL)){ |
265 |
// clean up |
|
266 |
getTaxonNameStore().deleteBean(newTaxonNameForRegistration); |
|
265 |
if(newTaxonNameForRegistration != null){ |
|
266 |
// clean up |
|
267 |
getTaxonNameStore().deleteBean(newTaxonNameForRegistration); |
|
268 |
} |
|
267 | 269 |
} |
268 | 270 |
getRepo().commitTransaction(txStatus); |
269 | 271 |
newTaxonNameForRegistration = null; |
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java | ||
---|---|---|
157 | 157 |
return bean; |
158 | 158 |
} |
159 | 159 |
|
160 |
@Override |
|
161 |
protected DTO prepareAsFieldGroupDataSource(DTO bean){ |
|
162 |
DTO mergedBean = getStore().mergedBean(bean); |
|
163 |
// DTO mergedBean = bean; |
|
164 |
return mergedBean; |
|
165 |
} |
|
160 |
// @Override
|
|
161 |
// protected DTO prepareAsFieldGroupDataSource(DTO bean){
|
|
162 |
// DTO mergedBean = getStore().mergedBean(bean);
|
|
163 |
// // DTO mergedBean = bean;
|
|
164 |
// return mergedBean;
|
|
165 |
// }
|
|
166 | 166 |
|
167 | 167 |
/** |
168 | 168 |
* If the bean is contained in the session it is being updated by |
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractEditorPresenter.java | ||
---|---|---|
44 | 44 |
*/ |
45 | 45 |
protected abstract DTO loadBeanById(Object identifier); |
46 | 46 |
|
47 |
/** |
|
48 |
* This method is called directly before setting the bean as item data source to |
|
49 |
* the field group of the editor. |
|
50 |
* <p> |
|
51 |
* Override this method to pre-process the bean if needed. This can be the case if |
|
52 |
* you are using a persistence layer with short running session like Hibernate. |
|
53 |
* |
|
54 |
* @param bean |
|
55 |
* @return |
|
56 |
*/ |
|
57 |
protected DTO prepareAsFieldGroupDataSource(DTO bean){ |
|
58 |
|
|
59 |
return bean; |
|
60 |
} |
|
61 |
|
|
62 |
// @Override |
|
63 |
// protected TransactionDefinition getTransactionDefinition(){ |
|
64 |
// super.getTransactionDefinition(); |
|
65 |
// if(definition.isReadOnly()){ |
|
66 |
// definition.setReadOnly(false); |
|
67 |
// } |
|
68 |
// return definition; |
|
69 |
// } |
|
70 | 47 |
|
71 | 48 |
/** |
72 | 49 |
* Regarding changing the Flush mode see see also {@link ViewScopeConversationHolder} |
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java | ||
---|---|---|
533 | 533 |
public final void loadInEditor(Object identifier) { |
534 | 534 |
|
535 | 535 |
DTO beanToEdit = getPresenter().loadBeanById(identifier); |
536 |
|
|
537 |
DTO preparedBean = getPresenter().prepareAsFieldGroupDataSource(beanToEdit); |
|
538 |
fieldGroup.setItemDataSource(preparedBean); |
|
536 |
fieldGroup.setItemDataSource(beanToEdit); |
|
539 | 537 |
afterItemDataSourceSet(); |
540 | 538 |
} |
541 | 539 |
|
Also available in: Unified diff
ref #7046 removing prepareAsFieldGroupDataSource() which was opening connectinos which where never closed and adding missing initStrategies