Overview of the Content Development Process

| | Comments (0) | TrackBacks (0)
Background Information

The SAP Enterprise Portal is a web interface for SAP NetWeaver and non-SAP content delivered seamlessly. From the user's perspective, its an extremely convenient way to get to all kinds of applications and data in one easy to use and consistent format via a web browser. The technology allows content from anywhere, using a Single Sign-On to be customized for the ultimate user experience. From the developer's perspective, the opportunities are endless. A developer can use this platform to incorporate data from various sources - SAP, databases, the web, Microsoft Outlook and IBM Lotus Notes, for example into a Portal page.

What is content and how can it be developed?

Portal Content consists of Applications that run in the Portal Runtime (Java) or the Web Dynpro Runtime. I will cover the details of Web Dynpro applications in another blog entry. Applications can also be created using the Business Server Pages (within the R/3 system using ABAP and HTML) and .Net. I will also explore these in another blog entry.

What is a Java Applications in the Portal

Java applications in the Portal are basically made up of either Components or Services or both. One or more Portal Components can be used to display HTML in an iView - which is a basic building block of Portal applications. A component typically extends a class called AbstractPortalComponent - which is part of the Portal Runtime API:

    com.sapportals.portal.prt.component.AbstractPortalComponent

A Portal Service provides functionality that can be used by a portal component or another service. A service typically implements the IService interface - which is also part of the PRT API:

    com.sapportals.portal.prt.service.IService

The Structure of a Java Application

Portal applications are stored in PAR files (which are just zipped files with a .par extension). A PAR file contains web resources, Java classes and a deployment descriptor called portalapp.xml. As a developer, you'll get used to ensuring that your applications have the following general folder hierarchy:

MyApplication01.jpg


This is the file structure of a typical Portal Application

The portalapp.xml file above (known as the deployment descriptor) is probably the most important part of the PAR file. Even if a component or service is provided with the PAR file, if its not in the portalapp.xml file, its as if it does not exist. Therefore, I suggest that you use the NetWeaver Developer Studio (NDS) software to develop your Java applications as this software creates the appropriate deployment descriptor for you automagically.

The Deployment Descriptor

The Deployment Descriptor consists of four hierarchical sections, subsections and properties of each, enclosed within the parent application. Everything has to be between the opening and closing application tags. The four sections are application-config, components, services and registry.

Here is an example of what a typical portalapp.xml file looks like:




Now that we've seen what a portal Java application consists of, let's take a quick overview of the steps involved in creating this content. I'll describe each step of the process in more detail in the next few entries in this series.
Creating Java Portal Content, Step by Step Overview:

   1. Create a Portal Application Project in NDS:
         1. File > New > Other... > Portal Application > Create a Portal Application Project
         2. Click Next and type a name for the project and click Finish
   2. Create a Portal Application Object - for this step one of the following items can be created, depending on the need:
         1. Portal Component
         2. Portal Service
         3. Portal Web Service
   3. Once the Portal Objects have been developed, the project is ready to be deployed either directly from NDS or uploaded into the portal manually.
         1. File > Export > PAR File and click Next
         2. select the project you wish to deploy and click Next
         3. ensure the correct PAR file is selected, select if you wish to include the source code and whether you wish to deploy the project right from NDS and click Finish
         4. If you elected to deploy directly from NDS, you'll need to make sure that NDS is configured to do this (a future blog entry in this series describes the details)
         5. If you elected to manually upload the PAR file into the portal, log into the portal with an account that has Developer access (a future blog entry in this series covers the details of portal security) and go to Java Development > Tools > PRT Admin Console and click on Browse from Archive Uploader and select the PAR file to upload and click on Upload.
   4. Create the iView based on the PAR file
         1. Log in to the portal with Content Administrator access and navigate to Content Administration > Portal Content
         2. Right click on the folder in the Portal Content Directory (PCD) in which you'd like the iView to be created and select New from PAR > iView from the context menu
         3. Select the PAR file uploaded in Step 3 above and click Next
         4. Select one of the components on the next screen and click Next
         5. Type an iView name and ID and click on Next and Finish
         6. You can right click on the iView you just created and click on Preview from the context menu to see what the iView looks like or attach it to a page and workset to display it on a portal page (a future blog entry in this series describes the details).

Development Methods

Now that we've seen the structure of a typical portal application, let's look at the different methods of developing Java applications for the SAP EP. There are other ways of developing content (such as Web Dynpro), which are not discussed in this entry. If you're using NDS for development, there are easy to use tools and wizards available for speeding up the initial development process. I strongly suggest using these, as they will make your life easier as an EP Developer. I will briefly go over each of them, but for detailed descriptions of each, please refer to the Help provided with NDS, under the SAP EP Plugins Guide section. Note that we'll be using the EP perspective in NDS for these methods.

Here's a screenshot of the different component and service types currently available from NDS by default.


NDSwizards.jpg



These wizards can be accessed from the File > New > Other... and selecting Portal Application followed by Create a New Portal Application Object

Portal Components come in four flavors:

   1. AbstractPortalComponent
   2. AbstractTestComponent
   3. JSPDynPage
   4. DynPage

AbstractPortalComponent is the most basic portal component that can used to create an iView for the SAP EP. This is also the fastest way to create a simple Java iView to display some content on the Portal.

This wizard generates some generic Java code that you can build upon. The only method of interest is the doContent() method, where content is created. For example:






AbstractTestComponent is a basic portal test component that can used to test applications using the portal framework.

DynPage is the most basic portal component type which can be used to build an HTMLB iView. This wizard creates a doInitialization() method (which is typically executed once per user), a doProcessAfterInput() method (which typically contains the input handling code, if any) and a doProcessBeforeOutput() method (which is where the GUI components and any other output is created).

JSPDynPage is a more elaborate version of the DynPage method above. It creates a JSP file and, optionally, a Bean class.

The code generated by this wizard is almost identical to the code for DynPage objects, except the presentation is handled by a JSP page and an optional Bean class is created. This means that the doProcessBeforeOutput methods are slightly different and there is an additional JSP file and an optional Bean class file. There are obviously other differences (such as the differences in the portalapp.xml file).

Portal Services only have a single wizard that can be used to create them. Portal Services created using this wizard, implement the IService interface.

Portal Web Service gives you three options to either convert a Portal Service into a Portal Web Service, use a Web Service to create a Portal Service, which gives lets you use either Client side or Server side web services.

Summary

In this entry I've attempted to give a whirlwind overview of the development process, target at the newbie SAP EP Developer. I have only touched on development of Java content, which is one of the many methods available for EP Development. In the next two entries of the Beginning EP Development series, I will cover Installing and Configuring the Preview Edition of EP and Setting up the NetWeaver development environment, which will set the stage for some serious development. Stay tuned!


0 TrackBacks

Listed below are links to blogs that reference this entry: Overview of the Content Development Process.

TrackBack URL for this entry: http://www.umairsalam.com/mt/mt-tb.cgi/7

Leave a comment

About this Entry

This page contains a single entry by umairsalam published on May 5, 2008 7:20 PM.

Beginning EP Development was the previous entry in this blog.

Installing the SAP NetWeaver Portal is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.