The Workshop Samples Application

The Workshop Samples Application contains a variety of code samples and mini-applications built with Workshop.

To run these samples, you must have WebLogic Server installed on your machine and add a WebLogic Server domain for use with Workshop. This server domain contains runtime libraries required by the application. Follow the instructions below:


Opening the Sample Application

  1. Select File > New > Example.
  2. In the New Example wizard select Workshop WebLogic/Beehive Examples > Workshop Samples Application and click Next.
  3. Next to the Domain home field, click the Browse button, browse to BEA_HOME/workshop_10.3/samples/domains/workshop and click OK.
  4. Click Finish

Sample Contents

The SamplesWorkspace contains the following samples. (For information on the tutorial-based samples, see Tutorial-based Samples.)

Control Samples

Database Control: Customer

Custom Control: Customer

Custom Control: Hello World

Web Service Controls (see Web Service samples below)

Web Application Samples

Hello World Web

Customer Web

Web Service Samples

Synchronous Hello World

Asynchronous Hello World

Secure News Service

Control Samples

Database Control: Customer

Demonstrates a database system control. This control performs basic operations on a database: select, insert, update and delete.

Sample Files

File Role in Sample
SharedControls/src/database/CustomerDBControl.java

Contains methods that create and query the data table PK_CUSTOMER.

This control is used by the Customer Web sample to retrieve customer data. It also works in concert with the Customer Custom Control.

This control extends the DB system control.

Running the Sample

This sample cannot be run independently. Instead run the Customer Web sample to invoke the methods on this control.

Custom Control: Customer

Demonstrates a basic custom control. This control mediates between the Customer Web sample and the Customer database control because its methods wrap the database control methods.

Sample Files

File Role in Sample
SharedControls/src/database/Customer.java

A JavaBean that defines the data structure for the Customer object.

A Customer object instance corresponds to an individual record in the PK_CUSTOMER data table.

An array of Customer objects corresponds to a record set from the PK_CUSTOMER data table.

SharedControls/src/database/CustomerControl.java

The control interface for the Customer control. Contains wrapper methods for the Customer Database Control. These methods perform basic database operations: select, update, insert and delete.

SharedControls/src/database/CustomerImpl.java

The control implementation for the Customer control.

Running the Sample

This sample cannot be run independently. Instead run the Customer Web sample to invoke the methods on this control.

Custom Control: Hello World

Demonstrates a simple custom control with one 'Hello World' method.

Sample Files

File Role in Sample
SharedControls/src/hello/Hello.java

The control interface class.

Contains a single method signature: String hello();

SharedControls/src/hello/HelloImpl.java

The control implementation class.

Running the Sample

This sample cannot be run independently. Instead run the Hello World Web sample to invoke the methods on this control.

Web Application Samples

Hello World Web

Demonstrates a simple web application. This web application contains one page flow (= a controller class + JSP pages). The page flow invokes the Hello World control and displays the result.

Sample Files

File Role in Sample
WebApps/Java Resources/src/helloWorld/HelloWorldController.java

The controller class. This controller class contains one action method, begin(). This method invokes the Hello World control, places the result of the invocation in an action output, and forwards to the index.jsp page.

WebApps/Java Resources/WebContent/helloWorld/index.jsp

This JSP displays the result of the Hello World control invocation. The result data is passed to the page through an action output/page input.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebApps/Java Resources/src/helloWorld/HelloWorldController.java and select Run As > Run on Server.
  3. The index.jsp page will display the results of calling the Hello World control.

Customer Web

Demonstrates a customer data management web application. This web application allows web access to a customer database.

Sample Files

File Role in Sample
WebApps/Java Resources/src/database/DatabaseController.java

The controller class. This controller class contains one action method, getCustomers(). This method invokes the Customer control, places the result of the invocation in an action output, and forwards to the index.jsp page.

WebApps/Java Resources/WebContent/database/index.jsp

This JSP displays the result of the Customer control invocation. The result data (a record set from a database) is passed to the page through an action output/page input.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebApps/Java Resources/src/database/DatabaseController.java and select Run As > Run on Server.
  3. The index.jsp page will display the results of calling the Customer control.

Web Service Samples

Synchronous Hello World

Demonstrates a simple, synchronous web service, web service control, and client.

Sample Files

File Role in Sample
WebServiceClients/Java Resources/src/clients/HelloWorldControlClient.java Client web service for HelloWorld.java (via the intermediary control HelloWorldServiceControl.java)
WebServiceClients/Java Resources/src/controls/HelloWorldServiceControl.java Intermediary control between HelloWorldControlClient.java and HelloWorld.java
WebServices/Java Resources/src/services/HelloWorld.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/Java Resources/src/clients/HelloWorldControlClient.java and select Run As > Run on Server.
  3. In the WebLogic Test Client, click getHelloWorldMessage.

Asynchronous Hello World

Demonstrates an asynchronous web service, web service control, and client.

Sample Files

File Role in Sample
WebServiceClients/Java Resources/src/clients/HWCallbackClient.java Client web service for HWCallback.java (via the intermediary control HWCallbackServiceControl.java)
WebServiceClients/Java Resources/src/controls/HWCallbackServiceControl.java Intermediary control between HWCallbackClient.java and HWCallback.java
WebServices/Java Resources/src/services/HWCallback.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/Java Resources/src/clients/HWCallbackClient.java and select Run As > Run on Server.
  3. In the WebLogic Test Client, enter a value in the name field and click start.

Secure News Service

Demonstrates a secure asynchronous web service, web service control, and client. Features role-based access filters and a secure callback from the base web service to the client.

Sample Files

File Role in Sample
WebServiceClients/Java Resources/src/clients.security/NewsServiceControlCaller.java Client web service for SecureNewsService.java (via the intermediary control NewsServiceControl.java)
WebServiceClients/Java Resources/src/controls/NewsServiceControl.java Intermediary control between NewsServiceControlCaller.java and SecureNewsService.java
WebServiceClients/Java Resources/src/controls/secureCallbackServerNewsServiceService.wsdl WSDL for the web service SecureNewsService.java
WebServices/Java Resources/src/services.security/SecureNewsService.java Base web service for this sample.

Running the Sample

  1. Open the SamplesWorkspace according to these instructions.
  2. Right-click on WebServiceClients/Java Resources/src/clients.security/NewServiceControlCaller.java and select Run As > Run on Server.
  3. In the WebLogic Test Client, enter the username/password pair weblogic/weblogic and click subscribeToNews.

Related Topics

Opening a Sample Workspace


Still need help? Post a question on the Workshop newsgroup. webappsamcust