Skip to Content
author's profile photo Former Member
Former Member

How to read profile properties of a Portal System

Hello,

I developed some portal Components that make use of the usermapping facilities of SAP EP by defining a System like the following (in portalapp.xml)

<component name="PirobaseSystemTemplate">

<component-config>

<property name="ClassName" value="" />

</component-config>

<component-profile>

<property name="com.sap.portal.pcm.Title" value="PirobaseSystemTemplate" />

<property name="ComponentType" value="com.sapportals.portal.system" />

<property name="logonmethod" value="UIDPW" />

<property name="usermappingtype" value="">

<property name="validvalues" value="4/user5/admin10/admin,user" />

<property name="category" value="UserManagement" />

<property name="personalization" value="NON-DIALOG" />

<property name="type" value="String" />

</property>

....

</component-profile>

</component>

I would like to define some arbitrary properties e.g like the following:

<property name="server" value="10.11.1.210" />

that might by customized by a system administrator.

Now I wonder how I can read these properties from a portal component (e.g. an AbtractPortalComponent or a PageProcessorComponent) analog to the component's own profile.

Thanks for any hint.

Regards

Torsten

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 24, 2004 at 06:41 PM

    See Java examples in portal. If I am not wrong, sample 3 does this.

    You must install Java SDK business package and assign yourself Java role.

    Regards

    Vitaliano

    IPortalComponentProfile profile = request.getComponentContext().getProfile();

    profile.getProperty("server");

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Forgot to mention that you can retrieve an attribute within a propery....

      profile.getPropertyAttribute(propertyName,attributeName)

      ex.

      profile.getPropertyAttribute("PirobaseSystemTemplate","server") if your "server" attribute is nested in "PirobaseSystemTemplate"

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2004 at 10:53 AM

    Hi Vitaliano,

    thanks for your help.

    Unfortunately, your answer is not what i was looking for. I know how to read the profile properties from a portal component itself, and i also know how to retrieve mapped user credentials for a specific portal backend System (created on a template as i gave) from some portal component (by implementing an AbstractBackendConnection). But i don't know how to read the profile of the portal SYSTEM that i use to get mapped credentials from this portal component that uses the system.

    So my precise question is: How can I read profile properties of a portal System from another portal component that uses this portal System. I tried around with using a landscape service retrieved from the PortalRuntime, but without success.

    Best regards

    Torsten

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Probably understood.

      Seems you are willing to brake component isolation... sorry that goes beyond my API knowledge.

      I would go for a workaround: say you define component "A" as a service with it's own properties and with a nice "getHostIP()" method. In component "B" you use that service and read the attribute you need.

      Should work unless component "A" is already an SAP one.

      Hope helps.

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2004 at 04:19 PM

    I found the solution using the EP5 backwards compability landscape API:

    ILandscapeService ls = (ILandscapeService) PortalRuntime.getRuntimeResources().getService(ILandscapeService.KEY);

    ISystem system = ls.getSystem("<the systems alias>");

    String attribute = system.getAttribute("<the property key in portalapp.xml>"));

    Regards

    Torsten

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.