Revision 37543
Added by Stefania Martziou about 9 years ago
PublicationInfoStep.java | ||
---|---|---|
47 | 47 |
//publication info form |
48 | 48 |
private FlowPanel publicationInfoPanel = new FlowPanel(); |
49 | 49 |
|
50 |
private Alert infoLabel = new Alert(); |
|
50 | 51 |
private Alert errorLabel = new Alert(); |
51 | 52 |
|
52 | 53 |
private Form publicationInfoForm = new Form(); |
... | ... | |
107 | 108 |
errorLabel.setVisible(false); |
108 | 109 |
errorLabel.setClose(false); |
109 | 110 |
|
111 |
infoLabel.setText("At least one author e-mail is required"); |
|
112 |
infoLabel.addStyleName("alertLabel"); |
|
113 |
infoLabel.setType(AlertType.INFO); |
|
114 |
infoLabel.setClose(false); |
|
115 |
|
|
110 | 116 |
publicationInfoForm.setType(FormType.HORIZONTAL); |
111 | 117 |
publicationInfoForm.addStyleName("publicationInfoForm"); |
112 | 118 |
publicationInfoPanel.add(publicationInfoForm); |
... | ... | |
117 | 123 |
publicationDateTextBox.setStartView(HasStartView.ViewMode.YEAR); |
118 | 124 |
publicationDateTextBox.setAutoClose(true); |
119 | 125 |
publicationDateTextBox.setFormat("yyyy/mm/dd"); |
126 |
publicationDateTextBox.setValue(null); |
|
120 | 127 |
|
121 | 128 |
acceptanceDateTextBox.setAlternateSize(AlternateSize.LARGE); |
122 | 129 |
acceptanceDateTextBox.setStartView(HasStartView.ViewMode.YEAR); |
123 | 130 |
acceptanceDateTextBox.setAutoClose(true); |
124 | 131 |
acceptanceDateTextBox.setFormat("yyyy/mm/dd"); |
132 |
acceptanceDateTextBox.setValue(null); |
|
125 | 133 |
|
126 | 134 |
articleRadio.setValue(true); |
127 | 135 |
articleRadio.addStyleName("inlineBlock"); |
... | ... | |
151 | 159 |
subjects.setAlternateSize(AlternateSize.XXLARGE); |
152 | 160 |
subjects.setPlaceholder(" subjects as a comma-separated list"); |
153 | 161 |
|
162 |
publicationInfoForm.add(infoLabel); |
|
154 | 163 |
publicationInfoForm.add(errorLabel); |
155 | 164 |
publicationInfoForm.add(new FormFieldSet("Title (*)", titleTextBox)); |
156 | 165 |
publicationInfoForm.add(new FormFieldSet("Authors (*)", multipleAuthorsWidget.asWidget())); |
... | ... | |
200 | 209 |
|
201 | 210 |
if(!multipleAuthorsWidget.hasAtLeastOneEmail()) { |
202 | 211 |
|
203 |
errorLabel.setText(goldOAConstants.publicationFormErrorAtLeastOneAuthorEmail()); |
|
204 |
errorLabel.setVisible(true); |
|
212 |
if(publicationDateTextBox.getValue()!=null && acceptanceDateTextBox.getValue().after(publicationDateTextBox.getValue())) { |
|
205 | 213 |
|
214 |
errorLabel.setText("At least one author e-mail is required and acceptance date must be before publication date"); |
|
215 |
errorLabel.setVisible(true); |
|
216 |
|
|
217 |
} else { |
|
218 |
|
|
219 |
errorLabel.setText(goldOAConstants.publicationFormErrorAtLeastOneAuthorEmail()); |
|
220 |
errorLabel.setVisible(true); |
|
221 |
} |
|
222 |
|
|
206 | 223 |
} else { |
207 | 224 |
|
208 |
Publication publication = new Publication();
|
|
225 |
if(publicationDateTextBox.getValue()!=null && acceptanceDateTextBox.getValue().after(publicationDateTextBox.getValue())) {
|
|
209 | 226 |
|
210 |
if(!doi.getValue().trim().equals("")) |
|
211 |
publication.setDoi(doi.getValue().trim()); |
|
212 |
publication.setTitle(titleTextBox.getValue().trim()); |
|
213 |
publication.setAuthors(multipleAuthorsWidget.getAuthors()); |
|
214 |
publication.setPublicationDate(publicationDateTextBox.getValue()); |
|
215 |
publication.setAcceptanceDate(acceptanceDateTextBox.getValue()); |
|
227 |
errorLabel.setText("At least one author e-mail is required and acceptance date must be before publication date"); |
|
228 |
errorLabel.setVisible(true); |
|
216 | 229 |
|
217 |
if(articleRadio.getValue()) |
|
218 |
publication.setType(Publication.Type.ARTICLE); |
|
219 |
else |
|
220 |
publication.setType(Publication.Type.MONOGRAPH); |
|
230 |
} else { |
|
221 | 231 |
|
222 |
publication.setLanguages(languages.getValue().trim()); |
|
223 |
publication.setSubjects(subjects.getValue().trim()); |
|
224 |
publication.setIdentifiers(multipleIdentifiersWidget.getPublicationIdentifiers()); |
|
232 |
Publication publication = new Publication(); |
|
225 | 233 |
|
226 |
return publication; |
|
234 |
if (!doi.getValue().trim().equals("")) |
|
235 |
publication.setDoi(doi.getValue().trim()); |
|
236 |
publication.setTitle(titleTextBox.getValue().trim()); |
|
237 |
publication.setAuthors(multipleAuthorsWidget.getAuthors()); |
|
238 |
publication.setPublicationDate(publicationDateTextBox.getValue()); |
|
239 |
publication.setAcceptanceDate(acceptanceDateTextBox.getValue()); |
|
240 |
|
|
241 |
if (articleRadio.getValue()) |
|
242 |
publication.setType(Publication.Type.ARTICLE); |
|
243 |
else |
|
244 |
publication.setType(Publication.Type.MONOGRAPH); |
|
245 |
|
|
246 |
publication.setLanguages(languages.getValue().trim()); |
|
247 |
publication.setSubjects(subjects.getValue().trim()); |
|
248 |
publication.setIdentifiers(multipleIdentifiersWidget.getPublicationIdentifiers()); |
|
249 |
|
|
250 |
return publication; |
|
251 |
} |
|
227 | 252 |
} |
228 | 253 |
} else { |
229 | 254 |
errorLabel.setText(goldOAConstants.publicationFormErrorAllFieldsRequired()); |
... | ... | |
243 | 268 |
|
244 | 269 |
multipleAuthorsWidget.clear(); |
245 | 270 |
|
246 |
publicationDateTextBox.setValue(new Date());
|
|
247 |
acceptanceDateTextBox.setValue(new Date());
|
|
271 |
publicationDateTextBox.setValue(null);
|
|
272 |
acceptanceDateTextBox.setValue(null);
|
|
248 | 273 |
|
249 | 274 |
languages.setValue(""); |
250 | 275 |
subjects.setValue(""); |
Also available in: Unified diff
Various improvements