cancel
Showing results for 
Search instead for 
Did you mean: 

How to get all the allowed values of a property?

Former Member
0 Kudos

Hi all,

I want to read all the allowed values of a property. I have created a new custom property and given 3 values as allowed values.

What i want to do is programtically read all the allowed values of that particular property.

Regards

Rajeev

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I think there should be a better way to do this, but this will work too:

IConfigurationAccess icAccess = Configuration.getInstance();
icAccess.initialize();
IConfigClientContext confContext = IConfigClientContext.createContext(ep5user);
IConfigManager icManager = icAccess.getConfigManager(confContext);
IConfigPlugin icPlugin = icManager.getConfigPlugin("/cm/services/properties_metadata");
imConf = icPlugin.getConfigurable(propertyId);
if (imConf != null) {
String propVal = imConf.getPropertyValue(propName);
}

- <b>propertyId</b> is the Property Id defined in CM configuration.

- you get the values delimited by ',' in <b>propVal</b>

Hope this helps,

Romano

Former Member
0 Kudos

Hi guys,

I'm trying to do exactly the same, i need a list with all the KM properties, i'm using the very same code thar Romano putted on his post, and i'm getting this:

InitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.#

On this sentence:

IConfigurationAccess icAccess = Configuration.getInstance();

I'm developing a Webdynpro application on server A and i'm using the KM libraries through an EJB inside a Webservice on server B.

Do you have any suggestions?

Thanks in advance

Former Member
0 Kudos

Hi,

I want to read all the allowed values of a property. I've not find any code example o reference in KM documentation.

Has anybody a solution?

Thanks in advance,

Former Member
0 Kudos

Hi,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/knowledge management and collaboration developers guide.html

Patricio.