MIFOSX-2038 : cleanup

This commit is contained in:
pramod
2015-08-27 15:04:40 +05:30
parent 80f122446a
commit 87adf49f44
2 changed files with 47 additions and 4 deletions
+45
View File
@@ -33250,6 +33250,8 @@ Request Body:
<br>
<div class=apiClick>search?query=Petra&resource=clients,groups</div>
<br>
<div class=apiClick>search?query=Petra&resource=clients,groups&exactMatch=true</div>
<br>
<table class=matrixHeading>
<tr class="matrixHeadingBG">
<td><div class="mifosXHeading2">Parameters</div></td>
@@ -33273,6 +33275,15 @@ Request Body:
Scoped resources on which search can be performed. If there is no resource parameter passed then search will be performed on all <a href="#search">scoped</a> resources.
</td>
</tr>
<tr>
<td>
exactMatch
<br><i>(non-mandatory)</i>
</td>
<td class=fielddesc>
Scoped resources on which search can be performed. If there is no exactMatch parameter passed then search will be performed for all partial matches <a href="#search">scoped</a> resources.
</td>
</tr>
</table>
<br>
<table class=matrixHeading>
@@ -33320,6 +33331,40 @@ GET https://DomainName/api/v1/search?query=000000111
}
]
</code>
<code class="method-declaration">
GET https://DomainName/api/v1/search?query=000000001&exactMatch=true
</code>
<code class="method-response">
[{
"entityId": 1,
"entityAccountNo": "000000001",
"entityExternalId": "ID_JKZGEXF",
"entityName": "Group_Name_HVCU5",
"entityType": "GROUP",
"parentId": 1,
"parentName": "Head Office",
"entityStatus": {
"id": 300,
"code": "groupingStatusType.active",
"value": "Active"
}
},
{
"entityId": 1,
"entityAccountNo": "000000001",
"entityExternalId": "ID_UOZAGPZ",
"entityName": "Client_FirstName_KJ5B6 Client_LastName_KDGX",
"entityType": "CLIENT",
"parentId": 1,
"parentName": "Head Office",
"entityStatus": {
"id": 300,
"code": "clientStatusType.active",
"value": "Active"
}
}]
</code>
</div>
</div>
<a id="advance_search" name="advance_search" class="old-syle-anchor">&nbsp;</a>
@@ -9,6 +9,7 @@ import java.util.Collection;
import java.util.Set;
import javax.ws.rs.Consumes;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
@@ -72,11 +73,8 @@ public class SearchApiResource {
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public String searchData(@Context final UriInfo uriInfo, @QueryParam("query") final String query,
@QueryParam("resource") final String resource ,@QueryParam("exactMatch") Boolean exactMatch) {
@QueryParam("resource") final String resource ,@DefaultValue("false") @QueryParam("exactMatch") Boolean exactMatch) {
if (exactMatch == null) {
exactMatch = false;
}
final SearchConditions searchConditions = new SearchConditions(query, resource,exactMatch);
final Collection<SearchData> searchResults = this.searchReadPlatformService.retriveMatchingData(searchConditions);