Breadcrumb
- Sabre Red 360 Software Development Kit Help
- Desktop Red Apps
- Red App Sample Plug-ins
- com.sabre.redapp.example.cf.webapp.services Sample
com.sabre.redapp.example.cf.webapp.services Sample
The com.sabre.redapp.example.cf.webapp.services sample demonstrates a JavaScript based web app that uses the emulator command intercept and markup services and focus behavior. This sample includes the following files:
-
Activator.java
controls the life cycle of this plug-in. -
The
redapp.xml
file registers the EMU_COMMAND service with a command starting from1LON
and the EMU_RESPONSE service with a command prefix ofHOTLON
. Theforce_focus
attribute is set tofalse
. -
The
plugin.xml
file passes the${plugin_resources}
variable to display the browser URL fromindex.html
andindex2.html
. -
index.html
gets the response object and modifies the command to1MUCKRK
. -
index2.html
applies markup instructions to insert a line in the response. -
json2.js
is the JavaScript file.
Running the Sample
-
In Eclipse, import the com.sabre.redapp.example.cf.webapp.services plug-in into your workspace and add it to your run configuration.
-
Launch Sabre Red 360 from your run configuration, and log in with your CERT Sabre ID.
-
Type any command that starts with 1LON. The command is 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.
-
Click OK on the dialog, and then click on the emulator tab to see the response to the substituted command.
When the force_focus
setting is true
, the web app always gains focus, whether it is opened or not.
-
Type HOTLON in Sabre emulator. The web app is opened in a new view. Dismiss the dialog. The web app marks up the command and inserts a line in Sabre emulator. The default force_focus setting is false, therefore, focus remains on Sabre emulator.
Note
|
You can set the force_focus values to true for the EMU_COMMAND and EMU_RESPONSE services in redapp.xml before you run this sample. Focus moves to the view window when the view is already open.
|