Skip to content

Commit fe9ee71

Browse files
committed
Aligning what we can with 5.x
1 parent be3b752 commit fe9ee71

File tree

18 files changed

+50
-50
lines changed

18 files changed

+50
-50
lines changed

agrest-docs-framework/src/docs/asciidoc/_chapters/_writing-resource-endpoints/create-entity.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Create Entity with `POST`
1+
=== Create Entity with "POST"
22

33
Now let's implement a `POST` method in DomainResource class:
44

@@ -27,7 +27,7 @@ curl -i -X POST 'http://example.org/myapp/domain' \
2727
> -d '{"vhost":"mysite1.example.org","name":"My Site #1"}'
2828
```
2929

30-
[source, JSON]
30+
[source,json]
3131
----
3232
HTTP/1.1 201 Created
3333
Content-Type: application/json

agrest-docs-framework/src/docs/asciidoc/_chapters/_writing-resource-endpoints/read-collection-of-entities.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Read Collection of Entities with `GET`
1+
=== Read Collection of Entities with "GET"
22

33
You may create more Domain objects, executing `POST` request above. Now
44
let's write a `GET` method to search for domains:
@@ -22,7 +22,7 @@ client like this:
2222

2323
`curl -i -X GET 'http://example.org/myapp/domain'`
2424

25-
[source, JSON]
25+
[source,json]
2626
----
2727
HTTP/1.1 200 OK
2828
Content-Type: application/json
@@ -37,12 +37,12 @@ Content-Type: application/json
3737
----
3838

3939
Since select chain above incorporates UriInfo, it will recognize Agrest control
40-
parameters passed from the client (see link:/protocol#control-parameters[Control Parameters]). Let's try using "cayenneExp" filter and "include":
40+
parameters passed from the client (see link:/protocol#control-parameters[Control Parameters]). Let's try using "exp" filter and "include":
4141

4242

4343
`curl -i -X GET 'http://example.org/myapp/domain?exp=vhost="mysite1.example.org"&include=id'`
4444

45-
[source, JSON]
45+
[source,json]
4646
----
4747
HTTP/1.1 200 OK
4848
Content-Type: application/json

agrest-docs-framework/src/docs/asciidoc/_chapters/_writing-resource-endpoints/read-single-entity.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Read a Single Entity with `GET`
1+
=== Read a Single Entity with "GET"
22

33
A common request is to locate a single instance of an entity by ID. Here is how
44
this can be done with Agrest:
@@ -23,7 +23,7 @@ Calling this endpoint, we'll get an expected result:
2323

2424
`curl -i -X GET 'http://example.org/myapp/domain/1'`
2525

26-
[source, JSON]
26+
[source,json]
2727
----
2828
HTTP/1.1 200 OK
2929
Content-Type: application/json

agrest-docs-framework/src/docs/asciidoc/_chapters/_writing-resource-endpoints/update-entity.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=== Update Entity with `PUT`
1+
=== Update Entity with "PUT"
22

3-
To update the entity we created before <<Create Entity with `POST`>> we have to implement a `PUT` method in DomainResource class:
3+
To update the entity we created before <<Create Entity with "POST">> we have to implement a `PUT` method in DomainResource class:
44

55
[source, Java]
66
----
@@ -16,15 +16,15 @@ public SimpleResponse update(@PathParam("id") int id, String data) {
1616
}
1717
----
1818

19-
This simple "update chain" is very similar to the <<Create Entity with `POST`>> and the <<Read a Single Entity with `GET`>> chains.
19+
This simple "update chain" is very similar to the <<Create Entity with "POST">> and the <<Read a Single Entity with "GET">> chains.
2020
Try to sent a request to this endpoint and get a result as expected
2121

2222
```
2323
curl -i -X PUT 'http://example.org/myapp/domain/1' \
2424
> -d '{"vhost":"mysite2.example.org","name":"My Site #2"}'
2525
```
2626

27-
[source, JSON]
27+
[source,json]
2828
----
2929
HTTP/1.1 200 OK
3030
Content-Type: application/json

agrest-docs-framework/src/docs/asciidoc/_chapters/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title: "Framework"
33
layout: docs-index
44
weight: 30
5-
docsMenuTitle: "Framework"
5+
docsMenuTitle: "Table of Contents"
66
description: "Agrest server framework documentation"
77
---

agrest-docs-overview/src/docs/asciidoc/_chapters/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title: "Overview"
33
layout: docs-index
44
weight: 10
5-
docsMenuTitle: "Overview"
5+
docsMenuTitle: "Table of Contents"
66
description: "Overview of the framework and it's basic concepts"
77
---

agrest-docs-protocol/src/docs/asciidoc/_chapters/_control-parameters/filtering-collection.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Filtering Collection with `exp`
1+
=== Filtering Collection with "exp"
22

33
NOTE: "exp" key was first introduced in Agrest 4.1. Previously it was called "cayenneExp".
44
Both are synonymous. "cayenneExp" is still supported, though should be considered deprecated.

agrest-docs-protocol/src/docs/asciidoc/_chapters/_control-parameters/ordering-collection.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Ordering Collection with `sort / dir`
1+
=== Ordering Collection with "sort" / "dir"
22

33
Example 1: Sort on a single property.
44

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[#Pagination]
2-
=== Pagination with `start / limit`
2+
=== Pagination with "start" / "limit"
33

44
These two parameters are used together to request from the server a range of objects
55
for a potentially huge collection. They allow to implement efficient data pagination on the client.
66

7-
`"start"` is an offset within the "data" array. All the objects below this
7+
`start` is an offset within the "data" array. All the objects below this
88
offset are discarded from the collection. Default "start" is 0.
99

1010

11-
`"limit"` is a maximum number of objects in the collection "data". Default is infinity (no limit).
11+
`limit` is a maximum number of objects in the collection "data". Default is infinity (no limit).
1212

1313
"limit" is applied after "start". So for a collection with a total of 10 objects,
1414
`?start=2&amp;limit=5` would result in objects 2..6 returned from the server. Returned Collection "total" would still be 10.

agrest-docs-protocol/src/docs/asciidoc/_chapters/_control-parameters/shaping-collection.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Shaping Collection with `include / exclude`
1+
=== Shaping Collection with "include" / "exclude"
22

33
Model entities may have "simple" properties (attributes) and properties that point to
44
related entities (relationships). By default Collection Document contains entity
@@ -11,7 +11,7 @@ Example 1: Include default properties (all entity attributes) minus "vhost" attr
1111

1212
`exclude=vhost`
1313

14-
[source, JSON]
14+
[source,json]
1515
----
1616
{ "id" : 45, "name" : "Agrest Site" }
1717
----
@@ -20,7 +20,7 @@ Example 2: Exclude all properties, but "id".
2020

2121
`include=id`
2222

23-
[source, JSON]
23+
[source,json]
2424
----
2525
{ "id" : 45 }
2626
----
@@ -29,7 +29,7 @@ Example 3: Multiple includes, one of them points to attributes of related entity
2929

3030
`include=id&amp;include=articles.title`
3131

32-
[source, JSON]
32+
[source,json]
3333
----
3434
{
3535
"id" : 45,
@@ -47,7 +47,7 @@ of related objects for each root object.
4747

4848
`include={"path":"articles","exp":"title like '%Agrest%'","sort":"title"}&amp;include=articles.title`
4949

50-
[source, JSON]
50+
[source,json]
5151
----
5252
{
5353
"id" : 45,
@@ -65,7 +65,7 @@ Example 5: Related objects as a map. Here we'll map article bodies by title.
6565

6666
`include={"path":"articles","mapBy":"title"}&amp;include=articles.body`
6767

68-
[source, JSON]
68+
[source,json]
6969
----
7070
{
7171
"articles" : {
@@ -79,7 +79,7 @@ Example 6: Include and Exclude parameters have ability to take an array of value
7979

8080
`include=["id","name"]`
8181

82-
[source, JSON]
82+
[source,json]
8383
----
8484
{ "id" : 45, "name" : "Agrest Site" }
8585
----
@@ -88,7 +88,7 @@ Example 7: The array can contain both the simple include and the advanced includ
8888

8989
`include=["id","articles.title",{"path":"articles","exp":"title like '%Agrest%'"}]`
9090

91-
[source, JSON]
91+
[source,json]
9292
----
9393
{
9494
"id" : 45,
@@ -103,7 +103,7 @@ Example 8: Attributes of a related entity can be presented as an inner array in
103103

104104
`include=["id","name",{"articles":["title","body"]}]`
105105

106-
[source, JSON]
106+
[source,json]
107107
----
108108
{
109109
"id" : 45,

agrest-docs-protocol/src/docs/asciidoc/_chapters/_control-parameters/structuring-collection.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
=== Structuring Collection with `mapBy`
1+
=== Structuring Collection with "mapBy"
22

33
Agrest presents the response as an array of entities <<Response: Collection Document>>.
44
E.g. Request of articles returns the following array:
55

6-
[source, JSON]
6+
[source,json]
77
----
88
{
99
"data" : [
@@ -19,7 +19,7 @@ Using `mapBy` this array can be transformed to a map. One of entity fields is us
1919

2020
`mapBy=publishedOn`
2121

22-
[source, JSON]
22+
[source,json]
2323
----
2424
{
2525
"data" : {

agrest-docs-protocol/src/docs/asciidoc/_chapters/_json-documents/request-update-document.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
=== Request: Update Document
1+
=== Update Document
22

3-
Update Document is sent from the client to the server to modify an entity collection.
3+
Update Document is sent in a _request_ body from the client to the server to modify an entity collection.
44
It is a Collection document stripped down to its "data" section. There are two flavors -
55
a single object and an array of objects:
66

7-
[source, JSON]
7+
[source,json]
88
----
99
{ "id" : 5, "name": "X" }
1010
----
1111

1212

13-
[source, JSON]
13+
[source,json]
1414
----
1515
[
1616
{ "id" : 5, "name": "X" },

agrest-docs-protocol/src/docs/asciidoc/_chapters/_json-documents/response-collection-document.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
=== Response: Collection Document
1+
=== Collection Document
22

3-
A document that passes the data from the server to the client. This is the main
3+
A document is used in _responses_ that return the data from the server. This is the main
44
representation of data in Agrest.
55

6-
[source, JSON]
6+
[source,json]
77
----
88
HTTP/1.1 200 OK
99
Content-Type: application/json

agrest-docs-protocol/src/docs/asciidoc/_chapters/_json-documents/response-simple-document.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
=== Response: Simple Document
1+
=== Simple Document
22

3-
This document is used in responses that contain no data, just a boolean status and a
4-
message. On success it might look like this:
3+
This document is used in _responses_ that contain no data, just a boolean status and a
4+
message. On success, it might look like this:
55

6-
[source, JSON]
6+
[source,json]
77
----
88
HTTP/1.1 200 OK
99
Content-Type: application/json
@@ -15,9 +15,9 @@ Content-Type: application/json
1515
----
1616

1717

18-
On failure it might look like this:
18+
On failure, it might look like this:
1919

20-
[source, JSON]
20+
[source,json]
2121
----
2222
HTTP/1.1 500 Server error
2323
Content-Type: application/json

agrest-docs-protocol/src/docs/asciidoc/_chapters/dates-and-times.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ JSON doesn't have datatypes for either date or time. Both are represented as str
44
Server and client must ensure that date/time strings are in
55
http://en.wikipedia.org/wiki/ISO_8601[ISO 8601 format] E.g.:
66

7-
[source, JSON]
7+
[source,json]
88
----
99
2015-04-19T11:08:53Z
1010
2015-04-10T11:08

agrest-docs-protocol/src/docs/asciidoc/_chapters/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title: "Protocol"
33
layout: docs-index
44
weight: 20
5-
docsMenuTitle: "Protocol"
5+
docsMenuTitle: "Table of Contents"
66
description: "HTTP/JSON protocol that unifies interaction between a client and an Agrest server"
77
---

agrest-docs-workflow/src/docs/asciidoc/_chapters/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title: "Workflow"
33
layout: docs-index
44
weight: 40
5-
docsMenuTitle: "Workflow"
5+
docsMenuTitle: "Table of Contents"
66
description: "A full tutorial covering simple Agrest application"
77
---

agrest-docs-workflow/src/docs/asciidoc/_chapters/running_app.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -i -X GET 'http://localhost:8080/api/category'
2626

2727
And get the following response:
2828

29-
[source, JSON]
29+
[source,json]
3030
----
3131
HTTP/1.1 200 OK
3232
Date: Wed, 03 Oct 2018 10:14:51 GMT
@@ -51,7 +51,7 @@ curl -i -X POST 'http://localhost:8080/api/category' -d '{"id":"2","name":"Horro
5151

5252
The response will be:
5353

54-
[source, JSON]
54+
[source,json]
5555
----
5656
HTTP/1.1 201 Created
5757
Date: Wed, 03 Oct 2018 10:42:17 GMT
@@ -64,7 +64,7 @@ Server: Jetty(9.3.14.v20161028)
6464

6565
Now make the 'GET' request again and you will receive the following:
6666

67-
[source, JSON]
67+
[source,json]
6868
----
6969
HTTP/1.1 200 OK
7070
Date: Wed, 03 Oct 2018 10:44:44 GMT

0 commit comments

Comments
 (0)