Page History
...
Code Representation of a DSpace Object
DSpace API Object (hibernate): org.dspace.content.DSpaceObject
Rest Object: org.dspace.app.rest.model.DSpaceObject
This is a plain old java object (pojo) representation of a DSpace object.
- Add private properties
- https://github.com/DSpace/DSpace/blob/rest7/dspace-spring-rest/src/main/java/org/dspace/app/rest/model/DSpaceObjectRest.java#L24-L30
- Add a get/set bean methods
- To exclude a property from JSON representation, add @JsonIgnore to the get method or to the property
...
- wrap the linked REST resource inside a DSpaceResource (so to have the identifier, self link, and links to other resources). The wrapper is actually created by the Repository responsible of the specific resource (ItemRepository, BitstreamRepository, etc.) https://github.com/DSpace/DSpace/blob/rest7/dspace-spring-rest/src/main/java/org/dspace/app/rest/model/hateoas/DSpaceResource.java#L58
This give a chance to add custom logic for extra links in specific resource - put the wrapper in the embedded sectionsection
- clean the attribute (not sure if useful/required/right) the attribute: https://github.com/DSpace/DSpace/blob/rest7/dspace-spring-rest/src/main/java/org/dspace/app/rest/model/hateoas/DSpaceResource.java#L64
- https://github.com/DSpace/DSpace/blob/rest7/dspace-spring-rest/src/main/java/org/dspace/app/rest/model/hateoas/DSpaceResource.java#L45-L74
- TODO: summarize in plain language the decisions that this code is making
...
- In the fromModel() function, map all object attributes from the persistence/hibernate model to the rest model
Repository Object: org.dspace.app.rest.repository.DSpaceRestRepository
Provide repository interface functions that return REST representations of DSpace objects.
Overview
Content Tools