Overview

In this entry I describe the process of testing the NetWeaver development environment you set up in Part 1 by building and then deploying it on the Portal. We will use the most basic building block for Java iViews, the AbstractPortalComponent. I will show you how to create the iView, add it to a Portal page.

As a pre-requisite, make sure you have at least Java Developer and Content Administrator access in a Portal. If you have the opportunity to do so, I suggest you install the Full Java Edition of the preview edition of SAP NetWeaver as I outlined in my previous blog entry in this series.

Step 1. Build and deploy a simple Java iView

So if you've rolled up your sleeves, here are the steps to build and deploy a simple lava iView:

1. Create a Portal Project

i. File > New > Other and choose Portal Application > Create a Portal Application Project and click Next
ii. Type a name for the Project and leave the default project root folder as is and click Finish
iii. NDS will create a Project for you, complete with all the necessary folder structure

2. Create a Portal Object

i. File > New > Other and choose Portal Application > Create a Portal Application Object and click Next
ii. Select the Portal Project you created in Step 1 above and click Next
iii.Select AbstractPortalComponent and click Next. I will go over each component type listed in the screenshot below in detail in the next blog entry in this series.

portalComponent_4.jpg
[choosing AbstractPortalComponent]
iv. Type HelloPortalWorld as the name and type a package name such as com.yourcompany.something and click Next
v. NDS will automatically create and add the necessary files to your project. Additionally, it will automatically add generic code that is required by the Portal to these files. This is an extremely valuable time saving feature, as you can imagine!
vi. In the HelloPortalWorld.java file, add a couple of lines of response.write code as shown (the editor has autocomplete functionality and will try to give you valuable and time-saving suggestions)

autocomplete_4.jpg
[cool autocomplete for the code you write]
This is the code that I use for this simple Java iView:


vii. Save and click on Project > Rebuild Project (or Rebuild All)
viii. Click on the create and upload PAR file button or click on File > Export > PAR File and click Next
ix. Select the Portal environment you'd like to upload this project to and click Finish

If the upload worked, you will see a message at the bottom pane (Deploy Output view) indicating successful deployment. If it didn't work, pay close attention to the error message. Most likely messages have to do with either the server not running or the port being incorrect. Revisit the settings one more time to make sure they are correct. If you've followed the installation and configuration steps outlined in this and the previous blog in this series, the settings should be as follows:

J2EE server: localhost J2EE port: 3601

Portal Server: localhost Portal Port: 50000

If you use a user other than the default admin, you have to give that user Java Developer role to be able to upload and deploy the iView. I will write more on User Administration and Content Administration in a future entry.

If you are still encountering problems with the configuration try searching the SDN Forums for an answer or leave a comment below this entry.

Step 2: Creating the iView

If you have successfully deployed your first Java iView into the Portal, the next step is to verify it in the Portal by logging on and seeing if the PAR file actually made it to the Portal. If it did, you can create an iView based on the PAR file and place it on a Page. As I will be covering the details of Content Administration processes (such as creating Folders, Roles, Worksets, Pages, iViews) later in this series, I will list the steps here briefly for completion. I have created screenshots for these activities as well and I will email them to you if you are interested in looking at them.

i. Log on to the Portal with an account that has Content Administrator privileges
ii. Go to Content Administration > Portal Content and expand the Portal Content folder
iii. Within the Portal Content Folder choose a folder of your choice (or create a new folder) and from the context menu choose New from PAR > iView
iv. Select MyFirstPortalProject (or the name you gave it instead) and click Next
v. Give the iView a Name (say Hello Portal World! or whatever else that strikes your fancy) and an ID - both the Name and the ID can be changed later, the ID cannot contain spaces or illegal characters (use something out of the ordinary and you'll see which ones are illegal) and click Next
vi. The Summary page displays the details of what you've done so far and gives you chance to either Cancel or go back and amend something, in case you were day dreaming before, click Finish if you are satisfied
vii. Click OK and you're done!
viii. You can either right click on the iView you just created and click on Preview or add it to a page

iViewPage_4.jpg
[your first java iView]

Step 3. Customizing NDS to your liking

Now that you've installed and configured your NDS, you are ready to customize it to your liking so you can be as efficient as possible. Every developer has his or her own preferences when developing. NDS, which is really based on the Eclipse platform, offers you the most flexibility in customization that I have seen so far. Almost everything in NDS is controlled by Plug-ins. With the right plug-ins, you can actually build PHP or ColdFusion applications, write JavaScript code, develop in C/C++ or COBOL or whatever else is available these days. If there isn't already a plug-in for your particular need, you can build it yourself and extend the functionality of NDS. Granted NDS is already a highly customized environment with a lot of tools for SAP EP Developers, the only limit to how much more you can tweak it is your own imagination. That said, let's see how we do it.

The way NDS looks at any given time is determined by the Perspective or the View you've chosen. There are some predefined Perspectives and Views available to choose from. For example, if you choose the Web Dynpro Perspective, all the tools you need while working in a Web Dynpro project become available and all the tools you used in the above Java iView are hidden. Explore the various Perspectives and Views by clicking on Window > Open Perspective or Show View. You can further enhance the way a Perspective or a View looks by customizing it yourself. My next blog entry on Java development methodologies talks about the Perspectives available in NDS for SAP EP development in more detail.

Jar Class Finder

In addition to the Perspectives and Views, you can add tools to your NDS installation. One of the most widely used tools is the Jar Class Finder. There already are a lot of material written on it so, as an exercise, I'll leave you to do a quick SDN search for "Jar Class Finder" and find the two excellent blog entries on how to get, install and use the Jar Class Finder.

Summary

This part 2 of the 4th blog entry in the Beginning EP Development series concludes the installation, setup and configuration steps for SAP NetWeaver SP 15, Sneak Preview (Full Java Edition). If you've been following the series so far as a new EP developer, congratulations! You've come a long way! There's lots more work to do before you can be a confident developer. My next few entries will focus on the development methodologies a Portal developer can use.

Overview

In this entry I describe the process of setting up the NetWeaver development environment. If you've downloaded and installed the preview edition of EP and NDS as described in the last entry in this series, then you can do most of these activities yourself. If you're trying to configure your work installation of NDS, you may need the help of your System Administrator to provide the configuration parameters you'll need.

As a pre-requisite, make sure you have at least Java Developer, Content Administrator and some System Administrator access to an installation of the Portal. If you have the opportunity to do so, I suggest you install the Full Java Edition of the preview edition of SAP NetWeaver as I outlined in my previous blog entry in this series.

Step 1. First Steps and Workspace setup

One of the first steps after you've downloaded and installed SAP NetWeaver Developer Studio (NDS) is to configure a local workspace for your development environment. A workspace, as the name might suggest, is a space on your local computer (or a network drive) in which to store your work and any user specific settings. You can have only one workspace for NDS at a time. In other words, you can have more than one, but only be able to use one or the other. You can, however, change the workspace location at a later time, if need be.

When you launch NDS for the first time, you will be presented with a dialog box as shown in the screenshot below where you will select a default workspace (or change it to something else if you feel rebellious.

01ndsSetup_4.jpg
[choosing a folder for NDS workspace]

Once you've set it up, NDS will start and show you a welcome screen as shown below, showing you the default perspective of Resources (more on SAP NDS Perspectives below) and some links to the Help contained with the installation as a guide! What a nice gesture from the good folks at SAP, eh? Now you know why the installation took so long: you get a wealth of development resources right at your fingertips.

02ndsSetup_4.jpg[The SAP NDS welcome screen]

The Help contained in NDS is an amazing, often overlooked, feature: it is all available to you locally on your PC and comes complete with examples, screenshots and the ability to let you search. The most updated version of this help is available online, of course, at http://help.sap.com/

08ndsSetup_4.jpg
[The SAP NDS Help screen. Note the search box on the top left]

Step 2. Configure Development environment

As you work with NDS, you will find that it is very customizable. Click on the Window > Preferences menu to access most of the customization options. There is a dizzying number of options available. Your safest bet is to stay with the default settings for most of them - but where's the fun in that, eh? Live a little and change the settings around to see how things change in this new environment. There is a "Restore Defaults" button on every screen where there are default settings set by the software installation!

Workspace

The workspace that you setup in the previous step is shown in the screenshot below. If you decide to change the workspace for whatever reason, you can do it on this screen and it will take effect once you've restarted NDS. As indicated in the screenshot, you can use a workspace other than your default, by using the "data" command line parameter.

03ndsSetup_4.jpg
[The default workspace for NDS.]

Java Runtime Environment (JRE) version

Another fundamental setting is the Java Runtime Environment (JRE) that you use for your development. As of this release of NetWeaver, stick with j2sdk1.4.2_08 as recommended by SAP. As you can see from the screenshot, you can add multiple JRE's here. You may add them here if you have a need to develop something other than for the SAP Enterprise Portal using NDS, which is really based on IBM's Eclipse platform. So if you wanted to write a Java application or an applet, using the latest Java Swing classes, you can do so by adding a newer JRE to your instance of NDS. I told you NDS is customizable, but this is nothing. Wait till you see what else you can do!


04ndsSetup_4.jpg
[The default JRE for NDS.]

J2EE Engine settings

The SAP J2EE Engine setting is another one that needs a quick look. If you've installed the Preview Edition of the NDS and EP on your Desktop or Local, you may just leave the default values set by the installation, server name localhost on port 3601. Alternatively, if you're developing from your PC but the J2EE server is on a separate server, you will need to enter the name of the server (possibly the full qualifying name such as myportalserver01.mycompany.com instead of the default localhost value.


05ndsSetup_4.jpg
[The default J2EE for NDS.]

Portal Settings, multiple environments

You can setup multiple Portal environments into your NDS for quick deployment of your applications. For example, you can configure NDS for your local, Development and QA testing environments and deploy applications directly. Normally, you wouldn't deploy directly to the QA environment, since the recommended method is to export content once (from the Development environment) and to import twice (into QA testing and Production environments), but that's a totally different discussion. You don't have to deploy directly from NDS. You also have the option of uploading your Portal project PAR files from within the Portal (from Java Developer > PRT Admin Console or from System Administration > Support > Portal Runtime > Archive Uploader). In SP15, there is a cool Portal Archive Deployer and Remover page under Java Developer.

06ndsSetup_4.jpg

[Multiple Portal Environments in NDS.]

Step 3. Test and troubleshoot your settings

There is only one way to really test your settings: build and deploy something simple. If the process works, it generally means that your configuration settings are correct and you can breathe a sigh of relief. If, however, you messed up (notice how I remove myself from the equation) there will be some troubleshooting to do. Part 2 of this entry, will talk about how to build a Hello Portal World Java iView, just to test the installation and configuration.

Summary

This blog entry covered a lot of ground for a beginner. You have now configured a development environment for yourself to start developing for the Portal. The next part of this entry will walk you through building and deploying a simple Java iView, just to test your settings.