Subsets
We're introducing a new "list of accessions", similar to current implementation of AccessionList.
Model
Add a new entity Subset
to ..model.impl:
public class Subset extends AuditedVersionedModel implements AclAware {
@Type(type = "uuid-binary")
protected UUID uuid;
protected boolean published;
// other strings, only description is @Lob
// dateCreated as string -- it's not the same as createdDate (from Auditing)
protected String title, description, publisher, rights, dateCreated, publisher;
@ManyToMany(cascade = {}, fetch = FetchType.LAZY)
@JoinTable(name = "SubsetAccessions", joinColumns = @JoinColumn(name = "subsetId"), inverseJoinColumns = @JoinColumn(name = "acceId"))
private List<AccessionId> accessionIds;
}
- Add JPA repository
- Implement service
Controller and JSP
Add a new SubsetController
at /subset with the following methods
- GET /subset/
listSubsets()
that renders the list of Subsets wherepublished == true
. - GET /subset/{uuid}
subset()
that renders all properties of the Subset + the passport data of accessions in the subset. It should use the components from browse.
REST API controller
New controller at /api/v1/subset with endpoints:
- POST /list
Page<Subset> list(@RequestBody SubsetFilters filter
) - GET /{uuid}
Subset get(@PathVariable UUID uuid)
- POST /create
Subset create(@RequestBody Subset subset)
- POST /update
Subset update(@RequestBody Subset subset)
- DELETE /{uuid},{version}
Subset delete(@PathVariable UUID uuid, @PathVariable int version)