Executing the wccLoginManagedHub Application

After setting up the wccLoginManagedHub application, and starting the web server, you can execute the sample application using the URLs described in this topic.

There are four URLs used in this sample application. They are each described below.

simpleLogin URL

http://wccloginmanagedhubmainsource:9090/wccLoginManagedHub/simpleLogin.html

This URL opens the simpleLogin WCC application, which displays the Login component:

The postLogin function for the simpleLogin sample application has been modified to open another browser window that points to the IframeContainerTest.html file, as follows:

classProto.postLogin = function() {
   this.jsxsuper();
   var extUrl =    'http://wccloginmanagedhubmainsource:9090/    wccLoginManagedHub/IframeContainerTest.html';
   var windowRef = window.open(extUrl, 'TestWindow');
};

See:

...\Samples\wccLoginManagedHub\JSXAPPS\simpleLogin\application\js\Application.js

IframeContainerTest URL

http://wccloginmanagedhubmainsource:9090/wccLoginManagedHub/IframeContainerTest.html

This URL, which is launched from the postLogin() function in the simpleLogin application, displays a new browser window that allows you to choose a login option, as well as choose whether to load either an Organization Browser component or an EventViews/EventViewer component in an iframe:

The Login Option selections are used to choose the login option, as follows:

  • Use Cached Login - This option causes the publishExternalLogin() function to be called, which causes the login to be cached by the ManagedHub.

    WCC applications are loaded into the IframeContainer asynchronously. If the iFrameContainer.publishExternalLogin method is called before the WCC application completes loading, the PageBus message is cached and the event is received by the WCC application as soon as it completes loading.

  • Use externalLogin URL Param - This option causes “?externalLogin=true” to be appended to the URL. This results in the application being initialized with the user name of the currently authenticated HTTP session.
  • Show Login Button - This option causes the Publish External Login to Iframe button to be displayed when either the Load Iframe: Org Browser or Load Iframe: Event Viewer button is clicked.

    The Publish External Login to Iframe button calls the publishExternalLogin() function to complete the login.

The buttons below the Login Option selections are used to create the iFrameContainer, as follows:

  • Load Iframe: Org Browser - This button creates a com.tibco.wcc.components.IframeContainer that is set up to load the simpleOrgBrowser WCC application.

    If either the Use Cached Login or Use externalLogin URL Param login option had been selected, the IframeContainer is directly loaded with the simpleOrgBrowser application.

    If the Show Login Button login option was selected, after the IframeContainer is loaded, the Publish External Login to Iframe button is displayed. Clicking this button calls the publishExternalLogin method to complete the external login, causing the simpleOrgBrowser application to be loaded.

    See simpleOrgBrowser URL.

  • Load Iframe: Event Viewer - Clicking this button creates a com.tibco.wcc.components.IframeContainer that is set up to load the simpleEventViewer WCC application.

    If either the Use Cached Login or Use externalLogin URL Param login option had been selected, the IframeContainer is directly loaded with the simpleEventViewer application.

    If the Show Login Button login option was selected, after the IframeContainer is loaded, the Publish External Login to Iframe button is displayed. Clicking this button calls the publishExternalLogin method to complete the external login, causing the simpleEventViewer application to be loaded.

    See simpleEventViewer.

simpleOrgBrowser URL

http://wccloginmanagedhubiframesource:9090/wccLoginManagedHub/simpleOrgBrowser.html

This is the WCC application that is loaded into the IframeContainer when the Load Iframe: OrgBrowser button is clicked. This application contains an OrganizationResourceBrowser component (which is a composite component containing the wccOrganizationBrowser and wccOrganizationResourceList components).

The postLoadInit function for this application creates an instance of the com.tibco.wcc.components.IframeClient:

classProto.postLoadInit = function(path) {
   this.jsxsuper();
   this.iFrameClient = new
com.tibco.wcc.components.IframeClient(this);
};

By creating the IframeClient instance, a subscription to the ManagedHub is set up for the externalLogin event. This results in the login being initialized for the application and the postLogin method is called, which then renders the wccOrganizationResourceBrowser component:

classProto.postLogin = function() {
   this.jsxsuper();
   jsx3.GO('wccOrganizationResourceBrowser').render();
};

See:

...\Samples\wccLoginManagedHub\JSXAPPS\simpleOrgBrowser\application\js\Application.js

simpleEventViewer

http://wccloginmanagedhubiframesource:9090/wccLoginManagedHub/simpleEventViewer.html

This is the WCC application that is loaded into the IframeContainer when the Load Iframe: EventViewer button is clicked. This application contains a wccEventViews and a wccEventViewer component.

The postLoadInit function for this application creates an instance of the com.tibco.wcc.components.IframeClient:

classProto.postLoadInit = function(path) {
   this.jsxsuper();
   this.iFrameClient = new
com.tibco.wcc.components.IframeClient(this);
};

By creating the IframeClient instance, a subscription to the ManagedHub is set up for the externalLogin and externalShowEvents events. The externalLogin results in the login being initialized for the application and the postLogin method is called, which then renders the wccEventViews component:

classProto.postLogin = function() {
   this.jsxsuper();
   jsx3.GO('wccEventViews').render();
};

See:

...\Samples\wccLoginManagedHub\JSXAPPS\simpleEventViewer\application\js\Application.js

The publishExternalShowEvents method publishes the externalShowEvents event. This event is handled by the IFrameClient, which calls the showEvent Tools Interface method to publish the application local event, which the EventViewer component subscribes to by default. When it receives the event, the EventViewer component creates a temporary event view, based on the parameters passed in the publishExternalShowEvents method, and adds the view to the event view list. (For information about the showEvent method, see showEvents

The publishExternalShowEvents method is located in IframeContainer.js in the following directory:

StudioHome\wcc\version\JSXAPPS\components\application\js\

where:

  • StudioHome is the directory in which TIBCO Business Studio was installed.
  • version is the version number of Workspace that was installed with TIBCO Business Studio.

For more information about the publishExternalShowEvents method, see Using the TIBCO PageBus Managed Hub with WCC Components.