Sun GlassFish Mobility Platform 1.1 Deployment Guide

Chapter 1 Setting Up and Running the Salesforce Sample Application

Sun GlassFishMobility Platform1.1 includes a new sample application, the Salesforce sample application. This document explains how to set up and run the sample application in a single-tier environment. Before you perform these steps, follow the installation instructions in Performing a Single-Tier Installation in Sun GlassFish Mobility Platform 1.1 Installation Guide. A single-tier installation is typical for this type of enterprise applications, that is, an application that uses a JAX-RS style connector communicate over the Internet to a backend database.

This document contains the following sections:

Overview of the Salesforce Demo

Salesforce.com, a global company that provides on-demand customer relationship management (CRM) services, delivers integrated, completely customizable enterprise applications for companies of all sizes. Salesforce CRM is easy to learn and use so you can set it up and start using it very quickly. Many companies use Salesforce CRM to manage their sales, marketing, customer service, and other essential business functions.

Users can create their own developer accounts and then use the Salesforce sample application with the Sun GlassFish Mobility Platform 1.1 gateway to access their data in the Salesforce repository. The Salesforce sample application consists of a client application and a RESTful Web Services (JAX-RS) connector. The Salesforce connector accesses a subset of account data and related contact and task information from the repository. It supports creating, editing, and deleting account tasks and editing contact information. The sample Salesforce client application can be run on a BlackBerry or a Palm Treo mobile device or by using the Windows Toolkit emulator.

To run the Salesforce sample application, you need the following:

Setting Up Your Salesforce Account

Salesforce provides a web service to their repositories and offers a free 90–day developer account for evaluations. You need to get a Salesforce developer account and security key before you can run the Salesforce sample application.

This section explains the following tasks:

ProcedureTo Obtain a Salesforce Developer Account

This procedure explains how to create your own developer account that enables you to use the Salesforce sample application with the Sun GlassFish Mobility Platform 1.1 gateway to access your data in the Salesforce repository.

Create a Salesforce Developer account:

  1. Go to http://Salesforce.com/developer.

  2. Register for a Developer account.

ProcedureTo Obtain the SalesForce Account Security Key

A Developer account security key must be used with the web service that enables the Sun GlassFish Mobility Platform software to interact with Salesforce database.

Get the Salesforce Developer account security key:

  1. Log in to your Salesforce Developer account.

  2. Select the Setup link at the top of the page.

  3. Select the “Reset your security token” text on this page.

  4. Follow the directions.

    A security key will be emailed to you.

Deploying the Salesforce Sample Client Application on Mobile Devices

The following procedures describe how to install the Salesforce sample client application on a BlackBerry smartphone or on a Palm Treo device running the Palm OS or Windows Mobile software.

ProcedureTo Deploy the Salesforce Sample Client Application on a BlackBerry Smartphone

Install and deploy the Salesforce sample client application to a BlackBerry smartphone:

  1. Install the BlackBerry Desktop Manager from the User Tools CD to a PC.

  2. Unzip the sjsmep-client-1_1-fcs.zip bundle and extract the files to your PC.

  3. Ensure that your BlackBerry smartphone is connected to the PC's USB interface.

  4. Select Start->All Programs->BlackBerry->Desktop Manager.

    The BlackBerry Desktop Manager is displayed.

  5. Double-click the Application Loader icon.

    The Application Loader Wizard is displayed.

  6. Click Next at the Welcome screen.

    The Add Application screen is displayed.

  7. Select Add.

  8. Browse to and select the salesforce_ws.alx file.

  9. Click OK.

    The screen shows the Salesforce client application that you selected and indicates that the next operation to be performed is to install that client application on your mobile device.

  10. Click Next until the client application is installed on your BlackBerry device.

  11. Click Finish when you are done.

ProcedureTo Deploy the Salesforce Client Application on a Palm Treo Smartphone

If you are using Windows Mobile, you can either load the client files onto your device using the Microsoft ActiveSync software and a USB cable or load them over the air. If you are using PalmOS, you must load the files over the air.

Install and deploy the sample Salesforce client on a Palm Treo smartphone running the Palm OS or Windows Mobile software:

  1. Ensure that your mobile device's software (Palm installation CDs for PalmOS or Windows Mobile) has been installed on a PC.

  2. Ensure that the J9 Virtual Machine (VM) software has been installed on your mobile device.

    You can get the J9 VM software from IBM.

  3. If you are loading the client files over the air, follow these steps:

    1. Unzip the sgmp-client-1_1-fcs.zip bundle, extracting the files to a web server that you can access from your mobile device.

      The clients are in the install-dir/samples directory, where install-dir is the directory where you unzipped the bundle.

    2. Click the IBM Java icon on your mobile device to start the J9 emulator.

    3. Click Install.

    4. In the URL field, type the path to the salesforce-ws.jad file on the web server that you unzipped in step a.

    5. Click OK.

  4. If you are using a USB cable to load the client files, follow these steps:

    1. Unzip the sgmp-client-1_1-fcs.zip bundle, extracting the files to the ActiveSync Folder for J9 on your PC Desktop.

    2. Connect the cable from the device to the PC where you extracted the client files.

    3. Bring up ActiveSync on the PC.

    4. Click Sync.

      The files are transferred.

Creating a Salesforce User

There are two ways to create a user for the Salesforce sample application – on the mobile device, using the pass-through feature by using the Gateway Admin Console. Each method has advantages and disadvantages. If you create the user from your mobile device, it is quite easy to do, but the Sun GlassFish Mobility Platform software will cycle through each different type of connector until it locates the correct one for the CRM, EIS, or database system with which you want to communicate. This process will be repeated each time a synchronization occurs. If you create the user through the Gateway Admin Console, the process takes a little longer but the user will always be associated with the correct connector type. There is no need to cycle through all of the connector types, since the user is explicitly tied to one type.

ProcedureTo Create a Salesforce User on Your Mobile Device

Use the pass-through convenience feature to create a Sun GlassFish Mobility Platform Gateway user for the Salesforce sample application from your mobile device:

  1. Turn on your mobile device.

  2. Locate and click the Salesforce Client icon.

    The Sync ML Client screen appears, showing the Salesforce Account Demo.

  3. Click Menu and select Server Settings.

    The Edit Sync Profile Screen appears.

  4. In the URL field, type the URL for your Sun GlassFish Mobility Platform gateway.

  5. In the Email field, type your Salesforce Developer account login name, as an email address.

  6. In the Password field, type your Salesforce Developer account password.

  7. In the Security Key field, type the Salesforce Developer account security key that was emailed to you.

  8. Press Save.

    The Sun GlassFish Mobility Platform user will be created for you.

ProcedureTo Create a Salesforce User on the Gateway

Create a MEP Gateway user for the Salesforce sample application using the Gateway Administration Console:

  1. In a browser window, open http://gateway_hostname:8080/sync/admin.

    The Gateway Administration Console login screen appears.

  2. Log in using the admin user name and admin password.

    The console appears.

  3. Select the Users tab, then select the Create User tab.

  4. In the Email Address field, type the email address of the Gateway user.

  5. In the Password field, type the password for the Gateway user.

  6. In the Username field, type the username of the Gateway user.

  7. In the Phone Number field, type the phone number of your mobile device.

  8. Select Salesforce from the Enterprise Connector drop-down list.

  9. Click Register.

  10. Click the Edit User tab to verify that the user was created.

Running the Salesforce Sample Application

The Salesforce client application only allows users to create, edit, and delete tasks associated with an account. The sample application can retrieve the list of accounts from the Salesforce database and display selected pieces of account data and account-specific contact and task data. Users can create, edit, and delete task information on the client, synchronize the data, and then see the changes on the Salesforce web site. Similarly, users can create new account, contact, and task information on the Salesforce web site, synchronize the data, and see those changes reflected on the mobile device.

ProcedureTo Run the Salesforce Client Application

Run the Salesforce sample application and exercise its capabilities:

  1. Perform a two-way sync to get the contents of your Salesforce database onto your mobile device.

  2. Create a new task on your mobile device.

  3. Perform a two-way sync to update your Salesforce database with the new task.

  4. Go to your Salesforce developer account and verify that the task is in the Salesforce database.

  5. From your Salesforce developer account, edit the new task in the Salesforce database.

  6. Perform a two-way sync to load the edited task onto your mobile device.

  7. Delete the task on your mobile device.

  8. Perform a two-way sync to remove the task from your Salesforce database.

  9. Go to your Salesforce developer account and verify that the task was deleted from the Salesforce database.

  10. Edit a contact on your mobile device.

  11. Perform a two-way sync to update the contact in your Salesforce database with the edited contact from your mobile device.

  12. Go to your Salesforce developer account and verify that the changes were made to the contact.