Revision fee89c0b
Added by Andreas Müller almost 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java | ||
---|---|---|
41 | 41 |
private boolean isOpenInEditor = false; |
42 | 42 |
private boolean success = true; |
43 | 43 |
|
44 |
/** |
|
45 |
* <p>Constructor for AbstractNewEntityWizard.</p> |
|
46 |
* |
|
47 |
* @param <T> a T object. |
|
48 |
*/ |
|
49 | 44 |
@Inject |
50 | 45 |
public NewTaxonNodeWizard(){ |
51 | 46 |
setWindowTitle(Messages.TaxonNodeWizardPage_new); |
... | ... | |
68 | 63 |
UpdateResult result; |
69 | 64 |
TaxonNode parent = getParentEntity(); |
70 | 65 |
|
71 |
Map<Language, LanguageString> nodes = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getMultiLanguageTextExcludedNotes();
|
|
66 |
Map<Language, LanguageString> notes = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getMultiLanguageTextExcludedNotes();
|
|
72 | 67 |
UUID refUuid = parent.getReference() != null? parent.getReference().getUuid(): null; |
73 | 68 |
|
74 |
TaxonNodeStatus status = null; |
|
75 |
if( ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isUnplaced()){ |
|
76 |
status = TaxonNodeStatus.UNPLACED; |
|
77 |
}else if( ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isPlacementDoubtful()){ |
|
78 |
status = TaxonNodeStatus.DOUBTFUL; |
|
79 |
}else if (((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isExcluded()){ |
|
80 |
status = TaxonNodeStatus.EXCLUDED; |
|
81 |
} |
|
69 |
TaxonNodeStatus status = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getTaxonNodeStatus(); |
|
82 | 70 |
if (status == null){ |
83 |
nodes = null;
|
|
71 |
notes = null;
|
|
84 | 72 |
} |
85 | 73 |
result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parent.getUuid(), taxon, refUuid, parent.getMicroReference(), |
86 |
status, nodes); |
|
87 |
|
|
74 |
status, notes); |
|
88 | 75 |
|
89 | 76 |
if (result.isOk()){ |
90 | 77 |
this.setEntity((TaxonNode)result.getCdmEntity()); |
... | ... | |
127 | 114 |
// return null; |
128 | 115 |
// } |
129 | 116 |
|
130 |
|
|
131 |
/** |
|
132 |
* <p> |
|
133 |
* openInEditor |
|
134 |
* </p> |
|
135 |
* |
|
136 |
* @return a boolean. |
|
137 |
*/ |
|
138 | 117 |
public boolean openInEditor() { |
139 | 118 |
return isOpenInEditor ; |
140 | 119 |
} |
... | ... | |
143 | 122 |
this.isOpenInEditor = isOpenInEditor; |
144 | 123 |
} |
145 | 124 |
|
146 |
/** |
|
147 |
* <p>openEmpty</p> |
|
148 |
* |
|
149 |
* @return a boolean. |
|
150 |
*/ |
|
151 | 125 |
public boolean openEmpty(){ |
152 | 126 |
return openInEditor() && openEmptyEditor; |
153 | 127 |
} |
154 | 128 |
|
155 |
/** |
|
156 |
* <p>getTaxonNode</p> |
|
157 |
* |
|
158 |
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object. |
|
159 |
*/ |
|
160 | 129 |
public TaxonNode getTaxonNode(){ |
161 | 130 |
if(generatedTaxonNodeUuid != null){ |
162 | 131 |
return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid); |
... | ... | |
177 | 146 |
this.wizardPageListener = wizardPageListener; |
178 | 147 |
} |
179 | 148 |
|
180 |
|
|
181 | 149 |
public boolean isSuccess() { |
182 | 150 |
return success; |
183 | 151 |
} |
184 | 152 |
|
185 |
|
|
186 | 153 |
public void setSuccess(boolean success) { |
187 | 154 |
this.success = success; |
188 | 155 |
} |
... | ... | |
197 | 164 |
} |
198 | 165 |
} |
199 | 166 |
} |
200 |
|
|
201 |
|
|
202 | 167 |
} |
Also available in: Unified diff
cleanup