PowerBuilder Tips, Tricks, and Techniques

Berndt Hamboeck

Subscribe to Berndt Hamboeck: eMailAlertsEmail Alerts
Get Berndt Hamboeck: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Unwired Accelerator in Action

Not just mobility development

Sybase doesn't just offer PocketBuilder for mobile development. Last month, we talked about Afaria and Unwired Accelerator, what they're good for and how they might be used. This month we'll take a closer look at Unwired Accelerator, install it and build a simple example with it. No coding will be required.

For those who missed the last issue, I will recap what Sybase Unwired Accelerator is:

  • First off, it's a rapid mobilization solution. When Sybase says, "What used to take months, now takes hours," it happens to be true.
  • It's got RAD tools to accelerate mobilizing Web applications, intranets, portals, databases, XML and Web services.
  • It supports connected access from BlackBerrys, PocketPCs, WAP-enabled phones, laptops and tablets.
  • It supports disconnected access from BlackBerrys and when used with M-Business Anywhere, another Sybase product, disconnected access from PocketPCs, Palm devices and tablets.
  • It's a superset of Sybase Enterprise Portal (and contains EP-Information Edition and all the Mobile capabilities).
  • You'll get the big picture and what's possible with Unwired Accelerator in Figure 1.
Installing and Starting
To get an evaluation copy go to eshop.sybase.com and pick Unwired Accelerator 6.5 with Windows 2000 as the platform (feel free to use the Linux version, but my step-by-step description uses the Windows version). The download is about 80MB. The install is pretty simple, just unzip the file and add an entry to your WinNTsystem32driversetchosts file called demo.sybase.com.

Start the portal and sample databases by using the startdb.bat file. Pick up the Tomcat server by using starttomcat.bat.

Now open your browser and go to the URL: http://demo.sybase.com:4040/onepage/index.html

You should see a login window. Log in with the user name masuper and the password m8super, and click the Login button. What you see are the default entries for the Mobile Web Studio account with administrative privileges. Once we're logged into the Mobile Web Studio, we can start developing our application. There are several options on the left side (see Figure 2):

1.  The Build menu includes:

  • Applications - create, edit, delete and manage applications and their content. They are dynamic and reusable components (also called portlets) that capture and deliver any information we want to define to our end users for using the portal or a wireless device. The data might be any source like Web content from another web site, XML feeds, database query results, JavaServer Pages or data from a corporate SAP system.
  • Templates - define the organization of applications with more than one element, where applications are located, background HTML code and so on. You can apply the templates you create to applications. Templates help applications display on specific device types. You can assign a different template for each device type for a given application.
  • Catalogs - here we create user-defined hierarchies of content to display in an application. When our portal users choose to add a portlet in the Portal Interface, they can browse through the catalog and add portlets of their choosing to their personal pages and page groups.
  • Pages - here we create, edit, delete and manage the Portal Interface pages on which the applications display.
  • Page Groups - this is the place to create, edit, delete and manage page groups to group and organize Portal Interface application pages.
  • Composite Apps - create virtual Web applications using several existing applications.

    2.  Automate menu objects on the Automate menu include:

  • Agents - they allow us to schedule or externally trigger the automatic processing (for example by SMS or e-mail) of a portlet's content.
  • Adapters - they're needed if we want to write a portlet's content to a file, an e-mail message or a database table. When the agent is triggered, the adapter interface would write the associated portlet's content to wherever we want (maybe into a database).
  • Servers - agents have to run on agent servers. During the installation, the default agent server is created by the portal. All agents run on the default agent server unless we assign them to a different agent server - look in tomcatwebappsonepageconfigglobal.properties.xml for the property AgentServerID, another interesting file if you want to reconfigure the portal to use your own brands, styles or messages (styles.xml, css.css and messages.xml).

    3.  The Manage menu includes:

  • Users/Roles - edit users and manage the resource with which they're associated. Create, edit and manage the roles, and assign roles to users.
  • Personalization - create and manage keys that let users personalize applications.
  • M-Business - deploy applications to M-Business Server groups, channels and users, and perform the M-Business Anywhere administration tasks specifically required by Mobile Web Studio. (see Figure 3)

    Building an Application
    Now it's time to start to write a simple application that users can see from a mobile device. We're going to build it from an existing Web application (try http://<your machineneame>:4040/ custview/Search.jsp and enter any username and password combination to log in to the sample app included in Unwired Accelerator).

    The steps for creating the mobile application using Web Studio include:

    • Create the application with a Web element using the Application Builder wizard, save it and give it a name, access privileges and additional configuration details. We will also approve it to make it available for the public.
    • Add the application to a page and add this page to an existing page group so our mobile users can call the page using, say, Pocket Internet Explorer.
    After clicking the Finish button we can close the Application builder and we're back in the Web Studio. Now it's time to set the status from "New" to Approved on our newly created customerSites Application. This is done with a right-click on the customerSites application in the detail pane. Select Approval Status and Approved.

    After closing the page builder we're back in the Web Studio again, where we again set the status from "New" to Approved on the created customersites page. The last and final step is to add the page to the existing DefaultPageGroup. This pagegroup is pre-defined and available to all mobile users when they connect to the mobile portal.

    Testing the application
    Unwired Accelerator provides browser access to the mobile device interface. Just point another browser window to http://demo.sybase.com:4040/onepage/mpindex.jsp.

    You won't have an account when you're running Unwired Accelerator for the first time, but the global.properties.xml property, MB.AutoRegistration, determines how user accounts are handled when Unwired Accelerator and M-Business Anywhere are integrated.

    If MB.AutoRegistration is set to true, which is the default, the user automatically joins the M-Business Anywhere server with the user name and password entered. Feel free to pick whatever you want. I'm using mobile/mobile as my user/password combination. After creating the user on the desktop, use your mobile device (I used my PocketPC with ActiveSync) to browse to the mobile portal (using Pocket Internet Explorer with the URL http://<your machinname>:4040/onepage/mpindex.jsp).

    You should be prompted for your username and password, and after logging in, you will see the default page for the mobile users. Now choose the customersite page from the dropdown and, voilà, you'll see the created page on your device.

    Sybase Unwired Accelerator is an interesting tool if you want to create Web applications for mobile devices. Most of the pages needed can be created by changing a few properties. In this simple example we used only a few of the available options. We didn't touch the continuous capture feature, which lets you capture a set of Web pages from a remote site and define how to extract the content for display, an impressive feature. Another feature is the built-in transaction support, a must for mobile enterprise applications. Lastly, we didn't get into M-Business Anywhere, which would let us work with a Web-based mobile application offline. Sybase is impressive when it comes to mobile development. Worth getting a demo.

  • More Stories By Berndt Hamboeck

    Berndt Hamboeck is a senior consultant for BHITCON (www.bhitcon.net). He's a CSI, SCAPC8, EASAC, SCJP2, and started his Sybase development using PB5. You can reach him under [email protected]

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.