New @OP cookie tags  Database element JNDI connection cache option

Chapter 2: Developer Features

File element

Unwired Accelerator lets you create application elements that are based on files. The file must contain data arranged in a format that can be mapped to grid data (see “Grid rules”). For example:

Using either file type, you can create an application element that uses the grid-rule functionality of Unwired Accelerator.

NoteUA uses the uploaded copy of the file, not the copy that is local to the browser. In other words, changes to the original file have no impact on the application created from the uploaded file. To have the changes take effect, you must upload the application again.

StepsCreating a delimited file element

This example shows how to create an application from a file source that uses commas to separate the data. You can also create a file that uses tabs, semi-colons, colons, or spaces to separate data.

  1. Use a spreadsheet application to create a four-column table in a spreadsheet program with the following content:

    Col1

    Col2

    Col3

    Col4

    1

    2

    3

    4

    999

    888

    777

    666

  2. Save the content as a comma-delimited file in a temporary directory, with the name data.csv; for example, C:\temp\data.csv.

  3. Log in to Web Studio, select Build Applications, select New from the Application Manager Status menu, then click New to launch Application Builder.

  4. Click the arrow to the right of the Add button and select File Element. You see the New Element window, which allows you to identify the file to upload from your local machine to the Unwired Accelerator server.

  5. Complete the File Element Definition options:

    Click Upload to the right of the Destination Location field. When the confirmation displays that the file was successfully uploaded, click OK.

  6. Click Preview to see the result.

  7. Click Next.

  8. In the next three windows (Split, Define, and Filter) click Next to bypass the fields, which are not necessary for this example.

  9. In the Window Preview window, enter fedata for the file element.

  10. In the Continuous Capture window, click Finish.

  11. In the Application Builder, click Save.

  12. In the Finish window, under the Content tab, in the Name field, enter fedata.

    Accept all the defaults, and click Finish.

  13. In the confirmation pop-up, click OK.

StepsCreating a fixed-column file element

This section describes how to create a file element using fixed column width data; that is, the source file data is arranged in columns of fixed length.

  1. Use a text editor to create a four-column table with the following content:

    Col1

    Col2

    Col3

    Col4

    1

    2

    3

    4

    99

    44

    1

    12

  2. Verify that the number of spaces between each column is the same; for this example put 9 spaces between each column.

  3. Format the text using a monospaced font—for this example, select Lucinda Console.

  4. Save the content as a text file (*.txt) in a temporary directory, with the name data.txt; for example, C:\temp\data.txt. Exit the text editor.

  5. Log in to Web Studio.

  6. Select Applications from the Build menu in the left pane, select New from Application Manager Status menu, then click the New button to launch Application Builder.

  7. Click the arrow to the right of the Add button and select File Element. You see the New Element window, which allows you to identify the file to upload from your local machine to the Unwired Accelerator server.

  8. Complete the File Element Definition options:

    Click Upload to the right of the Destination Location field. The program creates a \PortalDocs subdirectory beneath the directory you have specified as the temporary directory on the local machine. The file you upload is saved in a subdirectory beneath \PortalDocs that has your user name; for example, x:\temp\PortalDocs\opsuper, where “x” is the drive where the temporary directory is located, and “opsuper” is the name of the user that uploaded the file.

    When the confirmation displays that the file was successfully uploaded, click OK.

  9. Click Preview to see the result.

  10. Click Next.

  11. In the next three windows, click Next to bypass the fields (Split, Define, and Filter), which are not necessary for this example.

  12. In the Window Preview window, enter fixed width for the file element name.

  13. In the Continuous Capture window, click Finish.

  14. In the Application Builder, click Save, complete the options, then click Finish.

  15. In the Finish window, under Content tab, in the Name field, enter: fixed width.

    Click Finish.

  16. In the pop-up confirmation window, click OK.





Copyright © 2005. Sybase Inc. All rights reserved. Database element JNDI connection cache option

View this book as PDF