Adding a Web Application

To add a hosted Web application, you use the Web application adapter, WebApplicationAdapter.

A CCF Web application adapter is an interface that allows Web applications to function with each other or with other functions. A Web application adapter makes it easier to modify the application if you do not have access to its source or permission to change it.


Web application adapters have the following properties:

  • Name – the name of the application that this adapter instance works with.
  • Browser – a reference to the Internet Explorer browser that hosts the Web application.
  • ApplicationInitString – the database XML used to define the application. A developer or administrator can add custom tags that CCF will ignore, but that the adapter can use.

Web application adapters use the following virtual methods. (You can override these methods to allow your code to modify how the application works.)

  • Initialize
  • Close
  • NotifyContextChange – indicates that the session context has changed, and then passes the new context.
  • DoAction – permits the action to be modified before it takes place, and also permits the action to be cancelled.
  • GetStateData – allows the adapter to indicate its current state to CCF. This is used to save the application state in case the agent needs to move to a different desktop.
  • SetStateData – passes state to the adapter so that it can restore a session to its previous condition.
  • SessionChange – indicates that the agent is changing the current session.
  • BeforeNavigate – allows the URL to be modified before it is accessed. This also permits navigation to be cancelled.
  • DocumentComplete – indicates that it is safe to parse the HTML that the browser loaded to use for integration with other CCF hosted applications.
  • OnNewWindow – indicates that the Web page is trying to create a new window (also called a popup). This method passes information about the popup and returns true to permit it or false to prevent the popup from being created. The method can also cause either a new window to be created instead of the popup or for any other browser activity.

Web application adapters use the following methods:

  • AdapterContextChange – allows an adapter to change the context for the entire session.
  • AdapterFireAction – allows an adapter to fire an action (and associated data) for another application.

You can customize the web page content, in a hosted web application, by implementing additional action protocols. CCF provides the following action protocols:

Protocol

Requested URL

Description

CCF

CCF://Target App/Action?<ActionData><ActionData>

The protocol triggers a RequestAction event to the target web application.

CCFCTX

CCFCTX://update/Name1=Value1&Name2=Value2

The protocol adds a name-value pair to current context, and triggers a ChangeContext event


Following is an example of the CCF protocol call from a HTML page:


                    <HTML>
  <HEAD>
    <TITLE>Sample CCF Protocol Call</TITLE>
  </HEAD>
  <BODY
    <A href="ccf://MyApp/MyAction?<GetFocus>true</GetFocus>">Click to execute an action</A></FONT></P>
  </BODY>
</HTML>

                  

In the above example, clicking on the link will initiate the WebApplicationAdapter. The adapter will call the CCF protocol to update a CCF context. You can substitute the CCF protocol with the CCFCTX protocol to execute an action.


Show: