Skip to main content

com.sabre.redapp.example3.desktop.app.nudge_sampleplugin Sample

Please be aware that Nudge API is available only for Private Red Apps

The com.sabre.redapp.example3.app.nudge sample includes the following functionality:

  • This sample shows how to use Nudge API in the Sabre Red 360

  • com.sabre.redapp.example3.app.nudge.flowextpoint.NgvNudgeInitExtensionPoint - shows how to create nudge for specific air availability search and hotel shopping.

  • com.sabre.redapp.example3.app.nudge.flowextpoint.NgvNudgeActionExtensionPoint - shows how to handle triggered action executeRequestedAction(…​)

Desktop Nudge Models

  • RedAppNudgeItem - specifies desktop nudge item, properties:

    • String message - defines nudge message

    • String icon - defines icon displayed in Nudge, types:

      • "info"

      • "warning"

      • "danger"

      • png icon in BASE64

    • List<RedAppNudgeAction> action - defines action buttons

  • RedAppNudgeAction - specifies action, properties:

    • String id - defines action ID, used to recognized what type of action was triggered (must be unique)

    • String label - defines action button label

Running the Sample

  1. In Eclipse, import the com.sabre.redapp.example3.desktop.app.nudge 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. Sign in to the emulator

  4. Nudge with action in the sample is configured to display for Air Availability and Hotel Shopping where destination is DFW airport, type the command e.g. 1KRKDFW to show Air Availability results.

        The following figure shows Air Availability results with nudge - action button available.

nudge with action button

 

  1. Nudge action Click me! redirects user to new tab and display Sabre main page (http://www.sabre.com)

  2. Go to NgvNudgeInitExtensionPoint.java and find method createNudge() to see how to create nudge.

  3. Go to NgvNudgeActionExtensionPoint.java and find method executeRequestedAction() to see how to handle requested action.

  4. Nudge without action in the sample is configure to display for Air Availability where departure airport is YYZ and destination is DFW airport, type the command 1YYZDFW to show Air Availability results

        The following figure shows Air Availability results with nudge - action button is not available.

nudge without action button