Skip to content

Commit

Permalink
Added paging support for open search and username search
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan committed Apr 17, 2019
1 parent 149c8fd commit 93e49c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion connector-rest-wordpress/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>edu.unc.polygon</groupId>
<artifactId>connector-rest-wordpress</artifactId>
<version>.20-SNAPSHOT</version>
<version>.22-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Wordpress REST Connector</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ else if (filter != null && filter.byName != null) {
JSONObject nameSearchJson = new JSONObject();
nameSearchJson.put("search",searchName);
nameSearchJson.put("context","edit");
String pagedResultsOffset = String.valueOf(oo.getPagedResultsOffset());
if ( pagedResultsOffset != null && !StringUtil.isEmpty(pagedResultsOffset) ) {
jsonObject.put("page",pagedResultsOffset);
}
request = new HttpGetWithBody(configuration.getWordpressRestUrl() + "/wp/v2/users/");
try {
JSONArray nameSearchResponseJson = callRequestArray(request, nameSearchJson);
Expand Down Expand Up @@ -313,6 +317,10 @@ else if (filter != null && filter.byEmailAddress != null) {
JSONArray searchResponseJson = new JSONArray();
JSONObject jsonObject = new JSONObject();
jsonObject.put("context","edit");
String pagedResultsOffset = String.valueOf(oo.getPagedResultsOffset());
if ( pagedResultsOffset != null && !StringUtil.isEmpty(pagedResultsOffset) ) {
jsonObject.put("page",pagedResultsOffset);
}
try {
HttpEntityEnclosingRequestBase request;
request = new HttpGetWithBody(configuration.getWordpressRestUrl() + "/wp/v2/users");
Expand Down

0 comments on commit 93e49c5

Please sign in to comment.