Entering content frame

Procedure documentation Scenario 1: Step 2 – Developer 2 Enhances the Projects Locate the document in its SAP Library structure

In this step, a second developer adds some code to the new projects.

...

Prerequisites

You have started the SAP NetWeaver Developer Studio.

Access and Sync Project Files in the DTR

       1.      To open the Design Time Repository perspective, choose Window ® Open Perspective ® Other ® Design Time Repository.

       2.      To log on to the DTR, choose This graphic is explained in the accompanying text in the toolbar.

       3.      Enter user USER2 and the corresponding password.

TheDTR perspective appears. 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.

       5.      Select the projects folder and choose Sync from the context menu.

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

Note

Open the project node and check whether the files .classpath and .projects exist. If they are missing, you must make the setting for all SAP NetWeaver Developer Studios in the team as described under Scenario 1: Preparation Select Files for Automatic Storage in the DTR.

       6.      Create projects in your file system.

You need projects to be able to edit files.

                            a.      Select folder TaxEAR and choose Create Project from the context menu.

                            b.      Accept the default project name and choose OK.

                            c.      Select folder TaxWeb and choose Create Project from the context menu.

                            d.      Accept the default project name and choose OK.

Edit Files Synced from the DTR

...

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

       2.      Select the TaxWeb project and choose New ® JSP from the context menu.

A dialog window appears.

       3.      Enter the name tax and choose OK.

A dialog window Select Activity appears.

       4.      To create a new activity for your changes, in the dialog choose New.

       5.      Enter Add Content as display name of the new activity.

       6.      Enter a description of the activity if you like and choose OK.

The dialog window Select Activity appears.

       7.      Select the new activity (if necessary) and again choose OK.

A dialog window appears.

       8.      Confirm the file selection with OK.

       9.      Again select the activity Add Content.

The file tax.jsp is now added to the activity, but not yet checked in.

The JSP source appears.

   10.      Switch to the Sourcepane 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>

 

   11.      Save your entries.

   12.      In the J2EE Explorer view, select the TaxEAR project and choose Add Modules from the context menu.

A dialog window appears.

   13.      Select the TaxWeb project in the dialog and choose OK.

A dialog window Check-out for edit appears.

   14.      Confirm the question whether to check out files.

A dialog window appears.

   15.      Select the existing activty Add Content.

Your changes are added to this activity.

Note

Usually, the activities are checked in only after building and testing the sources. After they are checked in, the versions contained in them are available for the team on the server. This is done in the next step.

 

 

 

 

Leaving content frame