cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the iView ID in Java Webdynpro

Former Member
0 Kudos

Hi All,

I created an iView in portal from a java webdynpro application and let's say the PCD location of the iView is : pcd:portal_content/myFolder/wdiView

How do I get this PCD path inside the Webdynpro code via API?

like if the iview is created with a Portal Application I can do a

String myiViewName = request.getComponentContext().getContextName();

// request is of type IPortalComponentRequest

I am running NW 2004s (NW 700 SP15).

Thanks a lot in advance.

Regards,

Sanjeev

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I'm not sure I understand what you're trying to find. The iView itseld may not be known at runtime. For example, imagine if I start the WDJ app without launching from the portal. It won't have any knowledge about PCD locations etc.

The code you refer to is specific to finding details about a portal component. By definition, that only runs in the portal so it has a meaningful value.

What do you plan to do with the PCD location?

Former Member
0 Kudos

True that if the WD Applictaion is accessed outside of Portal, than there would be no PCD. But I can always put some check to see if the WD is running in Portal or not with WDPortalUtils.isRunningInPortal().

I want to find out when it is running in portal what is that PCD location of the WD iView.

Let me explain my usage lil bit:

- The WD Application has some data which End Used can personalize/customize, and that Data I store in PCD Store with the iView's PCD location.

- There are multiple iViews that point to same this WD App, but with different Applicattion Parameters.

I am able to Save the data to PCD if I know the PCD location of the iView created with this WD App. but before I could do that I need to be able to find the PCD location of the iView itself.

One solution to this is: put the iView PCD location as part of the ApplicationParameters, but that would have to be done for more than 40 iViews and I believe there is a better way to achieve the same

Thanks and Regards,

Sanjeev

Former Member
0 Kudos

This link http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b4/adbf40b87e0366e10000000a1550b0/frameset.htm refers to some functions available from the portal page builder, and might be useful, but I think the WDJ app doesn't know much about the iView that started it.

I'd like to think there's a neater way to do iView personalization for a WDJ app

Former Member
0 Kudos

Hi,

try like this

Hashtable env = new Hashtable()

env.put(Context.INITIAL_CONTEXT_FACTORY , IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);

env.put("com.sap.portal.jndi.requested_aspect",PcmConstants.ASPECT_ADMINISTRATION);

env.put(Context.SECURITY_PRINCIPAL,WDClientUser.getCurrentUser().getSAPUser());

InitialContext iCtx = null ;

iCtx = new InitialContext(env);

IAdminBase myIView = (IAdminBase)iCtx.lookup(<pcd location>);

For more details

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/94/fab74247e2b611e10000000a155106/frameset.htm

Go to "Core Development tasks section of this " see the details of accessing pcd.

However for using the portal standard services in webdynpro Java you will have to add the Sharing References in you webdynpro DC >under properties>web dynpro references -->Sharing Ref

so that at runtime those classes gets loaded to which your webdynrpo refers.

eg : PORTAL:sap.com/com.sap.portal.ivs.api.ivew

PORTAL:sap.com/com.sap.portal.pcm.admin.apiservice

PORTAL:sap.com/com.sap.portal.pcd.glservice

PORTAL:sap.com/com.sap.portal.ivs.ivewservice

PORTAL:sap.com/com.sap.portal.admin.util.PcmUtil

PORTAL:sap.com/com.sap.portal.ivs.connectorservice

PORTAL:sap.com/com.sap.portal.navigation.api_service

At the build time you will have to refer to the jars of standard portal service. If you don't have it in your local NWDS you can get them from server from irj application.

Former Member
0 Kudos

in your code:

IAdminBase myIView = (IAdminBase)iCtx.lookup(<pcd location>);

<pcd location> is what I do not have and want to find out.