Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Copyright 2012 Sybase, Inc. All rights reserved. Unpublished rights reserved under U.S. copyright laws. Sybase, and Sybase logo, are trademarks of Sybase Inc., or its subsidiaries. indicates registration in the United States of America. SAP, and the SAP logo, are the trademarks or registered trademarks of SAP AG in Germany and in several other countries. All other trademarks are the property of their respective owners.
Student Introductions
0-2
Course Objectives
Design and deployment of different types of Mobile Business Objects (MBOs) Development of a mobile workflow application Development of a native mobile application
Use the Sybase Control Center to perform administration functions that are related to development and testing
0-3
Course Ideology
The goal is to train developers on how to create mobile applications using Sybase Unwired Platform
The course does not show how to make use of all of the various APIs for each device in the market
This is not a mobile application user interface design course user interface design will be treated in a rudimentary fashion
0-4
Day 1:
Module 0: Course Introduction Module 1: Introduction and Architecture Module 2: Enterprise Developer Edition Installation
Day 2:
Module 3: Introduction to the Unwired WorkSpace Module 4: MBO Design, g , Development p and Deployment p y
Day 3:
Module 5: Introduction to Mobile Workflow Application Development Module 6: Advanced Mobile Workflow Application Development
0-5
Continued
Day 4:
Module 7: Introduction to Native Mobile Application Development Module 8: Sybase Unwired Platform Client APIs
Day 5
Module 9: Android Native Application Development Module 10: Data Change Notification (DCN) and Push
Note that you will find an Appendix B covering administration topics for the developer
0-6
Labs
0-7
Module Summary
0-8
Copyright 2012 Sybase, Inc. All rights reserved. Unpublished rights reserved under U.S. copyright laws. Sybase, and Sybase logo, are trademarks of Sybase Inc., or its subsidiaries. indicates registration in the United States of America. SAP, and the SAP logo, are the trademarks or registered trademarks of SAP AG in Germany and in several other countries. All other trademarks are the property of their respective owners.
Module Pre-Assessment
1-2
Module Objectives
1-3
1-5
1-6
Developers must create two components when building any Sybase Unwired Platform mobile application:
Define what data (attributes) will be available to display or edit and what operations (CRUD) can be performed on the data Designed using Sybase Unwired WorkSpace and deployed to the Unwired Server Necessary for both Mobile Workflow and Native applications Screens, controls, menus W kfl UIs Workflow UI are created t d using i the th M Mobile bil W Workflow kfl F Forms Edit Editor iin the Sybase Unwired WorkSpace Native UIs are created in IDEs like Xcode, Xcode Eclipse or Visual Studio using device platform SDKs
User Interface
1-7
Workflow
In Sybase Unwired Platform Workflow applications, there are no complex rules-based rules based decisions being performed performed, rather a more simple request-response type environment, such as:
Sybase Unwired Platform Workflow applications are not the same pp as SAP Workflow applications Uses Hybrid Web Container technology Gives developer much more control of application development Allows access to more complex features on the device platform Requires more coding, knowledge and time
Native
1-8
1
Sybase Unwired Server
Deploy MBOs and Workflow
2
Assign Workflow
WebMobile Device
1-9
1
Sybase Unwired Server
Deploy MBO code
2
Generate
MBO API
Device GUI
1 - 10
One of the challenges of building mobile applications is to keep the data in sync between the back-end EIS and the device
1 - 11
Synchronizes data between a device database and the servers server s cache database
Provided by Sybase Mobilink technology Device D i database d t b is i Sybase S b Ultralite Ult lit
For occasionally-connected devices that need access to data when offline Best for devices that need to store large g amounts of data on the device Requires the device to initiate the synchronization Changes are sent in bulk to the EIS Used on Windows, Windows Windows Mobile, Mobile Android and BlackBerry platforms 1 - 12
1 - 13
Sybase Unwired Platform can support one of the following environment types:
All d developers l should h ld iinstall t ll th the P Personall D Development l tS Server The Enterprise Development Server can be used by individual developers OR used to set up a testing environment that more closely mirrors a production environment
Single node server Clustered or multi-node servers Multi-tenant M lti t t environments i t whereby h b ah hosted t d solution l ti can b be architected by creating domains for each tenant (owner)
1 - 15
Unwired Platform Runtime Sybase Mobile SDK Personal Development Server Enterprise p Development p Server Enterprise Server Sybase Unwired WorkSpace Native Object API HTML5 / JS Hybrid App API OData SDK
1 - 16
Requires Unwired Server and Sybase Mobile SDK to be i t ll d on th installed the same, single-user i l h t host
1 - 17
Enterprise Development Server is a good choice for a UAT environment because it can be configured similarly to a production environment
1 - 18
Enterprise Server
Intended for use in a production environment Allows installation and configuration of components on different machines Allows clustered systems Number of CPUs and registered devices depends on licenses
1 - 19
Eclipse plug plug-in in for development of mobile business objects and mobile workflow packages For development of native applications that use MBOs and custom code written in C#, Java or Objective-C For development of applications for simple business processes, such as approvals and requests, requests that also use MBOs to facilitate connection to an EIS For development of simple, mostly online applications that leverage OData protocol and RESTful Web Services
OData SDK
1 - 20
Continued
Sybase OData SDK is a set of APIs used specifically for building native mobile applications that interact with OData channel models
1 - 21
1 - 22
Class Labs
Each student will be provided a Virtual Machine on which the class labs are to be performed
The Sybase Unwired Platform Enterprise Development Server is already installed Details of the install will be covered in Module 2
1 - 23
1 - 25
Devices send inbound communications through the Relay Server to the Unwired Server(s) Outbound traffic (from the Unwired Server) also flows through the Relay Server
1 - 26
A production scenario may have several Unwired Servers running in a clustered environment
1 - 27
Sybase Unwired Platform mobile applications do not talk directly to the EIS
In addition I dditi t to th the d data t cache, h th the D Data t Ti Tier manages clustering and monitoring databases A single Data Tier can service multiple Unwired Servers in a clustered environment
1 - 28
Messaging Database
Used specifically for MBS applications Contains a p permanent store of device connection information Is an embedded Sybase Advantage Database Server
1 - 29
Continued
Cluster Database
Contains configuration information about the cluster A Sybase SQL Anywhere database
Monitoring Database
When enabled, used to collect server runtime metrics for analysis or troubleshooting Can be a Sybase SQL Anywhere or a Sybase Adaptive Server database
1 - 30
A server can b be a member b of f only l one cluster l t Clusters serve two common purposes:
Load balancing is implemented using O/S or third-party hardware and/or software solutions Can achieve primitive (round-robin) load balancing using the Relay Server only
1 - 31
Cluster Strategies
2-node: 2 d a primitive i iti architecture hit t where h the th Data D t Ti Tier iis on one node, and the Server Tier is on another node
3-node: an architecture with two Server Tier nodes and one Data Tier node N+2 2 nodes: a redundant architecture with multiple Server Tiers supported by a relay server(s) and two Data Tier nodes
1 - 32
Relay Server 2
RSOE
Unwired S Server 2
Devices
1 - 33
DMZ
Manage Mobile Application Projects Design and deployment of MBOs Design deployment, Design, deployment and customization of Workflow applications Generate code to be used along with the client API to create Native applications Manage connections to EIS sources Explore EIS data
e.g. can drill down into an SAP BAPI to view its operations and then to view the operations p inputs/outputs p p
1 - 34
Unwired WorkSpace
1 - 35
The e SCC is s an a Adobe dobe Flex e application app ca o that a runs u s in a b browser o se
Internet Explorer 6+ Firefox 3.5+ 3 5+ Requires the Adobe Flash plug-in 10+
1 - 36
URL: https://hostname:8283/scc/
1 - 37
1 - 38
Administration Architecture
Node n
Web Container
Sybase Unwired Platform Flex Web Application
RMI Service
SCC Plugin for Sybase Unwired Platform
Unwired Server
IIOPS IIOP
SNMP Service
SNMP
Sybase Unwired Platform SNMP Plugin
RMI
Node 1
1 - 39
Windows XP Professional with SP2,SP3 SP2 SP3 Windows Vista Business, Enterprise or Ultimate Edition with SP2* Windows 7 Professional, Professional Enterprise or Ultimate Edition with SP1* SP1
Windows XP Professional with SP2, SP3 Windows Vista Business, Enterprise and Ultimate Edition with SP2 SP2* Windows 7 Professional, Enterprise and Ultimate Edition with SP1* Windows Server 2003 and 2008 Standard or Enterprise p Edition with SP2* Windows Server 2008 R2 Standard or Enterprise Edition
1 - 40
Connection Support
SAP Connectors
SAP Java Connector (SAP JCo) 3.x 3x Web Services (WS-I Basic Profile 1.1)
1 - 41
XP Vista (32 and 64 bit) and Windows 7 (32 and 64 XP, 64-bit) bit)
iPhone 3GS/4 iOS 4.2 and iOS 4.3, iPod Touch 3rd/4th gen g with iOS 4.2 and iOS 4.3, iPad iOS 4.2 and iOS 4.3, iPad2 iOS 4.3
1 - 42
Development Support
Used for Sybase y Mobile Workflow applications pp Can deploy to Windows Mobile Professional, Android, iOS and BlackBerry platforms Windows
C# / Visual Studio 2008 (.NET ( NET 3 3.5) 5) C# / Visual Studio 2008 (.NET CF 3.5) MacOS X 10.6 (Snow Leopard) with XCode 4.0.2 and iOS SDK 4.3 Java Plug-in for Eclipse version 1.3 Java Development Environment (JDE) v5.0/6.0 ADT 16.0.1 with Android SDK
Windows Mobile
Apple iOS
RIM BlackBerry
Android
1 - 43
Continued
Development Support
Android
Android SDK Tools Revision 12 A d id SDK Pl Android Platform tf tools t l Revision R i i 5 MacOS X 10.6 (Snow Leopard) with XCode 4.0.2 and iOS SDK 4.3 Java Plug-in for Eclipse version 1.3 Java Development Environment (JDE) v5.0/6.0
Apple iOS
RIM BlackBerry Bl kB
1 - 44
SAP R/3 R/3, 4 4.6 6 and d4 4.7 7 SAP ECC 5.0 and 6.0 Gateway 2.0 to SAP NetWeaver Mobile 7.1 (DOE) SAP Java Connector ( (JCO) ) 3.x
Relay Server:
IIS 6 6.0/7.0 0/7 0 or 7 7.5 5 on Windows (32-bit and 64-bit) Apache 2.2.8 (32-bit) or Apache 2.2.15 (32-bit and 64-bit) on Red Hat R5
1 - 45
Device Management
Sybase Unwired Platform does not perform any kind of device management Another Sybase product called Afaria is used specifically for device management
1 - 46
2.Production
3. Decommission Update applications with new versions / patches Back up device Software license usage / tracking Monitor the device Maintain device configuration settings
3. Decommission
Perform a remote kill of the device if it is lost Disable the device, networking applications If the user g gets a new device, , can re-provision/reimage device with existing configuration 1 - 47
Example Architecture
External Firewall BES (MDS) Server BlackBerry Carrier
HTTP 3200
Internal Firewall
HA available for Unwired Servers
HTTPS - 443
CDB
Sybase Unwired Platform Production I
MBOs deployed to the Production Server
JDBC/JCOs/WS
EIS
HTTP/SSL
JDBC/JCOs/WS
Devices
Inbound Traffic Connects through Relay Server
LDAP Server
External Network 1 - 48
DMZ
Internal Network
Sybase Unwired Platform interacts with SAP Mobile Gateway OData via the Sybase Online Data Proxy:
1 - 49
Application Deployment
APNS belongs to Apple, Apple Inc Inc. Apple Developer account required to access APNS iOS applications are signed and then deployed by pushing them through APNS to App Store Configure the APNS in the SCC under S Servers Server Configuration Messaging tab
1 - 50
iOS Architecture
External Network DMZ
Unwired Servers connect outbound to the Relay Server
Internal Network
Apple Devices
Device Inbound Traffic Connects through Relay Server Ports are configurable
HTTP:80/HTTP:443
External Firewall
Internal Firewall
1 - 51
BlackBerry Enterprise Server (BES) is proprietary middleware (MDS) required for communications with BlackBerry devices
1 - 52
Labs
1 - 53
Module Summary
1 - 54
Module Post-Assessment
1. What is the Unwired WorkSpace in relation to Eclipse? 2 What is the general purpose of Sybase Control Center? 2. 3. Why would you use a Relay Server with Sybase Unwired Platform? 4. True/False. The Consolidated Database is the same thing as any other enterprise back-end database.
1 - 55
Module Pre-Assessment
1. Provide a concise description that differentiates Unwired Server and Unwired WorkSpace. WorkSpace 2. True/False. The Consolidated Database exists on the mobile device. device 3. Can a developer use Microsoft Visual Studio to develop an Sybase Unwired Platform mobile application?
2-2
Module Objectives
2-3
Installation Prerequisites
Enterprise p Development p Server Installation Sybase Mobile SDK Installation Post Installation Tasks
Unwired Platform Runtime and Sybase Mobile SDK must be downloaded and installed
2-5
Sybase Unwired Platform and Sybase Mobile SDK can be downloaded from the SPDC at this URL:
https://sybase.subscribenet.com
You must Y t have h an account t to t log l into i t this thi web b site it License files required for software installation are also generated and downloaded from this site
License files are necessary y to install the Sybase y Unwired Server Runtime, Sybase Mobile SDK and for each of device client licenses purchased The installer will ask for the location of the license file
2-6
License Models
Served License:
Generic license Generated and loaded onto a Sybase SySam License Server that you download and install License Server software can be found at:
http://www.sybase.com/sysam
Un-served License:
Tied to the host name and MAC address of the machine Generated and used to install on a single g machine
2-8
Generating Licenses
After the Sybase Unwired Platform products are downloaded, license files must be generated at the SPDC for both the Unwired Server and Sybase Mobile SDK
Select the product from the product list and click License Keys
2-9
Continued
Generating Licenses
Select the appropriate license type for the software and click the Select to Generate button
2 - 10
Continued
Generating Licenses
Enter the Host ID and Host Name of the system where the software is to be installed
Generate G t the th license li file fil and d download d l d the th license li file fil t to th the system
2 - 11
Once logged in, choose the Sybase Unwired Platform to view a list of the available EBFs
2 - 12
2 - 13
Operating System
Windows XP Professional with SP2 SP2, SP3 Windows Vista Business, Enterprise or Ultimate Edition with SP2 Windows 7 Professional, Enterprise or Ultimate Edition Windows 2003 and 2008 Standard or Enterprise Edition with SP2 Windows 2008 R2 Standard or Enterprise Edition
2 - 14
Operating System
Windows XP Professional with SP2 SP2, SP3 Windows Vista Business, Enterprise or Ultimate Edition with SP2
Windows Wi d 7 Professional, P f i l E Enterprise t i or Ulti Ultimate t Edition Editi with ith SP1
2 - 15
Installation Prerequisites
.NET Framework 2.0 with SP2 Microsoft Windows Installer 3.1 or later Visual C++ Runtime ( (both 2005 and 2008 with SP1) )
The installer checks for these and installs them if they are not on the machine Required for Sybase Control Center (SCC) Required for Sybase Control Center (SCC)
2 - 16
Enterprise Development Server and Sybase Mobile SDK are pre-installed pre installed on class Virtual Machines
All platform components reside on a single machine The Relay Server, Server BES or APNS are not available or necessary for this class
For the class labs labs, deployment and testing will be done on simulators
2 - 17
Installation Prerequisites
Enterprise p Development p Server Installation Sybase Mobile SDK Installation Post Installation Tasks
Prior to Installation
For Windows 7 and Windows Vista, temporarily disable User Access Control (UAC)
Due to a NetBIOS OS limitation, make sure the host name is fewer than 15 characters
2 - 19
Starting Installation
Double-click setup.exe
2 - 20
License Types
2 - 21
2 - 22
If you are installing an Unserved license, must browse to the location of the generated license file
If installing a Served license, will be prompted for the address of the license server instead:
2 - 23
Installation Options
Online Data Proxy installation only includes functionality for the Online Data Proxy version of Sybase Unwired Platform:
2 - 24
Installation Types
2 - 25
2 - 26
2 - 27
Set Password
To proceed, you must change the default password for the supAdmin user Must use this password to access the Sybase Control Center admin tool
Password must be at least 8 characters and contain only ASCII alphanumeric l h i characters h t
2 - 28
Installation Summary
2 - 29
Required silent install files are located at the root directory of the Sybase Unwired Platform install media
2 - 30
Installation Prerequisites
Enterprise p Development p Server Installation Sybase Mobile SDK Installation Post Installation Tasks
2 - 32
Starting Installation
Install the SDK to the default Unwired Platform directory: y C:\Sybase\UnwiredPl atform
2 - 33
Installation Completion
2 - 34
Following the installation of the Sybase Mobile SDK, SDK four icons are added to the desktop that can be used to:
Start Sybase Unwired Platform Services Stop Sybase Unwired Platform Services Start S the Sybase S Control C Center C (SCC) Start the Unwired Workspace (Eclipse)
2 - 35
Installation Prerequisites
Enterprise p Development p Server Installation Sybase Mobile SDK Installation Post Installation Tasks
ClientAPI documentation and binaries for building native applications Eclipse the development IDE I t llL InstallLogs log l fil files created t d each time Unwired Platform is installed Unwired_Workspace all of the Eclipse plug-ins that make up th U the Unwired i dW Workspace k t tooling li IDE
2 - 37
Advantage910 Ad t 910 and d MessagingServer Sybase Advantage Database server and other runtime files necessary for MBS-type applications SQLAnywhere12 Sybase SQL Anywhere database server and utilities necessary for RBStype applications UnwiredServer Runtime files of the platforms application server
2 - 38
The custerdb, domainlogdb and monitordb databases are used in a clustered environment
2 - 39
2 - 40
Windows Services
2 - 41
2 - 42
Click the desktop icon and a command window will launch to indicate that the Unwired Server is starting:
2 - 43
Available from: http://na.blackberry.com/eng/developers/javaappdev/devtools .jsp Testing BlackBerry applications can be done with a simulator
2 - 45
2 - 46
After downloading the installation files, run the BlackBerry Eclipse plug plug-in in installer (setup.exe) and accept the default installation directory of:
C:\Eclipse p
After the install is complete, copy the contents of the plugins and features directories from the above folder and paste p them under:
C:\Sybase\UnwiredPlatform\Unwired_Workspace\Eclipse\syba y p p y se_workspace\mobile\rclipse\features C:\Sybase\UnwiredPlatform\Unwired_Workspace\Eclipse\syba se_workspace\mobile\rclipse\plugins k \ bil \ li \ l i
This allows you to use the plugin within the Sybase Unwired W kS WorkSpace Eclipse E li environment i t
2 - 47
These are freely downloadable from the Microsoft web site For y your convenience, they y have already y been installed on the classroom Virtual Machines
2 - 48
JCo files can be downloaded from the SAP web site There are two DLLs (librfc32 (librfc32.dll dll and sapjcorfc sapjcorfc.dll) dll) and one JAR file (sapjco.jar)
Installation directories for these files depends on your Windows Operating System
2 - 49
Labs
Lab 2-1: Installing SAP Java Connector Files Lab 2-2: 2 2: Starting Sybase Unwired Platform
Task 1: Start Sybase Unwired Platform Services Task 2: Start and Explore the Sybase Control Center
Lab 2-3: Reviewing g the Sybase y Unwired Platform Developer p Edition Installation
2 - 50
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
2 - 51
Module Summary
2 - 52
Module Post-Assessment
1. True/False. Eclipse is a prerequisite for the Sybase Unwired Platform installation. installation 2. True/False. Visual Studio 2008 is a prerequisite for the Sybase Unwired Platform installation. installation 3. True/False. A license is required to run Sybase Unwired Platform in a development environment. 4. True/False. Developers will always want to set their Sybase Unwired Platform services to start automatically. y JDE is installed as p part of the 5. True/False. The Blackberry Sybase Unwired Platform installation.
2 - 53
Module Pre-Assessment
1. What is Eclipse? 2 Before any kind of development can be performed 2. performed, what must you launch in Eclipse? 3. What must be created before you can begin development in an Eclipse-based environment?
3-2
Module Objectives
3-3
3-5
3-6
Eclipse Perspectives
The Eclipse Workbench is extensible through plug-ins Plug-ins Plug ins can add new perspectives into Eclipse
An Eclipse perspective can add views views, editors editors, wizards wizards, menus and toolbars to the Eclipse Workbench Views p provide ways y to navigate g and work with resources Editors provide tools to create and modify resources Wizards guide you through the process of creating artifacts necessary to build applications
Menu bars, toolbars and context menus provide the items you need to create and manipulate project artifacts
3-7
3-8
Problems Tab displays any warnings or errors generated Properties View displays the object in focus properties
3-9
3 - 10
3 - 11
Project Closed
3 - 12
3 - 13
Palette
The Palette will contain different items depending on which editor is active The Palette shown is for the Mobile Application Diagram
Click Cli k on an it item, lik like Mobile Business Object and then click Object, to drop it onto the diagram
3 - 14
Properties View
Entities such as MBOs contain many properties Property values can be set in this view Most of the design work for an MBO is performed here:
3 - 15
Customizing Views
Properties view displays across the bottom of the Unwired WorkSpace Given that there are many tabs with many properties, it will be difficult to work in such a small area Use the icons on the top right of the Properties View to maximize/minimize as you work:
3 - 16
3 - 17
Problems View
Not contextual, contextual displays all open projects projects errors and warnings This action takes you to the specific location (screen, MBO, etc.) where the warning or error occurred
3 - 18
Outline View
Click these icons to configure the Outline view for graphical or list orientation
3 - 19
Wizards
The Mobile Development perspective contains wizards that simplify common development tasks For example, example wizards help with:
The creation Th ti of f MBO MBOs The deployment of MBOs O to the Unwired Server
3 - 20
3 - 21
Add MBO Filter Switch Developer Profile Generate Code Deploy Project
3 - 22
3 - 23
3 - 24
Clicking here
Developer Profiles
Basic
Limits the visible functionality of the Perspective Enables the full functionality of the Perspective Enables advanced screens in the wizards
Advanced
3 - 25
3 - 26
Perspective Preferences
Select the menu item Window Preferences to access settings that can alter the way in which Eclipse works:
3 - 27
Connection Profiles
Before development can begin connection begin, profiles are necessary for:
EIS Sources
Unwired Server
The sample profiles shown here are installed with the product
3 - 29
Sample Database
Rightclick
3 - 30
3 - 31
3 - 32
3 - 33
JDBC Drivers
Only JDBC drivers for Sybase are installed with Sybase Unwired Platform For Microsoft, Oracle or IBM drivers, they must be downloaded from:
3 - 34
3 - 35
After installation of the JDBC driver, click the Add icon to locate the driver:
3 - 37
Verify setting by clicking the T t Connection Test C ti button b tt Click Finish to complete the database profile
3 - 38
Right-click the new Database Connection Profile to connect and to navigate through database objects and schema
3 - 39
Connection profiles to other Unwired Servers can be created by rightright clicking on the Unwired Servers node
3 - 40
Packages are containers of MBOs that have been deployed to Unwired Server Workflow applications are also l d deployed l dt to 3 - 42 the server
3 - 43
Requires:
Host Name or IP Address of the SAP Application Server System ID and number Client ID User U Name N Password
3 - 44
After connecting to the SAP application server, server you can navigate modules and review details of BAPIs in each module:
BAPI O Operation ti Inputs/Outputs
3 - 45
3 - 47
Native applications - use the Generate Code option and then set up projects in the IDE of your choice (Visual Studio, Eclipse, p , Xcode) ) Mobile Workflow applications - create a new Workflow Forms Editor diagram and create screens for the workflow
3 - 48
Click the New icon on the toolbar and choose the Mobile Application Project wizard
3 - 49
3 - 50
3 - 51
Project Folders
Lists of each MBO that has been created Lists which EIS data sources have been referenced by the MBOs MBO data d is i cached h d in i the h Consolidated C lid d Database D b (CDB) Defines options and schedules for refreshing data A mechanism that allows the user to provide runtime input to the load or synchronization parameters of an MBO Continued
Cache Groups
Personalization Keys
3 - 52
Project Folders
Roles
Secures access to an MBO and its operations Defines when changes are sent to the Unwired Server Contains project-level deployment profiles Java classes used to filter results before the data is passed down to the client Client-side code used for development of Native mobile applications
Synchronization Groups
Deployment
Filters
Generated Code
3 - 53
Project Files
Below is how the LosLogos project appears in the file system Moving a project from one machine to another requires copying all project-related directories and files:
3 - 54
3 - 55
A project can be imported from the file system OR by choosing a ZIP file:
3 - 56
Exporting Projects
Useful if you need to share a project with other developers Right-click in a null area of th W the WorkSpace kS N Navigator i t Select Export
To export:
3 - 57
Export Details
Provide necessary details for creating a file system or archive Resulting ZIP file will contain everything needed to import the project to another developers Unwired WorkSpace
3 - 58
Labs
3 - 59
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
3 - 60
Module Summary
A WorkSpace and project Mobile application diagram Database or other EIS Connections Unwired Server Connections
3 - 61
Module Post-Assessment
1. True/False. A WorkSpace is a physical file. 2 What is the name of the Sybase Unwired Platform Eclipse 2. Perspective? 3. True/False. A WorkSpace can contain multiple projects. 4. Which view is used mostly, when configuring application components?
3 - 62
Module Pre-Assessment
1. True/False. Mobile Business Objects only reside on the mobile device. device 2. Regardless of type, MBOs will ALWAYS contain:
a. b. c. d. SQL Java code Attributes Operations p
3. True/False. Oracle 11g is a supported back-end database for Sybase Unwired Platform.
4-2
Module Objectives
SAP BAPIs Web Services (both SOAP and REST) Databases (tables and stored procedures) Drag-n-drop from f the Enterprise Explorer Start the Wizard via the Palette
Create relationships between MBOs Create Personalization Keys Better understand MBO properties including:
4-3
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
In order to create any Sybase Unwired Platform mobile application (Native or Workflow), Workflow) two components are necessary:
Mobile Business Object(s) MBOs User Interface
Native UIs are created with the IDE of your choice Workflow UIs are created with the Unwired WorkSpace
4-5
MBO Defined
An MBO is like any object in the programming world, it is a container of attributes and operations
Attributes define the data-makeup of the object Operations O ti d define fi what h t th the object bj t iis capable bl of fd doing i
Native and Workflow applications will contain screens which display and allow editing of data
The fields displayed/edited are derived from an MBOs attributes The types of changes allowed depend on the MBOs operations
4-6
4-7
4-8
MBO Attributes
For example, if the data source is a database table, the attributes are mapped to columns from the SELECT statement
4-9
MBO Operations
Operations can be edited from the Definition tab in the Properties view Operations can have parameters to provide id iinput
4 - 10
4 - 11
Personalization Keys
Mechanism to allow mobile application users to provide input to the parameters of an MBO May be created in the Unwired WorkSpace or the SCC
4 - 12
Protected property
Obfuscates the values stored in the key so that they are more secure Can be set to:
St Storage property t
Server values are stored in the CDB Client values are stored in the device local database Transient values are stored in memory
Transient is required when the Personalization Key is used in the context t t of faW Workflow kfl application li ti
4 - 13
4 - 14
If th the MBO were sourced d from f a BAPI BAPI, no SQL would ld b be written but you would still have CREATE, UPDATE and DELETE type t operations ti
The BAPI-based MBO will call some other BAPI operation in order d t to perform f th the d data t manipulation i l ti More on BAPI-based MBOs and updates will be discussed l t iin thi later this module d l
4 - 15
MBO Relationships
In a relational database tables are related using Primary/Foreign keys MBOs can be related in a similar fashion Relationships must be manually created by the developer in U i d WorkSpace Unwired W kS
4 - 16
MBO Roles
Logical entities that control which users or groups can access an MBO
Provide user authorization before the request goes to the back end system (database, back-end (database SAP SAP, etc etc.) )
Sybase Unwired Platform roles work in conjunction with physical h i l roles, l which hi h reside id iin th the underlying d l i security it provider (i.e. LDAP server)
4 - 17
Role Assignments
A role can be assigned to individual or multiple MBOs A role can grant access to an operation within an MBO for security granularity
4 - 18
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
BAPI / RFCs
Any given BAPI might contain one to many operations which can be called from the MBO SAP includes several BAPIs, such as:
Posting g a sales order Listing employee benefits Changing passwords Tracking a shipment
4 - 20
If your SAP Administrator Ad i i h has exposed d the h BAPI as a (SOAP) Web Service, the BAPI can be accessed via the SOAP methods
4 - 21
Connect to an SAP Server Via the Enterprise Explorer or the Browse BAPI feature Provide default values or Personalization Keys as input
4 - 22
This was created automatically when you created the Mobile Application Project
Check Ch k th the t tabs b across th the t top of f th the Edit Editor view i and d select l t the one named Mobile Application Diagram:
4 - 23
Click Mobile Business Object in the Palette and click again to drop the MBO onto the diagram
Once selected, O l t d click li k anywhere in the diagram to start t t the th wizard i dt to create t th the MBO
4 - 24
2 1
4 - 25
Development Methodologies
EIS Data Source already exists mapping is automatic EIS Data Source does not yet exist Mapping will be manual once the data source is created Bottom-up approach Top-down approach
T d Top-down approach h
4 - 26
1. Click 1 Cli k the th B Browse button 2 Enter filter criteria 2. 3. Choose the appropriate BAPI/ Operation
4 - 27
After the BAPI Operation/RFC has been chosen, the next step is to define Inputs and Outputs
4 - 28
4 - 30
4 - 31
The result of the process just presented is a read-only MBO Operations p have to be added to the MBO to allow for updates to the SAP system y
4 - 32
4 - 33
4 - 34
Right-click over any MBO and choose Preview to test the data that will be returned to the device:
4 - 35
4 - 36
4 - 37
Runtime Credentials
The system-defined Personalization Keys (username and password) can be passed to an SAP system at runtime, runtime as a means for each user to authenticate themselves
4 - 38
4 - 39
Result Checker
Web Service and SAP MBO operations do not all use the same error reporting techniques
Result R lt Ch Checkers k are J Java classes, l created t db by Developers, D l that implement custom error handling for MBOs: Check each field for errors Implement p logic g that determines what constitutes an error If you choose to Create a new Result Checker, you will be prompted to add the Java nature to your project
4 - 40
Automatically assigned g
4 - 41
4 - 42
WSResultChecker Interface
The parameter is the SOAP Envelope returned when the operation is executed Use the SOAP API to retrieve returned values to see if the operation i was successful f l Returns a single Map.Entry<Boolean, String>
If the String value is not empty/null, it contains a warning message which will be logged on the server String value thrown in body of an exception Error logged on server Client will receive transaction log indicating failure
4 - 43
RestResultChecker Interface
4 - 44
SAPResultChecker Interface
The parameter is the JCo function that is executed Use the JCo API to retrieve returned values to see if the operation was successful The checkReturn method returns a single Map.Entry<Boolean, String>
Boolean ke key set to tr true e if operation was as s successful ccessf l If the String value is not empty/null, it contains a warning message g which will be logged gg on the server Boolean key set to false if operation was unsuccessful String value thrown in body of an exception Error logged on server Client will receive transaction log indicating failure
4 - 45
4 - 46
4 - 47
4 - 48
MBOs can only get their data from a single EIS source
Database table table, SAP BAPI Operation Operation, Web Service function You can:
Add, delete, change columns Add and delete rows Augment the output by reading from other EIS sources
4 - 49
4 - 50
4 - 51
4 - 52
4 - 53
4 - 54
4 - 55
4 - 56
If you do not have this information, Test Execute will let you, b trial-and-error, by ti l d d t i operation determine ti iinput t requirements i t
The only way to fully test a CREATE operation is to build the UI and test as the user would on the device / simulator
4 - 58
Customer name was not included in the BAPI operation input parameters, so the execution failed:
4 - 59
4 - 60
Commit SAP Operation (Auto Commit) is enabled by default and can only be changed by editing the operation:
4 - 61
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
The location of the service The function name What the function returns What the function takes in as parameters
Information about a SOAP Web Service is available in the WSDL (Web Services Definition Language) document
4 - 63
Web Service MBOs can be sourced from either SOAP or REST Web Services
SOAP (Simple Object Access Protocol) Web Services offer the traditional standards-based standards based approach to Web Services REST (REpresentational State Transfer) Web Services are the newer and more popular type of Web Service
REST uses the HTTP protocol instead of SOAP, SOAP making REST simpler to implement
4 - 64
4 - 65
4 - 66
4 - 67
Two operations
4 - 68
4 - 69
Drag the Web Service function from the Enterprise Explorer to the Mobile Application Diagram
4 - 70
4 - 71
4 - 72
When you click the Preview button (on the prior screen), the wizard requests argument values Click Preview Web Service will then return the data
Data Returned
4 - 73
4 - 74
4 - 75
Customer ID, Company Name, Contact First, Contact Last, C Company St Street, t Cit City, St State t and d Zi Zip C Code, d and dC Company Phone
All are St String i inputs i t except tC Customer t ID which hi h iis a Short Sh t On success, the function returns a value of 1 If no connection, it returns a -2, insert fails, -3, commit fails, -4, di disconnect tf fails, il -5 5
4 - 76
4 - 77
4 - 78
In this scenario, scenario the resulting MBO contains only one operation The operation contains parameters which will then be inputted by a user on the application screens
4 - 79
Operation Definition
Unlike an MBO that has attributes, attributes this MBO will pass data values using operation parameters If the MBO has no attributes the attributes, Operation Type must be set to OTHER
4 - 80
4 - 81
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
REST Overview
REST is a set of principles that define how Web standards, such as HTTP and URIs, URIs are used Five key principles of REST are:
Give every resource an ID Gi Link resources together Use standard HTTP methods
CRUD Post, Get, Put, Delete XML, , JavaScript p Object j Notation ( (JSON) ) or both
4 - 83
REST Process
A representation of the client-requested resource is returned The representation places the client application in a particular state As the client traverses a URL, another resource is accessed The new representation places the client application into a different state
The client application pp changes g ( (transfers) ) state with each resource representation
4 - 84
A Schema defines:
How many y elements ( (tags) g ) and/or attributes Order of the elements Cardinality of elements / attributes
4 - 85
Some providers, like Yahoo, will give you a URL for the XSD:
Yahoo also provides a sample of the XML data that will be returned:
Sample XML is needed if you have no access to an XSD and must to create y your own
4 - 86
The .NET Framework SDK has a utility named XSD.exe to create schemas from sample XML data:
4 - 87
4 - 88
Determines how the URI is parsed so all possible parameters are retrieved All parameters are treated as operation arguments, enabling MBO CRUD operations on the REST Web Service resources A string datatype is used if a datatype is not explicitly specified
/getCustomer/{id(int)} /getCustomer/{id(int?)}
4 - 89
4 - 90
4 - 91
4 - 92
4 - 93
Verify the URI template, choose the correct HTTP method and then add either a Request or Response representation:
After providing th XSD the XSD, click li k the Load Elements button and then choose the root element
4 - 95
XSLT Definition
Can choose the elements that are mapped to the MBOs MBO s attributes May also define the XSLT manually a ua y (default)
4 - 96
Service Authentication
For REST Services that require HTTP Basic Authentication, enter user name and password:
4 - 97
4 - 98
4 - 99
Dialogs contain valuable information that will help you correct a problem or error:
4 - 100
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
4 - 102
When dragging a table onto the diagram, the Quick Create Wizard is invoked
Choose which operations to embed into the MBO The SQL cannot be changed here but can be edited later
4 - 103
4 - 104
Click Mobile Business Object in the Palette and click again to drop the MBO onto the diagram
Click thethe MBO icon icon and click Click MBO andin the Diagram create a new click in thetoDiagram to MBO
4 - 105
4 - 106
Continued
Enter the SQL statement in the SQL Query text box provided OR Create it graphically
4 - 107
4 - 108
4 - 109
If the defined SQL statement does not contain a WHERE clause no action is required on this screen: clause,
4 - 110
Continued
4 - 111
Continued
4 - 112
4 - 113
All valid SQL is legal when creating an MBO, including a Select that uses a compute:
Computed C t d Column
4 - 114
Mapping Computes
4 - 115
Computed Attribute
The SQL of an MBO can have multiple tables, joins, parameters SELECT DISTINCT and ORDER BY parameters, BY, etc.: etc :
4 - 116
During development of the MBO, nothing precludes the use of a hard-coded hard-coded WHERE clause as shown below:
4 - 117
Drag a stored procedure from the Enterprise Explorer onto the Mobile Application Diagram
4 - 118
This stored procedure contains two read parameters which require runtime input:
customer_id product_id d t id
4 - 119
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
Message-Based Synchronization
Individual message based
Transfer Mode Bulk Data Transfer Low Volume Data Transfer Connectivity Requirement Synchronization and Operation Replay Result Transparency p y or users awareness of synchronization Device Status Freshness of Data
4 - 121
Efficient Higher overhead due to session Occasionally connected Mostly synchronous upload + download Asynchronous via background Sync Moderate Not available Potentially high with the use of Server Initiated Sync but can be expensive in high frequency cases
Two terms used to describe the process of maintaining data consistency in an RBS mobile application:
Synchronization synchronize between the Unwired Server Consolidated Database ( (CDB) ) and the mobile devices database
Requires a wireless connection Data updates are aggregated and synchronized when a connection becomes available Push type (server-initiated) synchronization can also be implemented
Data Refresh synchronize between the Unwired Server CDB and the EIS
Because RBS applications interact with the CDB CDB, if the EIS connectivity fails, the device can still access the data in the CDB
4 - 122
What data is needed and when How current should the data be on the device Which users can access the data
These requirements help drive update, synchronization, and access decisions Examples:
Data rarely changes, so synchronization is required only occasionally Data is very y volatile, , so a comprehensive p strategy gy is required q to ensure data is kept current on the device Large data load - reduce the frequency that data is updated or accessed in the consolidated database (cache), (cache) or filter out unneeded data using system features such as SQL data queries If data is only used on the device to persist data across application launches, use local caching or temporary usage via a local MBO
4 - 123
Personalization Keys
Enables users to provide input for data retrieval Can be persisted:
On the client (stored in the device database) On the server (stored in the CDB) Transient (In memory)
Built-in Personalization Keys, Username and Password, can be used to p propagate p g application pp credentials to the backend EIS
4 - 124
4 - 125
Optional default value(s) Storage location: Client, Server or Session (In memory) Description
4 - 126
Load Parameters
In RBS, load parameters control the amount of data refreshed between the back back-end end EIS and consolidated databases Creates partitions in the CDB based on values given Can obtain its value from with a Personalization Key, a S h i ti P Synchronization Parameter, t or a d default f lt value l
Unwired Server
EIS
CDB
4 - 127
Synchronization Parameters
Maps to an attribute Limits the data that is returned to the device C be Can b ti tied dt to a P Personalization li ti K Key, a control t l on a screen, a variable in an application
Unwired Server Mobile Device
1
Unwired Server
Mobile ob e Device e ce
2
EIS
4 5
CDB
4 - 129
4 - 130
Parameter Mapping
If the data source of the MBO contains a parameter, it is mapped to the backend EIS:
state_code t t d will ill b be passed d as a parameter to the Select statement WHERE clause when the remote operation executes
4 - 131
A default value will be sent to the server in absence of these property values
4 - 132
Must ust use Properties ope t es view e o of t the e MBO O to c create eate t them e
In this example, the synchronization parameter is given its value from a Personalization Key which is mapped to the state attribute When Query Limiting is enabled, on subsequent reads, the data is overwritten - when disabled, the data is appended
4 - 133
4 - 134
Define a state_code state code Load and Sync Parm containing the value of TX The e Load oad Parm a brings b gs TX rows o s back bac to t the eC CDB a and dt the e Sy Sync c Parm sends those same rows to the device
4 - 135
EIS
Performance Strategies
Strategies include:
Design the CDB cache to refresh client application data onon demand Create Synchronization groups identify the mobile business objects (MBO) that are to be synchronized as a group
Create Cache Groups specifies data refresh behavior for every MBO in the group
Work W k with ith Data D t change h notifications tifi ti (DCN (DCNs) )t to define d fi h how often to update data in the cache after data changes are detected in the data source
4 - 137
Defines a group of related MBOs in terms of their data synchronization requirements i t Developers or administrators can create additional synchronization groups g p
4 - 138
Change detection interval is the frequency, in hours, minutes, and seconds, seconds with which Unwired Server is notified of data changes within the synchronization group:
4 - 139
Once a new synchronization group has been created, created MBOs are assigned to that group via drag-and-drop
E.g. drag an MBO from the Default group to the new synchronization group
For example, example the FlightCustomer MBO can be synchronized on a different schedule than the MBOs residing in Default
4 - 140
Synchronize(DataChangesLessOften)
U d to only Used l update d FlightCustomer Fli htC t i our scenario in i U d to Used t update d t the th rest t of f the th MBO MBOs iin our scenario i
Synchronize(default)
One overload takes no arguments and will synchronize all MBOs in all Synchronization Groups
Synchronize( )
4 - 141
Every Mobile Application Project contains one Cache Group named Default
A cache h group specifies ifi th the data refresh behavior for e er mobile business every b siness object (MBO) within that group Developers or administrators can create additional Cache Groups
4 - 142
4 - 143
Cache Policies
Cache policy defines the cache refresh behavior and properties for the MBOs within the cache group based on the policy
On demand - Application logic combined with the cache interval determines when a cache refresh is triggered
Cache is not updated until a request is made of the cache and the cache has expired If a request is made of the cache and it has expired expired, there may be a delay responding to the request while the cache is refreshed
4 - 144
Continued
Cache Policies
Scheduled
The cache is refreshed when a scheduled task, task defined by the Unwired Server administrator, executes
The cache can also be refreshed per the Cache interval Load L d parameters t fill filled df from t transient i t personalization li ti k keys cannot be used with a scheduled cache type
4 - 145
Continued
Cache Policies
4 - 146
Continued
Cache Policies
Online
Used strictly with Mobile Workflow applications where access to real-time EIS data is required
4 - 147
Relationships
Are the mapping of attributes or parameters of one MBO to those of another Are beneficial because they:
Provision P i i related l dd data as a single i l unit i Properly sequence the operations on the related MBO
4 - 148
Relationship Types
One to many
One manager manages many employees One manager manages one department Many employees work in one department Changes can be propagated in both directions Operations such as deleting the Parent (e.g. Customer) will automatically t ti ll cascade d down d t to th the child hild ( (e.g. d delete l t orders) d )
One to one
Many y to one
Bi-directional Bi directional
C Composite it
4 - 149
Creating Relationships
Click Relationship in the Palette Drag the relationship from the parent MBO to the child MBO
The New Relationship wizard will launch allowing further definition of the Relationship
4 - 150
4 - 151
Completed Relationship
A one-to-many relationship between Customer and Sales order has been created below: Sales_order
4 - 152
4 - 153
4 - 154
Can only define create, update and delete operations Are instantiated with code and serve as temporary data stores for a mobile application pp Relationships can be created between LBOs but NOT between LBOs and LBOs, MBOs
Creating an LBO
Since it does not come from an EIS, EIS the creation of attributes in the LBO is a manual process LBOs do not have OTHER-type operations
4 - 155
Resulting LBO
Even though operations were specified in the creation of the LBO, they do not appear in the mobile application diagram The icon for the LBO is different from that of the MBO
4 - 156
MBO O Basics
MBOs from SAP BAPI MBOs from SOAP Web Services MBOs from REST Web Services MBOs from a Tables/Stored Procedures Advanced MBO Topics Deploying MBOs to Unwired Server
Deployment
The package is named after the Mobile Application Project Right-click Ri ht li k th the mobile bil project in the WorkSpace Navigator Select Deploy Project Project
4 - 158
Select a deploy mode, enter a version number and a package name, and select the appropriate synchronization method:
4 - 159
4 - 160
Deploying JARs
Custom Result Set Filters and Result Checkers should be packaged into Java Archive (JAR) files for deployment to the Unwired Server During deployment, deployment you can select a JAR file to deploy with your application:
4 - 161
Server/Domain Selection
4 - 162
Click the Server connection area to display the dropdown containing connection choices
4 - 163
4 - 164
Last screen of the Deployment Wizard allows you to create a deployment profile / package to make future deployments easier
4 - 165
4 - 166
Verifying Deployment
You can verify the deployment of your MBOs by navigating the Unwired Server profile in the Enterprise Explorer Packages are always deployed to a Domain
The L Th LosLogos L package in our example was deployed to the default domain
4 - 167
4 - 168
Allows you to designate the Unwired Server to which a package is deployed as well as perform a simple one-click deploy:
4 - 169
Deploy and Build options (Full and Incremental) appear on the Context Menu of the Mobile Deployment Package
The Build options only create JAR files which contain the MBOs These JAR files can then be deployed to an Unwired Server
4 - 170
Labs
4 - 171
Continued
Labs
4 - 172
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
4 - 173
Module Summary
During the course of this module, you have learned how to:
Use the Quick Create wizard to build a simple MBO Build MBOs from all of the EIS sources Build MBOs that require user input at runtime Create Personalization Keys to allow for user input to a mobile application Differentiate between Load and Synchronization Parameters Deploy an MBO to Unwired Server
4 - 174
Module Post-Assessment
1. Aside from attributes and operations, name three other things that make up an MBO. MBO 2. Which paradigm assumes that back-end data sources have already been created and/or identified? 3. True/False. An MBO can only be created by dragging it from the Palette. 4. True/False. Disabling Query Limiting in a Synchronization Parameter results in the device data appending instead of overriding. 5. What entity can be created to simplify the deployment of MBOs?
4 - 175
Module Pre-Assessment
1. What are the four starting point screens available for a Mobile Workflow? 2. For which devices will Sybase Unwired Platform generate mobile workflow applications? 3. Which Web technologies does the Hybrid Web Container support?
5-2
Module Objectives
5-3
Mobile Workflow Forms Editor Overview Mobile Workflow Application Development Configuring Mobile Workflow Application in the SCC Generating and Deploying a Workflow Package
Workflow applications can be request-response type applications li ti where h one user iinputs t a request t (d (data) t ) and d another user approves or denies the request Mobile Workflow applications include two layers:
Can still use entities like load parameters, synchronization parameters, personalization keys Built using g the Mobile Workflow Forms Editor within the Unwired WorkSpace
5-5
Device-initiated:
Workflow can be opened p like any y normal mobile application pp by y the user An example is a user submitting a travel expense report
Server-initiated:
Can be initiated by y an e-mail notification or Data Change g Notification Device receives e-mail notifications from an Unwired Server process that delivers a workflow message to a user based on a configured distribution rule and MBO extraction rules An A example l is i receipt i t of f an approvall request t
A single mobile workflow application can be both a serveri iti t d and initiated dad device-initiated i i iti t d workflow kfl
5-6
Is an application that uses a platform supplied embeddable browser control* control on which to build applications:
Some of the files that are generated in Unwired WorkSpace to build the container can be modified for customization p p purposes Container must be loaded onto the device manually or by using g device management g such as Afaria
5-7
Lookup/Search p
Push/DCN
Backend Data
Mobile Workflow Forms Editor Overview Mobile Workflow Application Development Configuring Mobile Workflow Application in the SCC Generating and Deploying a Workflow Package
Put controls onto screens D fi basic Define b i validation lid ti llogic i of f controls t l Create menus on screens
Define how the screens of the application flow Make calls to create, update, delete and other type operations in an MBO Call object queries of an MBO
5 - 10
Contains three tab pages where the developer can perform his work:
Introduction Flow Design
Identifies the starting points (such as client or server-initiated) that make up the application
Where you define the number of screens that will make up the application as well as the flow between the screens Where controls are added to specific screens Where menu items are created Can create validation rules for screen controls
Screen Design
5 - 11
Flow Design Diagram (tab active) Screen Design tab Palette Context-sensitive Properties p view
5 - 12
Starting Points
Define how the application pp is to be started Allow you to activate a device user Allow you to require user name and password authentication Developers define which screens are needed and in what order the user traverses the screens Placed onto a screen to display p y data or receive user input p Used to invoke operations such as MBO operations, navigation to another screen, etc. t Variables that hold data bound to MBO attributes or operation parameters
Controls
Menu Items
Keys
5 - 13
Starting Points
5 - 14
5 - 15
In the previous slide, when following the client-initiated flow, you can tell the user will see a Start Screen followed by the Create Request screen
The rectangles are the screens The arrows are the navigations
In this scenario, you can add a menu item on the Start Screen that can result in the navigation between it and the Create Request screen Screen transitions can also be created by choosing the GoTo navigation item from the palette
5 - 16
GoTo
When dragged gg between screens creates a new menu item in the source screen that opens the destination screen Directs flow depending on success or failure of MBO operation calls Lets the user drill down into the details from the higher-level listview control t l
Navigations
Operation p
Listview
5 - 17
Controls
Each screen can contain one or more controls Double-clicking any screen in the Flow Design view will cause that screen to open in the Screen Design view Once in screen design, the palette changes to show the controls you can add
Click the control in the palette and then click again on the screen
5 - 18
5 - 19
Slider
Apple iOS BlackBerry Android Note: When the Optimize for performance option is set in preferences, the Slider control is supported only on BlackBerry
Signature
Apple iOS Android BlackBerry 6.0 60
5 - 20
Menu Items
When a user selects a menu item, it invokes some type of action such as:
Navigating to a different screen Closing Cl i th the screen or application li ti Invoking an MBOs operation
Menus are supported only on BlackBerry and Windows Mobile platforms On the iOS platform, menus are provided from HTML controls designed g to emulate the iPhone navigation g bar and toolbar
5 - 21
Menu items are added to the special Menu box in the Screen Design view
Click MenuItem in the Palette and then click again in the Menu box (blue box)
5 - 22
5 - 23
Continued
Not invoked immediately, but is instead invoked when a Submit operation is made on a parent MBO Can only be added to screens that result from a Listview details navigation
5 - 24
For server-initiated workflows, ,y you can specify p y the value associated with a given key
5 - 25
5 - 26
5 - 27
5 - 28
Output Keys
Lists the keys of which values will be filled by the server and returned to the client Output keys are the result of configuring an Online Request menu item type
5 - 29
Mobile Workflow Forms Editor Overview Mobile Workflow Application Development Configuring Mobile Workflow Application in the SCC Generating and Deploying a Workflow Package
4. Configure the workflow notification mailbox and users in the SCC 5. Create the Mobile Workflow application user interface using the Mobile Workflow Forms Editor
5 - 31
Continued
6. Create screens by dragging and dropping MBOs or MBO operations from WorkSpace Navigator to the Flow Design
Or manually create, delete, and edit screens, controls, menus, screen navigations navigations, and so on Make edits to the generated Custom.js file if desired
8. Deploy the Mobile Workflow package to Unwired Server 9. On the device, run, test and debug the Mobile Workflow p package g
5 - 32
Regardless of the type of application being created (workflow or native), MBOs must be created
Create Connection Profiles to required data sources Create the MBOs from your data sources to meet the application requirements
5 - 33
Assuming you have created the MBOs to support the application select New Mobile Workflow Forms Editor application,
5 - 34
Continued
5 - 35
Continued
5 - 36
Continued
Once Matching and Extraction Rules are defined, the wizard is complete
5 - 37
Used to provide Unwired Server enough of the STATIC text of an email field to determine where to route a workflow request
Extraction Rule:
Extracts text elements to determine the p position/placement p of the unique ID in the string Unwired Server extracts the ID using start and end tags Will be used to send the correct workflow instance to the designated user device
5 - 38
5 - 39
Screen Design
Double-click a screen in the Flow Design to display this view Screen UI elements are designed here:
5 - 40
Controls must be added K Keys must t be b created t d and d mapped dt to th the controls t l Menu items must be added to call the appropriate operations
Dragging D i an MBO from f the th WorkSpace W kS Navigator N i t onto t the th Flow Design
Usually U ll creates t more screens th than iintended, t d d b but t unwanted t d screens can be deleted
Dragging D i an MBO MBOs operation ti f from th the W WorkSpace kS N Navigator i t onto the Flow Design
5 - 41
Click the Screen palette item and click again to drop it into th Flow the Fl D Design i editor dit
Enter the name of the screen The key will be automatically set
5 - 42
Adding Navigations
When creating a GoTo navigation between screens, screens a corresponding Open menuitem on the first screen will automatically be created
Some navigations cannot be explicitly created on the Flow Design but will be implicitly created when relevant properties of various controls and menuitems are specified
Changing the appearance of the navigation via the Navigation property sheet is strictly for design-time
5 - 43
Creating a Key
A control should have a corresponding key assigned Control properties are set/changed in the Properties p view To create a new key, select the control or other entity (starting point, screen,) and click New in its Properties page (Keys tab):
5 - 44
5 - 45
Defining Menus
Specify the MBO and the corresponding operation or object query Map the parameters to keys
Parameters which P hi h are mapped d to attributes ib or personalization keys or have a default value dont necessarily have to have a key mapped to them
5 - 46
Creating a GoTo navigation will automatically create an Open menuitem and vice verse
5 - 47
Find an MBO operation, or the whole MBO, in the WorkSpace Navigator and drag it to the Flow Design view
This will create the appropriate screens, controls, keys, menus and d navigations i ti for f that th t operation ti or MBO
Dragging an MBO operation will create a screen with a menu item that invokes that operation and with controls bound to keys that are bound to that operations parameters Dragging the entire MBO will create :
Screens for all operations A details screen for the MBO itself Screens for any related MBOs and their operations
5 - 48
Mobile Workflow Forms Editor Overview Mobile Workflow Application Development Configuring Mobile Workflow Application in the SCC Generating and Deploying a Workflow Package
Configure Inbox Notification if your workflow is designed to forward email notifications to users
5 - 50
5 - 51
Notification Mailbox
Enable here
5 - 52
5 - 53
5 - 54
Use Case:
Employees the ability to create a vacation request Managers the ability to approve/reject a vacation request
5 - 55
Continued
Unwired Server sends workflow to Boss SUP reviews starting point extraction rules to determine which workflow to route in order to generate special email containing an i t instance of f th the request t
MBO
INSERT
Trigger sends notification email to approver (boss) and to Inbox Notification (trafficcop)
EIS Database
5 - 56
Mobile Workflow Forms Editor Overview Mobile Workflow Application Development Configuring Mobile Workflow Application in the SCC Generating a Workflow Package
5 - 58
5 - 59
Generate
Select to generate the mobile workflow package and its files When option is unchecked, the Mobile Workflow package files are not regenerated regenerated, so that user modified files or changes made in the designer will not be reflected in the generated application
Place th Pl the generated t d mobile bil workflow kfl package k and d it its fil files iin the current project
5 - 60
Continued
Select the Unwired Server profile with which to associate the mobile workflow application and extract the username and password d credentials d ti l if you are using i static t ti authentication th ti ti Select to deploy the mobile workflow application to an Unwired Server
Continued
5 - 61
Deploy Mode
New select the first time you deploy to the Unwired Server Update updates an existing workflow Replace removes existing workflow and re-deploys
Device users must be registered in Sybase Control Center Click Get Users to select device users from the list
5 - 62
Continued
Validate controls as soon as the user tries to change focus away from them
If unselected, validation occurs only when the screen is saved If selected, l t d validation lid ti occurs as soon as th the control t l lloses focus If validation lid ti fails, f il a h help l element l t appears and d shows h the th error message
5 - 63
To install and configure the mobile workflow container files on to a BlackBerry device or emulator emulator, you must perform the following on the device:
Locate required files Copy required files to appropriate device/simulator folder Load MDS S and the BlackBerry simulator Configure and activate the workflow container on the device/simulator Generate the workflow application in Unwired WorkSpace
5 - 64
5 - 65
5 - 66
Continued
5 - 67
5 - 68
Continued
5 - 69
5 - 70
Continued
5 - 71
5 - 72
Define your connection: Server Name, User name, Activation Code etc Code, etc and then select Save:
5 - 73
Continued
On the Connection screen, provide the values defined when you registered the device user in the SCC
Server Name varies depending on your environment. In a single node environment environment, use the host name of the Unwired Server
In a production environment with relay servers servers, use the name of a deployed relay server host In a production environment with load balanced relay servers, servers use the name of the load balance controller
5 - 74
Continued
User Name the name of the device user you registered in the SCC Activation Code the activation code specified when you registered the device user Enable Automatic Registration if previously configured in the SCC this option will appear on the client device SCC,
5 - 75
Troubleshooting
Always check the Sybase Messaging Clients log entries when you encounter a problem with connections In the Connections screen, select Show Log from the menu:
5 - 76
5 - 77
5 - 78
Continued
5 - 79
In a production environment, you will need to use one or more of the following techniques:
Use Afaria to install the Mobile Workflow container on devices for enterprise deployment supported by Afaria Have your users install the Mobile Workflow container on the BlackBerry device using BlackBerry Desktop Manager
Connect the BlackBerry device to the computer that contains the Mobile Workflow container for BlackBerry Run the BlackBerry Desktop Manager following the instructions in the RIM documentation
For iOS devices, you must use Apples appStore/iTunes/APNS deployment methodology
5 - 80
Labs
Task 1: Review the Vacation Request Use Case and Add Email User Accounts Task 2: Set Up Ancillary Lab Components BlackBerry Simulator T k 3: Task 3 St Start t and dC Configure fi S Sybase b C Control t lC Center t f for Workflows W kfl Task 4: Create the Device-Initiated Project and Workflow Database Tables and Trigger Task 5: Create the Vacation Request Workflow Project MBOs Task as 6: 6 Deploy ep oy Mobile ob e Workflow o o Application pp ca o MBOs Os Task 7: Create the Device-Initiated Mobile Workflow Application Interface Task 8: Generate and Test the Device-Initiated Mobile Workflow Application
5 - 81
Continued
Labs
5 - 82
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
5 - 83
Module Summary
5 - 84
Module Post-Assessment
1. What is the name of the Editor used to create a mobile workflow application? 2. True/False. Before you can test your mobile workflow application you must customize the user interface application, interface. 3. True/False. You create mobile workflow screens by dragging a database table or other data source object to the Screen Design diagram.
5 - 85
Module Pre-Assessment
1. True/False. To alter the appearance of a web frontend, the only thing you can do is edit its CSS. CSS 2. True/False. Mobile workflow applications are easier to create than Native mobile applications. applications 3. True/False. Workflow applications are message-based.
6-2
Module Objectives
6-3
Workflow Review
6-5
6-6
Customization
These web technologies make it easy for you to customize the generated files by using JavaScript code
6-7
HTML
The generated HTML files contain all screens for the workflow app, each in their own <DIV> section of the document Files can be opened with third-party Web development tools and modified
Any y changes g made using g a third-party p y tool will be overwritten if generated from the Mobile Workflow deployment tool
Mobile Workflow Forms Editor includes a HTMLView control that can be placed on a screen, and in which custom HTML code can be inserted
6-8
CSS
A third-party CSS library is used to modify the look-and-feel of the HTML page jQueryMobile CSS file is embedded as the default look-andfeel for iOS, iOS BlackBerry 6 6, and Android
Can select from the variety of themes within the jQueryMobile framework or use your own CSS rules for skinning pages and screen elements
You can leverage existing CSS style rules from your own organization's organization s Web standards
6-9
JavaScript
Customization of the HTML page can be executed using embedded JavaScript in these customization points
Allows access to data-access functions for requests and cached h d values l Additional custom JavaScript files can be added to the Mobile Workflow package
6 - 10
A compilation of all resources used in the application The deployment unit for the application This is what is actually deployed to the device
<workflow_name>.zip kfl i
6 - 11
Continued
Files re-created if the Generate option is selected in the Mobile Workflow package generation wizard:
workflow.html kfl ht l
Container of all screens in the workflow app, each in their own <DIV> section of the document Same as above, but for BlackBerry 5.0 devices Same as above, but for iOS and BlackBerry 6.0 devices
workflow_CustomLookAndFeel.html
workflow_jQ jQueryMobileLookAndFeel.html y
Mappings between the keys and the MBO parameters, operations and attributes Functions to determine the locale do not edit Internal functions called by the generated code do not edit
Resources js Resources.js
Workflow.js
6 - 12
Continued
Files re-created if the Generate option is selected and the files do not exist:
API.js
Recommend y you do not edit this file Internal workflow functions Recommend you do not edit this file Continued
Utils.js
6 - 13
Files re-created if the Generate option is selected and the files do not exist (cont (cont.): ):
Custom.js
This is Thi i where h you make k your customizations t i ti Details on this to follow later in this section MessageValue, MessageValueCollection and W kfl M WorkflowMessage objects bj t that th t allow ll you t to easily il view i and d manipulate the contents of the in-memory data that the workflow application is using
W kfl M WorkflowMessage.js j
6 - 14
Makeup of Custom.js
Contains pre-defined customization points (function stubs) that can be coded with JavaScript: WorkflowLoad WorkflowLoad, Submit Submit, NavigateForward, NavigateBackward, ShowScreen, MenuItemClick Save MenuItemClick,
Each customization point has a Before and After version, i.e. BeforeWorkflowLoad
6 - 15
Coding in Custom.js
Developers have access to all of the standard JavaScript functions including DOM element manipulation functions, manipulation, etc etc. and also have access to many workflow functions that are provided in API js API.js The functions in API.js are categorized as:
Generall utility G tilit f functions ti ( (e.g. guid()) id()) Workflow-specific utility functions (e.g. parseDateTime()) Workflow message data functions (e.g. getCurrentMessageValueCollection()) Workflow UI functions (e.g. getCurrentScreen()) Workflow native functions ( (e.g. g doOnlineRequest()) q ()) Workflow validation functions (e.g. validateControl())
6 - 16
This example will modify the header and footer of each page of the application
Header will contain a company logo Footer F t will ill contain t i a copyright i ht notice ti
6 - 17
6 - 18
B f Before
6 - 20
After
Since we are testing Si t ti with ith BlackBerry 6.0, edits will b made be d to t th the jqueryj mobile-1.0a3.css file
6 - 21
Find the .ui-body-a selector and change the background and color property values
6 - 22
B f Before
6 - 23
After
B f Before
6 - 25
After
Hook into the submit process of a workflow by editing the customBeforeSubmit function in Custom.js Custom js
6 - 26
Edit the generated *.html file to determine values needed when writing JavaScript functions:
Screen Key
6 - 27
6 - 28
When the user enters a value greater than 1000, the error message is displayed and the form is not submitted:
6 - 29
A mailto: link - when clicked, will cause the device to start an email using the employees email address A tel: link - when clicked clicked, will cause the device to start dialing the employee using his phone number A location link - when clicked, , will cause the device to open p the browser and navigate to the page specified, passing relevant location data Continued
6 - 30
6 - 31
6 - 32
6 - 33
6 - 34
6 - 36
6 - 37
After adding the Object Query, save the project and re-deploy the project to Unwired Server
6 - 38
6 - 39
Add an EditBox control to the Start Screen where user will input search criteria
6 - 40
6 - 41
6 - 42
Map the finder finder method methods s in parameter to the key tied to the control where criteria will be entered:
Finder method in parameter
6 - 44
Maps the Customer MBO to the Listview control Listview Details are created from scratch or use the drag and drop method for creating screens before using it
Bind Customer MBO to Listview
6 - 45
6 - 46
6 - 47
6 - 48
Steps:
Create an MBO with one load parameter Map p the p parameter as a p propagate-to p g attribute Then assign the MBO to a cache group that uses an Online p y policy
6 - 49
Note that when the source of any MBO contains an input parameter the parameter automatically becomes a Load parameter, Parameter in the MBO:
6 - 50
Note the Load parameter in this case is not being given a value
6 - 51
O li cache Online h policy li will ill only l work k with i h MBS applications li i
6 - 52
Do not D t drag d th the MBO MBOs inside Mobile Business Objects folder into your cache group
6 - 53
For the changes to take effect re-deploy the project and build a Server-initiated Workflow application
6 - 54
Steps:
Create a workflow application using the editor with a serverserver initiated starting point
From Unwired WorkSpace, WorkSpace select File New Mobile Workflow Forms Editor Select the folder that contains the Customer MBO that was just configured for Online Lookup Name the file CustomerOnlineLookup.xbw and click Next In the Starting Points screen, select Responds to server-driven notifications, , and click Next
6 - 55
This is the standard wizard for creating new mobile workflow application:
6 - 56
6 - 57
6 - 58
6 - 59
6 - 60
Once selected, Matching Rule will be entered into the Matching Rule area of the window:
6 - 61
6 - 62
6 - 63
6 - 64
Test Message
Provide a sample message that adheres to that of the Matching Rule Will be used by the Extraction Rule to determine the value to send to Unwired Server via the MBO
6 - 65
6 - 66
Once opened, the workflow f instance will display only the d that data h satisfies i fi the criteria used by the h M Matching hi and d Extraction Rules
6 - 67
Can now specify a timeout value when making an online request that invokes an object query
When value is non-zero, the results of the query will be cached and encrypted in a cache on the device Subsequent requests using the same parameter values will use the results from the cache rather than a new result set retrieved from the server The contents of the cache can be cleared through custom code, either selectively or entirely
6 - 69
6 - 70
AttachmentViewer Control
Content for attachments can be downloaded as part of the original workflow message sent either as the result of an online request or as a server-initiated notification
6 - 71
Attachment Support
When requested as part of an online request of a workflow application attachments will be stripped out of the message application,
Stored in the device cache for later use when displaying in the attachment viewer Encrypted
Binary y content can also be extracted from the workflow message and used as the source for an image on the page
6 - 72
Note that BlackBerry and Windows Mobile require third-party software to view certain file types:
6 - 73
Also contains picType to hold the MIME type necessary for the AttachmentViewer
6 - 74
In this example, a Sybase SQL Anywhere system stored procedure (xp_read_file) (xp read file) is being used to read the physical pictures and convert them to binary data as they are inserted into the table:
6 - 75
6 - 76
6 - 77
Note that the data binding of Emps/pic, which is a Binary type in the database, database is mapped to a key of type String:
6 - 78
Screen Design
Attach the Input Data Binding Key to the AttachmentViewer control Set the MIME type key
AttachmentViewer Control
6 - 79
AttachmentViewer on Device
Creates the hyperlink Click hyperlink to launch the viewer:
Picture fetched using Att h AttachmentViewer tVi f from database via MBO
6 - 80
Localization
6 - 82
6 - 83
Creating Locales
A locale is created in the Workflow Forms Editor Click the New button in the Localization tab
6 - 84
Locale Wizard
Must minimally specify a language Optionally, you can specify a country and a variant:
6 - 85
If you add a locale that includes a country, must also include th locale the l l th that t contains t i only l th the llanguage If you add locale that includes a variant, must also include a l l with locale ith th the llanguage and d country t
Language only Language and Country Language, Country Language and Variant
6 - 86
Default Locale
Denoted with a blue checkmark Used when the regional settings on the device does not match the locales created for the workflow:
6 - 87
Right-click one of the newly created locale files in the WorkSpace Navigator:
6 - 88
On BlackBerry, the locale is changed under Options Typing and Input Languages:
6 - 89
The screen is Th i automatically i ll created d that h allows ll the h user to select which certificate to use:
6 - 91
Windows Mobile platform certificate picker will display when the Specify Specify Certificate Credentials Credentials menu item is used:
6 - 92
The platform picker varies depending on which platform the application is running:
Certificate details appear...
6 - 93
Design-Time Authentication
Labs
Task 1: Make General Cosmetic Changes Task 2: Write Validation Rules Using the Editor Task 3: Familiarize Yourself with Generated Files Task 4: Alter Application Appearance Task 5: Add Custom Business Logic Task 1: Create a Client-initiated Client initiated Online Lookup Task T k 1: 1 Setup S t the th D Database t b Task 2: Create the Mobile Workflow Application T k 3: Task 3 Add an Attachment Att h t Viewer Vi C Control t l
6 - 95
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
6 - 96
Module Summary
6 - 97
Module Post-Assessment
1. True/False. BlackBerry can natively display XLS attachments. attachments 2. True/False. Custom.js is where you will make the majority of the modifications to a workflow application. application 3. Name the file that contains many of the workflow functions that can be called when modifying the workflow application.
6 - 98
Module Pre-Assessment
1. For which platforms can you generate native mobile applications? 2. Differentiate between a synchronization parameter and a load parameter. 3. Name the platforms to which you can deploy Sybase Unwired Platform Native applications. 4. Name the language used to build iOS applications.
7-2
Module Objectives
Prepare your environments to develop, develop deploy and test a native mobile application
7-3
Preparing p g the Visual Studio Environment Preparing the Xcode Environment Preparing the Eclipse Environment
Unwired Platform provides a mechanism to generate object code for a device platform
Java for BlackBerry or Android devices C# code for Windows and Windows Mobile devices Objective C for iOS devices
This code can be used in the native IDE to develop a native mobile application
7-5
This back-end code is then imported into an IDE project of choice to develop the user interface
In the Unwired WorkSpace right-click i ht li k over th the M Mobile bil Application Project and select Generate Code Code Starts the Code Generation wizard
7-6
7-7
7-8
A Generated Code folder appears under the Mobile Application Project in the WorkSpace Navigator
7-9
The metadata classes are also under the Generated Code folder
\src\namespace\ intrnl
7 - 10
The project illustrated in the previous screens, ForGenVS, now contains objects generated to represent each of the MBOs
Customer.cs and Product.cs represent these MBOs and contain t i these th k key members: b
Fields for each of the attributes defined in the MBO Properties to GET or SET the values of the fields Methods to fetch data: FindAll( ( ), ) FindByPrimaryKey( y y y( ) ), etc. Create( ), Update( ) and Delete( ) methods
7 - 11
Customer.cs
7 - 12
Preparing the Visual Studio Environment Preparing the Xcode Environment P Preparing i th the E Eclipse li E Environment i t
At the start page select File New Project Choose Visual C# for the language From the Project Templates, select Smart Device Project
7 - 14
Note that the target platform and .NET framework version must be the same as the options selected during the code generation process in Unwired WorkSpace
7 - 15
Resulting Project
Once the template is selected the framework of the project is built Project details are displayed in the Visual Studio Solution Explorer Expand the project to view its components
7 - 16
sup-client.dll
C:\Sybase\UnwiredPlatform\ClientAPI\RBS\WM C:\Sybase\UnwiredPlatform\ClientAPI\RBS\WM\Ultralite
iAnywhere.Data.UltraLite.dll
7 - 17
Additional Libraries
In VS, select the project name, right click and select Add Existing Item
ulnet11.dll
mlcrsa11.dll
PUtilTRU.dll
7 - 18
For each of the added libraries, set the Copy py to Output p property to a value of Copy Always Select the mlcrsa11.dll library
In the Properties pane, scroll t the to th Copy C to t O Output t t parameter Click the drop-down arrow to select Copy always PUtilTRU.dll ulnet11.dll
7 - 19
Return to Unwired WorkSpace In WorkSpace Navigator Navigator, right click the Generated Code folder and select Copy In Visual Studio, paste this folder into the project Generated Code folder with Dlls and src folder should be di l d displayed:
7 - 20
Therefore, delete the Dlls f ld iin th folder the Generated G t dC Code d folder
Open the O th src f folder ld and d delete d l t the file with the extension csproj j
7 - 21
7 - 22
match y your VM
7 - 23
Continued
In the Login buttons clicked event, add a try / catch block to connect to the Unwired Server and to write status information to multiline textbox Name of the database class
try {
is project dependent
ForNativeAppDevDB.LoginInSync (textBox1.Text, textBox2.Text); ) textBox3.Text = Connected to SUP; } catch (E (Exception ception e ex) ) { textBox3.Text = Error connecting to SUP \r + ex.Message; }
7 - 24
Connected C dl d Cradled
Cradled
At this point, the Windows Mobile emulator should be ready to accept the deployment of the Windows Mobile Unwired Platform application
7 - 25
7 - 26
7 - 27
Test Application
Go back to the emulator Form1 should be displayed on the emulator
Click the Login button and Connected to SUP should be displayed in the multiline text box
7 - 28
Preparing the Visual Studio Environment Preparing the Xcode Environment Preparing the Eclipse Environment
Must register as an Apple Developer before you can download the components above Subscribe to the Apple Developer Program at:
http://developer.apple.com/iphone
7 - 30
Standard Developer
Registration fee applies Allows you to develop commercial applications and deploy them via the App Store Registration fee applies Allows large companies to create applications but distribute them internally (outside of the App Store)
Developer Enterprise
7 - 31
Programming Requirements
7 - 32
Xcode:
IDE that allows you to create, create manage manage, edit and debug your projects
Si l t Simulator:
Software simulator to simulate iOS device on your Mac Not all features are available in the iOS simulator
7 - 33
Xcode allows you to develop native applications for iPhone, iPod Touch and iPad:
iPhone 3G iOS 4.2, iPhone 3GS/4 iOS 4 4.2 2 and iOS 4.3 iPod Touch 3rd/4th gen with iOS 4.2 and iOS 4.3 iPad iOS 4 4.2 2 and iOS 4 4.3 3 iPad2 iOS 4.3
7 - 34
Objective C
Language used to build an iOS application Object-oriented Object oriented - but is more like SmallTalk than Java or C#
Messages are sent to objects instead of invoked methods The receiving object must determine how to work with the incoming message
Example: p
[ReceiveObject aMethod: ObjectB] Means that the message, g , aMethod is being g sent to ReceiveObject, passing ObjectB as an argument
7 - 35
7 - 36
Includes
Source files
Copy these files from your Windows environment to a folder on your Macintosh
7 - 37
In addition to the generated code, you MUST copy the iOS Client APIs to your Mac
Copy the C th entire ti contents t t of f the th f folder ld into i t a separate t directory on the Mac from the directory containing the generated code
7 - 38
Starting Xcode
On the Mac, select File New Finder Window Navigate to the /Developer/Applications folder on the Macintosh HD Double-click on the Xcode icon
7 - 39
7 - 40
7 - 41
7 - 42
Initial Project
As seen on a prior page, the Windows-based project template results in a main window and application delegate being created:
7 - 43
7 - 44
7 - 45
7 - 46
The Xcode project now contains the code that was generated in the Unwired WorkSpace and copied to the Macintosh:
7 - 47
7 - 49
From the Windows machine, copy the \UnwiredPlatform\ClientAPI\MBS\ObjectiveC\includes folder into your Xcode project folder on the Macintosh:
7 - 50
7 - 51
Allows the user to input user preference i f information, ti such h as server name, server port, etc.
7 - 52
7 - 53
Choosing Frameworks
Can hold the Command key down to multi-select Frameworks: The following are required:
AddressBook.framework Add B kf k CoreFoundation.framework QuartzCore.framework Security.framework y libicucore.A.dylib libstdc libstdc++.6.dylib 6 dylib libz.1.2.3.dylib
7 - 54
Frameworks Added
7 - 55
In the Build Settings of the target, adjust the Valid Architectures as shown below for an iOS Simulator environment:
7 - 56
The targets Library Search Path should include the location of the SUP Client API libraries:
7 - 57
Perform a Clean, followed by a Build of the project to make sure the configuration steps were successful:
7 - 58
Preparing the Visual Studio Environment Preparing the Xcode Environment Preparing the Eclipse Environment
In Unwired WorkSpace, perform Code Generation For BlackBerry applications, select Java language Select Java ME platform Select an Unwired Server and Domain Enter a unique package name, etc. Check Replication-based
7 - 60
Note that an error icon will appear in the generated source code for the BlackBerryNativeDB.java file
This file calls the net_rim_api.jar p j which is not in this projects build path
7 - 61
Changing Perspectives
Until now, weve been using the Sybase Unwired WorkSpace Mobile Development perspective
To develop the user interface for the BlackBerry yp platform, , install the BlackBerry Eclipse plugin Then, ,y you can select Window Open Perspective Other
7 - 62
7 - 63
7 - 65
7 - 66
7 - 67
Continued
Continuing in Windows Explorer, copy all the *.java files in the Unwired WorkSpace project projects s Generated code \src \src folder to the BlackBerry Application Development projects own \src \src folder
Do not copy the folder itself! Must M t copy iindividual di id l fil files If you get errors in the BlackBerry Application project, then you did not t copy/paste / t the th fil files correctly tl
7 - 68
The daveCo and daveCo.intrnl packages represent the files that were copied
7 - 69
7 - 70
Continued
7 - 71
7 - 72
If a connection was successful to the Unwired Server, Server the screen will display in its title Connected
7 - 73
Labs
Lab 7-1: Configuring BlackBerry Eclipse Plug-in Lab 7-2: 7 2: Project Setup Lab 7-3: Preparing the Visual Studio Environment
Task 1: Generate Code from Unwired WorkSpace Task 2: Create a Visual Studio Project j Task 3: Configure the Visual Studio Project Task 4: Create the Test Form Task 5: Deploy and Test the Application
7 - 74
Labs
7 - 75
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
7 - 76
Module Summary
How to prepare your environments to develop, develop deploy and test a native mobile application
7 - 77
Module Post-Assessment
1. What utility do you use to connect (start) and cradle the Windows Mobile emulator? 2. True/False. The Mobile Development perspective is used to create a BlackBerry user interface. interface 3. True/False. You must copy all the *.java files in the Unwired WorkSpace projects Generated code folder to the BlackBerry Application Development projects own folder before f you begin to write code in your BlackBerry project. 4. In an iOS project, the generated code folder is broken into _______________ and _________________ source files.
7 - 78
Module Pre-Assessment
1. For which platforms can you generate native mobile application code? 2. Name the two types of replication available in Sybase Unwired Platform. Platform 3. Name the language used for building iOS applications. 4. What development IDE is used to create iOS applications?
8-2
Module Objectives
8-3
Introduction
Exploring p g the Generated Code Sybase Unwired Platform Client API Overview Building a Visual Studio Application Building an iOS Application
Module Overview
In the previous module, you learned how to prepare the Visual Studio, Studio Xcode and Eclipse environments to begin development of native applications This module builds on those applications and demonstrates how to use the Sybase Unwired Platform Client APIs to build complete applications in Visual Studio and Xcode
8-5
Terminology
The terminology used in this module will be as it relates to the .NET NET environment
These t Th terms will ill not t coincide i id with ith th those of f th the Obj Objective ti C or Java environments
For example, .NET uses Namespace, Objective C uses Name Prefix, and Java uses Package
It will be up to you to make the translation that is appropriate for your chosen environment
8-6
Introduction
Exploring p g the Generated Code Sybase Unwired Platform Client API Overview Building a Visual Studio Application Building an iOS Application
Topic Purpose
In order to understand the generated code and some of the code examples examples, you need to know what was created by Sybase Unwired Platform (server-side) You will be shown all of the objects that were created, created as well as various property settings, to help you understand the code examples that follow
8-8
The sample project contains different types of MBOs (database and Web Services), Services) some of which are related:
SOAP Web Service MBO that th t allows ll updates Notice how the number of operations differs between the MBOs
8-9
MBO Operations
An Other-type operation was added to the Customer MBO This operation calculates a sales tax rate by calling a stored procedure:
8 - 10
Personalization Keys
Personalization keys were created to allow user input so as to filter the data:
8 - 11
Load Parameters
The Contact MBO contains a Load Parameter that filters the data being brought back to the CDB
8 - 12
Synchronization Parameters
The Contact MBO contains a Synchronization Parameter that is used to filter the data sent between the CDB and the device:
8 - 13
Object Queries
The Contact MBO contains FindAll, findByPrimaryKey and findByLastName object queries:
8 - 14
8 - 15
8 - 16
Database class
8 - 17
Fields (Instance variables) were generated for each of the MBO attributes and relationships:
8 - 18
8 - 19
8 - 20
8 - 21
Although you should never edit the generated code, a lot can be learned by a thorough review
Double-click on any of the generated classes in the Solution Explorer nd dropdown in the editor to easily view and navigate Use the 2 to any of the generated members
8 - 22
Introduction
Exploring p g the Generated Code Sybase Unwired Platform Client API Overview Building a Visual Studio Application Building an iOS Application
In order to build a native mobile application, you will need knowledge of:
Generated Object Code from your Mobile Application Project Sybase S b Unwired U i d Platform Pl tf Client Cli t APIs API Language and workings of your target device platforms d l development t environment i t - such h as Visual Vi l St Studio di
Sybase Unwired Platform Client APIs are libraries that contain functionality required to build a native mobile application
8 - 24
Client Libraries
Recall that when setting up external IDE projects (Visual Studio Xcode), Studio, Xcode) you added the following client libraries:
8 - 25
8 - 26
Namespace Information
Sybase.Persistence
Contains interfaces, interfaces enumerations and important classes, classes such as the Database class, to allow the application to connect to an Unwired Server, Server create a device local database database, etc. Contain several list-based classes that can be populated with MBO data and traversed to access/display data Classes contain functionality to allow runtime interrogation/investigation of details, such as MBO attributes and d their th i types, t operation ti d details, t il etc. t
Sybase.Reflection
8 - 27
8 - 28
8 - 29
Continued
8 - 30
Connecting C i to an U Unwired i dS Server Creating/deleting a device database CRUD operations Setting g Personalization Key y values Setting Synchronization Parameter values
8 - 31
Introduction
Exploring p g the Generated Code Sybase Unwired Platform Client API Overview Building a Visual Studio Application Building an iOS Application
Creating Forms
Business functionality can be placed inside the form control events form, and/or functions
8 - 33
8 - 34
Using Statements
8 - 35
8 - 36
8 - 37
8 - 38
8 - 39
Data is read from the selected item on the list screen and passed to an overloaded constructor and then processed:
8 - 40
8 - 41
A new MBO instance is created, properties are used to set values, values and Create( ) is called:
8 - 42
8 - 43
8 - 44
8 - 45
8 - 46
8 - 47
Dynamic Queries
8 - 48
8 - 49
You can use a Query object to fetch rows into the client logs table and then display them in a control (i.e. (i e ListView):
8 - 50
type
long String String Int
Description
The unique key of the log Name of the MBO for the row for which this log record was written String representation of the primary key of the row for which this log record was written One of several possible error codes codes. Text in blue are MBS only only. 200 indicates success. 401 indicates that the client request had invalid credentials, or that authentication failed for some other reason. 403 indicates that the client request had valid credentials credentials, but that the user does not have permission to access the requested resource (package, MBO or operation). 404 indicates that the client tried to access a non-existent SUP package or MBO. 405 indicates that there is no valid license to check out for the client. 500 to indicate an unexpected (unspecified) server failure. failure Descriptive message from the server with the reason for the log record The operation p ( (e.g. g create, , update, p , or delete) ) that caused the log g record to be written The id of the replay message sent by the client that caused this log record to be written Date and time of the log record
Additional documentation can be found in the Developer Reference for Windows and Windows Mobile guide:
8 - 52
Introduction
Exploring p g the Generated Code Sybase Unwired Platform Client API Overview Building a Visual Studio Application Building an iOS Application
Generating G i your projects j object bj code d and d copying i iit to your Mac Copying the provided iOS Client Library files from your Windows environment to your Mac Copying other Sybase Unwired Platform required files (headers, settings.bundle, etc.) to your Mac Configuring Xcode project settings such as Header and Library Search Paths, etc.
8 - 54
8 - 55
Model-View-Controller (MVC)
Model
Represents and manages the application state (the data) Does not care about the UI Representation of MBOs built with the Unwired WorkSpace Is the UI and allows the user to manipulate the data Built using g Interface Builder ( (XIB file), ) which is p part of Xcode The code that bridges the Model and the View
View e
Controller
When the data changes (Model), it is responsible for updating the View and vice-versa
8 - 56
8 - 57
8 - 58
Notice that the project now contains the controllers header and implementation files, files as well as the *.xib xib file (User Interface):
8 - 59
Interface Builder
The View (UI) portion of an application is an XIB file which is managed by Interface Builder
Use th U the Interface I t f Builder B ild t to add dd controls t l t to screens and d set t their properties View elements are connected to Controller elements via drag and drop
8 - 60
8 - 61
8 - 62
8 - 63
8 - 64
8 - 65
8 - 66
Create the database and start synchronization Start the client engine g Login to the Unwired Server Subscribe to the database Process CRUD requests Unsubscribe from the database Disconnect from the server
8 - 67
Initialization Code
8 - 68
After generating a new key value and d allocating ll ti a new customer instance, , the...
Attribute values are set Save operation is called Pending g changes are submitted to the Unwired Server
8 - 69
Call the findAll method of the MBO to return the data to a structure that can then be traversed to access the data:
8 - 70
Personalization keys can be assigned a value at runtime, usually by querying the user for input
E.g. When the findAll method is executed, the resultset will be limited to CA CA customers:
8 - 71
8 - 72
8 - 73
8 - 74
From the Connections Inspector, drag to associate an Outlet (field) in the Controller with a screen control:
8 - 75
8 - 76
Before you can run the application in the simulator, you must register your MBS device user in the Sybase Control Center (SCC)
8 - 77
8 - 78
Settings.bundle
During the Xcode project setup and configuration, one of the steps was to copy the settings bundle settings.bundle file into the project This file creates a settings screen for the Sybase Messaging Client
8 - 79
8 - 80
iPhone Simulator
Simulator functions like the real device ProductRun in Xcode starts the iPhone simulator
Test the application To close the simulator, select iOS Simulator Quit iOS Simulator or press Command + Q p
8 - 81
Client APIs
This module has discussed only a few of the Client APIs For more information, information refer to the Sybase Unwired Platform Developer Guides for:
8 - 82
Labs
Lab 8-1: Using Sybase Unwired Platform APIs and Generated Code
Task 1: Import an Existing Project Task T k2 2: C Create t a Visual Vi l Studio St di Project P j t Task 3: Configure the Visual Studio Project Task 4: Create the Login Form Task 5: Create the Main Form Task 6: Create the Customers Form Task 7: Create the Customer Detail Form Task 8: Create the Contacts Form Task 9: Deploy and Test the Application
8 - 83
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
8 - 84
Module Summary
During the course of this module, you have learned how to:
Develop, deploy and test a Windows Mobile native application Develop using Generated Code, the Client API and Visual Studio as the development IDE Develop, deploy and test an iOS native application using Generated Code, Code the Client API and Xcode as the development IDE
8 - 85
Module Post-Assessment
1. True/False. Sybase Unwired Platform gives you a FindAll( ) method. method You must write the code for any additional finder methods yourself. 2 What utility do you use to connect (start) and cradle the 2. Windows Mobile emulator? 3. What must your code do after you submit pending changes? 4. True/False. Another name for interface files is header files.
8 - 86
Module Pre-Assessment
1. True/False.Android SDK Tools include: SDK Manager and AVD Manager. Manager 2. True/False. Android Development Tools (ADT) is a plugin to the Eclipse IDE. IDE 3. True/False. An Android mobile application cannot run on an emulator.
9-2
Module Objectives
9-3
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
Android operating system is a multi-user Linux system with each applicaiton as a different user Each application is assigned a unique Linux ID
Each p process has its own virtual machine so an application pp runs in isolation from other applications
9-5
SDK Manager
Tool to install and update SDK Tools Each time the SDK Manager is launched the system is checked for most current version of software and makes recommendations
AVD Manager M
Tool to manage Android Virtual Device configurations AVD is a device configuration for the Android emulator
9-6
Define D fi projects j Create an application ID Add components with the Android Framework API Debug g applications pp Export signed files to distribute an application
9-7
AndroidManifest.xml File
Every Android application must have an AndroidManifest.xml file in its root directory Presents essential information to the Android system that allows the application to run Some of the key information in this file:
Declares permissions so the application can interact with other applications Lists libraries that the application must be linked against
9-8
Using Unwired WorkSpace, create a mobile application that will pull data from Unwired Platform
In this class, we will create a basic application to pull data from the sampledb When the project is deployed and packaged, it will create a JAR file that will be used as the backend for the Android application
Use Android ADT functionality in Unwired WorkSpace to create an Android application to run on an Android device
9-9
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
9 - 11
Continued
Must be equal to or greater than the API level that the application compiles against
SD card default is 96 MiB Skin default is HVGA Can add specific Hardware features by clicking New...
9 - 12
9 - 13
9 - 14
9 - 15
After restart, Unwired Workspace will be prompted to install latest version of the Android SDK
9 - 16
9 - 17
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
When a mobile application is deployed in Unwired WorkSpace it creates a jar file that defines the project WorkSpace, deployment parameters
Before code generation can take place for an Android project, project you must extract a file called deployment_unit.xml from a deployed projects project s default_package.jar default package jar file using a utility of some type
Navigate to the JDK directory on your system to use a JAR utility for this task
9 - 19
This operation Thi ti will ill extract t t th the d deployment_unit.xml l t it l file fil t to th the JDK1.6.0_26\bin directory
9 - 20
Once the deployment unit file is extracted, the code generation batch file can be used to generate backend code for the Android application
Code generation batch file is provided with Sybase Unwired Platform at:
Syntax:
codegen.bat java client android ulj <path> \deployment_unit.xml [-output <output dir>] [-doc] <output_dir>] [ doc]
9 - 21
-output and doc are optional parameters If an output t t directory di t is i not t specified, ifi d output t t is i placed l d in i ...\Utils\bin directory
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
From Unwired WorkSpace select File New Project and select Android Android Project:
9 - 23
Continued
Follow the Create Android Project wizard to name the project and designate the default project location:
9 - 24
9 - 25
Name Project name Package name com sybase sup samples obj com.sybase.sup.samples.obj ectapi Create Activity verify checkbox is selected
Name will be <projectname>Activity An Activity represents a single screen with a user interface
9 - 26
Once the Android Project is created, Eclipse switches to the Android ADT interface with the project displayed in Package Explorer in the left pane:
9 - 27
C:\Sybase\UnwiredPlatform\MobileSDK\ObjectAPI\Android
9 - 28
9 - 29
C:\Sybase\UnwiredPlatform\MobileSDK\ObjectiveAPI\Android
Copy the armeabi folder Return to Package Explorer and select the project
Right g click and select New Folder to create a new folder Label this folder libs
9 - 30
9 - 31
9 - 32
From Package Explorer, access the AndroidManifest.xml file and add activity information below this line: Add these lines:
</activity>
<activity android:name=.DetailActivity android:label=@string/app @ g/ pp_name> <intent-filter> <action android:name=android.intent.action.MAIN/> / <category android:name=android.intent.category.LAUNCHER/> g y / </intent-filter> </activity>
9 - 33
The project will not save if there are problems in the file
9 - 34
com.sybase.sup.samples.objectapi b l bj t i
Can optionally enter Version code and Version name on this screen to track application pp versioning g
9 - 35
Using Windows Explorer navigate to Explorer, the location of the codegen bat output codegen.bat directory
9 - 36
In Package Explorer, paste the sample java files to this project directory:
9 - 37
C:\Sybase Courses\SUP521\Lab Resources customer.xml, customer xml detail detail.xml xml and main.xml
In Package Explorer, Explorer paste these xml file to this project directory:
res\layout
9 - 38
Completed project with all copied libraries and code files should appear as:
9 - 39
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
New button
9 - 41
Continued
9 - 42
Continued
9 - 43
9 - 44
9 - 45
9 - 46
Modify Data
Double click an entry in the customer list and modify the name Click Submit
Submit button is mapped to the synchronize operation using the AndroidMobileAppDB.beginSy nchronize operation Synchronization y occurs in the background so the mobile user interface is not affected
9 - 47
Confirm Changes
As shown, the change made to the customer name is changed on the mobile device and sent to Unwired Server:
9 - 48
9 - 49
Configuring g g the Android Environment Generating Java Object Code Creating the Android Project Launching and Testing the Application Using Client Object API
Application APIs
getApplicationContext
Returns the Android application pp context that allows access to application-specific resources and classes Sets the Android application context that is required before calling the startConnection, registerApplicaiton or unregisterApplication methods
setApplicationContext pp
9 - 51
Connection APIs
Set the properties for this class during application initiation and before creating or accessing the local client database
9 - 52
Connection APIs
Database class name is generated as Package Name + DB DB For example:
connectionProfile i fil profile fil = <PkgName>DB.getConnectionProfile( ); Profile.setPageSize( 4*1024 ); Profile.setEncryptionKey (Your key of more than 16 characters);
9 - 53
Synchronization APIs
MBOs can be synchronized based on synchronization parameters for individual MBOs or a group of MBOs Synchronization parametes let an application change the parameters that retrive data from an MBO durin a synchronization session Primary purpose of a synchronization parameter is to partition data
When a value is changed, the call to save automatically propogates the change to Unwired Server
9 - 54
Synchronization APIs
9 - 55
Personalization APIs
Personalization keys allow an application to define certain input parameter values that are personalized for each mobile user Personalization APIs can be used to manage personalization key and get and set personalization key values Personalization keys include three types: client, server or transient (or session)
Client keys are persisted in the local database Server keys are persisted on the Unwired Server Session keys are not persisted and are lost when the device application pp terminates
9 - 56
9 - 57
com.sybase.mobile Package
Interface:
Cl Classes:
Application - Class for management of mobile application registrations, i t ti connections ti and d context t t ApplicationError - Error codes associated with applicaiton and d registration i t ti errors ApplicationSettings - Supports the discovery of settings which have been received form the server after application registration and connection
9 - 58
Continued
com.sybase.mobile Package
ConnectionProperties - Supports the configuration of properties to enable application registrations and connections ConnectionPropertyType - Defines the types of connection property ConnectionStatus - Constants for application connection status DefaultApplicationCallback - Default used for application callback handler DeviceCondition - Status codes associated with device condition changes RegistrationStatus - Constants for application registration status
9 - 59
Continued
com.sybase.mobile Package
Exceptions:
ApplicationRuntimeException - Thrown when a call to startConnection, registerApplication or unregisterApplication cannot be completed due to an error ApplicationTimeoutException - Thrown when a call to startConnection registerApplication or unregisterApplication startConnection, cannot be completed due to a time out ConnectionPropertyException - Thrown when a call to startConnection, registerApplication or unregisterApplication cannot be completed due to:
A problem with a value of one or more connectionProperties or if appplicationIdentifier has not been set
9 - 60
Refer to the Sybase Client Object API Javadocs from the Unwired Platform installation:
<UnwiredPlatform_InstallDir>\MobileSDK\ObjectAPI\apidoc Open O th the A Android d id subdirectory bdi t
9 - 61
com.sybase.sup.client.persistence Package
Classes:
AbstractEntity
Abstract base class of all the generated MobileBusinessObject implementation S per class of BigBinary Super BigBinar and BigString
BigData
Exceptions:
StreamNotClosedException StreamNotOpenException WriteAppendOnlyException
9 - 62
Labs
9 - 63
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
9 - 64
Module Summary
9 - 65
Module Post-Assessment
1. True/False. AndroidManifest.xml file contains information that tells an Android device how to run an application. application 2. What does an Activity in an Android application represents?
a. Si Single l screen with i h a user interface i f b. Group of screens with a user interface c. Action that occurs in the application
3. True/False. These elements are added to the AndroidManifest.xml file: <uses-permission> and <activity>.
9 - 66
Module Pre-Assessment
1. What are the two types of Data Change Notifications? 2 What standards protocols can DCN use to send and 2. receive messages? 3. What is JavaScript Object Notation (JSON)?
10 - 2
Module Objectives
10 - 3
DCN Logging, gg g, Sizing g and Monitoring g for Developers p Implementing Regular Data Change Notification Implementing Workflow Data Change Notification Device Notifications - Push
Data change notification (DCN) listener ports are 8000 (HTTP) and 8001 ( HTTPS/secure)
Push:
A mechanism that allows Unwired Server to notify clients of new MBO data rather than waiting for the next MBO synchronization h i ti
10 - 5
10 - 6
Two changes must be reconciled in order to implement DCN from the EIS to the actual device:
Change from the EIS to Unwired Server (CDB) Change Ch from f CDB to t the th client li t database d t b (synchronization) ( h i ti )
10 - 7
Types of DCN
Provides Native Mobile Application DCN C functionality f to replication-based (RBS) and message-based synchronization (MBS) clients Provides DCN functionality to workflow clients by extending t di regular l DCN for f MBS workflow kfl clients li t
10 - 8
DNC with Payload requires a JavaScript Object Notation (JSON) string (dcn (dcn_request) request) that contains one or more :upsert and :delete operations
Directly updates the Unwired Server cache (CDB), (CDB) with either:
The built-in, direct cache-affecting operations :upsert (update or insert) or With :delete
10 - 9
Database D b triggers i EIS system events External integration processes such as user exits, Java, etc.
Configurations g of the backend systems y will be required q to support JSON and HTTP(S)
Your backend EIS MUST be able to send HTTP(S) requests to the Unwired Server
10 - 10
10 - 11
DCN upsert p operations p also sets the changed g flag g of an MBO package to true
4. Unwired Server responds p Unwired Server sends a response message back to the EIS that contains the status of each DCN in the submitted message
10 - 12
Continued
10 - 13
MBO MBO
D C N
4 2
10 - 14
DCN upsert p operations p also sets the changed g flag g of an MBO package to true
4. Unwired Server responds p by y sending g a response p message g back to the EIS that contains the status of each DCN in the submitted message
10 - 15
Continued
When the client receives this message, it performs the corresponding di create, t update, d t or delete d l t operation ti on the th device's mobile database
10 - 16
EIS
2 DCN Servlet
MBO MBO
3 1
HTTP
10 - 17
2. Unwired Server cache (CDB) could be updated directly from th EIS, the EIS or th the DCN request t could ld originate i i t f from a source other than the EIS
The actual data (payload) is applied to the cache through either an :upsert (:update or :insert) or a :delete operation
10 - 18
EIS 2
EISConnection
DCN Servlet 3 1
HTTP
10 - 19
And updates the consolidated database (CDB) if needed, d depending di on th the operation's ti ' cache h update d t policy li
10 - 20
DCN Communicaton
Issue an HTTP(S) call to the DCN port calling a specific servlet to notify Unwired Server:
Default DCN port is port 8000 C ll can either Call ith b be a GET or POST
The response you get from the Unwired Server to your EIS can be ignored or processed The HTTP request can be altered before the processing g of the DCN takes place to utilize existing event notifications
For altering g and filtering g the DCN, , use DCN Filter Java classes
10 - 21
DCN Logging, gg g, Sizing g and Monitoring g for Developers p Implementing Regular Data Change Notification Implementing Workflow Data Change Notification Device Notifications - Push
Ti Time, User, U Stage, S Package, P k MBO, MBO Thread Th d ID, ID Node N d ID, ID Error E Time, Workflow ID, Application Connection ID, User, Package, Thread ID, Node ID, Operation, Subject, From, To, Body, Error
Useful for developers p during g development p and test system y application testing
10 - 23
10 - 24
Can configure HTTP logging to record request event information logged by DCNs
By default, HTTP logging for DCNs is enabled and prints output to: <UnwiredPlatform_InstallDir>/Servers/ <UnwiredPlatform InstallDir>/Servers/ UnwiredServer/logs/<server.name>-http.log
Open <UnwiredPlatform_InstallDir>/Servers/UnwiredServer/ Repository/Instance/com/sybase/djc/server/ApplicationServer/${you rserver}.properties Delete the enableHttpRequestLog line Save the file Restart Unwired Server
10 - 25
10 - 26
{yourserver}.properties Data
10 - 27
<UnwiredPlatform_InstallDir>\Unwired Platform\Servers
\UnwiredServer\deploy\webapps\dcn\WEB-INF\ Find the property, <Set name="maxFormContentSize" type="int">10000000</Set> and increase the value up to 100MB
10 - 28
Detailed data provides specific information on past notification activity for packages
C t Categories i of f information: i f ti
Domain: The domain to which the package affected by the DCN belongs b l Package: The name of the package containing data changes MBO: The name of the MBO to which the notification applied Notification Time: The date and time that Unwired Server received the DCN Processing g Time: The time that Unwired Server used to process the DCN
10 - 29
Performance monitoring highlights key totals and identifies average minimum, average, minimum and maximum values for primary activities
Calculations are dynamic and based on the data currently available in monitoring database for the specified time period
Description
Thetotalnumberofnotificationssentbytheenterprise informationsystemtoUnwiredServer. TotalNotifications
Keyperformanceindicator
Average/Minimum/Maximum Theaverage,minimum,ormaximumamountoftime ProcessingTime UnwiredServertooktoprocessaDCN. TimeatMinimum/Maximum ThetimeofdayatwhichtheshortestorlongestDCN M Message P Processing i Ti Time processing i event tcompleted. l t d TimeofLastNotification Received MBOwith ith Minimum/Maximum NotificationProcessingTime ThetimeatwhichthemostrecentDCNwasreceivedby UnwiredServer. Th nameof The fthe th package k and dassociated i t dmobile bil business b i object(MBO)withtheshortestorlongestnotification processingtime.
10 - 30
10 - 31
DCN Logging, gg g, Sizing g and Monitoring g for Developers p Implementing Regular Data Change Notification Implementing Workflow Data Change Notification Device Notifications - Push
JSON Digression
JavaScript Object Notation (JSON) is a lightweight, textbased open standard designed for human-readable data interchange Often used for serializing and transmitting structured data over a network connection JSON O Strings can automatically be parsed/marshalled by the eval() JavaScript function into an object
JSON schemas can be used to verify a JSON String There are JSON Parsers available for many languages
10 - 33
10 - 34
POST or GET?
POST and GET HTTP methods are both allowed All request parameters can be in either the URI or POST body Using POST is recommended If you are using HTTP BASIC authentication, the JSON encoded DCN request is always sent as the HTTP POST body Syntax:
http://<hostname>:8000/dcn/HttpAuthDC NServlet
10 - 35
dcn_request
Package name in the dcn_request is required for backwards compatibility but may be ignored
Example: p
...&package=unwired_server_PackageName &dcn_request={"pkg":"dummy","messages": q { p g y , g [{"id":"1","mbo":"CustomerWithParam","op": ":upsert","cols": {"id":"10001","fname":"Adam"}}]}
10 - 36
dcn_request Messages
Message id (id):
To be used to track the DCNs sent to the Server Thi value This l will ill be b returned t d in i the th DCN response Name of MBO that should be updated Operation that this DCN should invoke Name value pairs representing the attributes and values of an MBO
Bindings (col)
10 - 37
:upsert
Used to inject data into the Unwired Server cache (CDB) for a specified MBO Performs in place update or insert to Unwired Server cache
:delete
Used to delete data from the Unwired Server cache for a specified MBO Performs in place delete to Unwired Server cache
10 - 38
:upsert
The :upsert operation requires: Pass entire key dcn request={ dcn_request={ attribute(s) of the MBO "pkg":CustomPackage", "messages:[{ in order to locate the "id":"1", "mbo":"Department", correct row "op":":upsert", "cols": Any other MBO { attributes that are to "DepartmentID":999", be used in the upsert "DepartmentName":"MyDepartment, "D "DepartmentHeadID":"501 t tH dID" "501 }}]} All columns l used d iin the operation should use the MBOs MBO s attribute names, not the data source p column/parameter/etc. names
10 - 39
:delete
The built-in :delete operation requires: Pass entire key attribute(s) of the MBO in order to locate the correct row
All columns l used d iin the h operation i should h ld use attribute ib names instead of column names
Example:
dcn_request={"pkg":CustomPackage", "messages":[{"id":"1","mbo":"Department", "op":":delete", "cols":{"DepartmentID":999"}}]}
10 - 40
User-defined Operations
All parameters used in the MBO operation All columns l used d in i th the operation ti should h ld use th the MBO parameter name
All operation ti t types are possible ibl (CREATE (CREATE, UPDATE UPDATE, DELETE, OTHER) See example below...
10 - 41
10 - 42
DCN Response
Unwired Server returns a JSON string containing a status message for each message sent
Example: p
[{"recordID":999","success":true,"statusMe ssage":""}]
10 - 43
DCN Logging, gg g, Sizing g and Monitoring g for Developers p Implementing Regular Data Change Notification Implementing Workflow Data Change Notification Device Notifications - Push
You must decide whether you will notify server-initiated device users via the Notification Mailbox feature in the SCC or the WF-DCN (cannot implement both for the same device user)
10 - 45
New parameters are added to the message so as to be compliant with the Workflow Email Notification mechanism
Username (to) SUP user name, not the username used to register the device Subject (subject) Subject of the workflow message Originator (from) who the workflow message is from Body of the workflow message (body) it can embed customized information (received) received time of the Mobile Workflow message (read) whether the Mobile Workflow message is read (priority i it ) whether h th th the M Mobile bil W Workflow kfl message h has a hi high h priority i it List of dcn request (data) JSON format string as previously seen in dcn request dcn_request
10 - 46
10 - 47
SAP EIS
BAPI BAPI BAPI BAPI Function
HTTP
HTTP
MBO MBO
JCO
4 Client
WF-DCN
1
10 - 48
Example:
{id:999,op::delete,subject:test,t { , p , j , o:test,from:test,read :,priority:,body: MATCH:SUP MWF TaskID:TS97200149 MATCH:SUP_MWF,TaskID:TS97200149, WIID:1470577, USER:PERF0111*#END#*,data{}}
10 - 49
SAP example:
Sybase Unwired Server 4 3 2
MBO MBO MBO WF-DCN ABAP Function
SAP EIS
SAP W kfl Workflow and Inbox
HTTP
5 Client
Workflow Engine
1
10 - 50
Cache g group pp policy y of MBOs used in WF-DCN with p payload y must be DCN
10 - 51
10 - 52
Processing Messages
After Unwired Server receives the message, a matching workflow server-initiated starting point initiates the following:
Parses the message Extracts E t t data d t fi fields ld f from th the message Sets the extracted data into the parameter of an object query operation ti
Since the MBO uses an online cache policy, the object query is mapped dt to a lload d operation ti
The data is then passed into the load operation as a load parameter to trigger MBO data refresh
10 - 54
WF-DCN Response
A WF-DCN Response is also a JSON string BUT differs from a Regular DCN Response WF-DCN responses include two parts:
The result Th l of f processing i the h Mobile M bil Workflow W kfl request The result of processing the general DCN requests
10 - 55
DCN Logging, gg g, Sizing g and Monitoring g for Developers p Implementing Regular Data Change Notification Implementing Workflow Data Change Notification Device Notifications - Push
Push Overview
Push is a mechanism to notify mobile clients of changes made to the cache (CDB) Unwired Server determines when individual clients need to be notified of data changes Current Unwired Server push notification options:
BlackBerry:
HTTP Configured by Sybase Control Center Light Weight Polling (LWP) Apple Push Notification Service (APNS)
iOS
10 - 57
Pushable Applications
Implement logic to react to Push notifications MBS synchronized y applications pp are inherently yp pushable
10 - 58
Labs
10 - 59
Lab Debriefing
What did you do and why? What went well in the lab? What insights did you get during the lab? What did you observe in the lab? What did you find challenging? Add any items to your troubleshooting list
10 - 60
Module Summary
10 - 61
Module Post-Assessment
1. What are the two modifications required to a generic DCN when configuring a WF-DCN? 2. What must the MBO cache group policy be for WF-DCN with payload? 3. What two part JSON string does a dcn_request parameter contain?
10 - 62
Copyright 2012 Sybase, Inc. All rights reserved. Unpublished rights reserved under U.S. copyright laws. Sybase, and Sybase logo, are trademarks of Sybase Inc., or its subsidiaries. indicates registration in the United States of America. SAP, and the SAP logo, are the trademarks or registered trademarks of SAP AG in Germany and in several other countries. All other trademarks are the property of their respective owners.
Module Pre-Assessment
1. Based on earlier learning, list two reasons for using the Sybase Control Center. Center 2. Is the web-based application (the SCC) the only means of administering the S Sybase base Un Unwired ired Platform? 3. Can multiple servers be viewed/administered from a single SCC?
B-2
Module Objectives
B-3
General Administration Security Application Management Troubleshooting Monitoring and Miscellaneous Troubleshooting,
Setting Expectations
Items discussed in this module are meant for a developer that must perform some administrative tasks in order to complete development and testing Installation of a full production environment: e.g. e g Installation and configuration of Relay Servers, setup of clustered environments system health monitoring environments, monitoring, performance tuning techniques, etc. will be covered in the Sybase Unwired Platform Administration course
B-5
B-6
Topics to be Covered
The following are some of the key administration topics that will be covered in this module:
Domain creation User U creation ti Role creation Server-side connection profiles Deployment Dynamic log viewing and configuration Port management and configuration
B-7
General Administration Security Application Management Troubleshooting Monitoring and Miscellaneous Troubleshooting,
The toolbar is based on tile views which can be opened or closed via the toolbar icons
B - 10
Use the SCCs View menu item to display the Resource Explorer
B - 11
Resource Explorer
B - 12
B - 13
B - 14
Multiple Management Views can now be seen in a single instance of the SCC:
B - 15
Maintenance
Start/Stop/Suspend/Resume server Monitor and manage client licenses
Review Log
Used for troubleshooting and diagnostics Change sub-component log level Server log g files are separate p for each node and client requests q could be spread over multiple logs if multiple servers exist in the cluster
Configure Ports
B - 16
Click the checkbox to the left of the server name to enable the Start/Stop/etc. Start/Stop/etc buttons:
B - 17
Can also review the number of used and available device licenses:
B - 18
B - 19
B - 20
B - 21
Server log filtering is a nice feature since the log files can contain more information than is necessary
B - 22
B - 23
Port Numbers
Component
Unwired Server D t b Databases
Ports
CDB: 5200 MS DB: 6262
Configuration File
<install_dir>\Servers\UnwiredServer\Repository\Instance\com\sybase\sup\serv er\SUPServer\sup properties er\SUPServer\sup.properties <install_dir>S\ervers\UnwiredServer\Repository\Instance\com\sybase\sup\serv er\SUPServer\sup.properties and respective listener props files Port 5100 is Messaging Admin Web Service port. Follow manual steps to change to change this port documented in System Admin Guide <install_dir>\Servers\UnwiredServer\Repository\Instance\com\sybase\sup\serv er\SUPServer\sup properties er\SUPServer\sup.properties
Unwired Server S h i ti Synchronization Ports Relay Server and Relay Server Outbound Enabler Configuration Sybase Control Center O DS LDAP Server OpenDS S
B - 24
B - 25
Begin by importing your companys company s digital certificate into the servers keystore Security Profile points to the certificate (alias)
B - 26
B - 27
Change the MBS port or add multiple MBS listener (ports) on the Messaging tab:
B - 28
The feature overcomes network issues with always-on connectivity ti it and db battery tt life lif consumption ti on 3G networks t k
B - 29
Configuring APNS
An APNS certificate that uses Keychain Access in the Mac must be created created, downloaded and specified
B - 30
B - 31
General Administration Security Application Management Troubleshooting Monitoring and Miscellaneous Troubleshooting,
Security Terms
Authentication
The process of determining if someone (or some thing) is is, in fact, who they say they are Usually involves a user id and password, password but could use other means such as digital certificates, smart cards, retina scan, etc. etc
Authorization
The process of Th fd determining t i i if the th person, once authenticated, th ti t d is permitted access to a resource
B - 33
Security Configurations
B - 34
Security Configuration
B - 35
Aggregates various A i security i mechanisms h i f for protecting i Unwired Platform resources Determines the scope of user identity, authentication and authorization checks Includes security providers
B - 36
Security Components
Roles:
This is the authorization component Roles memberships are consulted when a user tries to access a particular resource
B - 37
Security configurations:
The install Th i t ll of f the th Sybase S b Unwired U i d Platform, Pl tf b both th D Developer l Editions, provide a single Security Configuration named admin d i
B - 38
B - 39
B - 40
B - 41
Look at the Authentication provider drop-down list to view options for authentication of the platform:
B - 42
Domains
One of the key features of the Sybase Unwired Platform is its multi-tenancy capabilities Domains provide a logical partitioning of a hosting organizations environment Server connections, packages (containing MBOs), role mappings, logs, etc. can be viewed and managed within a domain
B - 43
DomainA D i A could ld use an LDAP server DomainB could use Windows Active Directory
Can create multiple Domain Administrators where each can administer its own portion of the Unwired Server environment
B - 44
Viewing/Creating Domains
default is the domain provided by the installation Click the New button to add a new domain:
B - 45
Provide a name:
B - 46
B - 47
Administrator Types
Platform Administrator (supAdmin) Domain Administrator (supDomainAdmin) Super user of the platform Domain management, g Server configuration, g Device Registration, g Monitoring, and Package Deployment and Management Has all of the domain administrator rights as domain owner Package deployment and management, server connections, security configuration fi ti and d role l mapping i Access to those domains that platform administrator grants
B - 48
B - 49
Enabling a Domain
Click the Enable button when ready to activate the new Domain:
B - 50
Domain Visibility
Once the wizard is completed and the domain is enabled, it will become visible in the Enterprise Explorer in Unwired Workspace:
B - 51
Be careful when deploying MBOs because you now need to select the correct domain for the targeted Unwired Server:
B - 52
For the Development editions of the Sybase Unwired Platform physical users are created in the OpenDS LDAP Platform, server
The best tool for administering OpenDS is Apache Directory St di Studio The platform does not ship with Apache Directory Studio
B - 53
B - 54
B - 55
The LDAP Browser view of Apache DS will now show the groups and users that have been set up in the OpenDS LDAP server:
B - 56
B - 57
To simplify a new user creation, clone the LDAP settings of another user, user such as the provided supUser:
B - 58
B - 59
Double-click on the userPassword attribute to display a screen to allow you to set the password:
Double-click here
B - 60
B - 61
B - 62
B - 63
SCC
New user is visible in the SCC at the Applications node Application Users
B - 64
B - 65
Roles
Roles are used to grant users authorization to data Roles can be created in either the Unwired Workspace or the SCC To create a role in the Unwired Workspace, right-click on the Roles node of a project and select Role:
B - 66
No specific N ifi rights i ht or privileges are granted in a role No users are assigned i dt to th the role
B - 67
After creating the role, assign MBOs to the role in the roles properties:
B - 68
For more granularity, roles can be assigned to MBO operations only - instead of the entire MBO:
B - 69
B - 70
B - 71
General Administration Security Application Management Troubleshooting Monitoring and Miscellaneous Troubleshooting,
Package Details
Packages contain MBOs Can drill-down drill down to see the MBOs that are contained in any package If an MBO is expanded, the operations defined will be displayed:
B - 73
B - 74
B - 75
During testing, it may become necessary to manually purge the data in a cache group
Normally, cached data is invalidated according to the policy settings of the cache group
B - 76
Synchronization Groups
B - 77
Recall that when you deploy your MBOs to the Unwired Server you were given a chance to select or create a serverServer, side connection profile:
B - 78
B - 79
Make port, server name, user or password changes in the Edit Connection Pool dialog:
B - 80
Deployment
Application developers will create the deployment packages but will not be responsible for deploying them to a production environment Deployment is typically the responsibility of the Sybase Unwired Platform Administrator
However, d H developers l may need dt to deploy d l packages k f from th their i local server to a common server for UAT testing
There are a couple of methods available for deploying packages to other Unwired Servers
Export / Import (SCC) Deployment p y Wizard ( (Unwired Workspace p and SCC) )
B - 81
To export a package, select the package and click the Export button:
B - 82
Export Process
Choose the level of information to export and the name and location of the resulting *.zip zip file:
B - 83
To import a package, click the Import button and select the *.zip zip file that contains the package to be imported into the server:
B - 84
To use the SCCs Deployment Wizard, Wizard you must first create a JAR file for the package
B - 85
B - 86
B - 87
Click Browse to locate the *.jar file and specify other deployment options, options such as synchronization and deployment mode:
B - 88
Next, configure deployment p y properties by identifying the projects .jar file Deployment file i l d package includes k name and configuration information Deployment p y descriptor file is included in the .jar fie that was created
B - 89
Update (default)
Updates package with updated objects Prevents a package of the same name on the target server from being g deleted Replaces a package on the server Verifies a package and returns errors if any
Noclobber
Replace
Verify
B - 90
Select Domain
Click next and the Domain and Security configuration window is displayed: p y
Domain choose the domain to which you want to deploy Security configuration specifies the scope of data access and security
Must be created in the cluster and assigned to the domain where the package is deployed Security configuration can be changed after package deployment
B - 91
B - 92
B - 93
Deployment Summary
Deployment summary window is displayed: You can use the deployment descriptor created by this process to redeploy a project without having to use the wizard by clicking the Create Create a deployment descriptor check box
B - 94
General Administration Security Application Management Troubleshooting Monitoring and Miscellaneous Troubleshooting,
To access the client log, select a package and then the Client Log tab
Client logs show the date/time, user, device, MBO, operation and status (Message) that has been performed:
B - 96
MBO History
B - 97
Operation History
B - 98
Click the Settings tab and click the New button to create a d domain i llog:
B - 99
Enter a start and end date and click the Retrieve button to view the log entries for that date range:
B - 100
B - 101
For example, example click the Errors tab to see only application errors
B - 102
Enabling Monitoring
B - 103
B - 104
B - 105
exit: Exit command line utility help: Get help login: Login to Unwired server logout: Logout from Unwired server
P k Package C Commands: d
delete: Delete package deploy: d l Deploy D l package k export: Export package import: Import package
B - 106
Using U i an SNMP Cli Client application li i to front-end f d the h management functions of the platform Write your own custom client application to administer the Unwired Server
Sybase Unwired Platform includes a collection of libraries in the Management APIs to develop such a client
B - 107
Browser
Flash Plugin HTTPS
RMI Service
SCC Plugin for SUP MBean Inte erface IIOPS
Unwired Server
SNMP
SNMP Service
SUPSNMP Plugin
IIOP
RMI
Node 1
B - 108
In the modules on Workflow and iOS, we explained the need to create device users
Even though E th h the th SCC h has d device i user t templates, l t you may want a more automated approach By using the Java RMI (Remote Method Invocation) protocol, you can write your own custom Java application
B - 109
B - 110
B - 111
Module Summary
During the course of this module, you have learned how to:
Describe the administration architecture and its components Navigate the Sybase Control Center and perform general administration activities Monitor and manage:
Server status Deployed packages Device Users, Groups, Workflows, etc. MBOs Ports
Set up security features Get more information about the platforms Management APIs
B - 112
Module Post-Assessment
There are no post-assessments in this module
B - 113