├── src ├── reference │ ├── resources │ │ ├── images │ │ │ ├── callouts │ │ │ │ ├── 1.svg │ │ │ │ ├── 10.svg │ │ │ │ ├── 11.svg │ │ │ │ ├── 12.svg │ │ │ │ ├── 13.svg │ │ │ │ ├── 14.svg │ │ │ │ ├── 15.svg │ │ │ │ ├── 16.svg │ │ │ │ ├── 17.svg │ │ │ │ ├── 18.svg │ │ │ │ ├── 19.svg │ │ │ │ ├── 2.svg │ │ │ │ ├── 20.svg │ │ │ │ ├── 21.svg │ │ │ │ ├── 22.svg │ │ │ │ ├── 23.svg │ │ │ │ ├── 24.svg │ │ │ │ ├── 25.svg │ │ │ │ ├── 26.svg │ │ │ │ ├── 27.svg │ │ │ │ ├── 28.svg │ │ │ │ ├── 29.svg │ │ │ │ ├── 3.svg │ │ │ │ ├── 30.svg │ │ │ │ ├── 4.svg │ │ │ │ ├── 5.svg │ │ │ │ ├── 6.svg │ │ │ │ ├── 7.svg │ │ │ │ ├── 8.svg │ │ │ │ ├── 9.svg │ │ │ │ ├── 1.gif │ │ │ │ ├── 1.png │ │ │ │ ├── 2.gif │ │ │ │ ├── 2.png │ │ │ │ ├── 3.gif │ │ │ │ ├── 3.png │ │ │ │ ├── 4.gif │ │ │ │ ├── 4.png │ │ │ │ ├── 5.gif │ │ │ │ ├── 5.png │ │ │ │ ├── 6.gif │ │ │ │ ├── 6.png │ │ │ │ ├── 7.gif │ │ │ │ ├── 7.png │ │ │ │ ├── 8.gif │ │ │ │ ├── 8.png │ │ │ │ ├── 9.gif │ │ │ │ ├── 9.png │ │ │ │ ├── 10.gif │ │ │ │ ├── 10.png │ │ │ │ ├── 11.gif │ │ │ │ ├── 11.png │ │ │ │ ├── 12.gif │ │ │ │ ├── 12.png │ │ │ │ ├── 13.gif │ │ │ │ ├── 13.png │ │ │ │ ├── 14.gif │ │ │ │ ├── 14.png │ │ │ │ ├── 15.gif │ │ │ │ └── 15.png │ │ │ ├── logo.png │ │ │ ├── note.png │ │ │ ├── tip.png │ │ │ ├── admon │ │ │ │ └── note.png │ │ │ ├── important.png │ │ │ ├── oauth1_flow.png │ │ │ ├── oauth2_flow.png │ │ │ ├── twitter-authorize.png │ │ │ ├── xdev-spring_logo.jpg │ │ │ ├── sign-in-with-twitter.png │ │ │ ├── sign-in-with-facebook.png │ │ │ ├── sign-in-with-twitter-d.png │ │ │ ├── facebook-authorize-basic.png │ │ │ ├── facebook-authorize-scoped.png │ │ │ ├── facebook-authorize-loginbutton.png │ │ │ └── spring-social-twitter-example.png │ │ ├── image_src │ │ │ └── oauth_flows.graffle │ │ ├── css │ │ │ ├── highlight.css │ │ │ ├── manual.css │ │ │ ├── stylesheet.css │ │ │ └── html.css │ │ └── xsl │ │ │ ├── html-custom.xsl │ │ │ ├── html-single-custom.xsl │ │ │ └── pdf-custom.xsl │ └── docbook │ │ ├── index.xml │ │ ├── overview.xml │ │ ├── connecting.xml │ │ └── api.xml ├── api │ ├── doc-files │ │ └── th-background.png │ ├── overview.html │ └── spring-javadoc.css └── dist │ ├── changelog.txt │ ├── readme.txt │ ├── notice.txt │ └── license.txt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── spring-social-vkontakte └── src │ ├── test │ └── java │ │ └── org │ │ └── springframework │ │ └── social │ │ └── vkontakte │ │ └── connect │ │ └── package-info.java │ └── main │ ├── resources │ ├── META-INF │ │ ├── spring.handlers │ │ └── spring.schemas │ └── org │ │ └── springframework │ │ └── social │ │ └── vkontakte │ │ └── config │ │ └── xml │ │ └── spring-social-vkontakte-1.0.xsd │ └── java │ └── org │ └── springframework │ └── social │ └── vkontakte │ ├── api │ ├── package-info.java │ ├── impl │ │ ├── package-info.java │ │ └── VKontakteTemplate.java │ └── VKontakte.java │ ├── connect │ ├── package-info.java │ ├── VkAccessGrant.java │ ├── VKontakteConnectionFactory.java │ ├── VKontakteOAuth2Template.java │ ├── VKontakteServiceProvider.java │ └── VKontakteAdapter.java │ ├── security │ └── VKontakteAuthenticationService.java │ └── config │ ├── xml │ ├── VKontakteNamespaceHandler.java │ └── VKontakteConfigBeanDefinitionParser.java │ └── support │ └── VKontakteApiHelper.java ├── gradle.properties ├── .gitignore ├── settings.gradle ├── README.md ├── NOTICE ├── gradlew.bat ├── publish-maven.gradle ├── docs ├── docs.gradle └── manual │ └── src │ └── asciidoc │ └── index.adoc ├── gradlew └── LICENSE /src/reference/resources/images/callouts/1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/10.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/11.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/12.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/13.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/14.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/15.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/16.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/17.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/18.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/19.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/20.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/21.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/22.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/23.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/24.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/25.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/26.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/27.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/28.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/29.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/3.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/30.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/4.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/5.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/6.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/7.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/8.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/9.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reference/resources/image_src/oauth_flows.graffle: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/api/doc-files/th-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/api/doc-files/th-background.png -------------------------------------------------------------------------------- /src/reference/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/logo.png -------------------------------------------------------------------------------- /src/reference/resources/images/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/note.png -------------------------------------------------------------------------------- /src/reference/resources/images/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/tip.png -------------------------------------------------------------------------------- /src/reference/resources/images/admon/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/admon/note.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/1.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/1.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/2.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/2.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/3.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/3.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/4.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/4.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/5.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/5.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/6.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/6.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/7.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/7.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/8.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/8.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/9.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/9.png -------------------------------------------------------------------------------- /src/reference/resources/images/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/important.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/10.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/10.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/11.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/11.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/12.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/12.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/13.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/13.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/14.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/14.png -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/15.gif -------------------------------------------------------------------------------- /src/reference/resources/images/callouts/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/callouts/15.png -------------------------------------------------------------------------------- /src/reference/resources/images/oauth1_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/oauth1_flow.png -------------------------------------------------------------------------------- /src/reference/resources/images/oauth2_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/oauth2_flow.png -------------------------------------------------------------------------------- /src/reference/resources/images/twitter-authorize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/twitter-authorize.png -------------------------------------------------------------------------------- /src/reference/resources/images/xdev-spring_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/xdev-spring_logo.jpg -------------------------------------------------------------------------------- /src/reference/resources/images/sign-in-with-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/sign-in-with-twitter.png -------------------------------------------------------------------------------- /src/reference/resources/images/sign-in-with-facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/sign-in-with-facebook.png -------------------------------------------------------------------------------- /src/reference/resources/images/sign-in-with-twitter-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/sign-in-with-twitter-d.png -------------------------------------------------------------------------------- /src/reference/resources/images/facebook-authorize-basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/facebook-authorize-basic.png -------------------------------------------------------------------------------- /src/reference/resources/images/facebook-authorize-scoped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/facebook-authorize-scoped.png -------------------------------------------------------------------------------- /spring-social-vkontakte/src/test/java/org/springframework/social/vkontakte/connect/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TODO: add tests. 3 | */ 4 | package org.springframework.social.vkontakte.connect; 5 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/social/vkontakte=org.springframework.social.vkontakte.config.xml.VKontakteNamespaceHandler 2 | -------------------------------------------------------------------------------- /src/reference/resources/images/facebook-authorize-loginbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/facebook-authorize-loginbutton.png -------------------------------------------------------------------------------- /src/reference/resources/images/spring-social-twitter-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkolodrevskiy/spring-social-vkontakte/HEAD/src/reference/resources/images/spring-social-twitter-example.png -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Social's Service API for VKontakte 3 | */ 4 | package org.springframework.social.vkontakte.api; 5 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Implementation of Spring Social's Service API for VKontakte 3 | */ 4 | package org.springframework.social.vkontakte.api.impl; 5 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * VKontakte service provider connection repository and API adapter implementations. 3 | */ 4 | package org.springframework.social.vkontakte.connect; 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Dec 01 09:43:38 EST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip 7 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | springSecurityVersion=4.2.0.RELEASE 2 | junitVersion=4.12 3 | springVersion=4.3.5.RELEASE 4 | springSocialVersion=2.0.0.M1 5 | hamcrestVersion=1.3 6 | version=2.0.0.BUILD-SNAPSHOT 7 | servletApiVersion=3.1.0 8 | jsonPathVersion=2.2.0 9 | mockitoVersion=2.1.0 10 | vkSdkVersion=0.4.1 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings 4 | .DS_Store 5 | build 6 | **/build 7 | **/src/test/java/exploration 8 | .gradle 9 | spring-social-core/src/test/java/exploration 10 | # Eclipse 11 | **/.classpath 12 | **/.project 13 | **/.settings 14 | **/bin 15 | # Intellij 16 | .idea/ 17 | *.iml 18 | *.iws 19 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/resources/META-INF/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/social/spring-social-vkontakte.xsd=org/springframework/social/vkontakte/config/xml/spring-social-vkontakte-1.0.xsd 2 | http\://www.springframework.org/schema/social/spring-social-vkontakte-1.0.xsd=org/springframework/social/vkontakte/config/xml/spring-social-vkontakte-1.0.xsd -------------------------------------------------------------------------------- /src/api/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This document is the API specification for Spring Social VKontakte 4 |
5 |
6 |

7 | If you are interested in commercial training, consultancy, and 8 | support for Spring Social VKontakte, please visit SpringSource.com. 9 |

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/dist/changelog.txt: -------------------------------------------------------------------------------- 1 | Spring Social VKontakte 1.0.0.BUILD-SNAPSHOT (June 7, 2011) 2 | ======================================================= 3 | - Implemented support for UsersOperations, WallOperations, FriendsOperations, SecureOperations, LocationOperations 4 | AudioOperations, GroupsOperations, NewsFeedOperations, UtilsOperations. 5 | 6 | Spring Social VKontakte 2.0.0.BUILD-SNAPSHOT (January, 2016) 7 | ======================================================= 8 | - Removed previous API client implementation 9 | - Migrated to VK Java SDK, https://vk.com/dev/Java_SDK 10 | -------------------------------------------------------------------------------- /src/dist/readme.txt: -------------------------------------------------------------------------------- 1 | Spring Social VKontakte 2 | ----------------------------------------------------------- 3 | Spring Social VKontakte is an extension to Spring Social to enable connectivity with VKontakte. 4 | 5 | To find out what has changed in this release, see 'changelog.txt' 6 | 7 | Please consult the documentation located within the 'docs/reference' directory of this release and also visit the official Spring Social home at: 8 | http://www.springsource.org/spring-social 9 | 10 | There you will find links to the forum, issue tracker, samples, and other resources. 11 | 12 | -------------------------------------------------------------------------------- /src/reference/resources/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | code highlight CSS resemblign the Eclipse IDE default color schema 3 | @author Costin Leau 4 | */ 5 | 6 | .hl-keyword { 7 | color: #7F0055; 8 | font-weight: bold; 9 | } 10 | 11 | .hl-comment { 12 | color: #3F5F5F; 13 | font-style: italic; 14 | } 15 | 16 | .hl-multiline-comment { 17 | color: #3F5FBF; 18 | font-style: italic; 19 | } 20 | 21 | .hl-tag { 22 | color: #3F7F7F; 23 | } 24 | 25 | .hl-attribute { 26 | color: #7F007F; 27 | } 28 | 29 | .hl-value { 30 | color: #2A00FF; 31 | } 32 | 33 | .hl-string { 34 | color: #2A00FF; 35 | } -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/resources/org/springframework/social/vkontakte/config/xml/spring-social-vkontakte-1.0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | rootProject.name = 'spring-social-vkontakte' 18 | 19 | include 'docs', 'docs:manual' 20 | def docs = findProject(':docs') 21 | docs.buildFileName = 'docs.gradle' 22 | 23 | include 'spring-social-vkontakte' 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Spring Social VKontakte 2 | [![Build Status](http://fugru.com/jenkins/buildStatus/icon?job=spring-social-vkontakte)](http://fugru.com/jenkins/job/spring-social-vkontakte/) 3 | 4 | To check out the project and build from source, do the following: 5 | 6 | ``` 7 | git clone git://github.com/vkolodrevskiy/spring-social-vkontakte.git 8 | cd spring-social-vkontakte 9 | ./gradlew build 10 | ``` 11 | 12 | To generate Eclipse metadata (.classpath and .project files), do the following: 13 | 14 | ``` 15 | ./gradlew eclipse 16 | ``` 17 | 18 | Once complete, you may then import the projects into Eclipse as usual: 19 | `File -> Import -> Existing projects into workspace` 20 | 21 | To generate IDEA metadata (.iml and .ipr files), do the following: 22 | 23 | ``` 24 | ./gradlew idea 25 | ``` 26 | 27 | To build the JavaDoc, do the following from within the root directory: 28 | 29 | ``` 30 | ./gradlew :docs:api 31 | ``` 32 | 33 | The result will be available in `'docs/build/api'`. 34 | 35 | For more details go to project wiki https://github.com/vkolodrevskiy/spring-social-vkontakte/wiki 36 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | == NOTICE file corresponding to section 4 d of the Apache License, == 3 | == Version 2.0, in this case for the Spring Social VKontakte distribution. == 4 | ============================================================================ 5 | 6 | This product includes software developed by 7 | the Apache Software Foundation (http://www.apache.org). 8 | 9 | The end-user documentation included with a redistribution, if any, 10 | must include the following acknowledgement: 11 | 12 | "This product includes software developed by the Spring Framework 13 | Project (http://www.springframework.org)." 14 | 15 | Alternatively, this acknowledgement may appear in the software itself, 16 | if and wherever such third-party acknowledgements normally appear. 17 | 18 | The names "Spring", "Spring Framework", and "Spring Social" must 19 | not be used to endorse or promote products derived from this software 20 | without prior written permission. For written permission, please contact 21 | enquiries@springsource.com. 22 | -------------------------------------------------------------------------------- /src/dist/notice.txt: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | == NOTICE file corresponding to section 4 d of the Apache License, == 3 | == Version 2.0, in this case for the Spring Social VKontakte distribution. == 4 | ============================================================================ 5 | 6 | This product includes software developed by 7 | the Apache Software Foundation (http://www.apache.org). 8 | 9 | The end-user documentation included with a redistribution, if any, 10 | must include the following acknowledgement: 11 | 12 | "This product includes software developed by the Spring Framework 13 | Project (http://www.springframework.org)." 14 | 15 | Alternatively, this acknowledgement may appear in the software itself, 16 | if and wherever such third-party acknowledgements normally appear. 17 | 18 | The names "Spring", "Spring Framework", and "Spring Social" must 19 | not be used to endorse or promote products derived from this software 20 | without prior written permission. For written permission, please contact 21 | enquiries@springsource.com. 22 | -------------------------------------------------------------------------------- /src/reference/resources/css/manual.css: -------------------------------------------------------------------------------- 1 | @IMPORT url("highlight.css"); 2 | 3 | html { 4 | padding: 0pt; 5 | margin: 0pt; 6 | } 7 | 8 | body { 9 | margin-left: 10%; 10 | margin-right: 10%; 11 | font-family: Arial, Sans-serif; 12 | } 13 | 14 | div { 15 | margin: 0pt; 16 | } 17 | 18 | p { 19 | text-align: justify; 20 | } 21 | 22 | hr { 23 | border: 1px solid gray; 24 | background: gray; 25 | } 26 | 27 | h1,h2,h3,h4 { 28 | color: #234623; 29 | font-family: Arial, Sans-serif; 30 | } 31 | 32 | pre { 33 | line-height: 1.0; 34 | color: black; 35 | } 36 | 37 | pre.programlisting { 38 | font-size: 10pt; 39 | padding: 7pt 3pt; 40 | border: 1pt solid black; 41 | background: #eeeeee; 42 | clear: both; 43 | } 44 | 45 | div.table { 46 | margin: 1em; 47 | padding: 0.5em; 48 | text-align: center; 49 | } 50 | 51 | div.table table { 52 | display: table; 53 | width: 100%; 54 | } 55 | 56 | div.table td { 57 | padding-left: 7px; 58 | padding-right: 7px; 59 | } 60 | 61 | .sidebar { 62 | float: right; 63 | margin: 10px 0 10px 30px; 64 | padding: 10px 20px 20px 20px; 65 | width: 33%; 66 | border: 1px solid black; 67 | background-color: #F4F4F4; 68 | font-size: 14px; 69 | } 70 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/security/VKontakteAuthenticationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.security; 17 | 18 | import org.springframework.social.security.provider.OAuth2AuthenticationService; 19 | import org.springframework.social.vkontakte.api.VKontakte; 20 | import org.springframework.social.vkontakte.connect.VKontakteConnectionFactory; 21 | 22 | /** 23 | * VKontakte Authentication Service. 24 | * 25 | * @author vkolodrevskiy 26 | */ 27 | public class VKontakteAuthenticationService extends OAuth2AuthenticationService { 28 | 29 | public VKontakteAuthenticationService(String apiKey, String appSecret) { 30 | super(new VKontakteConnectionFactory(apiKey, appSecret)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/config/xml/VKontakteNamespaceHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.config.xml; 17 | 18 | import org.springframework.social.config.xml.AbstractProviderConfigBeanDefinitionParser; 19 | import org.springframework.social.config.xml.AbstractProviderConfigNamespaceHandler; 20 | 21 | /** 22 | * {@link org.springframework.beans.factory.xml.NamespaceHandler} for Spring Social VKontakte. 23 | * 24 | * @author vkolodrevskiy 25 | */ 26 | public class VKontakteNamespaceHandler extends AbstractProviderConfigNamespaceHandler { 27 | 28 | @Override 29 | protected AbstractProviderConfigBeanDefinitionParser getProviderConfigBeanDefinitionParser() { 30 | return new VKontakteConfigBeanDefinitionParser(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/reference/docbook/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | Spring Social VKontakte Reference Manual 7 | Spring Social VKontakte ${version} 8 | Spring Social VKontakte 9 | ${version} 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Craig 26 | Walls 27 | 28 | 29 | Keith 30 | Donald 31 | 32 | 33 | 34 | © SpringSource Inc., 2011 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/VkAccessGrant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.connect; 17 | 18 | import org.springframework.social.oauth2.AccessGrant; 19 | 20 | /** 21 | * Override {@link AccessGrant} to pass user id. 22 | * 23 | * @author vkolodrevskiy 24 | */ 25 | public class VkAccessGrant extends AccessGrant { 26 | private final Integer userId; 27 | 28 | public VkAccessGrant(String accessToken) { 29 | this(accessToken, null, null, null, null); 30 | } 31 | 32 | public VkAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn, Integer userId) { 33 | super(accessToken, scope, refreshToken, expiresIn); 34 | this.userId = userId; 35 | } 36 | 37 | public Integer getUserId() { 38 | return userId; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/VKontakte.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.api; 17 | 18 | import com.vk.api.sdk.client.actors.ServiceActor; 19 | import com.vk.api.sdk.client.actors.UserActor; 20 | import org.springframework.social.ApiBinding; 21 | 22 | /** 23 | * This is the central place for getting 24 | * {@link com.vk.api.sdk.client.actors.Actor} instances to interact with VK SDK, 25 | * also it provides user email if corresponding permission was requested and approved. 26 | * Implemented by {@link org.springframework.social.vkontakte.api.impl.VKontakteTemplate}. 27 | * 28 | * @author vkolodrevskiy 29 | */ 30 | public interface VKontakte extends ApiBinding { 31 | /** 32 | * Returns instance of {@code ServiceActor}. 33 | * 34 | * @return {@link ServiceActor} 35 | */ 36 | public ServiceActor getServiceActor(); 37 | 38 | /** 39 | * Returns instance of {@code UserActor}. 40 | * 41 | * @return {@link UserActor} 42 | */ 43 | public UserActor getUserActor(); 44 | 45 | /** 46 | * Returns user email. 47 | * 48 | * @return {@link UserActor} 49 | */ 50 | public String getEmail(); 51 | } 52 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/config/xml/VKontakteConfigBeanDefinitionParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.config.xml; 17 | 18 | import org.springframework.social.config.xml.AbstractProviderConfigBeanDefinitionParser; 19 | import org.springframework.social.security.provider.SocialAuthenticationService; 20 | import org.springframework.social.vkontakte.config.support.VKontakteApiHelper; 21 | import org.springframework.social.vkontakte.connect.VKontakteConnectionFactory; 22 | import org.springframework.social.vkontakte.security.VKontakteAuthenticationService; 23 | 24 | /** 25 | * Implementation of {@link AbstractProviderConfigBeanDefinitionParser} 26 | * that creates a {@link VKontakteConnectionFactory}. 27 | * 28 | * @author vkolodrevskiy 29 | */ 30 | class VKontakteConfigBeanDefinitionParser extends AbstractProviderConfigBeanDefinitionParser { 31 | 32 | public VKontakteConfigBeanDefinitionParser() { 33 | super(VKontakteConnectionFactory.class, VKontakteApiHelper.class); 34 | } 35 | 36 | @Override 37 | protected Class> getAuthenticationServiceClass() { 38 | return VKontakteAuthenticationService.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/VKontakteConnectionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.connect; 17 | 18 | import org.springframework.social.connect.support.OAuth2ConnectionFactory; 19 | import org.springframework.social.oauth2.AccessGrant; 20 | import org.springframework.social.vkontakte.api.VKontakte; 21 | 22 | /** 23 | * VKontakte {@link org.springframework.social.connect.ConnectionFactory} implementation. 24 | * 25 | * @author vkolodrevskiy 26 | */ 27 | public class VKontakteConnectionFactory extends OAuth2ConnectionFactory { 28 | 29 | public VKontakteConnectionFactory(String clientId, String clientSecret) { 30 | super("vkontakte", new VKontakteServiceProvider(clientId, clientSecret), new VKontakteAdapter()); 31 | } 32 | 33 | @Override 34 | public boolean supportsStateParameter() { 35 | // vk.com does not send state parameter in it's OAuth2 callback 36 | // see https://github.com/vkolodrevskiy/spring-social-vkontakte/issues/14 37 | return false; 38 | } 39 | 40 | @Override 41 | protected String extractProviderUserId(AccessGrant accessGrant) { 42 | return ((VkAccessGrant) accessGrant).getUserId().toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/reference/resources/css/stylesheet.css: -------------------------------------------------------------------------------- 1 | @IMPORT url("highlight.css"); 2 | 3 | html { 4 | padding: 0pt; 5 | margin: 0pt; 6 | } 7 | 8 | body { 9 | margin-left: 10%; 10 | margin-right: 10%; 11 | font-family: Arial, Sans-serif; 12 | } 13 | 14 | div { 15 | margin: 0pt; 16 | } 17 | 18 | p { 19 | text-align: justify; 20 | } 21 | 22 | hr { 23 | border: 1px solid gray; 24 | background: gray; 25 | } 26 | 27 | h1,h2,h3,h4 { 28 | color: #234623; 29 | font-family: Arial, Sans-serif; 30 | } 31 | 32 | pre { 33 | line-height: 1.0; 34 | color: black; 35 | } 36 | 37 | pre.programlisting { 38 | font-size: 10pt; 39 | padding: 7pt 3pt; 40 | border: 1pt solid black; 41 | background: #eeeeee; 42 | clear: both; 43 | } 44 | 45 | div.table { 46 | margin: 1em; 47 | padding: 0.5em; 48 | text-align: center; 49 | } 50 | 51 | div.table table { 52 | display: table; 53 | width: 100%; 54 | } 55 | 56 | div.table td { 57 | padding-left: 7px; 58 | padding-right: 7px; 59 | } 60 | 61 | .sidebar { 62 | float: right; 63 | margin: 10px 0 10px 30px; 64 | padding: 10px 20px 20px 20px; 65 | width: 33%; 66 | border: 1px solid black; 67 | background-color: #F4F4F4; 68 | font-size: 14px; 69 | } 70 | 71 | .mediaobject { 72 | padding-top: 30px; 73 | padding-bottom: 30px; 74 | } 75 | 76 | .legalnotice { 77 | font-family: Verdana, Arial, helvetica, sans-serif; 78 | font-size: 12px; 79 | font-style: italic; 80 | } 81 | 82 | p.releaseinfo { 83 | font-size: 100%; 84 | font-weight: bold; 85 | font-family: Verdana, Arial, helvetica, sans-serif; 86 | padding-top: 10px; 87 | } 88 | 89 | p.pubdate { 90 | font-size: 120%; 91 | font-weight: bold; 92 | font-family: Verdana, Arial, helvetica, sans-serif; 93 | } 94 | 95 | span.productname { 96 | font-size: 200%; 97 | font-weight: bold; 98 | font-family: Verdana, Arial, helvetica, sans-serif; 99 | } 100 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/VKontakteOAuth2Template.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.connect; 17 | 18 | import org.springframework.social.oauth2.AccessGrant; 19 | import org.springframework.social.oauth2.OAuth2Template; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * VKontakte-specific extension of {@link OAuth2Template}. 25 | * 26 | * @author vkolodrevskiy 27 | */ 28 | public class VKontakteOAuth2Template extends OAuth2Template { 29 | 30 | public VKontakteOAuth2Template(String clientId, String clientSecret) { 31 | super(clientId, clientSecret, "http://oauth.vk.com/authorize", "https://oauth.vk.com/access_token"); 32 | setUseParametersForClientAuthentication(true); 33 | } 34 | 35 | // When scope has "offline" option VKontakte returns expires_in=0, setting it to null in this case 36 | @Override 37 | protected AccessGrant createAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn, Map response) { 38 | // append id and email to user token 39 | // otherwise it would be very hard to change current spring social OAuth2 dance 40 | if (response.get("user_id") != null) { 41 | accessToken += "[id=" + response.get("user_id") + "]"; 42 | } 43 | if (response.get("email") != null) { 44 | accessToken += "[email=" + response.get("email") + "]"; 45 | } 46 | 47 | return new VkAccessGrant(accessToken, scope, refreshToken, expiresIn == 0 ? null : expiresIn, (Integer) response.get("user_id")); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/VKontakteServiceProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.connect; 17 | 18 | import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider; 19 | import org.springframework.social.vkontakte.api.VKontakte; 20 | import org.springframework.social.vkontakte.api.impl.VKontakteTemplate; 21 | 22 | import java.util.regex.Matcher; 23 | import java.util.regex.Pattern; 24 | 25 | /** 26 | * VKontakte {@link org.springframework.social.ServiceProvider} implementation. 27 | * 28 | * @author vkolodrevskiy 29 | */ 30 | public class VKontakteServiceProvider extends AbstractOAuth2ServiceProvider { 31 | 32 | private final String clientSecret; 33 | private final Integer clientId; 34 | 35 | public VKontakteServiceProvider(String clientId, String clientSecret) { 36 | super(new VKontakteOAuth2Template(clientId, clientSecret)); 37 | this.clientSecret = clientSecret; 38 | this.clientId = Integer.parseInt(clientId); 39 | } 40 | 41 | public VKontakte getApi(String accessToken) { 42 | Integer providerUserId = null; 43 | Matcher idMathcer = Pattern.compile("\\[id=([^\\]]*)\\]").matcher(accessToken); 44 | if (idMathcer.find()) { 45 | providerUserId = Integer.valueOf(idMathcer.group(1)); 46 | accessToken = accessToken.replaceAll("\\[id=" + providerUserId + "\\]", ""); 47 | } 48 | 49 | String email = null; 50 | Matcher emailMathcer = Pattern.compile("\\[email=([^\\]]*)\\]").matcher(accessToken); 51 | if (emailMathcer.find()) { 52 | email = emailMathcer.group(1); 53 | accessToken = accessToken.replaceAll("\\[email=" + email + "\\]", ""); 54 | } 55 | 56 | return new VKontakteTemplate(providerUserId, email, accessToken, clientId, clientSecret); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/config/support/VKontakteApiHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.config.support; 17 | 18 | import org.apache.commons.logging.Log; 19 | import org.apache.commons.logging.LogFactory; 20 | import org.springframework.social.UserIdSource; 21 | import org.springframework.social.config.xml.ApiHelper; 22 | import org.springframework.social.connect.Connection; 23 | import org.springframework.social.connect.UsersConnectionRepository; 24 | import org.springframework.social.vkontakte.api.VKontakte; 25 | import org.springframework.social.vkontakte.api.impl.VKontakteTemplate; 26 | 27 | /** 28 | * Support class for JavaConfig and XML configuration support. 29 | * Creates an API binding instance for the current user's connection. 30 | * 31 | * @author vkolodrevskiy 32 | */ 33 | public class VKontakteApiHelper implements ApiHelper { 34 | 35 | private final UsersConnectionRepository usersConnectionRepository; 36 | 37 | private final UserIdSource userIdSource; 38 | 39 | private VKontakteApiHelper(UsersConnectionRepository usersConnectionRepository, UserIdSource userIdSource) { 40 | this.usersConnectionRepository = usersConnectionRepository; 41 | this.userIdSource = userIdSource; 42 | } 43 | 44 | public VKontakte getApi() { 45 | if (logger.isDebugEnabled()) { 46 | logger.debug("Getting API binding instance for VKontakte"); 47 | } 48 | 49 | Connection connection = usersConnectionRepository.createConnectionRepository(userIdSource.getUserId()).findPrimaryConnection(VKontakte.class); 50 | if (logger.isDebugEnabled() && connection == null) { 51 | logger.debug("No current connection; Returning default VKontakteTemplate instance."); 52 | } 53 | return connection != null ? connection.getApi() : new VKontakteTemplate(); 54 | } 55 | 56 | private final static Log logger = LogFactory.getLog(VKontakteApiHelper.class); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/impl/VKontakteTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.api.impl; 17 | 18 | import com.vk.api.sdk.client.actors.ServiceActor; 19 | import com.vk.api.sdk.client.actors.UserActor; 20 | import org.springframework.social.oauth2.AbstractOAuth2ApiBinding; 21 | import org.springframework.social.vkontakte.api.VKontakte; 22 | 23 | /** 24 | * {@link VKontakte} implementation. 25 | * 26 | * @author vkolodrevskiy 27 | */ 28 | public class VKontakteTemplate extends AbstractOAuth2ApiBinding implements VKontakte { 29 | private UserActor userActor; 30 | private ServiceActor serviceActor; 31 | 32 | private final Integer providerUserId; 33 | private final String email; 34 | private final String accessToken; 35 | private final Integer clientId; 36 | private final String clientSecret; 37 | 38 | public VKontakteTemplate() { 39 | this.providerUserId = null; 40 | this.accessToken = null; 41 | this.clientId = null; 42 | this.clientSecret = null; 43 | this.email = null; 44 | initialize(); 45 | } 46 | 47 | public VKontakteTemplate(Integer providerUserId, String email, String accessToken, Integer clientId, String clientSecret) { 48 | super(accessToken); 49 | this.providerUserId = providerUserId; 50 | this.email = email; 51 | this.accessToken = accessToken; 52 | this.clientId = clientId; 53 | this.clientSecret = clientSecret; 54 | initialize(); 55 | } 56 | 57 | private void initialize() { 58 | userActor = new UserActor(providerUserId, accessToken); 59 | serviceActor = new ServiceActor(clientId, clientSecret, accessToken); 60 | } 61 | 62 | @Override 63 | public ServiceActor getServiceActor() { 64 | return serviceActor; 65 | } 66 | 67 | @Override 68 | public UserActor getUserActor() { 69 | return userActor; 70 | } 71 | 72 | @Override 73 | public String getEmail() { 74 | return email; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/api/spring-javadoc.css: -------------------------------------------------------------------------------- 1 | /* stylesheet.css 2008/04/22 nicolekonicki */ 2 | 3 | /* 4 | * 5 | * Spring-specific Javadoc style sheet 6 | * 7 | */ 8 | 9 | 10 | 11 | .code 12 | { 13 | border: 1px solid black; 14 | background-color: #F4F4F4; 15 | padding: 5px; 16 | } 17 | 18 | body 19 | { 20 | font: 12px Verdana, Arial, Helvetica, "Bitstream Vera Sans", sans-serif; 21 | background-color: #fff; 22 | color: #333; 23 | } 24 | 25 | 26 | /* Link colors */ 27 | a 28 | { 29 | color:#2c7b14; 30 | text-decoration:none; 31 | } 32 | 33 | a:hover 34 | { 35 | text-decoration:underline; 36 | } 37 | 38 | /* Headings */ 39 | h1 40 | { 41 | font-size:28px; 42 | color:#007c00; 43 | } 44 | 45 | /* Table colors */ 46 | 47 | table 48 | { 49 | border:none; 50 | } 51 | 52 | td 53 | { 54 | border:none; 55 | border-bottom:1px dotted #ddd; 56 | } 57 | 58 | th 59 | { 60 | border:none; 61 | } 62 | 63 | .TableHeadingColor th 64 | { 65 | background-color: #efffcb; 66 | background-image: url(doc-files/th-background.png); 67 | background-repeat: repeat-x; 68 | color:#fff; 69 | font-size:14px; 70 | height:26px; 71 | } 72 | 73 | .TableSubHeadingColor 74 | { 75 | background: #f7ffee; 76 | 77 | } 78 | .TableRowColor 79 | { 80 | background: #fff; 81 | } 82 | 83 | .TableRowColor a 84 | { 85 | border-bottom:none; 86 | color:#2c7b14; 87 | font-weight:normal; 88 | } 89 | 90 | tr.TableRowColor:hover 91 | { 92 | background:#eef2e1; 93 | } 94 | 95 | 96 | /* Font used in left-hand frame lists */ 97 | .FrameTitleFont 98 | { 99 | font-size: 120%; 100 | font-weight:bold; 101 | } 102 | 103 | .FrameTitleFont a 104 | { 105 | color: #333; 106 | } 107 | 108 | .FrameHeadingFont 109 | { 110 | font-weight: bold; 111 | font-size:95%; 112 | } 113 | 114 | .FrameItemFont 115 | { 116 | line-height:130%; 117 | font-size: 95%; 118 | } 119 | 120 | .FrameItemFont a 121 | { 122 | color:#333; 123 | } 124 | 125 | .FrameItemFont a:hover 126 | { 127 | color:#249901; 128 | border-bottom:none; 129 | text-decoration:underline; 130 | } 131 | 132 | /* Navigation bar fonts and colors */ 133 | .NavBarCell1 134 | { 135 | background-color:#fff; 136 | border:none; 137 | } 138 | 139 | .NavBarCell1Rev 140 | { 141 | background-color:#e3faa5; 142 | border:1px solid #9ad00c; 143 | padding:0; 144 | margin:0; 145 | } 146 | 147 | .NavBarCell1 a 148 | { 149 | color:#333; 150 | text-decoration:none; 151 | } 152 | 153 | .NavBarFont1Rev 154 | { 155 | 156 | } 157 | 158 | .NavBarCell2 159 | { 160 | border:none; 161 | } 162 | 163 | .NavBarCell2 a 164 | { 165 | color:#249901; 166 | font-size:90%; 167 | } 168 | 169 | .NavBarCell3 170 | { 171 | border:none; 172 | } 173 | 174 | /* Override sizes in font tags */ 175 | font 176 | { 177 | font: inherit !important; 178 | } 179 | -------------------------------------------------------------------------------- /publish-maven.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | 3 | ext.optionalDeps = [] 4 | ext.providedDeps = [] 5 | 6 | ext.optional = { optionalDeps << it } 7 | ext.provided = { providedDeps << it } 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | customizePom(pom, project) 12 | } 13 | } 14 | 15 | // upload artifact to Fugru maven repository 16 | // store fugruUser and fugruPassword in environment variables 17 | // as ORG_GRADLE_PROJECT_fugruPassword and ORG_GRADLE_PROJECT_fugruUser 18 | // this was done for security issues 19 | uploadArchives { 20 | repositories { 21 | def user, password 22 | if(project.hasProperty('fugruUser')) { 23 | user = project.fugruUser 24 | } else { 25 | user = 'guest' 26 | } 27 | if(project.hasProperty('fugruPassword')) { 28 | password = project.fugruPassword 29 | } else { 30 | password = '' 31 | } 32 | 33 | mavenDeployer { 34 | customizePom(pom, project) 35 | 36 | snapshotRepository(url: 'http://fugru.com/archiva/repository/snapshots/') { 37 | authentication(userName: user, password: password); 38 | } 39 | } 40 | } 41 | } 42 | 43 | def customizePom(pom, gradleProject) { 44 | pom.whenConfigured { generatedPom -> 45 | // respect 'optional' and 'provided' dependencies 46 | gradleProject.optionalDeps.each { dep -> 47 | generatedPom.dependencies.findAll { it.artifactId == dep.name }*.optional = true 48 | } 49 | gradleProject.providedDeps.each { dep -> 50 | generatedPom.dependencies.findAll { it.artifactId == dep.name }*.scope = 'provided' 51 | } 52 | 53 | // eliminate test-scoped dependencies (no need in maven central poms) 54 | generatedPom.dependencies.removeAll { dep -> 55 | dep.scope == 'test' 56 | } 57 | 58 | // add all items necessary for maven central publication 59 | generatedPom.project { 60 | name = gradleProject.description 61 | description = gradleProject.description 62 | url = 'https://github.com/vkolodrevskiy/spring-social-vkontakte' 63 | organization { 64 | name = 'Fugru' 65 | url = 'http://fugru.com' 66 | } 67 | licenses { 68 | license { 69 | name 'The Apache Software License, Version 2.0' 70 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 71 | distribution 'repo' 72 | } 73 | } 74 | scm { 75 | url = 'https://github.com/vkolodrevskiy/spring-social-vkontakte' 76 | connection = 'scm:git:git://github.com/vkolodrevskiy/spring-social-vkontakte' 77 | developerConnection = 'scm:git:git://github.com/vkolodrevskiy/spring-social-vkontakte' 78 | } 79 | developers { 80 | developer { 81 | id = 'vkolodrevskiy' 82 | name = 'Viktor Kolodrevskiy' 83 | email = 'viktor.kolodrevskiy@gmail.com' 84 | } 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/reference/docbook/overview.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Spring Social VKontakte Overview 5 | 6 |
7 | Introduction 8 | 9 | 10 | The Spring Social VKontakte project is an extension to Spring Social that enables integration with VKontakte. 11 | 12 | 13 | 14 | VKontakte is a social networking site geared toward professionals. 15 | It enables its users to maintain and correspond with a network of contacts they have are professionally linked to. 16 | 17 | 18 | 19 | Spring Social VKontakte enables integration with VKontakte with VKontakteConnectionFactory, a connection factory that can be plugged into Spring Social's service provider connection framework, and with an API binding to VKontakte's REST API. 20 | 21 | 22 |
23 | 24 |
25 | How to get 26 | 27 | 28 | The following Maven dependency will add Spring Social VKontakte to your project: 29 | 30 | 31 | 33 | org.springframework.social 34 | spring-social-vkontakte 35 | ${org.springframework.social-vkontakte-version} 36 | ]]> 37 | 38 | 39 | 40 | As an extension to Spring Social, Spring Social VKontakte depends on Spring Social. 41 | Spring Social's core module will be transitively resolved from the Spring Social VKontakte dependency. 42 | If you'll be using Spring Social's web module, you'll need to add that dependency yourself: 43 | 44 | 45 | 47 | org.springframework.social 48 | spring-social-web 49 | ${org.springframework.social-version} 50 | ]]> 51 | 52 | 53 | 54 | Note that Spring Social VKontakte may release on a different schedule than Spring Social. 55 | Consequently, Spring Social's version may differ from that of Spring Social VKontakte. 56 | 57 | 58 | 59 | Spring Social VKontakte uses Spring Social's OAuth1Template to add OAuth 1.0a authorization headers to requests sent to VKontakte. 60 | OAuth1Template uses the Commons Codec library when calculating request signatures. 61 | Therefore, you'll also need Commons Codec in your project: 62 | 63 | 64 | 66 | commons-codec 67 | commons-codec 68 | 1.5 69 | ]]> 70 | 71 | 72 | 73 | Consult Spring Social's reference documentation for more information on Spring Social dependencies. 74 | 75 |
76 | 77 |
78 | -------------------------------------------------------------------------------- /src/reference/docbook/connecting.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Configuring VKontakte Connectivity 5 | 6 | 7 | Spring Social's ConnectController works with one or more provider-specific ConnectionFactorys to exchange authorization details with the provider and to create connections. 8 | Spring Social VKontakte provides VKontakteConnectionFactory, a ConnectionFactory for creating connections with VKontakte. 9 | 10 | 11 | 12 | So that ConnectController can find VKontakteConnectionFactory, it must be registered with a ConnectionFactoryRegistry. 13 | The following class constructs a ConnectionFactoryRegistry containing a ConnectionFactory for VKontakte using Spring's Java configuration style: 14 | 15 | 30 | 31 | 32 | 33 | Here, a VKontakte connection factory is registered with ConnectionFactoryRegistry via the addConnectionFactory() method. 34 | If we wanted to add support for connecting to other providers, we would simply register their connection factories here in the same way as VKontakteConnectionFactory. 35 | 36 | 37 | 38 | Because consumer keys and secrets may be different across environments (e.g., test, production, etc) it is recommended that these values be externalized. 39 | As shown here, Spring 3.1's Environment is used to look up the application's consumer key and secret. 40 | 41 | 42 | 43 | Optionally, you may also configure ConnectionFactoryRegistry and VKontakteConnectionFactory in XML: 44 | 45 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ]]> 57 | 58 | 59 | 60 | This is functionally equivalent to the Java-based configuration of ConnectionFactoryRegistry shown before. 61 | The only casual difference is that the connection factories are injected as a list into the connectionFactories property rather than with the addConnectionFactory() method. 62 | As in the Java-based configuration, the application's consumer key and secret are externalized (shown here as property placeholders). 63 | 64 | 65 | 66 | Refer to Spring Social's reference documentation for complete details on configuring ConnectController and its dependencies. 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/connect/VKontakteAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.social.vkontakte.connect; 17 | 18 | import com.vk.api.sdk.client.Lang; 19 | import com.vk.api.sdk.client.VkApiClient; 20 | import com.vk.api.sdk.exceptions.ApiException; 21 | import com.vk.api.sdk.exceptions.ClientException; 22 | import com.vk.api.sdk.httpclient.HttpTransportClient; 23 | import com.vk.api.sdk.objects.users.UserXtrCounters; 24 | import com.vk.api.sdk.queries.users.UserField; 25 | import org.apache.commons.logging.Log; 26 | import org.apache.commons.logging.LogFactory; 27 | import org.springframework.social.connect.ApiAdapter; 28 | import org.springframework.social.connect.ConnectionValues; 29 | import org.springframework.social.connect.UserProfile; 30 | import org.springframework.social.connect.UserProfileBuilder; 31 | import org.springframework.social.vkontakte.api.VKontakte; 32 | 33 | /** 34 | * VKontakte {@link ApiAdapter} implementation. 35 | * 36 | * @author vkolodrevskiy 37 | */ 38 | public class VKontakteAdapter implements ApiAdapter { 39 | private final static Log log = LogFactory.getLog(VKontakteAdapter.class); 40 | 41 | private final VkApiClient vkApiClient; 42 | 43 | public VKontakteAdapter() { 44 | this.vkApiClient = new VkApiClient(HttpTransportClient.getInstance()); 45 | } 46 | 47 | public boolean test(VKontakte vkontakte) { 48 | try { 49 | UserXtrCounters user = vkApiClient.users().get(vkontakte.getUserActor()).fields(UserField.SCREEN_NAME, UserField.PHOTO_200) 50 | .lang(Lang.EN).execute().get(0); 51 | return true; 52 | } catch (ApiException | ClientException e) { 53 | return false; 54 | } 55 | } 56 | 57 | public void setConnectionValues(VKontakte vkontakte, ConnectionValues values) { 58 | try { 59 | UserXtrCounters user = vkApiClient.users().get(vkontakte.getUserActor()) 60 | .fields(UserField.PHOTO_200) 61 | .lang(Lang.EN).execute().get(0); 62 | values.setProviderUserId(String.valueOf(user.getId())); 63 | values.setDisplayName(user.getFirstName() + " " + user.getLastName()); 64 | values.setProfileUrl("https://vk.com/id" + user.getId()); 65 | values.setImageUrl(user.getPhoto200()); 66 | } catch (ApiException | ClientException e) { 67 | log.error("Error while getting current user info.", e); 68 | } 69 | } 70 | 71 | public UserProfile fetchUserProfile(VKontakte vkontakte) { 72 | try { 73 | UserXtrCounters user = vkApiClient.users().get(vkontakte.getUserActor()) 74 | .fields(UserField.SCREEN_NAME, UserField.PHOTO_200) 75 | .lang(Lang.EN).execute().get(0); 76 | return new UserProfileBuilder() 77 | .setId(String.valueOf(user.getId())) 78 | .setUsername(user.getScreenName()) 79 | .setFirstName(user.getFirstName()) 80 | .setLastName(user.getLastName()) 81 | .setName(user.getFirstName() + " " + user.getLastName()) 82 | .build(); 83 | } catch (ApiException | ClientException e) { 84 | log.error("Error while getting current user info.", e); 85 | return new UserProfileBuilder().build(); 86 | } 87 | } 88 | 89 | public void updateStatus(VKontakte vkontakte, String message) { 90 | // It's not good idea to post something. 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /docs/docs.gradle: -------------------------------------------------------------------------------- 1 | // Docbook and Javadoc building and uploading tasks 2 | apply plugin: 'base' 3 | 4 | description = "Spring Social VKontakte - Documentation" 5 | 6 | task docs { 7 | dependsOn 'manual:asciidoctor', 'apidocs' 8 | } 9 | 10 | project('manual') { 11 | description = "Spring Social VKontakte - Manual" 12 | apply plugin: 'base' 13 | apply plugin: 'asciidoctor' 14 | 15 | ext.expandPlaceholders = "" 16 | 17 | asciidoctor { 18 | options = [ 19 | eruby: 'erubis', 20 | attributes: [ 21 | copycss : '', 22 | icons : 'font', 23 | 'source-highlighter': 'prettify', 24 | sectanchors : '', 25 | toc2: '', 26 | idprefix: '', 27 | idseparator: '-', 28 | doctype: 'book', 29 | numbered: '', 30 | 'spring-social-vkontakte-version' : project.version, 31 | 'spring-social-version' : springSocialVersion, 32 | 'spring-version' : springVersion, 33 | 'spring-security-version' : springSecurityVersion, 34 | revnumber : project.version 35 | ] 36 | ] 37 | } 38 | 39 | 40 | ext.spec = copySpec { 41 | into ('reference/htmlsingle') { 42 | from(asciidoctor.outputDir) 43 | exclude 'build', 'Guardfile' 44 | } 45 | } 46 | } 47 | 48 | task apidocs(type: Javadoc) { 49 | destinationDir = new File(buildDir, 'apidocs') 50 | title = "Spring Social VKontakte $version API" 51 | 52 | source coreModuleProjects.collect { project -> 53 | project.sourceSets.main.allJava 54 | } 55 | 56 | classpath = files(coreModuleProjects.collect { project -> 57 | project.sourceSets.main.compileClasspath 58 | }) 59 | } 60 | 61 | apidocs.options.outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET 62 | 63 | apidocs.options.links = [ 64 | "http://static.springframework.org/spring/docs/3.2.x/javadoc-api", 65 | "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/", 66 | "http://download.oracle.com/javase/6/docs/api/" 67 | ] 68 | 69 | apidocs.options.groups = [ 70 | 'API Binding':['org.springframework.social.vkontakte.api*'], 71 | 'Connection Framework Support':['org.springframework.social.vkontakte.connect'], 72 | 'Configuration Support':['org.springframework.social.vkontakte.config*'], 73 | 'Spring Security Integration':['org.springframework.social.vkontakte.security'] 74 | ] 75 | 76 | ext.apiSpec = copySpec { 77 | into('apidocs') { 78 | from(apidocs.destinationDir) 79 | } 80 | } 81 | 82 | assemble.dependsOn = [apidocs, 'manual:asciidoctor'] 83 | 84 | task docsZip(type: Zip) { 85 | dependsOn docs 86 | group = 'Distribution' 87 | baseName = rootProject.name 88 | classifier = 'docs' 89 | description = "Builds -${classifier} archive containing api and reference " + 90 | "for deployment at static.springframework.org/spring-social/site/docs." 91 | 92 | with(project(':docs').apiSpec) 93 | with(project(':docs:manual').spec) 94 | } 95 | 96 | task schemaZip(type: Zip) { 97 | group = 'Distribution' 98 | baseName = rootProject.name 99 | classifier = 'schema' 100 | description = "Builds -${classifier} archive containing all " + 101 | "XSDs for deployment at static.springframework.org/schema." 102 | 103 | coreModuleProjects.each { module -> 104 | def Properties schemas = new Properties(); 105 | 106 | module.sourceSets.main.resources.find { 107 | it.path.endsWith('META-INF/spring.schemas') 108 | }?.withInputStream { schemas.load(it) } 109 | 110 | for (def key : schemas.keySet()) { 111 | def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') 112 | assert shortName != key 113 | File xsdFile = module.sourceSets.main.resources.find { 114 | it.path.endsWith(schemas.get(key)) 115 | } 116 | assert xsdFile != null 117 | into (shortName) { 118 | from xsdFile.path 119 | } 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/reference/docbook/api.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | VKontakte API Binding 4 | 5 | 6 | Spring Social VKontakte offers integration with VKontakte's REST API with the VKontakte interface and its implementation, VKontakteTemplate. 7 | 8 | 9 | 10 | To create an instance of VKontakteTemplate, you may pass in your application's OAuth 1 credentials, along with an access token/secret pair to the constructor: 11 | 12 | 13 | 19 | 20 | 21 | 22 | If you are using Spring Social's service provider framework, you can get an instance of VKontakte from a Connection. 23 | For example, the following snippet calls getApi() on a connection to retrieve a VKontakte: 24 | 25 | 26 | connection = connectionRepository.findPrimaryConnection(VKontakte.class); 28 | if (connection != null) { 29 | VKontakte vkontakte = connection.getApi(); 30 | 31 | // ... use VKontakte API binding 32 | }]]> 33 | 34 | 35 | 36 | Here, ConnectionRepository is being asked for the primary connection that the current user has with VKontakte. 37 | If a connection to VKontakte is found, it retrieves a VKontakte instance that is configured with the connection details received when the connection was first established. 38 | 39 | 40 | 41 | Once you have a VKontakte you can use it to interact with VKontakte on behalf of the user who the access token was granted for. 42 | 43 | 44 |
45 | Retrieving a user's VKontakte profile data 46 | 47 | 48 | To retrieve the authenticated user's profile data, call the getUserProfile() method: 49 | 50 | 51 | 53 | 54 | 55 | 56 | The data returned in the VKontakteProfile includes the user's VKontakte ID, first and last names, their "headline", the industry they're in, and URLs for the public and standard profile pages. 57 | 58 | 59 | 60 | If it's only the user's VKontakte ID you need, then you can get that by calling the getProfileId() method: 61 | 62 | 63 | 65 | 66 | 67 | 68 | Or if you only need a URL for the user's public profile page, call getProfileUrl(): 69 | 70 | 71 | 73 | 74 | 75 |
76 | 77 |
78 | Getting a user's VKontakte connections 79 | 80 | 81 | To retrieve a list of VKontakte users to whom the user is connected, call the getConnections() method: 82 | 83 | 84 | connections = vkontakte.getConnections();]]> 86 | 87 | 88 | 89 | This will return a list of VKontakteProfile objects for the user's 1st-degree network (those VKontakte users to whom the user is directly linked--not their extended network). 90 | 91 |
92 |
93 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 165 | if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then 166 | cd "$(dirname "$0")" 167 | fi 168 | 169 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 170 | -------------------------------------------------------------------------------- /src/reference/resources/xsl/html-custom.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | '5' 31 | '1' 32 | 33 | 34 | 1 35 | 36 | 37 | 1 38 | 39 | 40 | 1 41 | 0 42 | 1 43 | 44 | 45 | 46 | images/ 47 | .png 48 | 49 | 120 50 | images/callouts/ 51 | .png 52 | 53 | 54 | css/manual.css 55 | text/css 56 | book toc,title 57 | 58 | text-align: left 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 3 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Begin Google Analytics code 120 | 124 | 130 | End Google Analytics code 131 | 132 | 133 | 134 | 135 | Begin LoopFuse code 136 | 138 | 142 | End LoopFuse code 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/reference/resources/xsl/html-single-custom.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 1 32 | 33 | 34 | 1 35 | 36 | 37 | 1 38 | 0 39 | 1 40 | 41 | 42 | 43 | images/ 44 | .png 45 | 46 | 120 47 | images/callouts/ 48 | .png 49 | 50 | 51 | css/manual.css 52 | text/css 53 | book toc,title 54 | 55 | text-align: left 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 2 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | Begin Google Analytics code 117 | 121 | 127 | End Google Analytics code 128 | 129 | 130 | 131 | 132 | Begin LoopFuse code 133 | 135 | 139 | End LoopFuse code 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/reference/resources/css/html.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: justify; 3 | margin-right: 2em; 4 | margin-left: 2em; 5 | } 6 | 7 | a, 8 | a[accesskey^ 9 | 10 | = 11 | "h" 12 | ] 13 | , 14 | a[accesskey^ 15 | 16 | = 17 | "n" 18 | ] 19 | , 20 | a[accesskey^ 21 | 22 | = 23 | "u" 24 | ] 25 | , 26 | a[accesskey^ 27 | 28 | = 29 | "p" 30 | ] 31 | { 32 | font-family: Verdana, Arial, helvetica, sans-serif 33 | 34 | ; 35 | font-size: 36 | 37 | 12 38 | px 39 | 40 | ; 41 | color: #003399 42 | 43 | ; 44 | } 45 | 46 | a:active { 47 | color: #003399; 48 | } 49 | 50 | a:visited { 51 | color: #888888; 52 | } 53 | 54 | p { 55 | font-family: Verdana, Arial, sans-serif; 56 | } 57 | 58 | dt { 59 | font-family: Verdana, Arial, sans-serif; 60 | font-size: 12px; 61 | } 62 | 63 | p, dl, dt, dd, blockquote { 64 | color: #000000; 65 | margin-bottom: 3px; 66 | margin-top: 3px; 67 | padding-top: 0px; 68 | } 69 | 70 | ol, ul, p { 71 | margin-top: 6px; 72 | margin-bottom: 6px; 73 | } 74 | 75 | p, blockquote { 76 | font-size: 90%; 77 | } 78 | 79 | p.releaseinfo { 80 | font-size: 100%; 81 | font-weight: bold; 82 | font-family: Verdana, Arial, helvetica, sans-serif; 83 | padding-top: 10px; 84 | } 85 | 86 | p.pubdate { 87 | font-size: 120%; 88 | font-weight: bold; 89 | font-family: Verdana, Arial, helvetica, sans-serif; 90 | } 91 | 92 | td { 93 | font-size: 80%; 94 | } 95 | 96 | td, th, span { 97 | color: #000000; 98 | } 99 | 100 | td[width^ 101 | 102 | = 103 | "40%" 104 | ] 105 | { 106 | font-family: Verdana, Arial, helvetica, sans-serif 107 | 108 | ; 109 | font-size: 110 | 111 | 12 112 | px 113 | 114 | ; 115 | color: #003399 116 | 117 | ; 118 | } 119 | 120 | table[summary^ 121 | 122 | = 123 | "Navigation header" 124 | ] 125 | tbody tr th[colspan^ 126 | 127 | = 128 | "3" 129 | ] 130 | { 131 | font-family: Verdana, Arial, helvetica, sans-serif 132 | 133 | ; 134 | } 135 | 136 | blockquote { 137 | margin-right: 0px; 138 | } 139 | 140 | h1, h2, h3, h4, h6, H6 { 141 | color: #000000; 142 | font-weight: 500; 143 | margin-top: 0px; 144 | padding-top: 14px; 145 | font-family: Verdana, Arial, helvetica, sans-serif; 146 | margin-bottom: 0px; 147 | } 148 | 149 | h2.title { 150 | font-weight: 800; 151 | margin-bottom: 8px; 152 | } 153 | 154 | h2.subtitle { 155 | font-weight: 800; 156 | margin-bottom: 20px; 157 | } 158 | 159 | .firstname, .surname { 160 | font-size: 12px; 161 | font-family: Verdana, Arial, helvetica, sans-serif; 162 | } 163 | 164 | table { 165 | border-collapse: collapse; 166 | border-spacing: 0; 167 | border: 1px black; 168 | empty-cells: hide; 169 | margin: 10px 0px 30px 50px; 170 | width: 90%; 171 | } 172 | 173 | div.table { 174 | margin: 30px 0px 30px 0px; 175 | border: 1px dashed gray; 176 | padding: 10px; 177 | } 178 | 179 | div .table-contents table { 180 | border: 1px solid black; 181 | } 182 | 183 | div.table > p.title { 184 | padding-left: 10px; 185 | } 186 | 187 | table[summary^ 188 | 189 | = 190 | "Navigation footer" 191 | ] 192 | { 193 | border-collapse: collapse 194 | 195 | ; 196 | border-spacing: 197 | 198 | 0 199 | ; 200 | border: 201 | 202 | 1 203 | px black 204 | 205 | ; 206 | empty-cells: hide 207 | 208 | ; 209 | margin: 210 | 211 | 0 212 | px 213 | 214 | ; 215 | width: 216 | 217 | 100 218 | % 219 | ; 220 | } 221 | 222 | table[summary^ 223 | 224 | = 225 | "Note" 226 | ] 227 | , 228 | table[summary^ 229 | 230 | = 231 | "Warning" 232 | ] 233 | , 234 | table[summary^ 235 | 236 | = 237 | "Tip" 238 | ] 239 | { 240 | border-collapse: collapse 241 | 242 | ; 243 | border-spacing: 244 | 245 | 0 246 | ; 247 | border: 248 | 249 | 1 250 | px black 251 | 252 | ; 253 | empty-cells: hide 254 | 255 | ; 256 | margin: 257 | 258 | 10 259 | px 260 | 261 | 0 262 | px 263 | 264 | 10 265 | px 266 | 267 | - 268 | 20 269 | px 270 | 271 | ; 272 | width: 273 | 274 | 100 275 | % 276 | ; 277 | } 278 | 279 | td { 280 | padding: 4pt; 281 | font-family: Verdana, Arial, helvetica, sans-serif; 282 | } 283 | 284 | div.warning TD { 285 | text-align: justify; 286 | } 287 | 288 | h1 { 289 | font-size: 150%; 290 | } 291 | 292 | h2 { 293 | font-size: 110%; 294 | } 295 | 296 | h3 { 297 | font-size: 100%; 298 | font-weight: bold; 299 | } 300 | 301 | h4 { 302 | font-size: 90%; 303 | font-weight: bold; 304 | } 305 | 306 | h5 { 307 | font-size: 90%; 308 | font-style: italic; 309 | } 310 | 311 | h6 { 312 | font-size: 100%; 313 | font-style: italic; 314 | } 315 | 316 | tt { 317 | font-size: 110%; 318 | font-family: "Courier New", Courier, monospace; 319 | color: #000000; 320 | } 321 | 322 | .navheader, .navfooter { 323 | border: none; 324 | } 325 | 326 | div.navfooter table { 327 | border: dashed gray; 328 | border-width: 1px 1px 1px 1px; 329 | background-color: #cde48d; 330 | } 331 | 332 | pre { 333 | font-size: 110%; 334 | padding: 5px; 335 | border-style: solid; 336 | border-width: 1px; 337 | border-color: #CCCCCC; 338 | background-color: #f3f5e9; 339 | } 340 | 341 | ul, ol, li { 342 | list-style: disc; 343 | } 344 | 345 | hr { 346 | width: 100%; 347 | height: 1px; 348 | background-color: #CCCCCC; 349 | border-width: 0px; 350 | padding: 0px; 351 | } 352 | 353 | .variablelist { 354 | padding-top: 10px; 355 | padding-bottom: 10px; 356 | margin: 0; 357 | } 358 | 359 | .term { 360 | font-weight: bold; 361 | } 362 | 363 | .mediaobject { 364 | padding-top: 30px; 365 | padding-bottom: 30px; 366 | } 367 | 368 | .legalnotice { 369 | font-family: Verdana, Arial, helvetica, sans-serif; 370 | font-size: 12px; 371 | font-style: italic; 372 | } 373 | 374 | .sidebar { 375 | float: right; 376 | margin: 10px 0px 10px 30px; 377 | padding: 10px 20px 20px 20px; 378 | width: 33%; 379 | border: 1px solid black; 380 | background-color: #F4F4F4; 381 | font-size: 14px; 382 | } 383 | 384 | .property { 385 | font-family: "Courier New", Courier, monospace; 386 | } 387 | 388 | a code { 389 | font-family: Verdana, Arial, monospace; 390 | font-size: 12px; 391 | } 392 | 393 | td code { 394 | font-size: 110%; 395 | } 396 | 397 | div.note * td, 398 | div.tip * td, 399 | div.warning * td, 400 | div.calloutlist * td { 401 | text-align: justify; 402 | font-size: 100%; 403 | } 404 | 405 | .programlisting .interfacename, 406 | .programlisting .literal, 407 | .programlisting .classname { 408 | font-size: 95%; 409 | } 410 | 411 | .title .interfacename, 412 | .title .literal, 413 | .title .classname { 414 | font-size: 130%; 415 | } 416 | 417 | /* everything in a is displayed in a coloured, comment-like font */ 418 | .programlisting * .lineannotation, 419 | .programlisting * .lineannotation * { 420 | color: green; 421 | } 422 | -------------------------------------------------------------------------------- /docs/manual/src/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | = Spring Social VKontakte Reference 2 | Viktor Kolodrevskiy 3 | 4 | The Spring Social VKontakte project is an extension to 5 | http://projects.spring.io/spring-social[Spring Social] that enables 6 | integration with VKontakte. 7 | 8 | == Introduction 9 | http://www.vk.com[VKontakte] is the largest European online social networking service, based in Russia. It is available in several languages, and is especially popular among Russian-speaking users. VK allows users to message each other publicly or privately, to create groups, public pages and events, share and tag images, audio and video, and to play browser-based games. 10 | 11 | Spring Social VKontakte enables integration with VKontakte with 12 | `VKontakteConnectionFactory`, a connection factory that can be plugged into 13 | Spring Social's service provider connection framework, and with an API 14 | binding to VKontakte's REST API. 15 | 16 | [[]] 17 | === How to get 18 | 19 | The following Gradle dependency will add Spring Social VKontakte to your 20 | project: 21 | 22 | .build.gradle 23 | [source,groovy,subs="attributes,verbatim"] 24 | ---- 25 | compile "org.springframework.social:spring-social-vkontakte:{spring-social-vkontakte-version}" 26 | ---- 27 | 28 | Or in Maven: 29 | 30 | .pom.xml 31 | [source,xml,subs="attributes,verbatim"] 32 | ---- 33 | 34 | org.springframework.social 35 | spring-social-vkontakte 36 | {spring-social-vkontakte-version} 37 | 38 | ---- 39 | 40 | As an extension to Spring Social, Spring Social VKontakte depends on 41 | Spring Social. Spring Social's core module will be transitively resolved 42 | from the Spring Social VKontakte dependency. If you'll be using Spring 43 | Social's web module, you'll need to add that dependency yourself. 44 | In Gradle: 45 | 46 | .build.gradle 47 | [source,groovy,subs="attributes,verbatim"] 48 | ---- 49 | compile "org.springframework.social:spring-social-web:{spring-social-version}" 50 | ... 51 | repositories { 52 | maven { url 'http://fugru.com/archiva/repository/snapshots' } 53 | } 54 | 55 | ---- 56 | 57 | Or in Maven: 58 | 59 | .pom.xml 60 | [source,xml,subs="attributes,verbatim"] 61 | ---- 62 | 63 | org.springframework.social 64 | spring-social-web 65 | {spring-social-version} 66 | 67 | ... 68 | 69 | 70 | snapshot 71 | Fugru Maven Snapshot Repository 72 | http://fugru.com/archiva/repository/snapshots 73 | false 74 | true 75 | 76 | 77 | ---- 78 | 79 | Note that Spring Social VKontakte may release on a different schedule 80 | than Spring Social. Consequently, Spring Social's version may differ 81 | from that of Spring Social VKontakte. 82 | 83 | Consult 84 | http://docs.spring.io/spring-social/docs/1.0.x/reference/html/overview.html#overview-howtoget[Spring 85 | Social's reference documentation] for more information on Spring Social 86 | dependencies. 87 | 88 | 89 | [[]] 90 | == Configuring VKontakte Connectivity 91 | Spring Social's `ConnectController` works with one or more provider-specific `ConnectionFactory` instances to exchange authorization details with the provider and to create connections. 92 | Spring Social VKontakte provides `VKontakteConnectionFactory`, a `ConnectionFactory` for creating connections with VKontakte. 93 | 94 | So that `ConnectController` can find `VKontakteConnectionFactory`, it must be registered with a `ConnectionFactoryRegistry`. 95 | The following configuration class uses Spring Social's Java configuration support to register a `ConnectionFactory` for VKontakte: 96 | 97 | ```java 98 | @Configuration 99 | public class SocialConfig implements SocialConfigurer { 100 | 101 | @Override 102 | public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) { 103 | cfConfig.addConnectionFactory(new VKontakteConnectionFactory( 104 | env.getProperty("vkontakte.clientId"), 105 | env.getProperty("vkontakte.clientSecret"))); 106 | } 107 | 108 | ... 109 | } 110 | ``` 111 | 112 | If we wanted to add support for connecting to other providers, we would simply register their connection factories here in the same way as `VKontakteConnectionFactory`. 113 | 114 | Because client IDs and secrets may be different across environments (e.g., test, production, etc) it is recommended that these values be externalized. As shown here, Spring's `Environment` abstraction is provided as a parameter to `addConnectionFactories()` so that it can look up the application's client ID and secret. 115 | 116 | Optionally, you may also configure `VKontakteConnectionFactory` in XML. 117 | Using Spring Social VKontakte's XML configuration namespace: 118 | 119 | ```xml 120 | 123 | ``` 124 | 125 | This is roughly equivalent to the Java-based configuration of `ConnectionFactoryRegistry` shown before. 126 | As in the Java-based configuration, the application's client ID and secret are externalized (shown here as property placeholders). 127 | 128 | Refer to 129 | http://docs.spring.io/spring-social/site/docs/1.1.0.RC1/reference/htmlsingle/index.html#connecting[Spring Social's reference documentation] for complete details on configuring `ConnectController` and its dependencies. 130 | 131 | == VKontakte API Binding 132 | Spring Social VKontakte offers integration with VKontakte's REST API with the `VKontakte` interface and its implementation, `VKontakteTemplate`. 133 | Before you start using it, please get familiar with VK Java SDK, check https://github.com/VKCOM/vk-java-sdk[github vk-java-sdk] also https://vk.com/dev/SDK[vk skd page]. 134 | Interaction with VK API is done through VK Java SDK, the main class to work there is `VkApiClient`, to perform most of the operations this class requires `Actor` instances. 135 | Here comes Spring Social VKontakte -- it will provide instances of `Actor`. 136 | Here's sample of how you can use `VKontakte` with VK Java SDK `VkApiClient`: 137 | 138 | ```java 139 | 140 | private final VKontakte vkontakte; 141 | @Inject 142 | public VKontakteFriendsController(VKontakte vkontakte) { 143 | this.vkontakte = vkontakte; 144 | } 145 | 146 | @RequestMapping(value="/getIds", method=RequestMethod.GET) 147 | public String showFeed(Model model) throws ClientException, ApiException { 148 | VkApiClient vk = new VkApiClient(HttpTransportClient.getInstance()); 149 | GetResponse userIds = vk.friends().get(vkontakte.getUserActor()).execute(); 150 | List ids = userIds.getItems().stream().map(Object::toString).collect(Collectors.toList()); 151 | model.addAttribute("ids", ids); 152 | 153 | return "getIds"; 154 | } 155 | ``` 156 | 157 | If you are using Spring Social's 158 | http://docs.spring.io/spring-social/site/docs/1.1.0.RC1/reference/htmlsingle/index.html#connectFramework[service provider framework], you can get an instance of `VKontakte` from a `Connection`. For example, the following snippet calls `getApi()` on a connection to retrieve a `VKontakte`: 159 | 160 | ```java 161 | Connection connection = connectionRepository.findPrimaryConnection(VKontakte.class); 162 | if (connection != null) { 163 | VKontakte vkontakte = connection.getApi(); 164 | 165 | // ... use VKontakte API binding 166 | } 167 | ``` 168 | 169 | Here, `ConnectionRepository` is being asked for the primary connection that the current user has with VKontakte. 170 | If a connection to VKontakte is found, it retrieves a `VKontakte` instance that is configured with the connection details received when the connection was first established. 171 | 172 | The `VKontakte` interface is defined as follows: 173 | 174 | ```java 175 | public interface VKontakte extends ApiBinding { 176 | public ServiceActor getServiceActor(); 177 | public UserActor getUserActor(); 178 | public String getEmail(); 179 | } 180 | ``` 181 | 182 | Here's description: 183 | 184 | [[table_subApis]] 185 | .VKontakte's methods 186 | [options="header",] 187 | |======================================================================= 188 | |Method |Description 189 | |getServiceActor |Returns instance of VK Java SDK ServiceActor 190 | |getUserActor |Returns instance of VK Java SDK UserActor 191 | |getEmail |Returns user email, if `email` scope was specified and user approved to share email. 192 | |======================================================================= 193 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/dist/license.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/reference/resources/xsl/pdf-custom.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -5em 55 | -5em 56 | 57 | 58 | 61 | 62 | 63 | book toc,title 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | please define productname in your docbook file! 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 194 | 195 | 196 | 1 197 | 0 198 | 1 199 | 1 200 | 201 | 204 | 205 | 206 | 0 207 | 0 208 | 0 209 | 210 | 213 | 214 | false 215 | 216 | 217 | 11 218 | 8 219 | 220 | 221 | 1.4 222 | 223 | 224 | 225 | left 226 | bold 227 | 228 | 229 | pt 230 | 231 | 232 | 233 | 235 | 236 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 0.8em 248 | 0.8em 249 | 0.8em 250 | 251 | 252 | pt 253 | 254 | 0.1em 255 | 0.1em 256 | 0.1em 257 | 258 | 259 | 0.6em 260 | 0.6em 261 | 0.6em 262 | 263 | 264 | pt 265 | 266 | 0.1em 267 | 0.1em 268 | 0.1em 269 | 270 | 271 | 0.4em 272 | 0.4em 273 | 0.4em 274 | 275 | 276 | pt 277 | 278 | 0.1em 279 | 0.1em 280 | 0.1em 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 322 | 323 | 324 | 325 | 4pt 326 | 4pt 327 | 4pt 328 | 4pt 329 | 330 | 331 | 332 | 0.1pt 333 | 0.1pt 334 | 335 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 350 | 351 | 352 | 353 | 354 | 355 | pt 356 | 357 | 358 | 359 | 360 | 1em 361 | 1em 362 | 1em 363 | 0.1em 364 | 0.1em 365 | 0.1em 366 | 367 | #444444 368 | solid 369 | 0.1pt 370 | 0.5em 371 | 0.5em 372 | 0.5em 373 | 0.5em 374 | 0.5em 375 | 0.5em 376 | 377 | 378 | 379 | 1 380 | 381 | #F0F0F0 382 | 383 | 384 | 385 | 0.1em 386 | 0.1em 387 | 0.1em 388 | 0.1em 389 | 0.1em 390 | 0.1em 391 | 392 | 393 | 394 | 0.5em 395 | 0.5em 396 | 0.5em 397 | 0.1em 398 | 0.1em 399 | 0.1em 400 | always 401 | 402 | 403 | 406 | 407 | 408 | normal 409 | italic 410 | 411 | 412 | pt 413 | 414 | false 415 | 0.1em 416 | 0.1em 417 | 0.1em 418 | 419 | 420 | 423 | 424 | 428 | 431 | 434 | 435 | 436 | 437 | figure after 438 | example after 439 | equation before 440 | table before 441 | procedure before 442 | 443 | 444 | 445 | 1 446 | 447 | 0pt 448 | 449 | 450 | 3 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 469 | 502 | 503 | --------------------------------------------------------------------------------