use of org.cerberus.crud.service.IBuildRevisionParametersService in project cerberus-source by cerberustesting.
the class ReadBuildRevisionParameters method findBuildRevisionParametersByKey.
private AnswerItem findBuildRevisionParametersByKey(Integer id, ApplicationContext appContext, boolean userHasPermissions) throws JSONException, CerberusException {
AnswerItem item = new AnswerItem();
JSONObject object = new JSONObject();
IBuildRevisionParametersService libService = appContext.getBean(IBuildRevisionParametersService.class);
// finds the project
AnswerItem answer = libService.readByKeyTech(id);
if (answer.isCodeEquals(MessageEventEnum.DATA_OPERATION_OK.getCode())) {
// if the service returns an OK message then we can get the item and convert it to JSONformat
BuildRevisionParameters brp = (BuildRevisionParameters) answer.getItem();
JSONObject response = convertBuildRevisionParametersToJSONObject(brp);
object.put("contentTable", response);
}
object.put("hasPermissions", userHasPermissions);
item.setItem(object);
item.setResultMessage(answer.getResultMessage());
return item;
}
Aggregations