Basics of Enterprise Portal Development Using Java
Basics of Enterprise Portal Development Using Java
1.1
1.2
Debug
Java
Java Browsing
Resource editing
Portal Permissions
It defines user access rights. Every portal object can be assigned to an user or a group of
users through user groups and roles. Role is collection of information, services and tasks
that are available to a group of users.
1.3
An iView is a portal content building block. Each iView has a set of properties which are
used at runtime. These properties differentiate one iView from other iView. Also an iView
can be based on other iView and can inherit properties or can overwrite some properties
of parent iView on which it is based.
Users can access iViews assigned to their roles. iView can be assigned to portal pages.
These pages can be further assigned to any number of user roles. A user can access all the
iViews contained on that page to which his roles have access rights. iViews can also be
assigned directly to user role.
1.4
Component
Working with components organizes the application and also divides the application into
reusable units. Components provide encapsulation. The Outside world has no knowledge
about the objects in a component. In EP mostly classes are embedded in Netweaver
component. These classes are not visible to outside user. These classes are only visible to
outside user if they are added in public part of component.
Now a portal component is a Java class written and packaged specifically to run in the
portal.
1.5
Java API
First of all why we need to know about API. The answer is, it is required to add
functionalities in our netweaver applications. Here we are concerned mostly about EP
development using Java.
Java API has a list of all Java packages, classes, and interfaces; along with all of their
methods, fields and constructors; and also with information on how to use them.
For developing enterprise portals through SAP Netweaver using JAVA we need to use the
packages, classes or interfaces provided in the API.
There are various APIs provided by SAP to help in development of Netweaver
applications using JAVA.
Here I will try to discuss Enterprise Portal APIs. They are used in development of
enterprise portals.
The following three APIs are most commonly used while developing an Enterprise
portal:1. Enterprise Portal (Enterprise Portal Runtime and Services API)
2. PCD (Portal Content Directory API)
3. HTMLB (HTML Business for Java API)
There are various packages in Enterprise Portal API which provides classes and interfaces
for implementing Portal runtime, Page builders, wizards , dynamic system resolutions
etc.
We will discuss few useful classes and interfaces generally used in EP development.
Interface IPortalComponent
3. service() - This method is called for each request that the Portal builder
runtime routes to an instance of Portal Component. Multiple threads may
be executing within the service at any time. It processes the clients
requests. An implementation of the IPortalComponent interface can have
access to the request and the type of request sent by the client.
public
void service(IPortalComponentRequest request, IPortalComponentResponse respon
se) throwsPortalComponentException
request parameter clients request
response parameter- servers response
Class AbstractPortalComponent
IEventListenerComponent
IPortalComponent
IPortalComponentInit
We will create a simple portal application project and then we will use this project to
create iView, page and roles on EP.
2.1
Open Netweaver.
Click the Create Portal Application Project icon or use menu path.
File -> New -> Other -> Portal Application -> Create Portal Application Project
Enter name of project and directory where you want to store the project and click Finish.
Now click on icon Create Portal Application Objects
Click on finish . Then add following code as given in figure. Most of the code is auto
generated.
package test.hello;
import com.sapportals.portal.prt.component.*;
public class HelloTest1 extends AbstractPortalComponent
{
public void doContent(IPortalComponentRequest request, IPortalComponentResponse
response)
{
response.write("First portal application project demo");
}
}
We need to upload our project to portal. For this we will configure portal landscape.
Open Window->Preferences
Click on SAP Enterprise Portal.
Click Add to add a new portal system.
Suppose my portal has address : http://punitp54700d:50100/irj/portal
Enter Alias = Any name (MyPortal)
Host = punitp54700d
Port = 50100
User id for login
And click OK.
Make it default. Remember you can add more but only one can be default.
2.3
Click next.
Give the PAR file name and password for the portal to login. Check the checkbox Deploy
PAR to upload. You can also check the box Include source code of portal application.
We will use the project we just uploaded in to EP to create iView, page and roles on the
portal
3.1
IView is smallest unit of display in a portal. It can represent sap or non-sap application.
3.1.1
3.1.2
Creation of Folder
Give the folder name and id. Then click on Finish button.
3.1.3
Create iView
Now to create IView :Right click on folder you created ->New -> iView
Now here we will use the portal component deployed by us i.e. HelloProject to create the
iView.
Click on next button. Now you will go to screen for archive selection screen.
Click next. You will get Portal component selection screen. Select the component.
Click on next.
3.3
Now right click on the iview and chose Add iView toPage -> delta link
We use delta link when we want that the changes done to the iview should also reflect in
the page, else create a copy of it.
3.4
Now we will create a new role and add the page we created to this role.
Right click on folder -> New -> Role
Now right click on the Page and then select Add page to Role -> Delta link
Goto User Administration -> Roles -> search for the user
Click on assigned roles tab. Now search for the role u created i.e. role_helloproject1 (role
id used).
Select the role and add the role to users assigned roles and save.
Now log-off.
Now log-in as Administrator for changing the properties of role or you need sufficient
privileges.
Upon logging in as administrator open the role and you can see the properties button.
Click on that.
For Entry Point radio button check Yes. Save it.
Re-login from the user-id you assigned for the role above.
Now you can see the Role added in the navigation. Click on the role link to display
output.