Unwired Accelerator allows 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. For example:
Delimited columns – data separated by commas, tabs, semicolons, colons, or spaces. Typically, delimited columns are in a .csv extension, which you can create when you save the contents of a spreadsheet application.
Fixed-size columns – data arranged in columns of a fixed size. Files with fixed-size columns can be saved and uploaded with a .txt extension.
Using either file type, you can create an application element that uses the grid-rule functionality of Unwired Accelerator.
Unwired Accelerator 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. For the changes to take effect, you must upload the application again.
Creating 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, semicolons, colons, or spaces to separate data.
Use a spreadsheet application to create a four-column table in a spreadsheet program with the following content:
Save the content as a comma-delimited file in a temporary directory, with the name data.csv; for example, C:\temp\data.csv.
From the Mobile Application perspective, select File | New | Mobile Application.
When the Mobile Application wizard appears, select the Launch Element wizard, then select File from the Element Type drop-down list, and click Finish.
Alternatively, right-click the Mobile Application status folder in which you want to create the mobile application, and select Create (status name) Mobile Application With | File Element. You can also drag the data.csv file into the definitions element section and drop (Or drag the data.csv file and drop on a mobile application status folder).
Complete the File Element Definition options:
File To Upload – enter the full path or Browse to the file name of your source data (C:\TMP\data.csv).
If you upload a file with the same name as a previously uploaded file, the second file overwrites the first, unless you create a subdirectory below the upload directory and upload the second file to the subdirectory.
You cannot import or export a file mobile application across servers. See Importing and Exporting Mobile Application Elements.
Destination Location – accept the default location, which is created automatically.
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\masuper, where "x" is the drive where the temporary directory is located, and "masuper" is the name of the user that uploaded the file.
When the confirmation displays that the file was successfully uploaded to the Unwired Accelerator server, click OK.
File Name – leave blank. This field is automatically filled in once you click Upload.
Delimited, Fixed Width – reflects how source file content is arranged—data separated by a delimiter (such as a comma), or data arranged in fixed-sized columns.
For this example, select Delimited.
Delimiter – select the delimiter used in the source data file. Select "Comma."
Merge Repeated Delimiters – whether repeated delimiters should be replaced with a single delimiter. This is useful if your source data includes blank columns. For this example, leave this unselected.
Text Quoter – specifies the quote character that is used to define a section of "as is" text that may include delimiters. Accept the default.
Click Preview to see the result.
Click Next.
Click Next in the Rules window, which is not necessary for this example.
Creating 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.
Use a text editor to create a four-column table with the following content:
Verify that the number of spaces between each column is the same; for this example, place 9 spaces between each column.
Format the text using a monospaced font—for this example, select Lucinda Console.
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.
From the Mobile Application perspective, select File | New | Mobile Application.
When the Mobile Application wizard appears, select Launch Element wizard, select File from the Element Type drop-down list, and click Finish.
Alternatively, right-click the Mobile Application status folder in which you want to create the mobile application, and select Create (status name) Mobile Application With | File Element. You can also drag the data.txt file into the definitions element section and drop (Or drag the data.txt file and drop on a mobile application status folder).
Complete the File Element Definition options:
File to Upload – enter the full path and file name of your source data (C:\temp\data.txt), or click Browse to locate the file.
If you upload a file with the same name as a previously uploaded file, the second file overwrites the first, unless you create a subdirectory below the upload directory and upload the second file to the subdirectory.
You cannot import or export a file mobile application across servers. See Importing and Exporting Mobile Application Elements.
Delimited, Fixed Width – reflects how the source file content is arranged—data separated by a delimiter (such as a comma), or data arranged in fixed-sized columns.
For this example, select Fixed Width.
File Name – leave blank. This field is automatically filled in once you click Upload.
Destination Location – accept the default location, which is created automatically.
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\masuper, where "x" is the drive where the temporary directory is located, and "masuper" is the name of the user that uploaded the file.
When the confirmation displays that the file was successfully uploaded to the Unwired Accelerator server, click OK.
Columns (comma separated) – indicates where to place the columns for the data source; for this example, 0, 9, 18, 27 (this indicates that each column has nine spaces between it and the next).
Click Preview to see the result.
Click Next.
Click Next in the Rules window. Click Finish.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com