My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

Introduction

This application aims to provide a quick and easy way for building Java Web Applications for Facebook.

It aims to provide a fast-track and all-inclusive dive deep into how the Facebook Web Applications can be built. So you can take this projects as an application model then you refactor it to meet your company's need.

This project builds on top of proven open source tools. Like spring, struts, hibernate, tiles, etc. And it's free!.

Built on top of these proven Facebook Java APIs:

Showcase

  • Canvas Page in Facebook

http://apps.facebook.com/java-webapp/

  • Social Plugins, Graph API and JS SDK Website

http://www.consultek.us/facebook-webapp/

Latest News

Features

It was becoming too big to have it here, that's why we created our Features page.

How to use it

There are two ways to run the project.

  1. Download the war file. See "Running WAR".
  2. Download the source. See "Running Source".

Running WAR

  1. Download WAR file
  2. Expand the WAR file
  3. Configure Properties
  4. Create Database
  5. Compress the WAR file
  6. Move the WAR file to your application server.
  7. Start your application server
  8. Go to http://your-host:port/java-webapp-version/

Running Source

  1. You can checkout the source using a subversion client. Please follow the steps in the Source tab at the top.
  2. Configure Properties
  3. Create Database
  4. Create hibernate mappings by executing the following command:
  5. $ cd [PATH TO CHECKED OUT SOURCE]
    $ mvn -Phibernate process-resources
  6. Create WAR file (NOTE: this requires that you have created the hibernate mappings)
  7. $ cd [PATH TO CHECKED OUT SOURCE]
    $ mvn package

Alternatively, and if you have the properties and database configured, you can create the package in just one command that creates the hibernate mappings and package:

mvn clean -Dmaven.test.skip=true -Phibernate process-resources -Prelease package

Configure Properties

Whether you downloaded the WAR or checked out the source you will need to edit the facebook.properties file.

If you checked out the source this file can be found under:

src/main/resources/facebook.properties

If you downloaded the WAR file then you can find the properties file under:

WEB-INF/classes/facebook.properties

These are the properties that you need to modify. There are database properties and facebook settings. Please modify the properties according to your environment:

# Facebook Database
facebook.db.host = 127.0.0.1
facebook.db.port = 3306
facebook.db.schema = facebook
facebook.db.username = facebook
facebook.db.password = facebook
facebook.db.driver_class = com.mysql.jdbc.Driver


# Facebook
# Override these values with your own
facebook.api_key=
facebook.secret=
facebook.login_url=http://www.facebook.com/login.php?v=1.0
facebook.callback=http://www.consultek.us/facebook-webapp/canvas
facebook.connect.url=http://www.consultek.us/facebook-webapp
facebook.canvas=http://apps.facebook.com/java-webapp
facebook.devMode=true
# possible values are iframe and fbml
facebook.render.method=fbml


# URL for JS and CSS
server.url=http://www.consultek.us/facebook-webapp

Create Database

If you checked out the source code using subversion then you can create the database using maven. Execute the following commands:

$ cd [PATH TO CHECKED OUT SOURCE]
$ mvn -Pdb clean

If you did not checkout the source then I would recommend you download the database files manually from here.

Once you have the files. Open a command line and execute the following commands. Assuming your mysql root has no password.

$ cd [PATH TO DB FILES]
$ . create_db.sh

If your mysql root user has a password edit the files:

springwebmvc-hibernate/trunk/src/main/db/create_db.sh
springwebmvc-hibernate/trunk/src/main/db/drop_db.sh

If you want to drop the database execute the commands:

$ cd [PATH TO DB FILES]
$ . drop_db.sh

OAuth v2

NOTE: Available since version 0.4

The application has a couple of examples on how to use OAuth. You can see them here:

The source code for the above mentioned examples are:

Powered by Google Project Hosting