Example usage for org.springframework.social.facebook.api.impl FacebookTemplate FacebookTemplate

List of usage examples for org.springframework.social.facebook.api.impl FacebookTemplate FacebookTemplate

Introduction

In this page you can find the example usage for org.springframework.social.facebook.api.impl FacebookTemplate FacebookTemplate.

Prototype

FacebookTemplate

Source Link

Usage

From source file:com.notemyweb.config.SocialConfig.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook() {
    Connection<Facebook> facebook = connectionRepository().findPrimaryConnection(Facebook.class);
    return facebook != null ? facebook.getApi() : new FacebookTemplate();
}

From source file:org.easit.core.configurations.SocialConfig.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook() {
    Connection<Facebook> connection = connectionRepository().findPrimaryConnection(Facebook.class);
    return connection != null ? connection.getApi() : new FacebookTemplate();
}

From source file:com.springsource.greenhouse.config.SocialConfig.java

/**
 * A request-scoped bean representing the API binding to Facebook for the current user.
 * Since it is a scoped-proxy, references to this bean MAY be injected at application startup time.
 * The target is an authorized {@link Facebook} instance if the current user has connected his or her account with a Facebook account.
 * Otherwise, the target is a new FacebookTemplate that can invoke operations that do not require authorization.
 */// w  ww.  j a v  a  2  s  .c  o  m
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook() {
    Connection<Facebook> facebook = connectionRepository().findPrimaryConnection(Facebook.class);
    return facebook != null ? facebook.getApi() : new FacebookTemplate();
}