use of org.motechproject.mds.dto.RestOptionsDto in project motech by motech.
the class MdsRestBundleIT method prepareFilteredEntity.
private void prepareFilteredEntity() throws IOException {
EntityDto entityDto = new EntityDto(FILTERED_ENTITY_NAME);
entityDto = entityService.createEntity(entityDto);
FieldDto strField = new FieldDto(null, entityDto.getId(), TypeDto.STRING, new FieldBasicDto("strFieldDisp", "strField"), false, null);
FieldDto intField = new FieldDto(null, entityDto.getId(), TypeDto.INTEGER, new FieldBasicDto("intFieldDisp", "intField"), false, null);
entityService.addFields(entityDto, asList(strField, intField));
RestOptionsDto restOptions = new RestOptionsDto(true, true, true, true, false);
restOptions.setFieldNames(prepareFilteredRestFieldNames(entityService.getEntityFields(entityDto.getId())));
entityService.updateRestOptions(entityDto.getId(), restOptions);
}
Aggregations