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

Portal service configuration

I am writing a portal service and would like to use the System Administration --> System Configiguration --> Service Configuration to store some initialization parameters. I was successful in putting values into the service config via the portalapp.xml file:

<service-profile>

<property name="myConfig" value="true"/>

</service-profile>

What I need to know is how to read those properties from my service. I see an IServiceConfig interface that has a getProperty method, however I don't know how to implement/instantiate it. Also, if this is the correct interface, do I need to add a SharingReference in the <application-config> of the portalapp.xml?

Thanks,

Ray

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2005 at 04:18 PM

    Each service will have a init method and the serviceContext will be passed to you by the Framework.

    You can read the properties from the service context. Similar to this.

     /**
      * Generic init method of the service. Will be called by the portal runtime.
      * @param serviceContext
      */
      public void init(IServiceContext serviceContext)
      {
        String value = serviceContext.getServiceProfile().getProperty("myConfig");
    }

    Thanks

    Ankur

    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.