Revision 7aa81094
Added by Andreas Müller over 1 year ago
src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkflowService.java | ||
---|---|---|
14 | 14 |
import org.springframework.transaction.annotation.Transactional; |
15 | 15 |
|
16 | 16 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
17 |
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
|
|
17 |
import eu.etaxonomy.cdm.api.service.exception.TypeDesignationSetException;
|
|
18 | 18 |
import eu.etaxonomy.cdm.model.name.Registration; |
19 | 19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
20 | 20 |
|
... | ... | |
34 | 34 |
Registration createRegistration(TaxonName taxonName, List<Registration> relatedBlockingRegistrations); |
35 | 35 |
|
36 | 36 |
@Transactional |
37 |
boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws RegistrationValidationException;
|
|
37 |
boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws TypeDesignationSetException;
|
|
38 | 38 |
|
39 | 39 |
@Transactional(readOnly=true) |
40 | 40 |
Registration reloadRegistration(Registration registration); |
src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkflowService.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.api.application.CdmRepository; |
21 | 21 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO; |
22 | 22 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
23 |
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
|
|
23 |
import eu.etaxonomy.cdm.api.service.exception.TypeDesignationSetException;
|
|
24 | 24 |
import eu.etaxonomy.cdm.api.service.idminter.RegistrationIdentifierMinter; |
25 | 25 |
import eu.etaxonomy.cdm.model.name.Registration; |
26 | 26 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
... | ... | |
71 | 71 |
|
72 | 72 |
|
73 | 73 |
@Override |
74 |
public boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws RegistrationValidationException {
|
|
74 |
public boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws TypeDesignationSetException {
|
|
75 | 75 |
|
76 | 76 |
boolean doReloadWorkingSet = false; |
77 | 77 |
Reference citation = getRepo().getReferenceService().load(workingset.getCitationUuid(), Arrays.asList("authorship.$", "inReference.authorship.$")); |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java | ||
---|---|---|
40 | 40 |
import eu.etaxonomy.cdm.api.service.config.RegistrationStatusTransitions; |
41 | 41 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO; |
42 | 42 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
43 |
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
|
|
43 |
import eu.etaxonomy.cdm.api.service.exception.TypeDesignationSetException;
|
|
44 | 44 |
import eu.etaxonomy.cdm.api.service.name.TypeDesignationSet.TypeDesignationSetType; |
45 | 45 |
import eu.etaxonomy.cdm.api.service.registration.IRegistrationWorkingSetService; |
46 | 46 |
import eu.etaxonomy.cdm.api.util.UserHelper; |
... | ... | |
186 | 186 |
// only add if the regDtoUnpersisted has not been persisted meanwhile |
187 | 187 |
try { |
188 | 188 |
workingset.add(regDtoUnpersisted); |
189 |
} catch (RegistrationValidationException e) {
|
|
189 |
} catch (TypeDesignationSetException e) {
|
|
190 | 190 |
// would never happen here // |
191 | 191 |
} |
192 | 192 |
} |
... | ... | |
263 | 263 |
|
264 | 264 |
try { |
265 | 265 |
workingset = getWorkingSetService().loadWorkingSetByReferenceUuid(referenceUuid, true); |
266 |
} catch (RegistrationValidationException error) {
|
|
266 |
} catch (TypeDesignationSetException error) {
|
|
267 | 267 |
logger.error(error); |
268 | 268 |
showErrorDialog("Validation Error", error.getMessage()); |
269 | 269 |
} |
... | ... | |
437 | 437 |
* See also {@link #onTaxonNameEditorActionAdd(TaxonNameEditorAction)}). |
438 | 438 |
* |
439 | 439 |
* @param event |
440 |
* @throws RegistrationValidationException
|
|
440 |
* @throws TypeDesignationSetException
|
|
441 | 441 |
* passes on the Exception which may come from onRegistrationWorkflowEventActionStart() |
442 | 442 |
*/ |
443 | 443 |
@EventBusListenerMethod |
444 |
public void onDoneWithTaxonnameEditor(DoneWithPopupEvent event) throws RegistrationValidationException {
|
|
444 |
public void onDoneWithTaxonnameEditor(DoneWithPopupEvent event) throws TypeDesignationSetException {
|
|
445 | 445 |
|
446 | 446 |
if(!isFromOwnView(event)){ |
447 | 447 |
return; |
... | ... | |
514 | 514 |
* Creates a new Registration for an exiting (previously published) name. |
515 | 515 |
* |
516 | 516 |
* @param event |
517 |
* @throws RegistrationValidationException
|
|
517 |
* @throws TypeDesignationSetException
|
|
518 | 518 |
*/ |
519 | 519 |
@EventBusListenerMethod |
520 |
public void onRegistrationWorkflowEventActionStart(RegistrationWorkingsetAction event) throws RegistrationValidationException {
|
|
520 |
public void onRegistrationWorkflowEventActionStart(RegistrationWorkingsetAction event) throws TypeDesignationSetException {
|
|
521 | 521 |
|
522 | 522 |
if(!event.isStart()){ |
523 | 523 |
return; |
... | ... | |
657 | 657 |
* |
658 | 658 |
* |
659 | 659 |
* @param event |
660 |
* @throws RegistrationValidationException
|
|
660 |
* @throws TypeDesignationSetException
|
|
661 | 661 |
*/ |
662 | 662 |
@EventBusListenerMethod |
663 | 663 |
public void onDoneWithTypeDesignationEditor(DoneWithPopupEvent event) { |
src/test/java/eu/etaxonomy/cdm/vaadin/model/RegistrationWorkingSetTest.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO; |
20 | 20 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
21 |
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException;
|
|
21 |
import eu.etaxonomy.cdm.api.service.exception.TypeDesignationSetException;
|
|
22 | 22 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
23 | 23 |
import eu.etaxonomy.cdm.model.name.Rank; |
24 | 24 |
import eu.etaxonomy.cdm.model.name.Registration; |
... | ... | |
38 | 38 |
public class RegistrationWorkingSetTest { |
39 | 39 |
|
40 | 40 |
@Test |
41 |
public void test_2_names() throws RegistrationValidationException {
|
|
41 |
public void test_2_names() throws TypeDesignationSetException {
|
|
42 | 42 |
|
43 | 43 |
Reference article = ReferenceFactory.newArticle(); |
44 | 44 |
article.setTitleCache("Article", true); |
... | ... | |
65 | 65 |
|
66 | 66 |
|
67 | 67 |
@Test |
68 |
public void test_name_and_type() throws RegistrationValidationException {
|
|
68 |
public void test_name_and_type() throws TypeDesignationSetException {
|
|
69 | 69 |
|
70 | 70 |
Reference article = ReferenceFactory.newArticle(); |
71 | 71 |
article.setTitleCache("Article", true); |
Also available in: Unified diff
cleanup and rename RegistrationValidationException to TypeDesignationSetException in vaadin