HP Anywhere API Reference
App Descriptor XML

The descriptor file identifies your App to the HP Anywhere server. Add the descriptor file under the web resources, for example: at {PROJECT_HOME}\<myAppName>\<myAppName>-web\src\main\resources\<myAppName>-descriptor.xml

You do not need to define the development framework's resources in this file, as HP Anywhere automatically downloads these to the user device.

Fields in the Descriptor XML

Element Description
serviceName attribute of AppDescriptor element

The ID of the App service described by this descriptor.

This serviceName must be the same as the Spring bean implementation of AbstractBTOServiceEE.

For example, if the App has:
@Service("NOTES")
public class NotesApp extends AbstractBTOServiceEE
then the serviceName value is <AppDescriptor serviceName="NOTES">

The same serviceName is also the ID of the App to be triggered in the js file.

apiVersion

The version to be used by the server when accessing the App Rest API.

The apiVersion will be used in the future to support Apps that were compiled in the legacy App-framework-rest.

AppVersion

The version of the App.

The AppVersion will be used in the future to differentiate between different versions of the same App deployed for different customers.

vendorId The App vendor ID to be displayed in the catalog.
AppRootContext The name of the root context where the service resides. For example, for sample-notes-web.war the context root is sample-notes-web.
webResources webResources defines the App supported clients and the files to be downloaded to client. For each form factor, define the required js file names
formFactor The supported form factors are DESKTOP,SMARTPHONE, and TABLET.
jsName JavaScript path name of the App to be injected to the client side. The path is relative to the root context.
cssName CSS path names for the App to be injected to the client side. The path is relative to the root context.
hasSummaryData True when implementing the summary data JS API. If true, the App summary is displayed under the MyApps tab in the HP Anywhere client.
isOfflineSupported True when offline mode is supported for the App and users can log on and work with the App when the device is not connected to the network.
cache

(Relevant only for DESKTOP form factor)

Specifies if a resource is cached per version or forever.
perVersion (default): The resource is updated every time the app version is updated. Use for your app files and any files that you want to change for each version.  
forever: The resource remains unchanged regardless of app version updates.
To update the resource, use a different name, for example, replace <jsName cache=”forever”>lib/jquery.1.8.js</jsName> with <jsName cache=”forever”>lib/jquery.1.9.js</jsName>.

 

Example: Notes App descriptor file
Copy Code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<miniAppDescriptor serviceName="NOTES">
    <apiVersion>1.0</apiVersion>
    <miniAppVersion>1.0</miniAppVersion>
    <vendorId>HP</vendorId>
    <connectionDetails>
        <miniAppRootContext>sample-notes-web</miniAppRootContext>
    </connectionDetails>
    <webResources>
        <webResource>
            <formFactor>DESKTOP</formFactor>
            <jsNames>
                <jsName cache="forever" >sdk/sencha-touch-all.js</jsName>
                <jsName>app-all.js</jsName>
            </jsNames>
            <cssNames>
                <cssName>resources/css/app.css</cssName>
                <cssName cache="forever">sdk/resources/css/sencha-touch.css</cssName>
            </cssNames>
            <isSencha>false</isSencha>
        </webResource>
        <webResource>
            <formFactor>SMARTPHONE</formFactor>
            <jsNames>
                <jsName>sdk/sencha-touch-all.js</jsName>
                <jsName>app-all.js</jsName>
            </jsNames>
            <cssNames>
                <cssName>resources/css/app.css</cssName>
                <cssName>sdk/resources/css/sencha-touch.css</cssName>
            </cssNames>
            <isSencha>false</isSencha>
        </webResource>
        <webResource>
            <formFactor>TABLET</formFactor>
            <jsNames>
                <jsName>sdk/sencha-touch-all.js</jsName>
                <jsName>app-all.js</jsName>
            </jsNames>
            <cssNames>
                <cssName>resources/css/app.css</cssName>
                <cssName>sdk/resources/css/sencha-touch.css</cssName>
            </cssNames>
            <isSencha>false</isSencha>
        </webResource>
    </webResources>
    <hasSummaryData>true</hasSummaryData>
   <isOfflineSupported>true</isOfflineSupported> 
</miniAppDescriptor>