Professional Documents
Culture Documents
DOCUMENT ID: DC01644-01-0210-01 LAST REVISED: November 2011 Copyright 2011 by Sybase, Inc. All rights reserved. This publication pertains to Sybase software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845. Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Sybase trademarks can be viewed at the Sybase trademarks page at http://www.sybase.com/detail?id=1011207. Sybase and the marks listed are trademarks of Sybase, Inc. indicates registration in the United States of America. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies. Sybase, Inc., One Sybase Drive, Dublin, CA 94568.
Contents
Context Summary ..................................................................1 Usage Scenario ......................................................................3 Get Started .............................................................................5 Prerequisites ...................................................................5 Registering the Application Connection in Sybase Control Center ............................................................6 Importing the Sample .....................................................7 Working with the Sample Project ....................................9 Exploring the Database ..................................................9 Exploring MBOs ............................................................10 Mobile Business Objects .....................................10 The Mobile Application Diagram ..........................11 Exploring the Mobile Workflow Interface Design ..........12 The Mobile Workflow Forms Editor ......................12 Try It Out ...............................................................................15 Deploying the Sample MBOs to Unwired Server ..........15 Installing the Mobile Workflow Package .......................16 Installing the Mobile Workflow Container on the iOS Simulator ..................................................17 Configuring the BlackBerry Simulator for Mobile Workflow Packages .........................................18 Configuring the Android Emulator for Mobile Workflow Packages .........................................19 Installing Sybase Messaging Runtime on Windows Mobile ..............................................20 Generating Code for a Mobile Workflow Package ...........................................................24 Running the Sample on an iOS Simulator ....................26 Running the Sample on a BlackBerry Simulator ...........32 Running the Sample on an Android Emulator ..............34 Running the Sample on a Windows Mobile Emulator ...38
iii
Contents
Additional Modifications ................................................40 Learn More ...........................................................................47 Related Reference ........................................................47 Project Artifact Reference ....................................47 Troubleshooting Mobile Device Connectivity Issues ..............................................................48 Learn More about Sybase Unwired Platform ................49 Getting Help ..................................................................50 Index ..................................................................................51
iv
Context Summary
Context Summary
Use the Sybase Mobile Workflow Employee Directory sample to explore artifacts and the resulting mobile workflow package, the development environment, and the underlying components. The Employee Directory sample is a mobile workflow. It is a secure mobile application that is accessible from a supported smartphone. From their mobile devices, employees can use the Employee Directory to: Search for an employee by first name, last name, phone number, or department name. Navigate the organizational hierarchy (by manager and direct reports). Create an employee favorites list. Employees can be added or removed from this list. Initiate a phone call, open e-mail messages, or open a Google map of the employees office location. Sign up for notification of new hires or departures.
The Employee Directory sample is based on a development environment that uses: Sybase Unwired Platform Sybase Unwired Workspace, an Eclipse development environment Mobile Workflow device development The iOS, Android, BlackBerry, and Windows Mobile device platforms
Using this sample provides a comprehensive preview of the benefits Unwired Platform can offer. To learn how to create a mobile workflow package, see Tutorial: Mobile Workflow Package Development. Next steps 1. Review the Usage Scenario on page 3, which explores the business context and use case for the sample. 2. Follow the setup process in Get Started on page 5 to install and prepare artifacts in the Eclipse edition of Unwired Platform. 3. Test functionality and features as described in Try It Out on page 15.
Context Summary
Usage Scenario
Usage Scenario
A company provides its employees with a mobile workflow for their mobile devices that allows them to use the company directory remotely. Business requirements for the company include: Provide access to enterprise data sources by supporting remote access to the employee directory, company employees can quickly communicate with their colleagues and understand with whom they need to interact. Reduced maintenance and more simplicity the mobile workflow package must easily deploy with little or no employee intervention. The employee user base does not want to spend time troubleshooting or self-supporting. Secure transactions the employee (with credentials stored on an LDAP server) must be authenticated, and secure transmission of confidential internal data across the wireless network ensured.
Next: Get Started on page 5 shows you how to set up the sample on your computer.
Usage Scenario
Get Started
Get Started
You must complete the setup tasks before you can use the Employee Directory sample. 1. Review the Prerequisites on page 5. 2. Bring all artifacts into the Unwired Platform development environment for Eclipse. See Importing the Sample on page 7. 3. Open connections to the servers that this sample depends on. See Working with the Sample Project on page 9. 4. In the sampledb database, explore the existing tables that are the foundation for the mobile workflow package. See Exploring the Database on page 9. 5. Explore the mobile business objects (MBOs) that perform operations against tables in the sampledb database. See Exploring MBOs on page 10. 6. Review the mobile workflow form interface design in the Mobile Workflow Forms Editor. The design of the interface correlates to the MBOs that perform database operations. See Exploring the Mobile Workflow Interface Design on page 12.
Prerequisites
Before you begin importing and setting up the sample, review and complete the prerequisites. See Supported Hardware and Software for the most current version information for mobile device platforms and third-party development environments. This sample was developed and tested using the supported versions. If you use a different version, some steps may vary. Install Unwired Platform. For Windows Mobile, install: Windows Mobile emulator (or have access to an actual device) Windows Mobile SDK Active Sync 4.5 .NET Compact Framework 3.5 For Blackberry, install: BlackBerry JDE, which includes the BlackBerry simulator and MDS. For more information on configuring the BlackBerry Development Environment, see Developer Guide for BlackBerry. For Android, install: SDK Platform Android SDK Platform-tools Android SDK tools
Get Started For iOS, install: iOS simulator (or have access to an actual device) Xcode and iOS SDK Start the simulator or connect the device. Start Unwired Server: In Windows, select Start > Programs > Sybase > Unwired Platform > Start Unwired Platform Services. Start Sybase Control Center: In Windows, select Start > Programs > Sybase > Sybase Control Center. Log in using the user ID and password you indicated during installation. If you did not change the ID and password, the defaults are: User ID : supAdmin Password: s3pAdmin
Get Started Farm ID a string associated with the Relay Server farm ID. Can contain only letters A Z (uppercase or lowercase), numbers 0 9, or a combination of both. Default: 0 Activation code length the number of characters in the activation code. If you are reregistering or cloning a device, this value cannot be changed. Activation expiration (hours) the number of hours the activation code is valid. (Optional) Select the check box adjacent to Activation Code to enter the code sent to the user in the activation e-mail. This value can contain letters A Z (uppercase or lowercase), numbers 0 9, or a combination of both. Acceptable range: 1 to 10 characters.
Get Started a) Click File > Import. b) In the Import wizard, select General > Existing Projects into Workspace and click Next. c) Choose Select archive file and browse to the location where you saved EmpDir2_1.zip. d) Click Finish to import the artifacts in the archive as a project. 3. Right-click the EmpDir project and select Open in Diagram Editor. Ensure that the advanced developer profile is selected. 4. Copy the empDirImages folder from the Workspace Navigator to C:\. 5. Start the sample database by executing <UnwiredPlatform_InstallDir>\UnwiredPlatform \Servers\UnwiredServer\bin\sampledb.bat start from the command line. 6. In the Enterprise Explorer, create an ASA connection profile and connect to sampledb by following these steps: a) In Enterprise Explorer, right-click the Database Connections folder and select New. b) In New Connection Profile, select Sybase ASA as the connection profile type, in Name, enter sampledb, and click Next. c) In Drivers, select ASA v 12.x for Unwired Server Default, and configure these connection properties: Property
Host Port Database name User name Password Save password
Value
The default is localhost. 5500 sampledb Use the default, dba. Use the default, sql. Select this option.
When you are finished, click Test Connection. d) Click OK in the Ping Succeeded window. e) Click Finish. A sampledb database connection profile is added. This new profile should resolve any connection profiles errors you received when you imported the EmpDir project. If it does not, ping the server to see whether or not it is available. 7. Copy the empDirImages folder to the appropriate location (for example, c:\). 8. Right-click the empDir.sql file, then select Execute SQL Files.
Get Started Provide values for the database server type, connection profile name, and database name. 9. Right-click the EmpDir project and select Deploy Project. 10. Select Message-based. For more information, see the section called Install and Configure the Mobile Workflow Container On the Device in Developer Guide: Mobile Workflow Packages. 11. Configure the Sybase Settings on the device for the newly created user. 12. In the Sybase Control Center, click Refresh and ensure that the status for the registered user is Online. 13. Right-click EmpDir.xbw and select Generate Mobile Workflow Package. 14. On the device, open Workflow (for iOS) or go to the Inbox (for BlackBerry or Windows Mobile) and choose Workflows, then select the workflow named Empdir.
Get Started
Exploring MBOs
Review the existing attributes and operations for mobile business objects, and explore how MBOs are bound to the EmpDir table as their back-end data source. 1. In WorkSpace Navigator, expand the EmpDir > Mobile Business Objects folder to view the MBOs created for this sample (EmpFavorites, Emps, and ListEmpFavorites). EmpFavorites and Emps match two of the table names in sampledb. 2. To see the MBOs and understand the business logic behind them, right-click any MBO and select Open in Diagram Editor.
You can define MBOs using either a top-down approach designing attributes and parameters first, and later binding them to a data source, or a bottom-up approach specifying a data source, and automatically generating attributes and parameters from it. A mobile application includes MBOs, as well as role and server mappings, and other artifacts that are delivered to the Unwired Server during deployment.
10
Get Started
What the Mobile Application Diagram Shows The diagram shows the different objects and how they are related to each other : Emps MBO represents employee information. EmpFavorites MBO represents a list of commonly contacted employees. ListEmpFavorites MBO represents a listing of an employee's favorites.
11
Get Started
12
Get Started The Device Workflow toolbar includes a list of existing screens. You can open a different screen by selecting the corresponding screen name from the list.
13
Get Started
14
Try It Out
Try It Out
Deploy the sample MBOs, register device users, and run the sample on a device simulator. Now that you have set up your sample project and understand the MBOs that are used, you can deploy those MBOs to Sybase Unwired Server and run the sample on a device simulator. You can install a device simulator, then run the mobile workflow application on it. In the sections that follow you will be able to see basic usage of the Workflow application. In addition, you will learn how to apply optional modifications to the sample, including the look and feel on the device, the device cache, adding a confirmation dialog, and debugging.
15
Try It Out
3. Select all boxes to deploy all MBOs and click Next. 4. (Optional) In the Packager User-defined Classes window, click Next. This window is only seen if you are using the Advanced Developer Profile. 5. Select My Unwired Server and click Connect. 6. Accept the defaults for Domain and Security configuration, and click Next. 7. If you are using the Advanced profile, map the connection profile for sampledb to the Server connection profile of the same name. a) From Server Connection, select New Server Connection. b) Accept the defaults and click OK. This mapping process creates a named endpoint to the correct server that gives you access to the systems you require. 8. Click Finish to deploy the package to the Unwired Server.
16
Try It Out
Task 1. From your Mac, connect to the Microsoft Windows machine where Sybase Unwired Platform is installed: a) From the Apple menu, select Go > Connect to Server. b) Enter the name or IP address of the machine, for example, smb://<machine DNS name> or smb://<IP Address>. You see the shared directory. 2. Copy the MobileWorkflow-2.1.tar.gz from your Sybase Unwired Platform installation <UnwiredPlatform_InstallDir>\UnwiredPlatform \ClientAPI\Workflow\ios to a location on your Mac: 3. Unarchive the MobileWorkflow-2.1.tar.gz. This creates a Workflow folder. 4. In the Workflow folder, double-click WorkFlow.xcodeproj so that it opens in the XCode IDE. 5. If necessary, add these frameworks from the SDK to the project by selecting Project > Edit Active Target > <ProjectName> > General: Security.framework AddressBook.framework QuartzCore.framework CoreFoundation.framework libicucore.A.dylib libz.1.2.3.dylib libstdc++.dylib 6. In XCode, select Build > Build. The project builds and the simulator starts. Configuring iOS Connection Settings Configure the settings for the Mobile Workflow application.
17
Try It Out 1. Go to the device Settings screen and click WorkFlows. 2. Enter the settings for the Mobile Workflow application: Server Name the machine that hosts the server where the mobile application project is deployed. Server Port Unwired Server port number. The default is 5001. Company\Farm ID the company or farm ID you entered when you registered the device in Sybase Control Center, in this case, 0 (zero). User Name the user you registered in Sybase Control Center. Activation Code the activation code for the user, for example, 123. Password enter your password so that the Workflow container registers using the automatic registration option. Note: The Activation Code and Enable Automatic Registration options are mutually exclusive. If you use a password for automatic registration, you cannot enter an activation code and vice versa. URL Suffix (Optional) the URL suffix used to connect to a Relay Server.
3. Start the MDS server by clicking Start > Research in Motion > BlackBerry JDE 6.0.0 > MDS-CS. 4. Start the BlackBerry simulator. Configuring BlackBerry Connection Settings Configure the connection settings for the Mobile Workflow application. 1. Click the Workflow icon on the applications screen, then press the Menu key and select Settings. 2. Enter the settings for the Mobile Workflow application: Server Name the machine that hosts the server where the mobile application project is deployed. Server Port Unwired Server port number. The default is 5001.
18
Try It Out Company\Farm ID the company or farm ID you entered when you registered the device in Sybase Control Center, in this case, 0 (zero). User Name the user you registered in Sybase Control Center. Activation Code the activation code for the user, for example, 123. Enable Automatic Registration when you select this option, the Registration Password field is enabled. Enter your password. Note: The Activation Code and Enable Automatic Registration options are mutually exclusive. If you use a password for automatic registration, you cannot enter an activation code and vice versa. URL Suffix (Optional) the URL suffix used to connect to a Relay Server.
Select Menu > Save to save the settings. 3. Start the Mobile Workflow application, then view the settings log to verify that the connection is active. In Workflows, select Settings. On the Connection settings screen, select Show Log.
19
Try It Out
Configuring Android Connection Settings Configure the connection settings for the Mobile Workflow application. 1. Click the Workflows icon on the applications screen, then select Settings. 2. Enter the settings for the Mobile Workflow application: Server Name the machine that hosts the server where the mobile application project is deployed. Server Port Unwired Server port number. The default is 5001. Company\Farm ID the company or farm ID you entered when you registered the device in Sybase Control Center, in this case, 0 (zero). User Name the user you registered in Sybase Control Center. Activation Code the activation code for the user, for example, 123. Enable Automatic Registration when you select this option, the Registration Password field is enabled. Enter your password. Note: The Activation Code and Enable Automatic Registration options are mutually exclusive. If you use a password for automatic registration, you cannot enter an activation code and vice versa. URL Suffix (Optional) the URL suffix used to connect to a Relay Server.
Select Save to save the settings. 3. Start the Mobile Workflow application, then view the settings log to verify that the connection is active. From the Mobile Workflow application, tap Settings > Show Log.
Task 1. Start the Device Emulator Manager by navigating to C:\Program Files \Microsoft Device Emulator\1.0 and double-clicking dvcemumanager. 2. From the list of devices, right-click the device you want to use, and select Connect. 3. Right-click on the device again and select Cradle.
20
Try It Out The synchronization software appears. 4. Go to <UnwiredPlatform_InstallDir>\UnwiredPlatform\ClientAPI \Workflow\WM and copy the SUPMessaging_Pro.cab file to a folder on your mobile device, for example:
5. Use File Explorer on the device emulator to browse to the SUPMessaging_Pro.cab file. 6. Click on SUPMessaging_Pro.cab once to start the installation. Installing Microsoft Synchronization Software Install and configure Microsoft synchronization software so you can deploy and run a mobile application on a Windows Mobile emulator. Note: Microsoft ActiveSync is for Windows XP. If you are using Windows Vista, Windows 7, or Windows 2008, install Virtual PC 2007 SP1 and Windows Mobile Device Center to manage synchronization settings. Download the Windows Mobile Device Center from http://
www.microsoft.com/windowsmobile/en-us/downloads/microsoft/device-centerdownload.mspx.
1. Download Microsoft ActiveSync from http://www.microsoft.com/windowsmobile/enus/help/synchronize/device-synch.mspx. Save it to your local machine. Windows XP requires ActiveSync version 4.5. 2. In Windows Explorer, double-click setup.msi. 3. When installation is complete, restart your machine. ActiveSync starts automatically, and its icon appears in the Windows toolbar. 4. Double-click the ActiveSync icon. 5. Select File > Connection Settings. 6. Select Allow Connections to One of the Following, then select DMA. 7. Under This Computer is Connected to, select Work Network.
21
Try It Out
8. Click OK. Configuring Windows Mobile Connection Settings Configure the connection settings. Prerequisites Install the Sybase messaging runtime client. Task 1. Select Start > Programs > Sybase Settings. 2. In the Sybase Settings screen, click Connection. 3. In the Connection screen, enter the connection settings: Server Name the machine that hosts the server where the mobile application project is deployed. Server Port Unwired Server port number. The default is 5001. Company\Farm ID the company or farm ID you entered when you registered the device in Sybase Control Center, in this case, 0 (zero). User Name the user you registered in Sybase Control Center. Activation Code the activation code for the user, for example, 123. Enable Automatic Registration when you select this option, the Registration Password field is enabled. Enter your password. Note: The Activation Code and Enable Automatic Registration options are mutually exclusive. If you use a password for automatic registration, you cannot enter an activation code and vice versa.
22
Try It Out URL Suffix (Optional) the URL suffix used to connect to a Relay Server.
23
Try It Out 5. Start the Mobile Workflow application, then view the settings log to verify that the connection is active. Select tap Start > Programs > Sybase Settings > Menu > Show Log
Task 1. In the Mobile Workflow Application Designer, click . 2. In the New Mobile Workflow Package Generation wizard, select: Option
Favorite configurations Generate Unwired Server Profile
Description
(Optional) Select a configuration. Select Generate into the project. Select My Unwired Server as the profile with which to associate the mobile workflow package. Deploy the mobile workflow package to an Unwired Server, and in Deploy Mode, select New. Select this option, and click Get Users. Select a user, for example, user1.
24
Try It Out
3. In the Mobile Workflow Package Generation wizard, click Finish. The files for the mobile workflow package are generated and stored in the specified location as a .zip file. The mobile workflow package appears in Enterprise Explorer in the Workflows folder under Unwired Server.
25
Try It Out
26
Try It Out
The workflows are listed, and server notifications appear as e-mail messages in the Messages section. 3. Select the empDir application.
27
Try It Out
Your credentials are cached by the mobile workflow and are not requested again. 5. Search the employee directory in a variety of ways. Use the % symbol to represent wildcards.
28
Try It Out
The following are example search results for employees whose names begin with Jo.
29
Try It Out
7. In the Employee Details screen, do any of the following: View attachments such as images using the attachment viewer. Navigate through the company hierarchy by selecting the Manager or Direct Reports. 8. Add a commonly contacted employee to a favorites list, and request the list from the Search screen. Go to the Options screen, which allows you to enable or disable notifications.
9. Create a notification e-mail message when an employee is hired or terminated. The e-mail message is sent to those employees who registered for notifications. This functionality requires additional setup and configuration of an e-mail server. The insert
30
Try It Out and delete triggers provided in EmpDir.sql are provided as examples. To simulate this process, use the Send a Notification wizard.
31
Try It Out
2. Select Workflows. 3. Select the empDir application. A help screen appears, followed by a credentials screen. 4. Provide the user ID and password. Your credentials are cached by the mobile workflow and are not requested again. 5. Search the employee directory in a variety of ways. Use the % symbol to represent wildcards. 6. In the Employee Details screen, do any of the following: View attachments such as images using the attachment viewer. Navigate through the company hierarchy by selecting the Manager or Direct Reports. 7. Add a commonly contacted employee to a favorites list, and request the list from the Search screen.
32
Try It Out Go to the Options screen, which allows you to enable or disable notifications. 8. Create a notification e-mail message when an employee is hired or terminated. The e-mail message is sent to those employees who registered for notifications. This functionality requires additional setup and configuration of an e-mail server. The insert and delete triggers provided in EmpDir.sql are provided as examples. To simulate this process, use the Send a Notification wizard.
33
Try It Out
34
Try It Out
The workflows are listed in the next screen, and server notifications appear under the Sybase Workflows screen.
3. Select the empDir application. 4. Enter your user ID and password. Your credentials are cached by the mobile workflow and are not requested again.
You can search the employee directory in a variety of ways. Use the % symbol to represent wildcards:
5. Search the results for employees whose names begin with Jo.
6. Select one of the results to display Employee Details. Attachments such as images are displayed using the attachment viewer.
35
Try It Out
7. Navigate through the company hierarchy by selecting the Manager or Direct Reports buttons. 8. From the Search screen navigate to the Options screen, which allows you to enable or disable notifications.
9. Simulate a notification e-mail message. When an employee is hired or terminated, an e-mail message is sent to those employees who registered for notifications. This requires additional setup and configuration of an email server. The insert and delete triggers provided in EmpDir.sql are provided as examples. To simulate this process, use the Send a Notification wizard.
36
Try It Out
The information you provide in the Send Notification to a Device User dialog is sent to the device:
37
Try It Out
2. Select Workflows. 3. Select the empDir application. A help screen appears, followed by a credentials screen. 4. Provide the user ID and password. Your credentials are cached by the mobile workflow and are not requested again. 5. Search the employee directory in a variety of ways. Use the % symbol to represent wildcards. The following are example search results for employees whose names begin with Jo.
38
Try It Out
6. Select one of the results to display Employee Details. 7. In the Employee Details screen, do any of the following: View attachments such as images using the attachment viewer. Navigate through the company hierarchy by selecting the Manager or Direct Reports. 8. Add a commonly contacted employee to a favorites list, and request the list from the Search screen. Go to the Options screen, which allows you to enable or disable notifications. 9. Create a notification e-mail message when an employee is hired or terminated. The e-mail message is sent to those employees who registered for notifications. This functionality requires additional setup and configuration of an e-mail server. The insert and delete triggers provided in EmpDir.sql are provided as examples. To simulate this process, use the Send a Notification wizard.
39
Try It Out
Additional Modifications
Apply additional modifications to the sample, including the look and feel on the device, the device cache, adding a confirmation dialog, and debugging. Basic Look and Feel When you develop a workflow, it is recommended that you begin with a basic look and feel. This will enable you to generate a smaller workflow package that you can deploy, start, and debug easily. To use a basic look and feel, select Window > Preferences > Sybase, Inc > Mobile Development > Mobile Workflow Forms Editor:
40
Try It Out
When you generate the .zip file that is deployed to the device, all the contents under the html folder are included in that .zip file. When you use the basic look and feel, delete the previously generated contents if the sophisticated look and feel was previously selected. Customized Look and Feel You can further customize the look and feel by modifying the Custom.js file. For example, you could add a gradient background and footer by replacing the customBeforeWorkflowLoad and customAfterNavigateForward functions with the contents of the Customization\gradientAndFooter.txt file included in the EmpDir project. Then create an images folder under the generated html folder and copy EmpDirImages\gradient2.png into that folder. Ensure the look and feel setting is set to Basic for this example. Run the Package Generate wizard to redeploy the mobile workflow. Note that this change does not apply to iOS, since that platform already uses buttons instead of native menus.
If you prefer to replace menu items with buttons instead of adding a gradient background and footer, replace the contents of these same functions with the contents in Customization \menusToButtons.txt.
41
Try It Out To make changes to the sophisticated look and feel, modify the html\css\jquery \jquery.mobile-1.0a3.css file. For example, you could modify the color-stop values in the following code:
with
color: black
Add a Confirmation Dialog To add a confirmation dialog, replace the contents of the customBeforeSubmit function in Custom.js with the contents in Customization\beforeSubmit.txt included in the EmpDir project, and run the Package Generation wizard to redeploy the mobile workflow:
42
Try It Out
Add Clickable Links You can add custom code to replace the location, phone number, and e-mail text fields with clickable links to open Google Maps, dial the phone, and open e-mail messages. In addition, you can replace the attachment viewer link with an img tag so the employee's image can be shown without navigating to another screen. To make these changes, replace the contents of the customBeforeShowScreen function in Custom.js with the contents in Customization\beforeShowScreen.txt included in the EmpDir project:
Improve Searches To improve your searches, set the On-device cache timeout property. For example, select the By First Name menu item on the Search page and enter a value of 240, which is equivalent to 4 minutes. This will result in faster results in subsequent searches, and the results will be available even when the device is not connected to the network if you invoke the search within 4 minutes of the previous search.
43
Try It Out
Use a Debugger At times it is useful to be able to step through the customized code with a debugger. The simplest way to do this is to drag and drop the generated html file, such as workflow.html, onto a browser such as Chrome and press <Ctrl>-<Shift>-J to display the Java Script Console. Add a parameter to the URL to indicate the screen to be displayed. For example, add ?screenToShow=Search. To simulate the workflow message that would be passed into the workflow as a result of a menu action or a server notification, we can execute the menu action on a mobile device or simulator and then copy the workflow message that was sent to the device.
44
Try It Out 1. Modify the TraceConfig.xml file located at C:\Sybase\UnwiredPlatform \Servers\MessagingServer\Data\TraceConfig.xml and ensure that the WorkflowClient is set to debug:
<Module Name = "WorkflowClient" "WorkflowClient"/> Level = "Debug" Desc =
2. Restart the Sybase Messaging Service by running the following commands from a command prompt:
net stop Sybase Messaging Service net start Sybase Messaging Service
3. On the device, perform a search to return the favorite items. In the folder C:\Sybase\UnwiredPlatform\Servers\UnwiredServer \logs\WorkflowClient locate a .txt file that contains the device user name in it. Within that file, copy the returned message and paste it into a file named rmi.xml in the html folder. The message should appear as follows:
<XmlWidgetMessage> <Header></Header> <WidgetScreen>Favorites</WidgetScreen> <RequestAction>Favorites</RequestAction> <Values> <Value key="ListEmpFavorites" type="LIST"> <Values key="100010" state=""> </XmlWidgetMessage>
4. Copy the generated html folder to a Web server, such as the htdocs folder on Apache. 5. Open a desktop browser such as Chrome to the appropriate URL such as http:// servername/EmpDir_Sol/EmpDir/html/workflow.html? screenToShow=Search. 6. Click on Favorites to view the data, which is derived from the rmi.xml file that contains the workflow message with the data from a previous query. 7. Click on a favorites item to see the details screen. a. Press <Ctrl>-<Shift>-J to display the Java Script Console. b. Click the Scripts tab and select Custom.js. Now you can add a breakpoint, for example, in the customBeforeSubmit function. To use that breakpoint, in the workflows shown in the browser, select Favorites, select an employee, and click the Remove menu item.
45
Try It Out
46
Learn More
Learn More
Learn about this sample, or get additional help on using Unwired Platform in your enterprise environment. For information about project artifacts, database schemas, and other detailed information on this sample, see Related Reference on page 47. For information on how to coordinate your self-directed exploration of Unwired Platform samples, tutorials, and documentation, see Learn More about Sybase Unwired Platform on page 49. To get help or more information, see Getting Help on page 50.
Related Reference
Review reference information to understand the implementational and architectural details of this sample.
Contents
The source files for the MBOs used in this sample, as well as their required attributes (for example, the table and columns the MBOs access), and the operations they perform if any. The pointers to the data source used by the MBos in the sample. In this case, there is only one: PurchaseOrderDB. The roles defined for the project. The sample project has no roles defined. The personalization keys defined for the project. The sample project has no personalization keys defined. The database files used as the back-end repository for the sample. These files include the .BAT file that starts the database with all required properties, the database file itself, and its corresponding log file.
Roles
Personalization Keys
DB
47
Contents
The folder where all applicable deployment files are saved. The project contains some sample/test deployment files. You can add your own deployment files if you choose.
48
Learn More
Awaiting Server Notification After you deploy a workflow, if it does not appear on the device and this message is seen, try restarting the client. If this works and the device is a BlackBerry, you may need to modify the BlackBerry Push Configuration in SCC. Select Servers > Server Name > Server Configuration > Messaging > BlackBerry Push Configuration. Disabled: Low Storage This issue may occur on a Windows Mobile simulator. On the device check Settings > System > Memory. If necessary, browse to Device\Program Files\Sybase\Messaging \AMP and delete the sub folder. Redeploy your workflow after performing this action.
Developer Guide: BlackBerry Native Applications Developer Guide: iOS Native Applications
49
Learn More
Developer Guide: Windows and Windows Mobile Native Applications Developer Guide: Mobile Workflow Packages
Developer Guide for Unwired Server Management API customize and automate system
administration features.
Developer Guide: Unwired Server customize and automate server-side implementations for device applications, and administration, such as data handling.
Getting Help
Each Sybase installation that has purchased a support contract has one or more designated people who are authorized to contact Sybase Technical Support. If you cannot resolve a problem using the online help or other technical documents, have the designated person contact Sybase Technical Support or the Sybase subsidiary in your area.
50
Index
Index
A
ActiveSync, installing and configuring 21 Android 19 Android emulator 34 applications generating code for device 24 articles 49 artifacts reference 47
I
installing Microsoft ActiveSync 21 synchronization software 21 interface design 12 iOS simulator 26
M
MBOs overview 10 Microsoft ActiveSync, installing and configuring 21 Mobile Application Diagram 11 mobile applications generating code for 24
B
BlackBerry simulator 32
C
consolidated database, exploring 9
D
debugging 40 deploying configuring ActiveSync for 21 deploying to Unwired Server 15 device applications generating code for 24
P
prerequisites 5 projects artifact reference 47
R
reference project artifacts 47
E
Emulator 15
S
sample learn more 47 samples 49 Screen Design 12 ServerDB, exploring 9 Simulator 15 SUPMessaging_Pro.cab 20 Sybase Control Center register application connection 6 Sybase Mobile Workflow 19 Sybase Unwired Platform getting help 50
F
Flow Design 12
G
generating code for a device application 24
H
help, getting 50
51
Index
learning more about 49 Technical Support, contacting 50 synchronization software installing 21 tutorial projects 49 tutorials 49
T
tutorial configuring the Android emulator 19
W
Windows Mobile emulator 38
52