The Share action (highlighted in the screenshot below) enables the end user to share text and images. The text can be sent as HTML or plain text, and it is selected via an XPath expression in the Share action's Text field (see screenshot below). Additionally, text and image attachments can be generated. When the Share action is triggered on the mobile device, the device's sharing options are displayed. (These are the messaging and social-networking apps that are installed on the mobile device.) The end user can then select one of these apps, and proceed as he or she usually would when sharing.
|Note:||The Share action cannot be used on web clients.|
The XPath expressions for these two settings (the message's title and body text) can either be a string or can generate the respective texts from XML page sources.
In the screenshot above, the XPath expression for the Title field is a directly entered string, while the expression for the body text returns the content of the Location/@Geolocation node. This node provides the geolocation coordinates of the mobile device, which were obtained by using the Start/Stop Geo Tracking and Read Geo Data actions (see screenshot above).
Note: On iOS, the HTML/text selection has no effect; some apps might automatically interpret an existing html flag correctly.
Files and images can be attached to the message. You can select one of three options for attachments:
•No attachments (selected by default)
•Attachments listed below
Attachments listed below
This option allows attachments to be created individually. To add a new attachment, click . The screenshot below shows a message with two attachments. To delete an attachment, click its Delete icon.
Each attachment has the following properties:
•Filename (XPath): The filename can have any extension. The filename serves solely as a representation (in the message) of the attachment; it is not an actual path.
•Content (XPath): You can select an XML tree fragment, a single XML node, the text content of one or more nodes, or you can directly enter a string that will be the content of the attached file. The content will be parsed according to the selection in the (next) Content type property.
•Content type (combo box: XML/Base64/Text): If the content type is XML, then the content that is selected via the Content property (previous property) is parsed as XML data: an XML nodeset is expected, and the nodeset will be attached to the email. If the content type is Base64, then Base64-encoded content is expected, and this content is decoded. So, if the content is a Base64-encoding of an image, then an image is generated and attached to the email. If the content type is Text, then text is expected as content, and this text will be attached to the email. Note that the value of the Content property must be readable according to the selection made for the Content type property.
The XPath expression uses the mt-email-attachment XPath extension function to create the attachments.
The tutorial Sharing Geolocations shows how the Share action can be used.
MobileTogether extension functions
MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.