Skip Navigation

com.sabre.redapp.example.cf.webkit.webapp.services Sample

The com.sabre.redapp.example.cf.webkit.webapp.services sample demonstrates a WebKit based app that uses the emulator command intercept and markup JavaScript services. The sample includes the following files:

  • The redapp.xml file registers the EMU_COMMAND service with a command prefix of 1FRA and the EMU_RESPONSE service with a command HOTFRA. The force_focus attribute is set to false for both services.

  • The plugin.xml file passes the ${plugin_resources} variable to display the browser URL from index.html and index2.html.

  • index.html gets the response object and modifies the command to 1MUCKRK.

  • index2.html applies markup instructions to insert a line in the response.

  • json2.js is the JavaScript file.

Running the Sample

  1. Eclipse, import the com.sabre.redapp.example.cf.webkit.webapp.services plug-in into your workspace  and add it to your run configuration.

  2. Launch Sabre Red 360 from your run configuration, and log in with your CERT Sabre ID.

  3. Type any command that starts with 1. The command is intercepted and changed to 1MUCKRK. Note that the default setting for force_focus is false. If the web app is not open, it is automatically opened and gains focus. If the web app is open, focus remains in Sabre emulator.

  4. Type HOTLAX in Sabre emulator. The web app is opened in a new view. The web app marks up the command and inserts a line "This line was inserted by MarkupService" in response shown in Sabre emulator. The default force_focus setting is false, therefore, focus remains on Sabre emulator.