Entwicker camp2007 blackberry-workshop
Upcoming SlideShare
Loading in...5
×
 

Entwicker camp2007 blackberry-workshop

on

  • 228 views

 

Statistics

Views

Total Views
228
Views on SlideShare
228
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Entwicker camp2007 blackberry-workshop Entwicker camp2007 blackberry-workshop Presentation Transcript

  • Deploying DominoApplications to the BlackBerry. Bill Buchan HADSL Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • What Is This About?• This workshop aims to teach you: – How to web service enable Domino applications – The BlackBerry MDS studio – Developing your first BlackBerry application• Why BlackBerry? – Market leading handheld data device – Robust – Loved by CIOs – Do you have them already?• Who am I? – Bill Buchan – HADSL – http://www.hadsl.com Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • What is this About?(cont.)• Where do I find BlackBerry MDS Studio? – The BlackBerry Web site • www.BlackBerry.com• The MDS toolkit contains: – A BlackBerry simulator – The BlackBerry Mobile Data Suite Engine – An integrated development environment Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • What do you need to do ?• Have a Domino server running locally (or use mine)• Have Domino Designer open and ready• Install BlackBerry MDS studio – accepting ALL defaults Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • MDS Architecture• MDS is a Java-based application stack – May run on the BlackBerry Enterprise Server • In a small environment • Larger environments may require dedicated servers – Application repository holds applications – Can push applications to users’ BlackBerries• MDS also provides: – On-line data connectivity services via web services • Allowing handsets to utilize web services – Application access to PIM data on the BlackBerry • Allowing applications to interrogate the BlackBerry Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Solution Architecture Sec RIM u re D ata ll C han wa nel re Internet Fi GPRS BES MDS WBlackBerry Se eb BlackBerry rv Domino BlackBerry MDS Mobile Data Suite ice Domino BES BlackBerry Enterprise Server s Servers Domino Servers RIM GPRS Research In Motion General Packet Radio Service Servers Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Solution Architecture (cont.)• We are interested in: – Web service enabling a Domino application – Interacting with that application via a BlackBerry handset Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Web Service Enabling: Introduction• What is a web service? – A web service is a standard application-to-application interface – It usually uses the “http” protocol — just like a web page – It usually encapsulates its data into an XML file – It can be made secure• How can I create a web service? – Prior to Domino 7, using Java Servlets – In Domino 7 you can create web services in LotusScript• How can I “consume” a web service: – Quick and Dirty: MS SOAP DLL  Use for Testing – Better: use a Java Agent – Project “Stubby” – http://www.openNtf.org Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Web Services: Resources• www.nsftools.com – Julian’s site is a very good repository of Domino Java Code• The sample database for this session• www.openNtf.org – The “Stubby” project Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Web Services: Design• We shall create a web service that provides a single function – GetAllPurchaseOrders() shall return a String Array containing all Purchase Orders• Open Designer and navigate to “Web Services” – Create a new web service called “Simple” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Solution Web Services: Coding the Return Type• We cannot return a string array() via a function:• However, we can return a class.. Class Returns Public purchaseOrders() As String Sub new() Redim purchaseOrders(0) End Sub End Class Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • SolutionWeb Services: Coding the Web Service• Now populate our web service classClass testWebService This function returns a string array! Public Function GetAllPurchaseOrders() As Returns On Error Goto errorhandler collect all documents in the view and summarise them into the string arrayexitFunction: Exit Functionerrorhandler: MsgBox "The system experienced a run-time error: "+_ Error$ + " at line: " +Trim(Str(Erl)) + Chr(10) Resume exitFunction End Function Den nächste Schritt zum Erfolg : Domino&Notes Powered byEnd Class 8 Bundled-KnowHow
  • Web Services: Performance• Domino reloads LotusScript on each call – Ouch. It might not handle large concurrency. – No persistent (in memory) data – Don’t do complex actions during your web service • Keep it to lookup or store operations – Write documents that are then “completed” by a scheduled agent – How can I tell if its taking a long time? • User response • Lack of scalability in terms of concurrent users • “Profile” the web service using agent profiling Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Web Services: Scalability• Want a heavyweight, scalable web service? – Consider rewriting in Java:• Persistent session data • Caching of common lookup views • Able to use threading to separate “heavy duty” tasks• Use a LotusScript web service to prototype and test• If performance does not scale, rewrite in Java Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Web Services: Summary• Web service enabling a Domino application: – Domino 7 makes it simple to web service enable an application using LotusScript – Lots of web service tutorials on the web• Remember: – Web services are a standard, platform independent, language independent, application-to-application interface – Useful for exposing Domino data to other platforms – Useful for dispelling anti-Domino bias in your company – Web services are not the point of this presentation! Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Lesson 1: Creating a Domino Web Service1.Right click on the BBWS database, and choose “Open Designer”2.Go to the Shared Code section3.Open the “Web Services” Section4.Click on “New”web Service.... Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Lesson 1: Creating a Domino Web Service1. Name this web service “Simple”2. In the options section • Ensure that “Option Declare” exists3. In the declarations section • Define the class Returns: • Define the class “Simple” • Fill in the missing code to populate the string array using summary information from the view.4. Use lots of “MsgBox” functions to log comments to the server log5. Use Internet Explorer to display the Web Service WSDL Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • MDS Studio First Look• Like many other IDEs: – It has lots of screens – It has a tree-style navigator to see objects – Double-clicking on an object opens it in the editor – Selecting an item allows you to edit its properties• It has two “perspectives” – Application perspective is for editing the application – Test perspective is for testing the application Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • MDS Studio First Look (cont.)• It has a BlackBerry simulator – You can choose different models to test your code• Generally it is: – Stable – Quick – Easy to use• It’s very quick for debug/test cycles – Just change perspective, edit, and retest Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • MDS Documentation• The documentation is pretty good. But: – Quite thin in some respects – You should rely on the online technical forum – You might consider a technical support contract Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Introduction• We shall create a BlackBerry application – To retrieve information from our Domino Server • Using the web service we created earlier – That is easy for the end user – That shows how to: • Amend screens • Create scripts • Call different actions• We shall compile and distribute the application – To the built-in BlackBerry simulator Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Creating a New Project • Choose “File, New Project” – And choose “Quick Start Approach Wizard” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Creating a New Project (cont.)• Now enter the URI of the Web service Application – http://<server>/<database>/<webservicename>?WSDL – In our case, use the URL: • http://127.0.0.1/bbws.nsf/Simple?WSDL Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Creating a New Project (cont.) • Select the web service(s) you wish to import – In our case, we just choose the single function • GetAllPurchaseOrders() Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Creating a New Project (cont.)• Finally, give the project a name – Call it “First Project” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Application: Quick Fix• We shall apply a quick fix to this application – The default application sends a web service query to our Domino server, and then displays a screen stating that the web service request has been sent – We need to edit the Javascript routine that the “Go” button calls in order to allow the response event to trigger, and display our return value – In the navigator screen, navigate to “Scripts” – Open script “GETALLPURCHASEORDERSRequest_onSubmit” – Delete the second line of the script – Click on “File”, “Save All” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Running the Project:• Right click on the project name in the explorer bar, and select “Test” – This will compile, publish, and deploy the application to the simulator, and start the simulator – If the MDS services have not yet started, they will also be started Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Running the Project (cont.) • The simulator will appear – Use your mouse scroll heel (or the down– arrow) to select the MDS Control Center icon on the BlackBerry menu – Click the mouse scroll button to select (or click on the ScrollWheel on the right) • Can’t see the simulator? Check your taskbar. – It often hides down there Den nächste Schritt zum Erfolg : Domino&Notes Powered byGOTCHA! 8 Bundled-KnowHow
  • First Project: Viewing the Project on the Simulator • On the simulator screen – Select MDS Control Center – Scroll down to your application – Click on the application and choose “Start” from the menu Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Running the Project on the Simulator• We see a single screen with a single button – Select and click on “Go” – The application will then call our Domino Web service and display the results Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Initial Comments• We need to do some work – Add more meaningful screen titles – Bypass the “Go” button on the first screen so that the application automatically gets the Purchase Orders – Make the Purchase Order text read-only so that the user does not have to scroll past it to get to the button • In fact — lets move the button to the top Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Updating the Front Screen• Switch back to Blackberry MDS Studio – On the Blackberry MDS Studio, switch from the “Test Perspective” back to the “Development Perspective” – On the Navigator, expand the “Test” project, expand “Applications”, expand “Screens” – Double-click on the “scrMain” screen – Remove the button – Change the caption to “fetching Purchase Orders” – Click on the screen itself and change the Initialize property to run Script “GETPURCHASEORDERSRequest_onSubmit” – Change the window title to “Purchase Orders” – Now click on “File”, “Save All” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Updating the Second Screen • Lets update the second screen – Double click on the “scrGETPURCHASEORDERSResponse” screen – Delete the “Service Response” text and icon – Delete the “GETPURCHASEORDERS” label – Drag the button to the top of the screen – Change the button text to “Refresh” – Change the OnClick action • To a Script • Choose Script GETPURCHASEORDERSRequest_onSubmit – Change the returned text to “read-only” – Change the window title to “Purchase Orders” • Click on “File”, “Save All” Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Testing• Right click on the project, and choose “Test” – This will recompile and redeploy the application to the simulator • The application will refresh on the simulator screen – Check that the version of the application on the simulator is the version you expect Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • First Project: Conclusion• Congratulations! We have just completed an entire test + development cycle – Web service enabled a Domino application – Tested the web service application – Created a complete new BlackBerry application using the Web Service Definition Language (WSDL) – Deployed the application to the simulator – Tested that application making “live” web service calls back to Domino – Redesigned the UI of that application – Recompiled and redeployed the application back to the simulator Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • A More Complex Application: Introduction• A more complex application allows the user to send data to the web service and act on its results – In this case we shall • Present the user with a list of Purchase Orders • Allow the user to display a particular purchase order • Allow the user to create a new purchase order – The new version of the web service is not much more complicated. Only two new calls: • CreatePurchaseOrder() • SearchForPO(searchString as String) as String• This demonstration shows: – How to bind returned data to edit controls – How to trigger messages when edit controls change Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • A More Complex Application: Note• Note that: – This is still not an enterprise application – We have only touched the surface of MDS Studios ability. – The methods used are to illustrate BlackBerry MDS Studio techniques, not necessarily best practice Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Agenda …• Introduction• Architectures• Lesson 1: Web Service Enabling a Domino Application• BlackBerry MDS Studio Overview• Lesson 2: First Application• Lesson 3: A Complex Application• Wrap-up Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Resources• The BlackBerry MDS Studio: – www.blackberry.com• The BlackBerry Developers area – Domino Sample Code: • www.blackberry.com/developers/resources /domino/samplecode.shtml• Example database for this presentation: Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow
  • Summary• Domino applications can be easily web service enabled• You don’t need a BlackBerry or a BES Server to code and test BlackBerry applications• Deploying Domino applications to the BlackBerry MDS Studio – Uses web services – Is straightforward• Blackberry MDS Studio – Is a fairly simple IDE – Quick to code and test – May run out of steam with more complex applications Den nächste Schritt zum Erfolg : Domino&Notes Powered by 8 Bundled-KnowHow