cancel
Showing results for 
Search instead for 
Did you mean: 

How to get read the value from portalapp.xml of a KM service

Former Member
0 Kudos

Hi All,

I am working on KM Services. The service is for setting the VALIDUNTIL date of the documents uploaded to the KM. The VALIDUNTIL date is based one of the custom property.

If the property is A then the VALIDUNIT date is +1 year from the date of creation.. like tat for B and C.

I want to store the no of years for A,B and C in a properties file, so tat it can be changed later.

I have tried putting it into a resource bundle and accessing it but I am not able to access it.

What I am thinking is adding these value in portalapp.xml. Can any of u suggest how to get read the value from portalapp.xml of a KM service at runtime.

Regards

George

View Entire Topic
Former Member
0 Kudos

		<YourService> service = (<YourService>)PortalRuntime.getRuntimeResources().getService(<YourService>.KEY);
		String value = service.getContext().getServiceProfile().getProperty("key");

You can read a value from portalapp.xml using the above.

Former Member
0 Kudos

Thanks Ankur,

But I am not able to read... this is the code I have tried

RFServiceWrapper myServ = (RFServiceWrapper)PortalRuntime.getRuntimeResources().getService(RFServiceWrapper.KEY);

Please correct me if I am wrong

Regards

George

Former Member
0 Kudos

I am assuming RFServiceWrapper is your interface of the service.

When you execute this code, do you get any value for

myServ 

object. If not

what is the value of the Static variable KEY defined in the interface

RFServiceWrapper

Former Member
0 Kudos

Hi Ankur,

The interface is ....

public interface IRFServiceWrapper extends IService{

public static final String KEY = "com.sap.km.service.KMService";

}

The exception i am getting is not able to find the service..."KMService".

Regards

George

Former Member
0 Kudos

Hi George,

I have the same problem. How did you resolve it?

Best regards

Irene

Former Member
0 Kudos

Hi Iryna,

I used .properties file for storing the properties..

Cheers

George

Former Member
0 Kudos

Hi George, thank you for the quick answer. Wich properties do you mean?

Regards Iryna

Former Member
0 Kudos

Hi Iryna,

I have some proj specific properties... tats wat I have included...

Regards

George