Package net.sf.iqser.plugin.facebook.infrastructure

Examples of net.sf.iqser.plugin.facebook.infrastructure.IFacebookContentBuilder


   */
  public byte[] getBinaryData(Content content) {
    //determine accessToken and object type from content URL
    String type = URLUtils.getObjectType(content.getContentUrl());   

    IFacebookContentBuilder builder = createBuilder(type, accessToken);

    return builder.getBinaryData(content);
  }
View Full Code Here


   
    long newSyncTime = System.currentTimeMillis();
    Date lastSyncDate = new Date(lastSyncTime);   
         
    for (String type : userDataTypes) {
      IFacebookContentBuilder builder = createBuilder(type, accessToken);
      builder.doSynchonization("me", lastSyncDate);
    }
   
    // get friends
    IFacebookRESTClient fbClient = facebookClientFactory.createFacebookAPIClient(accessToken);
    //List<User> friendList = fbClient.getUserFriends();
    List<User> friendList = fbClient.getFacebookConnectionByID("me/friends", User.class);
   
    // for each friend synch types:  User, Post, Events, Status, Notes
    for (User friend : friendList) {
      for (String type : friendDataTypes) {
        IFacebookContentBuilder builder = createBuilder(type, accessToken);
        builder.doSynchonization(friend.getId(), lastSyncDate);
      }
    }
   
    lastSyncTime = newSyncTime;
  }
View Full Code Here

  @Override
  public Content getContent(String contentURL) {
    //determine accessToken and object type from content URL
    String type = URLUtils.getObjectType(contentURL);   

    IFacebookContentBuilder builder = createBuilder(type, accessToken);

    Content content = builder.getContent(contentURL);
   
    customizeContent(content);
   
    return content;
  }
View Full Code Here

  public void performAction(String action, Content content) {
    //determine accessToken and object type from content URL   
    if (getActions(content).contains(action)) {
      String type = URLUtils.getObjectType(content.getContentUrl());

      IFacebookContentBuilder builder = createBuilder(type, accessToken);

      builder.performAction(action, content);
    } else {
      throw new IQserRuntimeException("Action " + action + " not supported by content");
    }
  }
View Full Code Here

   * @param type - content type
   * @param accessToken - the Facebook access token
   * @return a IFacebookContentBuilder
   */
  private IFacebookContentBuilder createBuilder(String type, String accessToken){
    IFacebookContentBuilder builder = ContentBuilderFactory.getContentBuilder(type);
    IFacebookRESTClient fbClient = facebookClientFactory.createFacebookAPIClient(accessToken);
    builder.setFbClient(fbClient);
    builder.setFbContentProvider(this);
   
    return builder;
  }
View Full Code Here

TOP

Related Classes of net.sf.iqser.plugin.facebook.infrastructure.IFacebookContentBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.