Altova MobileTogether Designer

Editable and read-only data

Data in tree nodes can be editable or non-editable (read-only), depending on whether the tree is that of an editable page source or a read-only page source. Whether a page source is editable or read-only is defined at the time the page source is added. If you wish to change the editable/read-only definition, delete the page source and re-create it with the new definition.

 

Client actions can change the content of editable nodes. For example, if a combo box is associated with a node of an editable page source, the end user's combo box selection will be passed to the associated node and become its modified value. In the case of read-only page sources, the content of associated nodes is used for display purposes only. These associated nodes are known as page source links. A source node link is added to a control by dragging the tree node onto the control.

 

Assigning data to page sources

Data is assigned to nodes (in both editable and read-only data-source trees) in the following ways:

 

Assign a default file: The data in the default file is passed to the nodes of the tree and becomes the content of the nodes. The structure of the default file must be the same as that of the page source tree.

Add node content manually: The context menu of every node has commands that allow the content of the node to be specified (the Ensure exists commands). If the node already has content assigned by another method (such as via a default file), the manually added node content overrides the previously assigned content.

 

Assigning a default file

An XML page source can have a default file assigned to it. The data in the default file will be passed to the page source as its data tree. To assign a default file do the following: Just below the root node name of the page source is an entry for the default file (see screenshot below).

MTPageSrcsNewEmptyXML01

Click the Additional Dialog button to display the Specify File dialog (screenshot below), select the required file, and click OK. The assignment is made and the file path appears in the Default File entry. After a default file has been assigned, you can change the assignment by double-clicking the Default File entry and browsing for the new default file.

 

Data from the default file will be used as the data of the page source. However, in order for the data to be used, the default file must have the same structure as the page source. Note that, when a default file is assigned to a page source, its structure is not automatically imported. To import the structure of the XML file, use the context menu command Import Structure from XML. You can also manually create the structure of the page source to match the structure of the default file.

 

File is located on server

If the default file is located on the server, select the Server radio button (see screenshot below). The dialog now enables you to browse for a file (Absolute/Relative Path) or to specify the file via a global resource (File Alias or Folder Alias). Select the option you want.

MTDSpecifyFileServer

Absolute/Relative Path: You can enter a path, browse for a file, or enter an XPath expression that generates the path to the file. Use the Reset button to remove the current entry. The path can be relative to the design file, or absolute. If the file is deployed to the server along with the design file, then the relative/absolute path specified in the dialog will be used internally (in the server's database) to access the file. If the file is not deployed, then it must be stored in a directory on the server. In this case: (i) if a relative path is selected in the Load From or Save/Specify File dialog, then, at runtime, this relative path will be resolved on the server with reference to the Working Directory (defined in the MobileTogether Server settings); (ii) if the path in the Load From or Save/Specify File dialog is absolute, the file's containing folder on the server must be a descendant of the Working Directory. See the section Location of Project Files for details. You can also choose whether to allow untrusted SSL connections or not, when accessing or saving the file. If the Absolute/Relative Path field is in a dialog to save a file—and not to load a file—you can optionally specify a default file extension; this extension will be used if none is specified with the file name.

 

Automatically create subfolders on file save: If intermediate folders in the file path are missing on the server, they will be created when the file is saved. This option is relevant only when saving; it is absent where the action is restricted to file loading.

 

Allow untrusted SSL connections: A certificate associated with a URL is considered untrusted if it isn’t signed by a trusted root certificate or if it can’t link to a trusted root certificate. If the certificate is signed by a major certificate authority, it just means that one of the chain certificates in between yours and the root is not installed on the web server. If a trusted certificate is expected (for example, because the HTTPS protocol is specified), then selecting this option enables connections also with URLs that have an untrusted certificate.

 

Global Resource File Alias: Select a file alias from the file aliases available in the combo box. The available file aliases will be those currently defined in the Global Resources Definitions file. Each file alias maps to different file resources according to the currently active configuration in MobileTogether Designer (selected via the command Tools | Active Configuration). See the section Altova Global Resources for details.

 

Global Resource Folder Alias with path fragment: Select a folder alias from the folder aliases available in the combo box (see screenshot below).
 
MTDSpecifyFileGRFolderAliases
 

The available folder aliases will be those currently defined in the Global Resources Definitions file. Each folder alias maps to different folder resources according to the currently active configuration in MobileTogether Designer (selected via the command Tools | Active Configuration). The path fragment specifies the rest of the path to the file resource. See the section Altova Global Resources for details.

 

 

File is located on client

If the default file is located on the client, specify the path to it by entering/selecting the location, or by constructing the path with an XPath expression. Use the Reset button to remove the current entry.

MTDSpecifyFileClientNonUserDef

The file to load/save can be specified by you, the designer, or it can be specified by the end user. If you specify the file, then this information will be stored in the solution, and the file will be loaded/saved when the action is triggered. If you choose to let the end user select the file to be loaded/saved, then, when the action is triggered, a browse dialog is opened on the client device and the end user can enter/select the file to load/save.

 

Note:The option to let the end user select the file to load/save is available for the following actions: Print To (Source File and Target File options), Load/Save File, Load/Save Image, Load/Save Binary File, Load/Save Text File, Read Folder, and Get File Info.

 

Note:Files on the client can also be saved to an SD card on the mobile device.

 

Filename is defined below (by the designer of the solution)

 

Default file extension for file saving: When saving files, you can optionally specify a default file extension; this extension will be used if none is specified with the file name.

 

Automatically create subfolders on file save: If intermediate folders in the file path are missing on the client, they will be created when the file is saved. This option is relevant only when saving; it is absent if the action is a file loading action.

 

Device dependent directories: Select the device directory from the dropdown list. On Windows Phone/RT and iOS, the allowed directories are pre-determined. On Android devices, in addition to the directories in the dropdown list of the Android combo box, you can enter any folder you like. On Android and Windows Phone/RT, if you select Default, which is the default selection, the MobileTogether app's sandbox directory is selected. On iOS devices, MobileTogether creates two directories: (i) a Backed-up directory for files that are saved to the iCloud, and which can then be re-downloaded; (ii) a Non-backed-up directory for files that do not need to be backed up. Select Backed-up directory or Non-backed-up directory as required. In web browsers, files are located relative to the browser's sandbox.

 

File locations for simulations: Since files located on the client will not be available during simulations, you can specify a folder that will stand in for the client folder during simulations. Files within this stand-in folder must, of course, have the same names as the files specified in the design. This folder is specified in the Simulation tab of the Options dialog (Tools | Options).

 

Note:  On web clients, files are stored temporarily on the server. They are deleted from there when the server session ends. A server session ends after a specified period of inactivity; this period is defined in the Sessions setting in the Misc pane of the Server Settings tab (see the MobileTogether Server user manual).

 

Filename is defined by the end user (on the client device)

 

Default file extension for file saving: When saving files, you can optionally specify a default file extension; this extension will be used if none is specified with the file name.

 

Optional File Filter: The browse dialog that is opened on the client device will filter the file types to be loaded/saved so that only those file extensions that you have defined are allowed. You can enter: (i) a comma-separated or semicolon-separated list of extensions (for example: txt,html;xml), or (ii) an XPath expression that returns a sequence of string items, where each string item is a file type extension (for example, here is one sequence containing three string items: 'txt','html,'xml').

 

Optional Default File: You can enter a default filename, either directly or via an XPath expression, to guide the end user.

 

Web Message Box: Before the File Open/Save dialog is opened, a message box is displayed. You can enter text directly or via an XPath expression to override the default text of the message box.

 

Automatically create subfolders on file save: If intermediate folders in the file path are missing on the client, they will be created when the file is saved. This option is relevant only when saving; it is absent if the action is a file loading action.

 

Note:  On iOS devices, letting the user select the file on the device works only as an import/export from/to the iCloud; users are not allowed to browse the backed-up folder or non-backed-up folder.

 

Adding node content manually

You can manually add content to individual nodes via two commands in the context menu of the selected node:

 

Ensure Exists Before Page Load (Fixed Value): A fixed string value is added as content of the node and displayed in the tree.

Ensure Exists Before Page Load (XPath Value): An XPath expression provides the content of the node. The XPath expression and Edit XPath icon are displayed in the tree.

 

The node's content is generated before the page is loaded, and the page is passed with this node content to the client.

 

Note that content added manually in this way overrides content added via a default file or with the Ensure Exists on Load commands.

 

© 2017-2023 Altova GmbH