cancel
Showing results for 
Search instead for 
Did you mean: 

SAP api call to store preferences...

Former Member
0 Kudos
176

Hi, I'd like to know what SAP provides to store user preferences or configurations? For example, in the Vignette portal, I saw an api call like:

<b>preferences.store();</b>

After this call, the user preferences will be stored somewhere in Vignette.

Does SAP provide a similar api call? If so, can you provide a brief example?

Any suggestions or response are greatly appreciated!

Thanks so much for your help,

Baggett

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Baggett,

You have to first add a property in

portalapp.xml

to be personalized.

Example:

<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
  </application-config>
  <components>
    <component name="display">
      <component-config>
        <property name="ClassName" value="com.ust.fund.display"/>
        <property name="SecurityZone" value="com.ust.fund/high_safety"/>
      </component-config>
      <component-profile>
        <property name="PersonalizationClass" value="com.ust.fund.personalization"/>
        <b><property name="selectedval" value="">
          <property name="personalization" value="no-dialog"/>
        </property></b>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

Then you can then store the value in your personlization class by following code.

public void doEdit(
		IPortalComponentRequest request,
		IPortalComponentResponse response) {

IPortalComponentProfile profile = request.getComponentContext().getProfile();
profile.setProperty("selectedval", "Prakash");
profile.store();
}

Former Member
0 Kudos

Hi Prakash,

Thank you so much for your great response Prakash!

Thank you again,

Baggett

Answers (0)