• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Lab:  Mobile App Development with XPages and Extension Library
 

Lab: Mobile App Development with XPages and Extension Library

on

  • 4,414 views

This lab introduces you to Mobile development with the XPages extension library.

This lab introduces you to Mobile development with the XPages extension library.

Statistics

Views

Total Views
4,414
Views on SlideShare
4,413
Embed Views
1

Actions

Likes
1
Downloads
101
Comments
0

1 Embed 1

http://www.slashdocs.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

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

    Lab:  Mobile App Development with XPages and Extension Library Lab: Mobile App Development with XPages and Extension Library Presentation Transcript

    • XPages Mobile Development Lab Lance Spellman | President, WorkFlow Studios
    • Agenda
      • Review existing Notes application
      • Think about mobile requirement
      • Model page flow of mobile app
      • Create mobile Xpage
      • Create page fragments that mobile app will transition between
        • View
        • Document
        • Linked Doc
    • Existing Notes Application
      • Movie database
      • Contains 3 types of documents/forms
        • Movies
        • Actors
        • A join table for actors in movies
      • Contains 3 views
        • Movie list
        • Actor list
        • Actors, categorized by the movies they appear in
    • Movie Form
    • Actor Form
    • Movie-Actor Form
      • This form has 2 fields
        • actor_id
        • movie_id
      • Every time an actor appears in a movie, a record is created with this form that has the movie_id the actor appeared in, as well as the actor_id
    • Movies By Title View
      • Aliased as byTitle
      • Alpha listing of movie titles
    • Actors by Last Name View
      • First column has Last Name, sorted alpha
      • Second column has First Name, sorted alpha
    • Movie Actors View
      • For every movie, list actors appearing in it
      • Categorized view on the movie's id
      • Actor id's appear in 2 nd column
    • Mobile Requirement
      • Build an application that lists movies in alpha order
      • Allow selection of movie
      • For selected movie, show actors that appear in that movie
    • Model the Mobile Page Flow
      • The mobile application's main page is going to be called “m”
      • Initial content for that page should be a view listing the movies
        • Implemented as an mPage control named “home”
      • Clicking a movie link should transition to a new page fragment
        • Also implemented as an mPage control named “movie”
      • On “movie” page, a view for the actors that appear in the movie will be listed
        • A categorized view showing single category results
        • Looks up user information from the actor_id provided
    • Enable the Extension Library
      • Open Application Properties
      • On Advanced tab, checkmark the Extension Library
    • Use oneuiv2 Theme
      • Go to the XPages tab
      • Type “oneuiv2” into the Application Theme field
    • Create New XPage
      • Name the page “m”
      • Go to source tab
    • Add Mobile App Control
      • Go to Controls
      • Find the “Mobile Apps” section
      • Drag an “App” control on to the page
    • Configure Properties for App Control
      • In All Properties for the control
      • Set selectedPageId equal to “home”
        • This will be default page fragment the Xpage will show when browser opens the page
    • Add a Mobile Page to the App Control
      • A Mobile Page control is a page fragment, a piece of functionality
      • It will appear in a mobile app as it's own “page” in the application
      • Mobile Pages slide in/out, fade in/out as they are used
      • The content of pages is retrieved via AJAX when it's time to display that page fragment
      • Add a Mobile Page control inside the Mobile App container
    • Set Mobile Page Properties
      • This will be the home (or first) page of the application
      • In Properties, set id = “home”
      • Set keepScrollPos = true
        • There will be a view on this page. With this property set to true, the user will be taken back to the position they were in for the view
      • Set resetContent = false
        • Indicates that the content doesn't need to be refreshed or rebuilt
        • In cases with an active view, you might want to set this to true
    • Add Page Heading to Mobile Page
      • A Page Heading spans the top of the page and usually has a title for the content on that page
      • Add Page Heading control inside the Mobile Page
      • Set the label property to “Movie Listing”
    • Preview the Mobile Page
      • Open Safari
      • Turn on Develop Menu from Preferences (if not on already)
      • From Develop Menu, set User Agent to Mobile Safari iPhone 4.1
      • Go to http://127.0.0.1/mobile.nsf/m.xsp
      • Just a blue banner with our “Movie Listing” title so far
    • Add a Data View Control to the Page
      • Time for some content!
      • Add a Data View Control inside the home Mobile Page
      • Change to the Design tab
      • Wow, there's a lot going on here
    • Set Properties for the Data View
      • Set var = “viewEntry”
      • Set rendererType = “com.ibm.xsp.extlib.mobile.MobileView”
      • In the data properties, select “Domino View”
      • For viewName, set it to “byTitle”
      • For var, set it to “view1”
    • Preview: 30 Blank Rows
      • Getting close. Page now wants to display the view and honors the 30 rows at a time default property
      • Need to define a view column (or more) to display
    • Adding a Summary Column
      • In the Data View control's properties, find the “format” section of properties
      • Click the selector next to the “summaryColumn” property
      • Set columnName = “Name”
        • The actual programmatic name of the view column
      • Set columnTitle = “Name”
        • How you want the column title to appear on the page
    • Preview and Voila, View Entries
      • Now we need a pager to bring more entries to the page
      • Still inside the data view container, add the code below
      • xp:key corresponds to the editable area we see in design mode
      • The “for” variable in addRows points back to the id assigned to the data view container
    • Preview and Try the “More...” Pager
      • Whenever “More...” is clicked 10 more rows will be added to the page (via AJAX call)
        • 10 is the value we gave to the “rows” variable in the addRows event
        • Can be whatever value you want
    • Add New Mobile Page For Movie
      • Now, when the user clicks a view entry, it needs to do something
      • We'll create the “movie” mPage and setup the view to open that page when clicked
      • Below the 1 st mPage, add a new “Mobile Page” control
      • Set the id to “movie”
      • Set resetContent = true
        • Every time a movie document is opened, it will be fresh content, so resetContent needs to be true
    • Add a Header to the New Movie Page
      • Any non-home page in a mobile app should probably have a Header control
      • The Header control is much like the Page Header Control in that it supports a title, but it also supports buttons for going back to previous page
      • Drag a “Header” control into the “movie” mPage
      • Set title to “Movie”
      • Set backButtonTitle to “Home”
      • Set backPageId to “home”
      • Set backPageUrl to “#home”
      • Set transition to “slide”
    • Send View Link Clicks to the New Page
      • Go back to the dataView control's properties
      • Set pageName = “#movie”
        • Rather than going to a different Xpage, it goes to an anchor link (the movie mPage) on our Xpage
    • Preview the App
      • Now view links on “home” page should slide to the “movie” page when clicked
      • The “movie” page should have a header with a back button labeled “Home”
      • The Home button should take you back to the Home mPage
    • Add Panel and Data Source to mPage
      • Panels can contain their own data source
      • In mobile apps, it's important to only load things at the time needed
      • By putting a panel in the mPage, the data for that panel will only be computed when that page is active
      • Drag a panel control below the header in “movie” mPage
      • Set up a data source for the panel for a Domino Document
      • Set to the “movie” form and Open Document
    • Add a Static Line Item into the Panel
      • A “Static Line Item” Control is a formatted mobile control
      • The properties allow for it to have an icon, main title, right title, a url if it's clicked
      • We just want to use the title property and display the name of the movie
      • Drag a “Static Line Item” control from Mobile Apps into the panel
      • For title, compute the value and use “document1.Name”
        • Don't type it directly, use the code popup so in source it reads #{document1.Name}
        • Document1 is the data source defined in the panel
        • Name is the field name for the movie title on the movie form
    • Preview
    • Add Round Rect List Control
      • Below the static line item, add a “Round Rect List” control from Mobile Apps
      • This will be an area where we can provide a highlight panel with more information about the movie
    • Add margins and padding to control
      • By default, the round rect list control butts up against the left-hand side of the screen and has no padding
      • Either go to the style tab for the control and add 10px margin and 5px padding, or create a style class in css and apply it
    • Self-Study: Add repeat control
      • Inside the round rect list, create a repeat control that does a lookup to the movie_actors view
        • @DbLookup('', 'movie_actors', key, 2)
        • Key is the id of the movie, which is provided by the data source in the panel, or #{document1.id}
      • Once you have the repeat, put a computed field inside the repeat that either shows the actor_ids from the lookup, or perform an additional lookup to get the name of the actor , or create another mPage to go from the actor_id to an actor detail page
    • Questions?
    • Legal Disclaimers
      • © IBM Corporation 2009. All Rights Reserved.
      • The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.
      • References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.
      • IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both.
      • Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
      • All references to LOANr refer to a fictitious company and are used for illustration purposes only.
      The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion