-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IVIS-46: -Create SDK chapter, start fill it.
- Loading branch information
1 parent
7dab2d4
commit eddab9b
Showing
8 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
API description | ||
=============== | ||
|
||
SDK simplify API invocation to easy steps: | ||
|
||
#. Get service for entity | ||
#. Invoke methods in that servoice | ||
|
||
Examples how do that you will find at `Routines <http://docs.ivis.se/en/latest/sdk/routines.html>`_. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.. |copy| unicode:: 0xA9 | ||
Get started | ||
=========== | ||
|
||
* `Add repository`_ | ||
* `Maven <http://docs.ivis.se/en/latest/sdk/get_started.html#mvn1>`_ | ||
* `Gradle <http://docs.ivis.se/en/latest/sdk/get_started.html#grdl1>`_ | ||
* `Add dependencies`_ | ||
* `Maven <http://docs.ivis.se/en/latest/sdk/get_started.html#mvn2>`_ | ||
* `Gradle <http://docs.ivis.se/en/latest/sdk/get_started.html#grdl2>`_ | ||
|
||
|
||
iVIS SDK consists of ivis-core and ivis-sdk dependencies. | ||
To use them you need include dependencies from Imcode |copy| maven repository to your Maven or Gradle configuration file. | ||
|
||
Add repository | ||
-------------- | ||
|
||
.. _`mvn1`: | ||
|
||
Maven | ||
~~~~~ | ||
|
||
Write in your pom.xml | ||
|
||
.. code-block:: xml | ||
<repositories> | ||
<repository> | ||
<id>imcode</id> | ||
<url>http://repo.imcode.com/maven2</url> | ||
<snapshots> | ||
<updatePolicy>always</updatePolicy> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<releases> | ||
<updatePolicy>always</updatePolicy> | ||
<enabled>true</enabled> | ||
</releases> | ||
</repository> | ||
</repositories> | ||
.. _`grdl1`: | ||
|
||
Gradle | ||
~~~~~~ | ||
|
||
Write in your build.gradle | ||
|
||
.. code-block:: js | ||
repositories { | ||
maven { url "http://repo.imcode.com/maven2" } | ||
mavenCentral() | ||
} | ||
Add dependencies | ||
---------------- | ||
|
||
.. _`mvn2`: | ||
|
||
Maven | ||
~~~~~ | ||
|
||
Write in your pom.xml | ||
|
||
.. code-block:: xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.imcode.ivis</groupId> | ||
<artifactId>ivis-core</artifactId> | ||
<version>1.0.0-alpha1-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.imcode.ivis</groupId> | ||
<artifactId>ivis-sdk</artifactId> | ||
<version>1.0.0-alpha1-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
.. _`grdl2`: | ||
|
||
Gradle | ||
~~~~~~ | ||
|
||
Write in your build.gradle | ||
|
||
.. code-block:: js | ||
dependencies { | ||
compile group:'com.imcode.ivis', name:'ivis-core', version:'1.0.0-alpha1-SNAPSHOT' | ||
compile group:'com.imcode.ivis', name:'ivis-sdk',version:'1.0.0-alpha1-SNAPSHOT' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
iVIS SDK | ||
======== | ||
|
||
iVIS provides SDK for easier api uses. | ||
|
||
You think login, token management, api calls etc very hard to implement and will take many hours of your precious time. You will see that is not true. | ||
In this chapter you will look how to do routines jobs by few lne of codes. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
get_started | ||
api_description | ||
routines | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Routines | ||
======== | ||
|
||
Routines operation vast your time. Don't worry! You will see how to do basic concepts working with iVIS API faster. | ||
And as conclusion we will create simple web application which calls iVIS API. So let's started! | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
routines/configuration | ||
routines/login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import com.imcode.imcms.addon.ivisclient.oauth2.IvisAuthorizationCodeResourceDetails; | ||
|
||
@Configuration | ||
public class BeansContext { | ||
|
||
@Value("${client-id}") | ||
private String clientId; | ||
|
||
@Value("${client-secret}") | ||
private String clientSecret; | ||
|
||
@Value("${user-authorization-uri}") | ||
private String userAuthorizationUri; | ||
|
||
@Value("${access-token-uri}") | ||
private String accessTokenUri; | ||
|
||
@Bean | ||
public OAuth2ProtectedResourceDetails transferService() { | ||
IvisAuthorizationCodeResourceDetails client = new IvisAuthorizationCodeResourceDetails(); | ||
|
||
|
||
return client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Configuration | ||
============= | ||
|
||
We will use Spring for configuration and also Dependency Injection principle. | ||
|
||
Additionally to your configuration you will needed: | ||
|
||
#. `Properties`_ | ||
#. `Beans for injection`_ | ||
* `Java config`_ | ||
* `XML config`_ | ||
|
||
Properties | ||
---------- | ||
|
||
.. code-block:: properties | ||
api-server-address = http://ivis.dev.imcode.com | ||
client-address = http://client.of.ivis.com | ||
client-id = ff11397c-3e3b-4398-80a9-feba203f1928 | ||
redirect-uri = ${client-address}/redirecttome | ||
user-authorization-uri = ${api-server-address}/oauth/authorize | ||
access-token-uri = ${api-server-address}/oauth/token | ||
Beans for injection | ||
------------------- | ||
|
||
Java config | ||
~~~~~~~~~~~ | ||
|
||
.. literalinclude:: /sdk/routines/code/BeansContext.java | ||
:language: java | ||
:linenos: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Login | ||
===== | ||
|
||
First you need define properties for client configuration: | ||
|
||
.. code-block:: properties | ||
server-api-address = http://ivis.dev.imcode.com | ||
client-address = http://some.client.of.ivis.com |