cancel
Showing results for 
Search instead for 
Did you mean: 

How to acces portal services in webdynpro

Former Member
0 Kudos

Hi I want to access portal services from webdynpro, i red that for that we have to provide sharing reference in webdynpro application. which will be

PORTAL :< Vendor name>/<Full qualified name of the portal service>

my question is how to find out vendor name and Full qualified name of the portal service from par

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Web Dynpro applications can access portal services in one of the following ways:

● Directly: The application can get an instance of the service on the machine on which the Web Dynpro application is running.

● Via the Service Factory: The application can request an instance of the service from the service factory. The service factory provides a conduit to portal services to ensure that the proper service is called, even in cases when the Web Dynpro application and the portal are running on different machines.

Only services written in a remote-safe manner are available via the service factory. These services include the following portal services:

Page Service

Tray Service

Page Service

The page service provides information about the page in which the application is running, and enables you to perform the following tasks:

● Getting a list of the atomic names of the visible iViews in the page.

You may want to use this method to avoid updating the user interface of an iView when it is not visible.

IWDPageService pageService = (IWDPageService)

    WDPortalUtils.getService(WDPortalServiceType.PAGE_SERVICE);

// String array receives iView names
String[] iViews = pageService.getVisibleIViews();

● Hiding/showing iViews in the page

IWDPageService pageService = (IWDPageService)
    WDPortalUtils.getService(WDPortalServiceType.PAGE_SERVICE);

// display iView Search
pageService.showIView("Search");

// hide iView Details
pageService.hideIView("Details");

Changes to the visibility of iViews are not saved. When a user refreshes the page, the original settings are restored.

Tray Service

The tray service enables you to add a menu item to an iView or page tray, and to specify a Web Dynpro action to execute when the menu item is selected.

The following is an example of adding an iView and page menu item:

IWDTrayService trayService = (IWDTrayService)
    WDPortalUtils.getService(WDPortalServiceType.TRAY_SERVICE);

if (trayService != null) {

    // Add iView tray menu item
    trayService.addIViewItem("addItemComment", "Add Comment",
    wdThis.wdGetAddItemCommentAction(), null);

    // Add page tray menu item
    trayService.addPageItem("addItemComment", "Add Comment", 
    wdThis.wdGetAddItemCommentAction(), null);
}

Generally, tray menu items are added in the wdDoModifyView() method. Make sure to add the menu item once; otherwise, duplicate menu items are displayed.

Procedure

This section describes how to call a portal service.

For services whose interfaces are provided by Web Dynpro (such as IWDPageService and IWDTrayService), you do not need to perform Steps 1 and 2.

1. Make a sharing reference to the service, by doing the following:

a. Right-click the Web Dynpro development component or Web Dynpro project, and select Properties.

The Properties dialog box opens.

b. From the left pane, select Web Dynpro References.

c. In the Sharing references tab, add a reference to the portal service with the following format:

PORTAL:<Vendor name>/<Fully qualified name of the portal service application>

For example, the following shows a reference to the navigation service:

This graphic is explained in the accompanying text

2. To build the project, add the JAR file containing the service to the classpath of the project in the IDE.

Do not store the JAR file of the service in the libfolder of your development component or Eclipse project. This causes classloader problems at runtime.

3. Get an instance of the service.

To call a portal service directly, without the service factory, call WDPortalUtils.getServiceReference() with the key for the service, as in the following example:

IUserObjectBasedNavigation obnService = (IUserObjectBasedNavigation)
    WDPortalUtils.getServiceReference(IUserObjectBasedNavigation.KEY);

To call a portal service via the service factory, call WDPortalUtils.getService() with the WDPortalServiceType constant for the service, as in the following example:

INavigationService navService = (INavigationService)
    WDPortalUtils.getService(WDPortalServiceType.NAVIGATION)

If more than one Web Dynpro controller needs to use the same portal service, you can store the portal service reference in a controller context node. All other controllers that need to use the service must define a context node and map it to the context node with the service reference.

A portal service can be called only when the portal platform and the Web Dynpro application are running on the same machine.

It is recommended not to use your Web Dynpro-based portal content in a global or federated portal scenario.

Refer This Link for More Information:

[http://help.sap.com/saphelp_nw04s/helpdata/en/d2/0357425e060d53e10000000a155106/frameset.htm]

I Hope This Information Might Be Helpful For you.

Regards,

Sharma.

Answers (0)