alfresco-mvc
alfresco-mvc copied to clipboard
webscript context mapping
when generating HATEOAS links
Link.of(ServletUriComponentsBuilder.fromCurrentServletMapping().path("/objects/id/list").build().toUriString(), "list");
Link.of(ServletUriComponentsBuilder.fromCurrentContextPath().path("/objects/id/list").build().toUriString(), "lista");
Link.of(ServletUriComponentsBuilder.fromCurrentRequestUri().path("/objects/id/list").build().toUriString(), "listv");
Link.of(ServletUriComponentsBuilder.fromCurrentRequest().path("/objects/id/list").build().toUriString(), "listn");
the links are generated with the missing alfresco webscript root context
"links": [
{
"rel": "list",
"href": "http://localhost:9090/objects/id/list"
},
{
"rel": "lista",
"href": "http://localhost:9090/objects/id/list"
},
{
"rel": "listv",
"href": "http://localhost:9090/sites/efectaaaf/libraries/documentLibrary/objects/id/list"
},
{
"rel": "listn",
"href": "http://localhost:9090/sites/efectaaaf/libraries/documentLibrary/objects/id/list"
}
]
providing a similar feature with a new class "WebscriptUriComponentsBuilder" seems reasonable