hateoas

Angular2 support with HATEOAS

走远了吗. 提交于 2019-12-21 02:44:23
问题 I have a restful web service with the support of HATEOAS links. When I call "http://localhost:8080/v1/bookings/1225380?lock=true" link I got following resource URLs. I want to integrate these Hypermedia with my Angular2 application (recently upgraded to final version). I found few resources which were implemented with Angular1 with the support of Angular HAL (links - https://paulcwarren.wordpress.com/2015/04/03/role-based-spas-with-angularjs-and-spring-hateoas/, https://github.com/LuvDaSun

How to expose a complete tree structure with Spring Data REST and HATEOAS?

坚强是说给别人听的谎言 提交于 2019-12-21 02:43:14
问题 I have a JPA tree structure @Entity public class Document { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String text; @ManyToOne @JoinColumn(name = "parent") Document parent; @OneToMany(mappedBy = "parent", fetch = FetchType.EAGER) Set<Document> children; (getters and setters) } and a projection @Projection(name = "all", types = Document.class) public interface AllDocumentsProjection { int getId(); String getText(); Set<Document> getChildren(); } When I make a

How an RPC-style example would look modelled in a resource-centric style

妖精的绣舞 提交于 2019-12-20 07:38:50
问题 I have been reading around the web about REST for several days now and am struggling with the concept of HATEOAS. I think I am struggling because I don't properly understand how to model data as resources and (state-transitioning?) links between resources. I believe my problem is that all my experience is OO and RPC and I am unused to thinking in a resource-centric manner. The only way to get an understanding is to take an example from my world, say what I think that might look like modelled

How to add HATEOAS links in a sub resource

落花浮王杯 提交于 2019-12-20 04:53:57
问题 I have a parent resource called the AdminResource and a child resource called the AdminModuleResource. The resource of the parent is correctly fitted with HATEOAS links: { "firstname" : "Stephane", "lastname" : "Eybert", "email" : "mittiprovence@yahoo.se", "password" : "e41de4c55873f9c000f4cdaac6efd3aa", "passwordSalt" : "7bc7bf5f94fef7c7106afe5c3a40a2", "links" : [ { "rel" : "self", "href" : "http://localhost/admins/3683" }, { "rel" : "modules", "href" : "http://localhost/admins/3683/modules

Optionally disable HATEOAS format in Spring Data Rest

雨燕双飞 提交于 2019-12-18 18:52:08
问题 So let's say I have an existing application that has two endpoints /people and /pants. Calling GET /people returns: [ { "name":"john", "age":37, "pants":[ { "color":"green", "brand":"levis", "size":"medium" }, { "color":"indigo", "brand":"jncos", "size":"medium-with-huge-legs" } ] }, { "name":"june", "age":23, "pants":[ { "color":"pink", "brand":"gap", "size":"small" } ] } ] If i were to use Spring Data Rest and call GET /person i'd receive something like: { "_links":{ "next":{ "href":"http:/

REST Client Implementation Embracing HATEOAS Constraint?

喜你入骨 提交于 2019-12-18 12:15:03
问题 Does anybody know of an implementation of a REST client that embraces the constraint of Hypermedia as the Engine of Application State (HATEOAS)? The Sun Cloud API seems to be a good candidate, judging from the way it's documented and a statement by the author to the effect that Ruby, Java, and Python implementations were in the works. But so far I've found no trace of the code. I'm looking for anything - even a partial implementation would be helpful. 回答1: The very first thing you should look

Spring Data REST How to add embedded resources inline

我与影子孤独终老i 提交于 2019-12-18 12:01:05
问题 I'm using Spring Data REST and Hateoas in combination with HAL browser. This works perfectly, but now I would like to make a JSON dump of a specific entity with (a set of) its associated objects. I used @Projection but then I got stuck again. FYI: The normal behaviour (with embedded and links etc) should remain besides the new endpoint (without embedded and links). To further illustrate my problem/question: class Person { String name; List<Company> companies; } class Company { String name;

what is hypermedia , hypermedia controls, hypermedia formats

你离开我真会死。 提交于 2019-12-18 09:59:33
问题 I'm currently reading "Rest in practice" book . I'm unable to understand the following terminology Hypermedia , hypermedia format, hypermedia controls, Domain application protocol. The author was suggesting need for domain specific hypermedia format. I could hardly understand those. I googled these terms but couldnt find a right answer. Can anyone explain these terminologies and why we need domain specific hypermedia formats instead of application/xml ? 回答1: Hypermedia = the fact that client

Bookmark AngularJS frontend (direct access) - Spring Data Rest backend

。_饼干妹妹 提交于 2019-12-13 00:34:03
问题 I've started to implement a web-front end to manipulate a RESTful service served by Spring Data Rest over a traditional relational DB. This is done with AngularJS and the angular-hal library that I found fits very well the HATEOAS philosophy and formalism of Spring Data Rest . For example, I just need to know the first API endpoint ('/'), and then all of my queries are done through the relations without caring for the urls. The problem I have is to be able to directly access the page

Symfony and Wildurand/Hateoas Bundle - no links on JSON reposnse

只愿长相守 提交于 2019-12-12 11:38:56
问题 I am using FOSRest and Willdurand/Hateoas bundle. I follow examples from https://github.com/willdurand/Hateoas#configuring-links but there is no "links" field on JSON response. /** * Users * * @ORM\Table(name="users") * @ORM\Entity * @Serializer\ExclusionPolicy("ALL") * @Hateoas\Relation("self", href="expr('/users' ~ object.getId())") */ class User { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") * @Serializer\Groups({