Manifest.xml File

The manifest.xml file describes how the contents of the Hybrid App package .zip file are organized.

This file must reside at the root of the Hybrid App ZIP package. This shows the outline of what the manifest.xml file contains.

Example 1

Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AMPManifest.xsd">
  <ModuleName>…</ModuleName>
  <ModuleVersion>…</ModuleVersion> 
  <ModuleDesc>…</ModuleDesc> 
  <ModuleDisplayName>…</ModuleDisplayName> 
  <ClientIconIndex>…</ClientIconIndex> 
  <InvokeOnClient>…</InvokeOnClient> 
  <PersistAppDomain>…</PersistAppDomain>
  <MarkProcessedMessages>…</MarkProcessedMessages> 
  <DeleteProcessedMessages>…</DeleteProcessedMessages> 
  <ProcessUpdates>…</ProcessUpdates>
  <CredentialsCache>…</CredentialsCache>
  <RequiresActivation>…</RequiresActivation>
  < SharedStorage key> ... </ SharedStorage > 

<TransformPlugin>
<File shared="true">WorkflowClient.dll</File> 
<Class>Sybase.UnwiredPlatform.WorkflowClient.Transformer</Class> 
</TransformPlugin> 
- <ResponsePlugin> 
<File shared="true">WorkflowClient.dll</File> 
<Class>Sybase.UnwiredPlatform.WorkflowClient.Responder</Class> 
</ResponsePlugin>


  <ClientWorkflows>
    <WindowsMobileProfessional>
      <HTMLWorkflow>
        <File>…</File>
        <HtmlFiles>        
          <HtmlFile>…</HtmlFile>        
          <HtmlFile>…</HtmlFile>        
        </HtmlFiles>
      </HTMLWorkflow>
    </WindowsMobileProfessional>
    <BlackBerry>
      <HTMLWorkflow>
        <File>…</File>
        <HtmlFiles>        
          <HtmlFile>…</HtmlFile>        
          <HtmlFile>…</HtmlFile>        
        </HtmlFiles>
      </HTMLWorkflow>
    </BlackBerry>
    <BlackBerry6>
      <HTMLWorkflow>
        <File>…</File>
        <HtmlFiles>        
          <HtmlFile>…</HtmlFile>        
          <HtmlFile>…</HtmlFile>        
        </HtmlFiles>
      </HTMLWorkflow>
    </BlackBerry6>
    <Android>
      <HTMLWorkflow>
        <File>…</File>
        <HtmlFiles>        
          <HtmlFile>…</HtmlFile>        
          <HtmlFile>…</HtmlFile>        
        </HtmlFiles>
      </HTMLWorkflow>
    </Android>
    <iPhone>
      <HTMLWorkflow>
        <File>…</File>
        <HtmlFiles>        
          <HtmlFile>…</HtmlFile>        
          <HtmlFile>…</HtmlFile>        
        </HtmlFiles>
      </HTMLWorkflow>
    </iPhone>
  </ClientWorkflows>

  <ContextVariables>  
    <ContextVariable>
      <Name>…</Name>
      <Value>…</Value>
      <Certificate>…</Certificate>
      <Password>…</Password>
    </ContextVariable>
   </ContextVariables>

   <Metadata version="1"> 
     <Item> 
      <Name>Key1</Name> 
      <Value>Value1</Value> 
     </Item> 
     <Item> 
      <Name>Key2</Name> 
      <Value>Value2</Value> 
     </Item> 
  </Metadata>
  <MatchRules>
    <SubjectRegExp>…</SubjectRegExp> 
    <ToRegExp>…</ToRegExp> 
    <FromRegExp>…</FromRegExp> 
    <CCRegExp>…</CCRegExp> 
    <BodyRegExp>…</BodyRegExp> 
  </MatchRules>
</Manifest>

ModuleName

<ModuleName>SampleActivitiesModule</ModuleName>

The ModuleName defines the name of the Hybrid App package.

ModuleVersion

<ModuleVersion>2</ModuleVersion>

The ModuleVersion defines the version of the Hybrid App package.

ModuleDesc

<ModuleDesc>AMP Sample - Activities Collection</ModuleDesc>

The ModuleDesc provides a short description of the Hybrid App package.

ModuleDisplayName

<ModuleDisplayName>Activities Sample</ModuleDisplayName>

The name of the Hybrid App package that is displayed to the user in the Hybrid App list on the device for Hybrid Apps that are client-invoked. When the Hybrid App package is deployed, you can override the DisplayName specified here with one of your own choosing.

ClientIconIndex

<ClientIconIndex>35</ClientIconIndex>

The index of the icon associated with the Hybrid App package. This icon is shown beside the e-mail message in the device’s Inbox listing instead of the regular e-mail icon. When the Hybrid App package is deployed, you can override the icon that is specified here with one of your own choosing.

InvokeOnClient

<InvokeOnClient>1</InvokeOnClient>

Specifies whether this Hybrid App can be used without an associated e-mail. 1 = true, 0 = false. If 1 is specified, the Hybrid App is shown in the Hybrid App list on the device and can be used without the context of an e-mail message.

PersistAppDomain

<PersistAppDomain>1</PersistAppDomain>

States whether this Hybrid App uses a persistent application domain when the .NET assembly plugin is loaded. 1 = true, 0 = false. By default, it is set to false, meaning an application domain is created and removed every time the plugin is loaded.

MarkProcessedMessages

<MarkProcessedMessages>1</MarkProcessedMessages>

Indicates whether a Hybrid App message shows a visual indication in the Inbox after it has been processed (1 = true, 0 = false).

Note: When a Hybrid App message shows a visual indication that it has been processed, the visual indication disappears if the device is re-registered, or if the device user performs a Refresh All Data action.

DeleteProcessedMessages

<DeleteProcessedMessages>1</DeleteProcessedMessages>

Indicates whether a Hybrid App message is deleted from the mobile device’s Inbox after it has been processed (1 = true, 0 = false).

Note: You cannot set both DeleteProcessedMessages and MarkProcessedMessages to true (1). To set MarkProcessedMessages to true, you must set DeleteProcessedMessages to false (0) as shown:
<MarkProcessedMessages>1</MarkProcessedMessages> 
  <DeleteProcessedMessages>0</DeleteProcessedMessages>

ProcessUpdates

<ProcessUpdates>1</ProcessUpdates>

Indicates whether Hybrid App messages associated with this Hybrid App package that are already delivered to the device can be updated from the server with modified content. (1 = true, 0 = false). By default, this is set to false (0).

CredentialsCache

<CredentialsCache key="activity_credentials>1</CredentialsCache>

Specifies whether a Hybrid App requires credentials (1 = true, 0 = false). Different Hybrid Apps can specify different credentials keys. Hybrid Apps with the same credentials key share that set of credentials. In the case of shared credentials, they are requested only once by the Hybrid App that is launched first.

RequiresActivation

<RequiresActivation key=”shared_activation_key”>1</RequiresActivation>

Specifies whether a Hybrid App requires activation (1 = true, 0 = false). If set to true, the screen defined in the ActivationScreen tag is displayed the very first time theHybrid App is launched, before the default screen is displayed.

If the Activation Screen contains credentials controls (and the Hybrid App requires credentials), the values are updated to the Credentials Cache automatically, without further prompting, with the specified Credentials Screen.

Different Hybrid Apps can specify different activation keys. Hybrid Apps with the same activation key share their activation status. For example, if Hybrid App A and Hybrid App B both specify an activation key of AB (using the key attribute on the RequiresActivation tag), when Hybrid App A gets activated, it also activates Hybrid App B so that when Hybrid App B is invoked for the very first time, its activation screen is not seen; it goes directly to the default screen.

TransformPlugin

<TransformPlugin> <File/> <Class/> </TransformPlugin>

(Optional) If this is defined, the ResponsePlugin tag must also be defined. Describes the server module implemented as a .NET assembly that implements the IMailProcessor interface. This module is responsible for processing the intercepted e-mail message before it gets delivered to the device.

Inner tags

<File shared=”true”>WorkflowClient.dll</File> The path, including the filename of the assembly that implements the IMailProcessor interface. The path is relative to the Hybrid App ZIP package. If the shared property is present and set to true, the DLL is located in the <UnwiredPlatform_InstallDir>\Servers\MessagingServer\bin folder (installed by an external process) and all Hybrid Apps using that DLL will use the same version of the DLL. If the shared property is not present, or is present and is set to false, each Hybrid App will use its own version of that DLL in the Hybrid App’s own folder.

<Class>Sybase.UnwiredPlatform.WorkflowClient.Transformer</Class> The .NET Type in the assembly that implements the IMailProcessor interface.

ResponsePlugin

<ResponsePlugin> <File/> <Class/> </ResponsePlugin>

(Optional) If this is defined, the TransformPlugin tag must also be defined. Describes the server module implemented as a .NET assembly that implements the IResponseProcessor interface. This module is responsible for processing the response from the device.

Inner tags

<File shared=”true”>WorkflowClient.dll</File> The path, including the filename, of the assembly that implements the IResponseProcessor interface. The path is relative to the Hybrid App .zip package. If the shared property is present and set to true, the DLL is expected to be located in the <UnwiredPlatform_InstallDir>\Servers\MessagingServer\bin folder (installed by an external process), and all Hybrid Apps using that DLL will use the same version of the DLL. If the shared property is not present, or is present and set to false, each Hybrid App will use its own version of that DLL in the Hybrid App’s own folder.

<Class>Sybase.UnwiredPlatform.WorkflowClient.Responder</Class> The .NET Type in the assembly that implements the IResponseProcessor interface.

ClientWorkflows

<ClientWorkflows> 
  <WindowsMobileProfessional>
    <HTMLWorkflow>
      <File>…</File>
      <HtmlFiles>        
        <HtmlFile>…</HtmlFile>        
        <HtmlFile>…</HtmlFile>        
      </HtmlFiles> 
    </HTMLWorkflow>
  </WindowsMobileProfessional> 
  <BlackBerry>
    <HTMLWorkflow>
      <File>…</File>
      <HtmlFiles>        
        <HtmlFile>…</HtmlFile>        
        <HtmlFile>…</HtmlFile>        
      </HtmlFiles> 
    </HTMLWorkflow>
  </BlackBerry> 
  <BlackBerry6>
    <HTMLWorkflow>
      <File>…</File>
      <HtmlFiles>        
        <HtmlFile>…</HtmlFile>        
        <HtmlFile>…</HtmlFile>        
      </HtmlFiles> 
    </HTMLWorkflow>
  </BlackBerry6> 
  <iPhone>
    <HTMLWorkflow>
      <File>…</File>
      <HtmlFiles>        
        <HtmlFile>…</HtmlFile>        
        <HtmlFile>…</HtmlFile>        
      </HtmlFiles> 
    </HTMLWorkflow>
  </iPhone> 
  <Android>
    <HTMLWorkflow>
      <File>…</File>
      <HtmlFiles>        
        <HtmlFile>…</HtmlFile>        
        <HtmlFile>…</HtmlFile>        
      </HtmlFiles> 
    </HTMLWorkflow>
  </Android> 
</ClientWorkflows>

This section of the manifest.xml file describes the supported device platforms for the Hybrid App and the corresponding client module to use for each platform.

Inner tags

<File>…</File>

Contains a reference to an XML file. That XML file should have contents similar to this:
<?xml version="1.0" encoding="utf-8"?>
<widget>
  <screens src="html/myAndroidHybridApp.html" default="Start_Screen">
    <screen key="html/myAndroidHybridApp.html">
    </screen>
  </screens>
</widget>

The referenced HTML file must be present in the list of HtmlFiles tags that follow and must also be present in the Hybrid App .zip package.

<HtmlFile>…</HtmlFile>

Indicates that the named file (html/js/API.js, html/myAndroidHybridApp.html) will be used on the specified platform. The referenced file must be present in the Hybrid App .zip package.

ContextVariables

<ContextVariables>...</ContextVariables>

Describes the collection of context variables that will be made available to the methods in the IMailProcessor and IResponseProcessor interfaces. When the Hybrid App package is deployed by the administrator, the Display Name that is specified here can be overriden with one of their own choosing.

<ContextVariables >
<ContextVariable> 
<Name/> 
<Value/> 
<Certificate/> 
<Password/> 
</ContextVariable> 
Describes a context variable that will be made available to the methods in the IMailProcessor and IResponseProcessor interfaces. When administrators deploy a Hybrid App package, they have the ability to override the value of the context variable that is specified here.

It is good practice for developers of Hybrid Apps to provide sufficient documentation so that administrators can knowledgeably edit a context variable’s value as necessary. Context variables are a good place to store configuration information that will likely change between development and production environments.

Inner tags

<Name>OutputFolder</Name> The name of the context variable. This is the key used to retrieve the value of the context variable in the methods defined in the IMailProcessor and IResponseProcessor interface.

Note: The value of the <Name> tag supports single-byte characters only.

<Value>C:\ActivitiesSampleOutput</Value> The value of the context variable. When administrators deploy a Hybrid App, they have the ability to override the value of the context variable that is specified here.

Note: The value of the <Value> tag supports single-byte, double-byte, or both, characters.

<Certificate>false</Certificate> Indicates whether this context variable is a Base64 string representation of an X.509 certificate. If this value is set to true, SAP Control Center displays a dialog specific to selecting an X.509 certificate.

<Password>false</Password> Indicates whether this context variable is a password. If set to true, the value is displayed as asterisks in the SAP Control Center console.

Client Variables

You can define client variables on the server side and retrieve it on the client side by using either native API or JavaScript API. In the JavaScript API, you can call the hwc.getClientVariables(moduleid, version) method to retrieve the client variables.

An optional metadata element in manifest.xml is used to specify clientvariables information. It has a version attribute of integer type to identify and keep track of metadata changes. You can set any positive integer value as the initial version. After the Hybrid App is deployed, each time the metadata gets updated, the version number is increased by one.

<Metadata version="1"> 
 <Item> 
    <Name>Key1</Name> 
    <Value>Value1</Value> 
 </Item> 
 <Item> 
   <Name>Key2</Name> 
   <Value>Value2</Value> 
 </Item> 
</Metadata>

You can update the client variables for a Hybrid App in SAP Control Center, and the change will be pushed to the already deployed clients. The client variables received on the client side are treated as read-only. The client cannot update the client variables.

Similar to server side Hybrid App context variables, client variables are stored as name/value pairs. Both name and value are string type, and the name is case sensitive. The maximum length of the client variable key name is 256 in ANSI code (not Unicode). Although the name is case sensitive, it cannot have the same item names that differ only by case. The metadata item key name cannot be an empty string. The object of a complex type needs to be serialized to string values to set the value.
Note: Due to a limitation on Windows Mobile platforms, the total length of all the client variables (keys and values) cannot exceed 2000 characters.

If the client side variables are updated, the change is applied the next time the Hybrid App is opened.

Similar to context variables, when the Hybrid App package is deployed in SAP Control Center with the option of "Replace," the updated client variables for the old Hybrid App package are not automatically passed to the new Hybrid App package.

MatchRules

<MatchRules>...</MatchRules>

Describes the collection of match rules that are used to determine if a message is sent to a TransformPlugin server module for processing. When administrators deploy a Hybrid App, they have the ability to Add, Delete, and override the Match Rules that are specified here.

<MatchRule>... </MatchRule> Describes a single match rule.

Note: The value of the <MatchRule> tag supports double-byte characters.

Inner tags

<SubjectRegExp>…</SubjectRegExp> The value to test for against the "Subject" line of a message.

<ToRegExp>…</ToRegExp> The value to test for against the "To" line of a message.

<FromRegExp>…</FromRegExp> The value to test for against the "From" line of a message.

<CCRegExp>…</CCRegExp> The value to test for against the "CC" line of a message.

<BodyRegExp>…</BodyRegExp> The value to test for against the <Body> text of a message.