Use api methods

Important

You can use API method only if admin check permission for that method for client and user (result it is a cross of permissions).

First you need get iVIS service factory from request.

HttpServletRequest request = ... ; // get HttpServletRequest
IvisServiceFactory ivisServiceFactory = IvisOAuth2Utils.getServiceFactory(request);

Note

If service factory invokes first time it wil create service factory in user session context.

Next uses exist IvisServiceFactory instance need get service for specific entity.

//for example you need ApplicationService
ApplicationService applicationService = ivisServiceFactory.getService(ApplicationService.class);

And then just invoke API methods like Java methods.

List<Application> allApplications = applicationService.findAll();

All API services described at ivis-services module.

Class diagram of all interfaces with methods.

Note

Registered bean IvisServiceArgumentResolver provide you possibility use SDK in handler method next way. Also IvisIdToDomainClassConverter allow use id definition instead whole object.

@RequestMapping(value = "/classes/save", method = RequestMethod.POST)
public ModelAndView saveSchoolClass(@ModelAttribute("schoolClass") SchoolClass schoolClass,
                                    SchoolClassService classService) {
    //in this object pupils and school fields are objects with only one non null property id
    classService.save(schoolClass);
    view.setViewName("school_classes/created");
    return view;
}