Internal publications#673
Conversation
axlbonnet
left a comment
There was a problem hiding this comment.
Some classic stuff :
- add validation
- move authorization in the business
Also, there is a bibtext feature currently, we should keep that for a v2 I think.
| if (publication.getDoi() != null && !publication.getDoi().trim().isEmpty()) { | ||
| CoreUtil.assertOnlyLatin1Characters(publication.getDoi()); | ||
| } | ||
|
|
There was a problem hiding this comment.
i prefer the original flow : first verify and raise error, then correct characters.
|
|
||
| ensureAdminOrAuthor(existing); | ||
| // Keep creator immutable to avoid ownership spoofing from request payload. | ||
| publication.setVipAuthor(existing.getVipAuthor()); |
There was a problem hiding this comment.
move those 2 lines in business
| private String type; | ||
| private String typeName; | ||
| private String vipAuthor; | ||
| private String vipApplication; |
There was a problem hiding this comment.
Could we add some validation ?
Except doi, all should be mandatory.
Also can we make vipAuthor readonly ?
There was a problem hiding this comment.
Check read only with jsonView
There was a problem hiding this comment.
NotBlank instead of NotNull
| private String date; | ||
| private String doi; | ||
| private String authors; | ||
| private String type; |
There was a problem hiding this comment.
This one is kind of an enum (see EditPublicationLayout::PUBLICATION_TYPES).
I don't know what is the best way for you to deal with that on the frontend.
There was a problem hiding this comment.
Create an enum in business (move from GWT) and an endpoint to serve the potential values
No description provided.