Skip to content

Working with Web Projects

Web Builder projects are meant to be incorporated into Web or client/server applications. Web Builder provides standardized interfaces of incorporating host data into your applications. The general process is to:

  • Use Web Builder to create the project, making modifications and customizations with Web Builder.
  • Deliver the project to developers who will enhance the Web application or use the Java or .NET objects to access host data.

See Setting HTML 5 Properties for information on deploying these applications.

Deploying a Java legacy Web application

Because Web Builder automatically deploys Web applications to your local Host Integrator Web Server, you can test projects that are under development on your local machine, rather than deploying them to production servers. Use the Project menu to deploy and undeploy a project on your local server.

The Web application, in the form of a WAR file, is copied into the Web server folder:

<VHI install folder>\servletengine\webapps.

To deploy the Web application to the VHI Web Server on a different machine (either UNIX or Windows), manually copy the .WAR file to <VHI install folder>/servletengine/webapps. To deploy the Web application to the VHI Web Server on Windows platforms, manually copy the .WAR file to <VHI install folder>\servletengine\webapps.

During the deployment process the Microsoft User Account Control (UAC) utility prompts you to continue deployment using elevated privileges. Click Continue to dismiss the dialog box and continue deploying the Java Web application.

About the WAR File

A Web archive (.war) file is a convenient way to deploy the generated Web application to any JSP 1.2 compliant servlet engine or application server. A .war file is generated for Web applications in the <documents>\Micro Focus\Verastream\HostIntegrator\projects\<ProjectName>\webapp folder.

Moving the Java Web Application Files to Another Server

To move a Web application to another test or production environment:

Confirm that the deployed application has access to the Host Integrator model:

  • If you created the application using a model in your production environment, the Web application's access information is correct.
  • If you created the application using a model outside your production environment or from an exported XML file, you must correct the appropriate Management, server, and domain statements. You can do this by either:

  • Opening the Web Builder Project Properties dialog box and modifying the connection information. -or-

  • Editing the bean.properties file in the <VHI install folder>\projects\<ProjectName>\javabeans\src\<ProjectName> folder, and rebuilding the project.

Copy the <ProjectName>.war file, following the steps specific to the servlet runner.

Deploying a .NET legacy Web application

Because Web Builder automatically deploys .NET Web applications to your local IIS Server, you can test projects that are under development on your local machine, rather than deploying them to production servers.

During the deployment process the Microsoft User Account Control (UAC) utility prompts you to continue deployment using elevated privileges. Click Continue to dismiss the dialog box and continue deploying the .NET Web application.

A <ProjectName>.sln file is generated in the <documents>\Micro Focus\Verastream\HostIntegrator\projects\<ProjectName>\solution directory. You can use this file to edit the .NET Web application. Other generated files are copied to Inetpub\wwwroot\<ProjectName>.

To move the .NET Web Application Files to another server

Confirm that the deployed application has access to the Host Integrator model:

  • If you created the application using a model in your production environment, the Web application's access information is correct.

  • If you created the application using a model outside your production environment or from an exported XML file, you must correct the appropriate Management server, server, and domain statements. You can do this by either:

  • Opening the Web Builder Project Properties dialog box and modifying the connection information. -or-

  • Editing the <ProjectName>Session object, and rebuilding the project.

  • Verify that the .NET connector (AppConn connector interfaces) is installed on the production server.

  • Copy the <ProjectName> folder from Inetpub\wwwroot to the same location on the production Web server.

  • Configure it as an application using Internet Services Manager.

Using Objects

Providing an object to your host applications enables rapid reuse of the business logic that exists on these hosts. The .NET class library, or Java Beans interface becomes a reusable object for creating portals, Web applications, and other business solutions.

Programmers are able to use their language and development tool of choice because you can use a single Host Integrator model to generate these component interfaces:

.NET Class Library Setup

The Verastream .NET Class Library is a library of classes and interfaces that comply with the Microsoft .NET Framework SDK. You can add this library as a reference in Visual Studio .NET to access host data and functionality.

Prior to using the Verastream .NET Class Library for a production application:

  1. If necessary, rebuild the .NET Class Library project to access the model on the production server:

    • In Web Builder, open the Project Properties dialog box for the project.
    • In the Project Properties dialog box, enter the correct server name.
    • Click Build to regenerate the .NET Class Library using the production server name.
  2. Add the project as a reference in Visual Studio .NET. The <ProjectName>.dll is located in the <documents>\Micro Focus\Verastream\HostIntegrator\projects\<ProjectName>\classlibrary\bin folder.

.NET Class Library Code Example

This example illustrates how to use a Web Builder generated .NET Class Library. The example uses a project named CICSAccts_Class_Library, which generated a .NET Class Library for the CICSAccts model. The GetAccount procedure takes an account number as an input parameter and returns account information.

using System.Data;
using CICSAccts_Class_Library;
// Create an object to represent the session
CICSAccts_Class_LibrarySession session = new CICSAccts_Class_LibrarySession();
// Create an object to hold the filter values
GetAccountFilters filters = new GetAccountFilters();
// Initialize the filters object with the values you want to pass to the host filters.AcctNum = 31415;
// Call the procedure on the session, passing in the filters
DataSet ds = session.GetAccount(filters, null,0);
// Access the data set and process through them
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
  {
  Console.WriteLine(ds.Tables[0].Rows[i]["AcctNum"]);
  Console.WriteLine(ds.Tables[0].Rows[i]["LastName"]);
  //...
  }

Java Beans Setup

Java Bean components, or Beans, are reusable software components that can be manipulated visually in a Java application development tool. Beans can be combined to create traditional applications and incorporated into Web applications as Java servlets.

When you generate, the following files are copied to the <documents>\Micro Focus\Verastream\HostIntegrator\projects\<ProjectName>\javabeans\src\<ProjectName> directory, for each model and its associated procedures:

  • <ProjectName>Session.java
  • <ProcedureName>Filters.java
  • <ProcedureName>Inputs.java
  • <ProcedureName>Record.java
  • <ProcedureName>RecordSet.java

The corresponding class files are located in the bld directory.

Prior to using Verastream Java Beans for a production application:

  1. If necessary, rebuild the Java Beans project to access the model on the production server:

    • In Web Builder, open the Project Properties dialog box for the Java Beans project.
    • In the Project Properties dialog box, enter the correct server name.
    • Click Build to regenerate the Java Beans using the production server name.
  2. Copy the <documents>\Micro Focus\Verastream\HostIntegrator\projects\<projectname>\javabeans folder to the web server.

  3. Change the server's CLASSPATH to include these lines:

    <VHI_install_folder>\lib\java\wcp.jar
    <VHI_install_folder>\lib\java\vhiprop.jar
    <VHI_install_folder>\lib\java\apptrieve.jar
    `<documents>\Micro Focus\Verastream\HostIntegrator;\projects\<projectname>\javabeans\<projectname>.jar
    
    Java Beans Code Example

This example illustrates how to use Web Builder generated Java Beans. The example uses a project named CICSAccts_beans, which generated Java Beans for the CICSAccts model. The GetAccount procedure takes an account number as an input parameter and returns account information.

// Create an object to represent the session
CICSAccts_beans session = new CICSAccts_beansSession();

// Create a bean to hold the filter values
GetAccountFilters filters = new GetAccountFilters();

// Initialize the filters bean with the values you want to pass to the host
filters.setAcctNumber(new Integer (20000));

// Call the procedure on the session, passing in the filters
GetAccountRecordSet recordSet = session.getAccount(filters);

// Access the array of records and process through them

GetAccountRecord[] records = recordSet.getGetAccountRecords();
for (int i = 0; i < records.length; i++)
{
System.out.println(records[i].getAcctNum());
System.out.println(records[i].getLastName());
//...
}