Skip to main content

Sample

Plugin

To use Native API feature you have to create a Red App which will bind your application to SR360. To start, please create empty plugin according to steps described here. This Red App does not need to contain any business logic or even any code. All it needs are few configuration files. Here you will find what needs to be configured.

Below you can see how minimal plugin.xml file should look like. It needs to contribute to com.sabre.edge.cf.redapp and com.sabre.edge.dynamo.nativeapi extension points.

plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<plugin>
  <extension point="com.sabre.edge.cf.redapp"/>
  <extension point="com.sabre.edge.dynamo.nativeapi"/>
</plugin>

 

Next, there is a sample redapp.xml file. It contains multiple service usage authorizations and declares listening for EMU_RESPONSE and com.sabre.redapp.example.webkit.myEvent events . You can also see how 1LASLAX and 1KRKWAW commands interception are configured by declaring Service with EMU_COMMAND name and intercepted command provided as action code. Below you can find an example, so you can adapt it to your needs

redapp.xml:

<CFBundle>
  <RedApp id="example-view-7lkkd5ces">
    <Authorization name="com.sabre.edge.cf.emu.Session"
                   threshold="10" metric="tpm" />
    <Authorization name="com.sabre.edge.cf.emu.ShowInEmulator"
                   threshold="100" />
    <Authorization name="com.sabre.edge.cf.host.Locking"
                   threshold="10" metric="tpm" />
    <Authorization name="com.sabre.edge.cf.emu.ExecuteInEmulator"
                   threshold="10" metric="tpm" />
    <Authorization name="com.sabre.edge.cf.host.AggregatedResponseCommunication"
                   threshold="10" metric="tpm" />
  </RedApp>
    <Service name="EMU_COMMAND" action_code="1LASLAX" />
    <Service name="EMU_COMMAND" action_code="1KRKWAW" />
    <EventListener event_filter="EMU_RESPONSE" state="PRE" />
</CFBundle>

Complete sample project can be found alongside other Sabre Red 360 Software Development Kit samples under com.sabre.redapp.example3.nativeapi.

Client

Sample client application written in C# that communicates with Sabre Red 360 through Native API can be found here.