juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject incubator-juneau git commit: Add Query menu items to AddressBookResource.
Date Thu, 06 Jul 2017 20:46:47 GMT
Repository: incubator-juneau
Updated Branches:
  refs/heads/master 3c2f101c2 -> 357342a17


Add Query menu items to AddressBookResource.

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/357342a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/357342a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/357342a1

Branch: refs/heads/master
Commit: 357342a17d21c3d63c3fc4cf01e21e72c319e3d8
Parents: 3c2f101
Author: JamesBognar <jamesbognar@apache.org>
Authored: Thu Jul 6 16:46:44 2017 -0400
Committer: JamesBognar <jamesbognar@apache.org>
Committed: Thu Jul 6 16:46:44 2017 -0400

----------------------------------------------------------------------
 .../rest/addressbook/AddressBookResource.java    | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/357342a1/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java
b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java
index e6e4327..d65fe85 100644
--- a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java
+++ b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java
@@ -47,6 +47,7 @@ import org.apache.juneau.utils.*;
 	widgets={
 		PoweredByJuneauWidget.class,
 		ContentTypeMenuItem.class,
+		QueryMenuItem.class,
 		StyleMenuItem.class
 	},
 
@@ -129,9 +130,7 @@ public class AddressBookResource extends ResourceJena {
 	 * [GET /]
 	 * Get root page.
 	 */
-	@RestMethod(name="GET", path="/",
-		converters=Queryable.class
-	)
+	@RestMethod(name="GET", path="/")
 	public Link[] getRoot() throws Exception {
 		return new Link[] {
 			new Link("people", "people"),
@@ -146,7 +145,10 @@ public class AddressBookResource extends ResourceJena {
 	 * Introspectable filtering enabled to allow public methods on the returned object to be
invoked.
 	 */
 	@RestMethod(name="GET", path="/people/*",
-		converters={Traversable.class,Queryable.class,Introspectable.class}
+		converters={Traversable.class,Queryable.class,Introspectable.class},
+		htmldoc=@HtmlDoc(
+			links="{up:'request:/..',options:'servlet:/?method=OPTIONS',query:'$W{queryMenuItem}',contentTypes:'$W{contentTypeMenuItem}',styles:'$W{styleMenuItem}',source:'$C{Source/gitHub}/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java'}"
+		)
 	)
 	public AddressBook getAllPeople() throws Exception {
 		return addressBook;
@@ -159,7 +161,7 @@ public class AddressBookResource extends ResourceJena {
 	 * Introspectable filtering enabled to allow public methods on the returned object to be
invoked.
 	 */
 	@RestMethod(name="GET", path="/people/{id}/*",
-		converters={Traversable.class,Queryable.class,Introspectable.class}
+		converters={Traversable.class,Introspectable.class}
 	)
 	public Person getPerson(@Path int id) throws Exception {
 		return findPerson(id);
@@ -170,7 +172,10 @@ public class AddressBookResource extends ResourceJena {
 	 * Get all addresses in the address book.
 	 */
 	@RestMethod(name="GET", path="/addresses/*",
-		converters={Traversable.class,Queryable.class}
+		converters={Traversable.class,Queryable.class},
+		htmldoc=@HtmlDoc(
+			links="{up:'request:/..',options:'servlet:/?method=OPTIONS',query:'$W{queryMenuItem}',contentTypes:'$W{contentTypeMenuItem}',styles:'$W{styleMenuItem}',source:'$C{Source/gitHub}/org/apache/juneau/examples/rest/addressbook/AddressBookResource.java'}"
+		)
 	)
 	public List<Address> getAllAddresses() throws Exception {
 		return addressBook.getAddresses();
@@ -181,7 +186,7 @@ public class AddressBookResource extends ResourceJena {
 	 * Get a single address by ID.
 	 */
 	@RestMethod(name="GET", path="/addresses/{id}/*",
-		converters={Traversable.class,Queryable.class}
+		converters={Traversable.class}
 	)
 	public Address getAddress(@Path int id) throws Exception {
 		return findAddress(id);


Mime
View raw message