Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    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 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"

  • avatar image
    Former Member
    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 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

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded