cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Personalization parameters inside JSPDynPage

Former Member
0 Kudos

I have a jspdynpage Iview. I would like to set some personalization parameters & read it in doInitialization() method of jspdynpage. I tried setting the parameter of iView called “parameters to Pass from Page Request”. I tried both url & embedded isolation method. I am not able to read the value of the parameter in doInitialization(). I always get null. How do I personalize iView?

Here is my portalapp.xml

-


<?xml version="1.0" encoding="utf-8"?>

<application>

<application-config>

<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>

</application-config>

<components>

<component name="test_event_controller">

<component-config>

<property name="ClassName" value="com.documentum.ei.epiviews.test_event_controller"/>

<property name="SecurityZone" value="com.documentum.ei.epiviews.test_event_controller/low_safety"/>

<property name="com.sap.portal.reserved.iview.ParamList" value="*"/>

</component-config>

<component-profile/>

</component>

</application>

Here is the JSPDynPage code:

public static class dctm_test_jspdynpage2DynPage extends JSPDynPage {

public void doInitialization() {

IPortalComponentRequest request =

(IPortalComponentRequest) this.getRequest();

String parameter = request.getParameter("p1");

}

}

I clicked on the personalize option on the iView & set following attribute:

“Parameters to Pass from Page Request” to “p1=test123“ (without double quotes)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I tried changing the portalapp.xml & added code to retrieve profile parameters in my code. But I still don't get the value of p1. Am I suppose to see the p1 attribute in personlization dialog? I don't see it. Also the value is null. I ALSO tried <property name="p1" value="testing"> but I still get null.

Former Member
0 Kudos

Hi Sam,

My fault, i had a mistake in my portalapp.xml. I am missing </property> tag. The correct portalapp.xml is following.

<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="test_event_controller">
<component-config>
<property name="ClassName" value="com.documentum.ei.epiviews.test_event_controller"/>
<property name="SecurityZone" value="com.documentum.ei.epiviews.test_event_controller/low_safety"/>
</component-config>
<component-profile>
 <property name="p1" value="">
  <property name="personalization" value="dialog"/>
 <b></property></b>
</component-profile>
</component>
</application>

PS: Please reward points for helpful answer or problem is resolved. thank you

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks I had a typo in my portalapp.xml. It's working now. 10 points awarded.

Former Member
0 Kudos

Hi Sam,

You need to do the following.

1. Your portalapp.xml is incorrect. you need to fix that first. it should look like following.


<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="test_event_controller">
<component-config>
<property name="ClassName" value="com.documentum.ei.epiviews.test_event_controller"/>
<property name="SecurityZone" value="com.documentum.ei.epiviews.test_event_controller/low_safety"/>
</component-config>
<component-profile>
 <property name="p1" value="">
 <property name="personalization" value="dialog"/>
</component-profile>
</component>
</application>

2. In your doInitialization() add the following code.

PortalComponentRequest request =
(IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile profile = myContext.getProfile();
String parameter = profile.getProperty("p1");

PS: Please reward points for helpful answer or problem is resolved. thank you

Former Member
0 Kudos

Hi Sam,

You need to do the following.

1. Your portalapp.xml is incorrect. you need to fix that first. it should look like following.


<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="test_event_controller">
<component-config>
<property name="ClassName" value="com.documentum.ei.epiviews.test_event_controller"/>
<property name="SecurityZone" value="com.documentum.ei.epiviews.test_event_controller/low_safety"/>
</component-config>
<component-profile>
 <property name="p1" value="">
 <property name="personalization" value="dialog"/>
</component-profile>
</component>
</application>

2. In your doInitialization() add the following code.

PortalComponentRequest request =
(IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile profile = myContext.getProfile();
String parameter = profile.getProperty("p1");