Difference between revisions of "Opentaps 2 Notes"
(→How to Install It) |
(→Facebook Integration) |
||
Line 79: | Line 79: | ||
===Facebook Integration=== | ===Facebook Integration=== | ||
+ | |||
+ | By default, your opentaps Notes application is configured to work with Facebook using a "opentaps v2 Notes Local Testing" application. '''This application will only work if you use http://localhost:8080/ for Geronimo'''. It will not work if you used another ip address, such as 127.0.0.1 Facebook is very sensitive to the referring URL of each application. | ||
+ | |||
+ | To configure a different facebook application integration, you must: | ||
+ | # Create facebook application. In the "Select how your app integrates with Facebook" section the "App on Facebook" should be marked. The Canvas URL and Secure Canvas URL should be URL of the you server. For example for local testing it can be http://localhost:8080/ and https://localhost:8080/ | ||
+ | # The App ID from facebook application should set to FB_CLIENT_ID variable from the FacebookResource.java, the App Secret should set to FB_CLIENT_SECRET. | ||
+ | # The FB_REDIRECT_URL from FacebookResource.java should correspond to facebook application Canvas URL. For our example the FB_REDIRECT_URL should be http://localhost:8080/notes/facebook/callback | ||
+ | # The FB_HTML_CLIENT_CALLBACK from FacebookResource.java should specify html client side URL. For example http://localhost/note_app.html | ||
===How to Use It=== | ===How to Use It=== |
Revision as of 18:34, 17 February 2012
opentaps 2 Notes
Contents
What It Does
This is a very simple yet useful application to demonstrate the concepts and technologies behind opentaps 2.
On the server side, there will be a set of API for creating and retrieving notes which can be associated with different things: orders, customers, tasks, products, etc. On the client side, there will be UI tools for working with the server-side notes API to create or retrieve notes. You can write your own UI around these API, using our examples for both web and mobile platforms.
The cool thing is that you can configure up to 10 things to associate with your notes, whatever they maybe. You can thus associate notes with your customers or tasks and make a CRM system, or associate them with your products or orders and have a product review system. You can even organize the UI to make your own version of Twitter.
The open source version of opentaps 2 Notes will include:
- a server side application built with opentaps 2
- a browser client written in HTML5/CSS/Javascript
- mobile clients for iPhone and Android
- mobile libraries for iPhone and Android for use with your own applications
How It Works
The Data Model
NoteData - the notes themselves * noteId - unique ID * noteText - text field for the note * createdByUserId - identity of user creating the note * userIdType - identifies type of user Id (Facebook, twitter, LDAP, email, etc.) * dateTimeCreated - date and time when note was created * attribute1..10 - arbitrary attributes associated with note
The Architecture
Separate OSGi bundles are created for:
- Notes application services, defining all the API services (see below)
- Notes application implementation, implementing the services using the repository interfaces
- Notes application repository, including definitions of the entities and implementations of the repository methods
The API
createNote
- Input:
- text
- value for attribute1...10
- Output:
- noteId
getNoteById
- Input:
- noteId
- Output:
- NoteData for noteId
updateNote
- Input:
- noteId
- text
removeNote
- Input
- noteId
getNotes
- Input (any of the following):
- createdByUserId
- createdByUserType
- value for attribute1...10
- Output
- List of NoteData or empty list
Javascript/HTML
Mobile API
How to Install It
Follow general installation instructions for Getting opentaps 2
Facebook Integration
By default, your opentaps Notes application is configured to work with Facebook using a "opentaps v2 Notes Local Testing" application. This application will only work if you use http://localhost:8080/ for Geronimo. It will not work if you used another ip address, such as 127.0.0.1 Facebook is very sensitive to the referring URL of each application.
To configure a different facebook application integration, you must:
- Create facebook application. In the "Select how your app integrates with Facebook" section the "App on Facebook" should be marked. The Canvas URL and Secure Canvas URL should be URL of the you server. For example for local testing it can be http://localhost:8080/ and https://localhost:8080/
- The App ID from facebook application should set to FB_CLIENT_ID variable from the FacebookResource.java, the App Secret should set to FB_CLIENT_SECRET.
- The FB_REDIRECT_URL from FacebookResource.java should correspond to facebook application Canvas URL. For our example the FB_REDIRECT_URL should be http://localhost:8080/notes/facebook/callback
- The FB_HTML_CLIENT_CALLBACK from FacebookResource.java should specify html client side URL. For example http://localhost/note_app.html
How to Use It
Starting the Server
See instructions from Running opentaps v2 on how to get opentaps v2 server running in Apache Geronimo.
The first time you start Notes application, you must deploy it into Geronimo. Click on "Deployer" on left hand of Geronimo console and upload the .eba file from modules/notes/eba/target/ as the Archive.
Once installed, the Notes application can be found by clicking on "Aries Applications (EBA)" on the left hand side. It should have a status of "Running".
The HTML App
Simply open the file opentaps-2/clients/html/note_app.html in any browser.