Skip Navigation

About Website Integration Using Default Implementations

The Sabre Red 360 Software Development Kit has Java classes that you can use to simplify running a website with a known URL in either a default editor or a default view. With this functionality, you add your URL and a single default editor or view class, and you are done. You do not write any Java code. These DefaultWebkitEditor and WebkitView classes automatically embed a browser in an editor or view object for you, however, you must use the default editor and view "as is."

Your web-based application can be HTML app that is embedded in a browser.

Red Apps with any of the following characteristics can use this feature:

  • A Red App points a browser in Sabre Red 360 to a known and specific URL.

  • A Red App includes business logic within a web page.

  • A Red App communicates with other Red AppsSabre data stores, listens for events, or interacts with other services.

Using this technique, a Red App within an editor or a view can interact with other Red Apps if the Red App exposes a service or builds its own bridge to listen for events using a JavaScript bridge. A JavaScript bridge lets Red Apps use the SRWRuntime communications services to access other SRWRuntime functionality, and the bridge also lets Red Apps access OSGi whitelisted services. If you want to use OSGi communication services, however, you must use the default browser components for your editor or view. For information, see the introduction to [access to OSGi Services with JavaScript] and other related topics.

  • A Red App runs a website in either an editor or a view.

  • If a Red App runs in a view, the app must complement the activity in the editor with which it is associated. This can be any editor, including SR360’s Classic Style or Graphical Style display. A Red App must conform to the behavior of views in Sabre Red 360.

  • A Red App can register for complex event listening using JavaScript functions if it uses the default classes for the browser editor or view.

  • A Red App can implement active listening for commands or responses by registering a JavaScript function as a service. This type of Red App must also implement the default browser editor or view classes.

You can add this functionality to any plug-in within a Red App bundle, however, if you are using SRWRuntime communications services, this functionality must be in the main plug-in within a Red App bundle.

The URL

For an editor, the URL is added to the browserURL property in the com.sabre.edge.platform.core.editor.editorApp extension point.

You can specify the URL for a browser editor by using any of the following:

  • A web address that points to a specific website, for example http://www.sabre.com

  • A pointer to a local resource in a plug-in. The resource is defined in the resource that is copied from a file. To use this mechanism, you must also implement functionality that automatically unpacks and copies resources in a plug-in. (For more information, see About Unpacking and Copying Plug-in Resources.)

The pointer is defined with the following variable:

        ${plugin_resources}/someResource.html

  • The location of the resource on a local drive, for example C:/something

For a browser view, the URL is passed in the url property in the com.sabre.edge.platform.core.ui.viewApp extension point.

Constraints

If you use this functionality, your web app cannot do the following:

  • Customize the browser editor or a view

  • Handle the life cycle of the editor

  • Dynamically create a URL at runtime

When to Use a Custom Implementation

If you want to customize the browser or editor, display more than a browser, or add complex business logic to handle the editor, you must write your own editor wrapper and use Java code. For information, see Website Integration Using a Custom Implementation of an Editor.