cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to call iview properties through web dynpro?

Former Member
0 Kudos

Hi Experts,

I want to control certain iview properties at runtime. The iview is based on a webdynpro java application.

Is it possible to control the iview properties through my webdynpro java application at runtime?

Thanks & Regards,

Anurag

Edited by: Anurag Gwari on Jun 7, 2010 3:13 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Not required anymore.

0 Kudos

Hi All,

I have a similar requirement as Anurag. The difference is that based on certain conditions, I need to maximize or minimize the iView Tray programmatically.

I have 2 iViews - A and B. In iView "A", I have 2 buttons - Maximize and Minimize.

On clicking "Maximize" button in A iView, the iView tray in "B" iView should be expanded.

On clicking "Minimize" button in A iView, the iView tray in "B" iView should be collapsed.

I have written the following code:

<code>

//Set the property for iView tray

if (strTraySetting.equalsIgnoreCase("Max"))

{

myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Open");

myIView.save();

}

else if (strTraySetting.equalsIgnoreCase("Min"))

{

myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Close");

myIView.save();

}

</code>

However, the iView property is not being set and the B iView is not responding to dynamic iView tray setting. Can you please let me know what is the issue?

Thank you for the help in advance.

Regards,

Pavithra

Former Member
0 Kudos

Hi

dear

This is solu...

Hashtable env = new Hashtable();

InitialContext iCtx = null;

IiView myIView;

try

{

String iViewID = "pcd:portal_content/Pragnesh/kmpage";

iCtx = new InitialContext(env);

myIView =(IiView)iCtx.lookup(iViewID);

}

catch(NamingException e)

{

}

myIView.setProperty("com.sap.portal.navigation.Invisible","yes");

Edited by: pragu4468 on Oct 14, 2011 2:07 PM

former_member192152
Active Participant
0 Kudos
Former Member
0 Kudos

Hi All,

Thanks a lot for your replies.

Now since manipulation of iview properties is possible through webdynpro, let me be a liitle bit more specific in my requirement.

Actually, I want to control one specific property of an iview "Invisible in Navigation Areas" to true and false based on some conditions.

How can I modify this property at runtime?

Moreover, Can I apply the logic in my webdynpro java application instead of creating a portal application for this?

Thanks & Regards,

Anurag

Former Member
0 Kudos

Hi Anurag,

You can definitely do the same without creating the Portal component but can do by creating a webdynpro application. For you purticular requirement you need to access and change the "com.sap.portal.navigation.Invisible" Property of the IVIew.

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Can you help me with the code required for accessing and changing the property at runtime?

Actually, I browsed the links that were provided by you but I am not very confident on how to implement the code for this.

It would be really great if you can help me with the code and the required jars for this requirement.

Thanks a lot for your prompt reply.

Regards,

Anurag

Former Member
0 Kudos

Hi Anurag,

in the webdynpro properties you need to add the service reference - "com.sap.portal.ivs.api_iview"

and a Jar file - "com.sap.portal.ivs.api_iview_api.jar"


Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);


Perform the lookup by supplying the PCD name of the object, and then cast the returned object to the appropriate semantic object interface.
InitialContext iCtx = null;
try
{
String iViewID = "pcd:portal_content/myFolder/stocks";
iCtx = new InitialContext(env);
IiView myIView =(IiView)iCtx.lookup(iViewID);
}
catch(NamingException e)
{
}


myIView.setProperty("com.sap.portal.navigation.Invisible","yes");

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Thanks for your great help so far.

I am getting the problems on the below two lines:

env.put(Context.SECURITY_PRINCIPAL, request.getUser());

env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);

I do not know how to set an environment variable. Do I need to set any eenvironment variable here?

I've added the following jars:

1. com.sap.portal.ivs.api_iview_api

2. com.sap.portal.pcm.admin.apiservice_api

3. com.sap.portal.pcd.glservice_api

4. gl_api

Do I require any other jars to be added?

Kindly assist. Also please tell me all the import statements.

Regards,

Anurag

Edited by: Anurag Gwari on Jun 8, 2010 4:48 PM

Edited by: Anurag Gwari on Jun 8, 2010 5:03 PM

Former Member
0 Kudos

Import Staments


import javax.naming.Context;
import com.sapportals.portal.pcd.gl.IPcdContext;
import com.sap.portal.directory.Constants;

request.getUser() will work in the portal component but not in the webdynpro application. Inoirder to get the IUser object in webdynpro replace request.getUser() with -

 WDClientUser.getCurrentUser().getSAPUser();

For this you need to add com.sap.security.api.jar jar file.

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Thanks a lot once again.

Now the only problem is with the third line and I guess that is because I am not able to import the third statement that you have mentioned.

For the below import statement, which jar am I supposed to add?

import com.sap.portal.directory.Constants;

Thanks a lot in advance.

Thanks & Regards,

Anurag

Former Member
0 Kudos

You need to add prtjndisupport.jar

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Thanks a lot for your quick answer.

I've the only problem left now and that is with the line : PcmConstants.ASPECT_SEMANTICS.

It says PcmConstants cannot be resolved.

Do I need to maintain this PcmConstants entry anywhere?

Regrads,

Anurag

Former Member
0 Kudos

import com.sap.portal.pcm.admin.PcmConstants

and the jar file is tcepbcpcmadminapijava.jar

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

I hope not to bother you again.

The previous issue has been resoved now but there is a new issue which has appeared now.

The issue is with this line : myIView.setProperty("com.sap.portal.navigation.Invisible","yes");

It says "The method setProperty(String,String) is undefined for the type Iiview."

How can I remove this issue?

Thanks & Regards,

Anurag

Former Member
0 Kudos

Hi Raju,

Do you have any news for me regarding the latest issue?

Thanks in advance for your reply.

Regards,

Anurag

Former Member
0 Kudos

Hi,

It is possible to maipulate the PCD Objects through webdynpro java. Please go thorugh the following article [Article(Accessing the PCD Objects)|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/314ae7a5-0c01-0010-c198-9c7c5e8cee46]

For acheiving this we need to add the Following jars -

com.sap.portal.ivs.api_iview_api.jar

com.sap.portal.pcd.glservice_api.jar

gl_api.jar

Please refet to the following thread /thread/1151176 [original link is broken]

The type of coding is same in Portal component or webdynpro Java.

Thanks,

Raju Bonagiri