use of com.runwaysdk.dataaccess.AttributeBooleanIF in project geoprism-registry by terraframe.
the class UserInfo method serializePage.
private static JSONObject serializePage(Integer pageSize, Integer pageNumber, JSONArray externalSystems, ValueQuery vQuery) {
JSONArray results = new JSONArray();
OIterator<ValueObject> it = vQuery.getIterator(pageSize, pageNumber);
try {
while (it.hasNext()) {
ValueObject vObject = it.next();
JSONObject result = new JSONObject();
result.put(GeoprismUser.OID, vObject.getValue(GeoprismUser.OID));
result.put(GeoprismUser.USERNAME, vObject.getValue(GeoprismUser.USERNAME));
result.put(GeoprismUser.FIRSTNAME, vObject.getValue(GeoprismUser.FIRSTNAME));
result.put(GeoprismUser.LASTNAME, vObject.getValue(GeoprismUser.LASTNAME));
result.put(GeoprismUser.PHONENUMBER, vObject.getValue(GeoprismUser.PHONENUMBER));
result.put(GeoprismUser.EMAIL, vObject.getValue(GeoprismUser.EMAIL));
result.put(GeoprismUser.INACTIVE, AttributeBoolean.getBooleanValue((AttributeBooleanIF) vObject.getAttributeIF(GeoprismUser.INACTIVE)));
result.put(UserInfo.ALTFIRSTNAME, vObject.getValue(UserInfo.ALTFIRSTNAME));
result.put(UserInfo.ALTLASTNAME, vObject.getValue(UserInfo.ALTLASTNAME));
result.put(UserInfo.ALTPHONENUMBER, vObject.getValue(UserInfo.ALTPHONENUMBER));
result.put(UserInfo.POSITION, vObject.getValue(UserInfo.POSITION));
result.put(UserInfo.EXTERNALSYSTEMOID, vObject.getValue(UserInfo.EXTERNALSYSTEMOID));
results.put(result);
}
} finally {
it.close();
}
JSONObject page = new JSONObject();
page.put("resultSet", results);
page.put("count", vQuery.getCount());
page.put("pageNumber", pageNumber);
page.put("pageSize", pageSize);
page.put("externalSystems", externalSystems);
return page;
}
Aggregations