Encoding remote policy responses

You deliver responses from a remote policy servers in an XML document, apart from themes which are transmitted as CSS markup.

You deliver responses from a remote policy servers in an XML document, apart from themes which are transmitted as CSS markup.

In addition to defining the policy values to be returned to MCS, you can specify caching directives that control the period during which MCS will use a local copy of the data without requesting it from the remote source again.

Policy response elements

Responses to requests for single policies can be fulfilled using the XML markup created in the Mobile Portal Toolkit workbench. For details see the schemata marlin-lpdm.xsd and marlin-rpdm.xsd. Sets of policies require the use of the rpdm:policies and rpdm:policyContainer elements, and the declaration of the namespace:

xmlns:rpdm="http://www.volantis.com/xmlns/2011/06/marlin-rpdm"

The rpdm:policies element is a wrapper for a set of remote policies. Within the wrapper each policy in the set must be contained in an rpdm:policyContainer element, where the url attribute is the base URL for the variants in a policy.

<rpdm:policies
  xmlns:rpdm="http://www.volantis.com/xmlns/2011/06/marlin-rpdm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.volantis.com/xmlns/2011/06/marlin-rpdm 
    http://www.volantis.com/schema/2011/06/marlin-rpdm.xsd">
  
  <rpdm:policyContainer url="baseurl">
    
    <lpdm:imageComponent
      xmlns:lpdm="http://www.volantis.com/xmlns/2011/06/marlin-lpdm"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.volantis.com/xmlns/2011/06/marlin-lpdm 
        http://www.volantis.com/schema/2011/06/marlin-lpdm.xsd">
        
      <lpdm:deviceImageAsset value="green_repeater.gif" pixelsX="1" pixelsY="20"
        pixelDepth="1" rendering="monochrome" encoding="gif" 
        assetGroupName="/Q403_PC.mgrp" deviceName="PC"/>
        
    </lpdm:imageComponent>
    
  </rpdm:policyContainer>
  
</rpdm:policies>
Note:

Earlier versions of remote policy schema encoding are currently supported. MCS performs a transform on the XML to render a result compatible with the 3.5 version. The new schema is a version-specific interface that will evolve over time and will not necessary always change in a backwards-compatible manner.

Cache elements

You can use cache elements enclosed by cache-control on all component element types, and to layoutFormat and theme elements. The values of these elements have the same meaning as the default cache attributes in the MCS remote policy cache elements. When provided in a response, they override the MCS remote cache element default values set in the mcs-config.xml file. However, cache performance is still constrained by the cache control values defined in the same file.

Note:

Cache elements are not specific to remote policies, but are currently only supported for remote access. They must be added to policies manually, or by XSL transform.

The table gives the cache element names and descriptions. For further details you should refer to the topic Configuring the policy caches and the related configuration element reference. The corresponding policy cache element attribute names begin with 'default'.

Name Description Type Default Options Use
cache-this-policy Whether or not the policy value should be cached. xs:boolean true   optional 
retain-during-retry Whether or not the cached value should be used during the retry period xs:boolean false   optional
retry-failed-retrieval Whether or not to retry a failed attempt to retrieve the entry. If the value is 'false' the values of retryInterval, retryMaxCount and retainDuringRetry are ignored. xs:boolean false   optional 
retry-interval The period in seconds between attempts to refresh the item. A value of 0 indicates that MCS should attempt to load the value from the remote server. xs:int 0   optional
retry-max-count  The maximum number of times that a failed refresh should be attempted xs:int 0   optional 
time-to-live  The default period in seconds that the cached entry is valid. xs:int     optional 

Related topics