Show TOC Start of Content Area

Procedure documentation Creating Public Parts for the Development Components  Locate the document in its SAP Library structure

Use

In this step, you create and configure two new public parts. You use them to publish the different development components. The public parts are:

      api

Public part against which the other components can compile.

      tax

Public part used for assembling a runtime archive that contains the full set of classes. In addition, this public part will be used to wrap this library with a deployable J2EE library.

For more information about the purpose of the public parts, see Purposes of Public Parts.

Prerequisites

You are working in the Java perspective Java DC Explorer view.

Procedure

Creating a New Public Part api

You add a public part to the development component (DC) by publishing the classes ITaxCalculator and TaxFactory.

Step 1: Create a new public part api

...

       1.      Go to the Java perspective Java DC Explorer view.

       2.      Open your DC node to add the public part.

       3.      Open the MetaData node and select the node Public Parts.

       4.      From the context menu, choose New Public Part...

       5.      In the dialog that appears, specify api as the name of the new public part.

       6.      Select the radio button Provides an API for developing/compiling other DCs.

       7.      Enter API of the Tax Calculator as the caption. Choose Finish.

       8.      In the dialog that appears, confirm that you want to add the new file to the DTR repository. Choose OK.

       9.      Select the activity New Java Component, if necessary, and choose OK.

Step 2: Add entries to the public part api

...

       1.      Open the Public Parts node in Java DC Explorer view.

You see a new entry named api.

       2.      Select api Entities and from the context menu, choose Edit Entities...

A dialog window Input Help: Entities appears.

       3.      Select Java Class in the Select Entity Type tree and mark the checkboxes of the following entries in the hierarchical display:

                            a.      ITaxCalculator

                            b.      TaxFactory.

       4.      In the section Add Entity to Public Part, select the entry as Class and confirm with Finish.

You have added the ITaxCalculator and TaxFactory to the public part.

Step 3: Build the DC locally

...

       1.      From the context menu of your DC, choose Development Component Build...

       2.      On the dialog that appears, select your project node and choose OK.

An archive for the selected DC is created.

Creating a New Public Part tax

Step 1: Create a new public part tax

...

       1.      Open the node DC MetaData and select Public Parts.

       2.      Open the context menu and choose New Public Part.

       3.      In the dialog that appears, specify tax as the name of the new public part.

       4.      Select the radio button Can be packaged into other build results (e.g.SDAs).

       5.      Specify Tax Calculator Library as the caption. Choose Finish.

       6.      On the dialog that appears, confirm that you want to add the new file to the DTR repository by choosing OK.

       7.      If you do not use a default activity, select the New Java Component activity and choose OK.

In the Java DC Explorer view under the Public Parts node you have created a new public part tax.

Step 2: Add entries to the public part tax

...

       1.      Select the Entities node of tax. From the context menu, choose Edit Entities…

       2.      In the dialog that appears, from the Select Entity Type list, select the entry Java Package Tree.

       3.      In the Select Entities tree, select the entry org.

       4.      In the section Add Entity to Public Part, select the entry as Class.

       5.      To confirm your entries, choose Finish.

You have added the package tree to the public part. You can now see the entries under the Entities node.

Step 3: Build the DC locally

...

       1.      From the context menu of your DC, choose Development Component Build...

       2.      On the dialog that appears, select your project node and choose OK.

An archive for the selected DC is created.

Result

You have created the public parts of the development component and added the required entries to them.

You have built two archives:

      example.org~tech~tax~calc~api.jar

Contains the classes against which other components can compile.

      example.org~tech~tax~calc~tax.jar

Contains all classes, but cannot be used for component builds. Therefore the class TaxCalculator is private to the component.

You can find these files in the Java perspective in the Package Explorer view under the path:

Project node gen default public

      api lib java api.jar

      tax lib java tax.jar

Next Step

Checking in the Activity

End of Content Area