alfresco-mvc icon indicating copy to clipboard operation
alfresco-mvc copied to clipboard

webscript context mapping

Open dgradecak opened this issue 2 years ago • 0 comments

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

dgradecak avatar Nov 09 '22 08:11 dgradecak