Show TOC Start of Content Area

Procedure documentation Importing the Project Templates for the Web Dynpro Tutorial Locate the document in its SAP Library structure

Use

This tutorial consists of a Web Dynpro project that calls the EJB methods provided with the J2EE quick car rental application over a Web service. Therefore, before you can begin with the tutorial, you need to import both the project for the car quick rental application as well as the Web Dynpro project. These projects are available in the following packages.

·        The J2EE_QuickCarRental project is available with the SAP NetWeaver Developer Studio. It contains the EJB, the dictionary project, and the Web service used by the car rental application.

·        The TutWD_CarRental project is the starting point for the Web Dynpro project used in this tutorial.

You can find both of these initial projects in the example directory for the SAP NetWeaver Developer Studio.

In addition, you can also find the completed project on the SDN. This project contains the quick car rental projects and the Web Dynpro project after completion of this tutorial. See Home ®  Developer Areas  ® SAP NetWeaver Platform  ® Security.

Prerequisites

This graphic is explained in the accompanying textThis graphic is explained in the accompanying text

You know the workspace directory for your SAP NetWeaver Developer Studio.

This graphic is explained in the accompanying textThis graphic is explained in the accompanying text

If you have previously worked on either the J2EE quick car rental project or the Web Dynpro car rental applications using the SAP NetWeaver Developer Studio, then these projects are closed and removed from the SAP NetWeaver Developer Studio workspace.

This graphic is explained in the accompanying textThis graphic is explained in the accompanying text

You know the path to the examples provided with the Developer Studio. In a default installation this path is C:\Program Files\SAP\JDT\eclipse\examples.

Recommendation

This tutorial assumes that you are working with the car rental applications as they are provided with initial projects. Therefore, if you have previously worked on either the J2EE or the Web Dynpro car rental applications and deployed them to the AS Java, we recommend you remove them not only from the Developer Studio’s workspace, but also from the AS Java and start with a completely new set of projects. Note the following:

    When deleting the projects from the Developer Studio, also delete the content from the workspace. Also delete the Dictionary project and the Helperclasses. (Switch to the Navigator to make sure that all projects have been removed.)

    To remove the applications from the AS Java, use the Deploy service in the Visual Administrator. Remove the applications sap.com/QuickCarRentalEar and local/TutWD_CarRental and any of their corresponding components.

    You do not need to remove any entries from the database itself.

Procedure

Importing the project templates into the SAP NetWeaver Developer Studio

...

       1.      Navigate to the location of the examples for the SAP NetWeaver Developer Studio.

       2.      Unpack the J2EE_QuickCarRental.zip and WebDynpro_CarRental.zip archives into the workspace directory for the Developer Studio.

       3.      Start the SAP NetWeaver Developer Studio.

       4.      Switch to the J2EE Development perspective and import the projects from the quick car rental application.

                            a.      To switch to the J2EE Development perspective, choose Window  ® Open Perspective ® J2EE Development.

                            b.      Choose File ® Import.

                            c.      Select Multiple Existing Projects into Workspace and choose Next.

                            d.      In the Select base folder field, enter your workspace directory (or use the Browse... function).

The projects for the car rental application appear. These are Helperclasses, J2EE_QuickCarRentalEar, J2EE_QuickCarRentalEjb, J2EE_QuickCarRentalWeb, QuickCarRentalDictionary and TutWD_CarRental.

                            e.      Select all of these projects. Also select the Open projects after import indicator and choose Finish.

The projects are opened in the SAP NetWeaver Developer Studio.

Note

Depending on your settings, you may receive warnings that apply to the Web Dynpro project. You can ignore these warnings.

       5.      Deploy the dictionary archive to the AS Java.

                            a.      Switch to the Dictionary perspective. (Choose Window ® Open Perspective ® Dictionary.)

                            b.      Choose the Dictionary Explorer.

                            c.      Select the QuickCarRentalDictionary project, open the context menu with the right mouse button, and choose Deploy.

If this is the first time you deploy from the SAP NetWeaver Developer Studio, then you are prompted for the SDM password. Enter this password to continue with deployment.

       6.      Deploy the EAR archive to the AS Java.

                            a.      Switch back to the J2EE Development perspective and the J2EE Explorer.

                            b.      Expand the J2EE_QuickCarRentalEar project.

                            c.      Select the J2EE_QuickCarRentalEar.ear node, open the context menu and choose Deploy to J2EE Engine.

       7.      Deploy the Web Dynpro project to the AS Java.

                            a.      Switch to the Web Dynpro perspective.

                            b.      Expand TutWD_CarRental ® Web Dynpro ®Applications.

                            c.      Select the CarRentalApp node, open the context menu and choose Deploy New Archive and Run.

The Web Dynpro car rental application starts.

Note

If the application does not run, then make sure the AS Java and the SDM are running and that the host and port are correct. Also make sure that the host and port are correct in the model for the Web service (under TutWD_CarRental ® Web Dynpro ® Models ® CarRentalModel ® Logical Ports ®Config1Port_Document).

Initial Project Structure

Once you have imported the project template into the Developer Studio, you will see the following structures in the corresponding views.

Web Dynpro Explorer

Web Dynpro Project Structure

This graphic is explained in the accompanying text Web Dynpro Project: TutWD_CarRental

       This graphic is explained in the accompanying text Web Dynpro Application: CarRentalApp

       This graphic is explained in the accompanying text Web Dynpro Model: CarRentalModel

        This graphic is explained in the accompanying text  Web Dynpro Component: CarRentalComp

J2EE Explorer

J2EE Project Structure

This graphic is explained in the accompanying text J2EE application project: J2EE_QuickCarRentalEar

This graphic is explained in the accompanying text J2EE Enterprise Java Bean project: J2EE_QuickCarRentalEjb

This graphic is explained in the accompanying text J2EE Web project: J2EE_QuickCarRentalWeb

Navigator

The Navigator shows all of the projects, including the helper classes and the dictionary project needed by the quick car rental application.

Navigator

This graphic is explained in the accompanying text Helperclasses

This graphic is explained in the accompanying text J2EE application project: J2EE_QuickCarRentalEar

This graphic is explained in the accompanying text J2EE Enterprise Java Bean project: J2EE_QuickCarRentalEjb

This graphic is explained in the accompanying text J2EE Web project: J2EE_QuickCarRentalWeb

This graphic is explained in the accompanying text Dictionary project: QuickCarRentalDictionary

This graphic is explained in the accompanying text Web Dynpro Project: TutWD_CarRental

Next Step:

Integrating UME Permissions in the Web Dynpro Application - Steps

 

End of Content Area