Skip to Content
0
Jan 15, 2009 at 08:25 AM

Question regarding implementation of Portal Service

101 Views

Hello,

I want to create a portal service that calls our R/3 system and comes back with customer master data. For that I have to hand over the userid to the portal service.

The Interface looks like that:

import com.sapportals.portal.prt.service.IService;
import com.lgs.model.CustomerDataBean;

public interface IR3CustDataService extends IService
{
    public static final String KEY = "R3CustDataService";
    
    // returns an object with all customer master data from R/3
	public CustomerDataBean getCustomerData(String userid); 
}

The implementation of the method in the corresponding class is:

CustomerDataBean cdb = new CustomerDataBean();

public CustomerDataBean getCustomerData(String userid) {
		return cdb;
}

Now I would implement the program logic (accessing R/3 and fill the CustomerDataBean) in the init method of the portal service class.

public void init(IServiceContext serviceContext) {
                mm_serviceContext = serviceContext;

                implementation of program logic, usage of userid necessary

}

My question is now how I can use the String userid in the init method? How can I hand over the userid to the init method so that I can use it?

Any hint is really appreciated!

Thanks a lot.

Arno