Show TOC Start of Content Area

Procedure documentation Enhancing the Projects  Locate the document in its SAP Library structure

Use

In this step, a second developer (USER2) adds code to the newly created project.

This graphic is explained in the accompanying text

Procedure

Access and Sync Project Files in the DTR

       1.      Open the Design Time Repository perspective.

From the menu path of the SAP NetWeaver Developer Studio, choose Window Open Perspective Other Design Time Repository.

       2.      To log in to the DTR, choose the Log On…button in the toolbar.

       3.      In the dialog that appears, enter USER2 and the corresponding password.

In the Repository Browser view, you will see the folder structure on the DTR server.

       4.      Browse the structure and locate workspace scenario1/tax/dev/projects.

       5.      Select the projects folder and chooseSync from the context menu.

This replicates the projects TaxEAR and TaxWeb to your local file system.

Create projects in your file system

You need projects to be able to edit the files.

...

       1.      Select folder TaxEAR.

       2.      Choose Create Project from the context menu.

       3.      Accept the default project name. Choose OK.

       4.      Select folder TaxWeb.

       5.      Choose Create Project from the context menu.

       6.      Accept the default project name.Choose OK.

Edit Files Synced from the DTR

...

       1.      Open the J2EE perspective and switch to the Project Explorer view.

       2.      Select the TaxWeb project and choose New JSPfrom the context menu.

       3.      In the dialog that appears, enter the name tax and choose OK.

       4.      In the dialog that appears, to create a new activity for your changes, choose New. Enter Add Content as the display name of the new activity.

       5.      Enter a description of the activity and choose OK.

       6.      In the dialog that appears, select the new activity and choose OK. Confirm the file selection with OK.

       7.      Again select the activity Add Content.

The file tax.jsp now is attached to the activity but it is not yet checked in.

The JSP source appears.

       8.      Switch to the Source pane and enter the following code:

<%@ page language="java"%>

<html>

<head>

<title>Tax Calculator</title>

</head>

<body bgcolor="#c8e3ff">

<h1>Simple Tax Calculator</h1>

<form action="tax.jsp" method="POST">

<table border="0" cellspacing="5" cellpadding="5">

   <colgroup>

      <col width="20%" />

      <col width="80%" />

   </colgroup>

   <%

      double income;

      try {

         income = Double.parseDouble(request.getParameter("income"));

      } catch (Exception e) {

         income = 0;

      }

   %>

   <tr>

      <td>Income:</td>

      <td><input name="income" value="<%= income %>" type="text"

         size="30" maxlength="40"></td>

   </tr>

   <tr>

      <td>Tax:</td>

      <td><%=(income * 0.3)%></td>

   </tr>

   <tr>

      <td colspan="2" align="center"><input type="submit"

         value="calculate tax"></td>

   </tr>

</table>

</form>

</body>

</html>

 

       9.      Save your entries.

   10.      In the Project Explorer view, select the TaxEAR project. Choose Modules and from the context menu choose Add/Remove.

   11.      In the dialog that appears, choose the TaxWeb project and choose OK.

   12.      Select the tax.jsp file and from the context menu, choose DTR Edit.

The file is checked out for editing.

Note

Usually, the activities are checked in only after the sources are built and tested. After they are checked in, the versions contained in them are available for the team on the server.

Next Step

Starting the Application

End of Content Area