Configuring LiveView to Use LiveView Web

This topic describes how to configure your LiveView projects in StreamBase Studio to support using TIBCO LiveView™ Web clients.

TIBCO LiveView Web

TIBCO LiveView™ Web is a browser-based application that allows you to create a rich display of cards that visualize data from queries and to create actions against a running LiveView server. It displays data in a variety of real-time charting formats, and supports extensions such as custom visuals using JavaScript. Cards are created and laid out in pages, with each card presenting the results of a continuous query against the LiveView server in a variety of visualizations and data displays.

LiveView Web is implemented by adding a WAR file, lvweb.war, to your LiveView project:

  • You can specify adding the WAR file at project creation time, when you create your LiveView project in StreamBase Studio.

  • You can add the WAR file to an existing project.

  • You can upgrade the version of the LiveView Web WAR file to a licensed version newer than the one included with the TIBCO LiveView™ Web Standard Edition bundled with LiveView.

Adding LiveView Web at Project Creation Time

By default, the lvweb.war file is added to all new LiveView Fragment project types at project creation.

When you run the File>New>StreamBase Project wizard and select the LiveView Fragment project type, a property of that project creation type specifies adding the lvweb.war file to the project.

To control this, click Next twice in the wizard to get to the Archetype Properties panel. As shown in the following example, the default setting of the lvweb property is true.

If you are certain that you do not want LiveView Web client functionality in your new LiveView project, you can change the value of lvweb to false.

With this setting set to true, Maven retrieves the lvweb.war file from the repository delivered with LiveView, and places it into the src/main/liveview/lv-user-webapps folder of the newly created project. You may have to refresh the project folder to see the file in place.

Adding LiveView Web to an Existing Project

You can add the lvweb.war file to an existing LiveView project.

Follow these steps:

  1. First, check whether the project is already LiveView Web-enabled. Do this by opening the StreamBase Studio project folder src/main/liveview/lv-user-webapps for your project, and looking for the file lvweb.war.

    Note

    You may have to right-click and select Refresh to get the folder and file to appear.

  2. If the lvweb.war file or the lv-user-webapps subfolder is not present, then select the folder name for your LiveView project in the Project Explorer view. Right-click and select Maven>Add Dependency from the context menu. This opens the Add Dependency dialog.

  3. Type lvweb in the Enter groupId search field. This should locate the lvweb.war file in the local on-disk repository installed with StreamBase.

  4. Open the com.tibco.ep.lvweb folder. Select the [war] file listed there.

    (If you see more than one version listed, select the latest version you are licensed to use. Do not select any version listed as "lastUpdated".)

  5. If the Version field is empty after making the [war] selection, fill in the field with the version number shown in the line you selected in the Search Results.

  6. In the Scope drop-down, select provided.

  7. Click OK. If the project's pom.xml file is open in the POM Editor, make sure it is saved.

  8. This causes Studio to configure the project and to retrieve the WAR file from the repository delivered with LiveView, placing it in the src/main/liveview/lv-user-webapps folder of this LiveView project. Watch the status bar in the lower right of the Studio window for progress messages.

  9. When the progress messages end, select the project's name in the Project Explorer view. Right-click and select Refresh.

  10. Confirm that lvweb.war is now in the src/main/liveview/lv-user-webapps folder.

  11. Now when you run this project in Studio as a LiveView Fragment, you can point your browser to a URL such as http://localhost:10080/lvweb to see the LiveView Web client view of the server. What you see depends on the security features enabled in your LiveView fragment project:

    • If your LiveView project is security-enabled (as Studio's LiveView Web sample is), then you see a login page. If you have not yet configured user names and passwords for your project, you can log in with admin/admin or guest/guest.

    • If your LiveView project is not security-enabled, and you have not yet configured a dashboard and cards, then you see an initially blank dashboard.

You can specify the StreamBase and LiveView ports used by the project by editing its Run Configuration or by providing a configuration file.

Updating the LiveView Web Version for a Project

The version of TIBCO LiveView™ Web Standard Edition bundled with the current release of TIBCO LiveView is shown in the LiveView Web Version row of the Supported Configurations page of the StreamBase Installation Guide.

LiveView Web is released on a different schedule than TIBCO LiveView. You may wish to use the lvweb.war file from a newer or older release of LiveView Web than the one bundled with LiveView. Of course, use only the versions you are licensed to use.

Note

If you hope to bypass this procedure by manually copying a different release's lvweb.war file into your project's lv-user-webapps folder without the other steps below, you will find that Maven restores the file version shipped with StreamBase in the next Maven>Update Project command, or on reopening Studio. This entire procedure is designed to prevent that action.

Follow these steps:

  1. Install the different release of LiveView Web using the instructions included with its download package.

    Tip

    On Windows, make a note of the installation location of LiveView Web, which by default is in a hidden folder. When the installer prompts you to confirm the location during installation, you can copy the proposed installation folder to the system clipboard, then paste that path name to a text editor page for reference in the next step.

  2. You must install the lvweb.war file into your local Maven repository, which is usually the ~/.m2 folder of your system home directory. There are two ways to do this:

    In either case, the fields to specify are described in the following table:

    Parameter Name Value
    file [Absolute path to the replacement lvweb.war on your system. Example for Windows:]

    "C:\Users\sbuser\AppData\Local\TIBCO Software Inc\LiveView Web 1.4\lvweb.war"

    [Example for macOS using command-line mvn (must escape the spaces with backslashes)]

    /Users/sbuser/Applications/TIBCO\ LiveView\ Web\ 1.4.1/lvweb.war

    [Example for macOS using a launch configuration (do NOT escape the spaces)]

    /Users/sbuser/Applications/TIBCO LiveView Web 1.4.1/lvweb.war

    groupId com.tibco.ep.lvweb
    artifactId lvweb
    version [version of the replacement LiveView Web, such as 1.4.1]
    packaging war
    generatePom true

    For reference on macOS, the following shows a mvn install:install-file command to install the WAR file for LiveView Web 1.4.1. The example is shown on multiple lines for clarity, but must be entered as one long command.

    mvn install:install-file 
      -Dfile=/Users/sbuser/Applications/TIBCO\ LiveView\ Web\ 1.4.1/lvweb.war
      -DgroupId=com.tibco.ep.lvweb
      -DartifactId=lvweb 
      -Dversion=1.4.1 
      -Dpackaging=war
      -DgeneratePom=true
    

    For reference on Windows, the next example shows the mvn install:install-file command:

    mvn install:install-file 
      -Dfile="C:\Users\bwright\Appdata\Local\TIBCO Software Inc\LiveView Web 1.4\lvweb.war" 
      -DgroupId=com.tibco.ep.lvweb
      -DartifactId=lvweb 
      -Dversion=1.4.1 
      -Dpackaging=war
      -DgeneratePom=true
    

    If you are using the launch configuration method to Maven-install the replacement WAR file, fill in the Goals field as shown here. To fill in the Base directory field, click Workspace, which shows you a list of the projects in your current Studio workspace. Select the project you are updating with this procedure.

    Fill in the middle section of the launch configuration dialog like this example:

  3. Rebuild the index for your local repository. Follow these steps:

    1. Select the Maven Repositories view. (If this view is not already in your current Studio perspective, open it with Window>Show View>Other, then Maven>Maven Repositories.)

    2. Open the Local Repositories folder.

    3. Select the Local Repository entry.

    4. Right-click and select Rebuild Index from the context menu.

    5. Watch for status messages in Studio's status bar in the lower right. This command sometimes does not start a rebuild on first invocation. If the command returns very quickly with no status messages, re-run the Rebuild Index command.

    6. Watch for Studio status bar messages. The command should take 5 to 15 seconds with dozens of status messages and possibly a dialog box or two.

  4. Disable the existing Maven dependency for this project on the lvweb.war version shipped with StreamBase:

    1. Double-click to edit the pom.xml file for your project.

    2. Open the Dependencies tab.

    3. Select the lvweb : war line.

    4. Click Remove.

    5. Save the pom.xml file.

  5. Remove the existing lvweb.war file that ships with StreamBase from this project. Open the src/main/liveview/lv-user-webapps folder, select the existing lvweb.war file, right-click and select Delete from the context menu.

  6. Select the folder for your LiveView project in the Project Explorer view. Right-click and select Maven>Add Dependency from the context menu. This opens the Add Dependency dialog.

  7. Type lvweb in the Enter groupId search field. This should locate projects with lvweb in their classnames in the local on-disk repository installed with StreamBase.

  8. Open the com.tibco.ep.lvweb folder. Select the newly installed [war] file listed there. The image above shows a selection of the WAR file for LiveView Web 1.3.2.

    (If you see more than one version listed, select the latest version you are licensed to use. Do not select any version listed as "lastUpdated".)

    Important

    On macOS, the newly added JAR file should now appear in the list of versions, as shown in the image above.

    On Windows, the newly added JAR file may still not appear in the Maven>Add Dependency dialog even after a successful index rebuild. In this case, if you saw a BUILD SUCCESS message when you installed the file, then it is safely installed. You can select an existing [war] file in the list to get it to fill in the Group Id and Artifact Id fields for you. Then type or overwrite manually the number of the version you successfully installed into the Version field.

  9. If the Version field is empty after making the [war] selection, fill in the field with the version number shown in the line you selected in the Search Results tree view.

  10. In the Scope drop-down, select provided.

  11. Click OK. If the project's pom.xml file is open in the POM Editor, make sure it is saved.

  12. Right-click your project in the Project Explorer view and from the context menu, select Maven>Update Project. If you do not see status messages in Studio's status bar and a dialog from Studio, run the command again until you do.

  13. Select the project's name in the Project Explorer view. Right-click and select Refresh.

  14. Confirm that an lvweb.war file has returned to the src/main/liveview/lv-user-webapps folder. However, this does not show the version number.

  15. Close any browser tabs that may be currently showing LiveView Web pages from this project. You may also have to clear your browser's file and data cache.

  16. Run this project in Studio as a LiveView Fragment. The version of LiveView Web in use shows up as a message in the Console view.

  17. To confirm that the new LiveView Web version is in place, point your browser to a URL such as http://localhost:10080/lvweb to see the LiveView Web client view of the server. (The port may differ for your project, depending on the ports you have specified to use.) What you see depends on the security features enabled in your LiveView fragment project:

    • If your LiveView project is security-enabled (as Studio's LiveView Web sample is), then you see a login page that includes the LiveView Web version number. If you have not yet configured user names and passwords for your project, you can log in with admin/admin or guest/guest.

    • If your LiveView project is not security-enabled, and you have not yet configured a dashboard and cards, then you see an initially blank dashboard. The LiveView Web version number in use shows in the lower right corner.

You must perform these steps for every LiveView fragment project in which you want to use a LiveView Web version different from the one shipped with StreamBase.