Skip to content

Commit

Permalink
IVIS-46: SDK chapter fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Dec 15, 2016
1 parent caf8811 commit d062e86
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/sdk/routines/access_to_protected_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Prerequisites

You can limit access to specific urls, or some code areas on JSP page. iVIS provides SDK in both cases.

Both variants has optional parameter roles (String). "role" it is comma separated list of roles which gives user access
Both variants has optional parameter roles (String). "roles" it is comma separated list of roles which gives user access
to protected resources.

Filter
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/routines/beans_configuration.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Beans configuration
===================

To use services with provided method we need next beans.
To use services with provided methods we need next beans:

.. code-block:: java
Expand Down
2 changes: 0 additions & 2 deletions docs/sdk/routines/login.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ Let's see how it looks like.
return new RedirectView(redirect, true);
}
If user unauthorized you need redirect to login page.
.. code-block:: java
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/routines/mvc_configuration.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Mvc configuration
=================

To use services direct in handler methods
To use services direct in handler methods we need following:

.. code-block:: java
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/routines/tokens_flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ As you can see this method also logout user from iVIS.

If user not logged in, filter intercept access to protected resources by error thrown:

1. org.springframework.security.oauth2.common.exceptions.UnauthorizedUserException with message Token isn't good.
2. org.springframework.security.access.AccessDeniedException Token is good, but roles aren't.
1. org.springframework.security.oauth2.common.exceptions.UnauthorizedUserException with message "Token isn't good".
2. org.springframework.security.access.AccessDeniedException with message "Token is good, but roles aren't".



Expand Down
14 changes: 14 additions & 0 deletions docs/sdk/routines/use_api_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ All API services described at `ivis-services <https://github.com/imCodePartnerAB

:download:`Class diagram </images/services.png>` 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.

.. code-block:: java
@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;
}

0 comments on commit d062e86

Please sign in to comment.