Creating a Mobile Business Object From a File

Create a mobile business object from a file; for example, an image, a PDF file, or a text file.

Prerequisites 

Open a mobile application project.

A mobile business object (MBO) that is created from a file is different from other MBOs in several ways:
  • You create the MBO from a file that is located on the file system, instead of from a data source.
  • An MBO created from a file supports only two operations, download and upload.
  • There are no attributes or parameters.
  • There are no relationships.
  1. Select Mobile Application Diagram > Add > File from the main menu bar.
  2. Enter a name and description for the MBO, then click Next.
  3. Define the operations:
    Operation Description
    Download Define the files to download:
    • Source server files – enter a file name, or click Browse, and select a file in the local or network file system. For local files, enter the complete system path; for example, C:\Afaria\test.txt. For network files, use the UNC (Uniform Naming Convention) path format; for example, \\remote\test\abc.doc.

      You can use the asterisk wildcard character to include multiple files; for example, *.gif.

      Note: The main reason to select a file from the local file system is to preview the file MBO during development. Typically, when a mobile application is deployed to Unwired Server, files are downloaded from Afaria.
    • Target device folder – a copy of the file is placed in this location. Enter the location as a relative path; for example, \temp\.
    • Content type – (optional) select the file type so device clients open the document with the appropriate application. The file types that are supported depend on the location of the source server files; types may include PDF, Microsoft Word, Excel, PowerPoint, and various text and image files.
    • Preview Data – preview the selected source files.
    Upload If you want the MBO to support the upload operation, select this option, and define the files to upload:
    • Source device files – the location of the mobile-device file or directory to upload.
    • Target server folder – the destination for uploaded files; enter the path, or select Browse, and select the location.
    • Content type – select the file type. Supported file types include PDF, Microsoft Word, Excel, PowerPoint, and plain text files.
    Note: To transfer files wirelessly, an Afaria device client must be installed on the mobile device. For details, see Sybase Control Center > Administer > Afaria Environment and Device Clients > Set Up > Device Clients .
  4. (Optional) Configure role assignments for the file MBO.
  5. Review the configuration on the Summary page. To change any values, click Previous; otherwise, click Finish.

Example: insurance appraiser

An insurance company could use file MBOs to upload and download accident reports and images. An appraiser at the scene of an accident could use a file MBO to upload photographs of the damage, then someone in the claims department could download the image, and file a report.

Related concepts
Mobile Business Objects
Related reference
Mobile Business Object Properties
Supported Data Sources


Created September 17, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com