cancel
Showing results for 
Search instead for 
Did you mean: 

How to create DynPage based on user parameter and than implement it?

Former Member
0 Kudos

Hello,

I've written a Portal Application which contains a Portal Object which is a DynPage.

I am using NWDS for development and NW 04 Patch 11 as the portal.

This DynPage process something according to a hardcoded URL. I would like to transform this URL to a parameter which will be received from the user.

Can someone please explain me the whole process with a simple example that includes:

1. How to change the code/project to receive parameter from the user?

2. How to change the iView configuration which is based on this PAR file to send the user parameter.

3. Where the user should enter it's parameter once all done?

Thank you.

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Roy,

If i understand your question properly, then you should do the following. This will let you change the value globally for all the users as an iview parameter. If you edit the iview then you will see the property that you have added to portalapp.xml.

1. Modify your portalapp.xml to accept iview personalization.

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
  </application-config>
  <components>
    <component name="links_tree">
      <component-config>
        <property name="ClassName" value="com.sap.sen.gcp.km.links.links_tree"/>
        <property name="SecurityZone" value="com.sap.sen.gcp.km.links/high_safety"/>
      </component-config>
      <component-profile>
        <b><property name="url" value="/documents"/></b>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

3. The following code will get you the value of path.

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile profile = myContext.getProfile();
<b>String url = profile.getProperty("url");</b>

Former Member
0 Kudos

Hi Roy,

If you want every user to personalize the iview and pass the value then you would do the following.

1. Modify your portalapp.xml to accept iview personalization.

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
  </application-config>
  <components>
    <component name="links_tree">
      <component-config>
        <property name="ClassName" value="com.sap.sen.gcp.km.links.links_tree"/>
        <property name="SecurityZone" value="com.sap.sen.gcp.km.links/high_safety"/>
      </component-config>
      <component-profile>
       <b> <property name="url" value="">
          <property name="personalization" value="dialog">
          </property>
       </property></b>
      </component-profile>
    </component>
  </components>
<services/>
</application>

2. Same code for getting the url. The following code will get you the value of path.

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

Former Member
0 Kudos

Hey Prakash,

I tried to implement this.

I do see that the iView has now url property with the value dialog, but when I choose "Personalize" I receive a message "The object has no editable properties".

By the way, does this iView need to have URL isolation mode or the embedded is OK as well?

Former Member
0 Kudos

Oh, I forgot to set it to Read/Write... My mistake

Former Member
0 Kudos

It's working 10X!

By the way, is it possible to turn the property into a combo box with predefined values that the user can choose from?

Former Member
0 Kudos

Yes you can do that by changing your portalapp.xml

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="SharingReference" value="htmlb"/>
    <property name="ServicesReference" value="com.sap.portal.runtime.application.contentconversion,com.sap.portal.runtime.application.xsltransform"/>
  </application-config>
  <components>
    <component name="YahooRSS">
      <component-config>
        <property name="ClassName" value="com.ust.RSSComponent.display"/>
        <property name="SecurityZone" value="com.ust.RSSComponent/high_safety"/>
      </component-config>
      <component-profile>
        <property name="styleSheetReference" value="rss.xml"/>
        <property name="News" value="Yahoo! News - Top Stories">
          <property name="personalization" value="dialog"/>
          <property name="type" value="select[Yahoo! News - Top Stories,Yahoo! News - U.S. National,Yahoo! News - World,Yahoo! News - Business,Yahoo! News - Technology,Yahoo! News - Politics,Yahoo! News - Sports,Yahoo! News - Entertainment,Yahoo! News - Health,Yahoo! News - Science]"/>
        </property>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

If you want a fairly involved personalization (with tablview etc) then you will have to write your own custom personalization class.

Former Member
0 Kudos

Hey,

Whan I set this line:

<property name="type" value="select[Yahoo! News - Top Stories,Yahoo! News - U.S. National,Yahoo! News - World,Yahoo! News - Business,Yahoo! News - Technology,Yahoo! News - Politics,Yahoo! News - Sports,Yahoo! News - Entertainment,Yahoo! News - Health,Yahoo! News - Science]"/>

I wtites the values inside the property line when I choose Prersonalize and doesn't displays a combo box... Any idea why?

Former Member
0 Kudos

I didn't get you.

Former Member
0 Kudos

Your portalapp.xml was incorrect. it should look following.

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference"
value="com.sap.portal.htmlb"/>
    <property name="ServicesReference"
value="com.sap.portal.runtime.application.contentconversion,com.sap.port
al.runtime.application.xsltransform"/>
  </application-config>
  <components>
    <component name="ViewPage">
      <component-config>
        <property name="ClassName" value="ViewPage"/>
      </component-config>
      <component-profile>
       <property name="Select a value" value="value1">
        <property name="personalization" value="dialog"/>
        <property name="type" value="select[Value1,Value2,Value3]"/>
       </property>
     </component-profile>
    </component>
  </components>
  <services/>
</application>

Former Member
0 Kudos

10x for everything...

Answers (0)