Skip to Content
0
Former Member
Mar 27, 2006 at 06:03 AM

How to get Allowed Values of a property in Property Metadata?

35 Views

Hi, SDN fellows.

I am having problem retrieve the allowed values of a property in property metadata.

I went through the KM example - Implementing a Metadata Extension for KMC Properties. I get some hints on what class that I should use to do this. But I still don't get the solution I want it.

I tried to use the DefaultMetadataExtension (which implements IDynamicValues) to call the method getAllowedValues(IMetaName metaName).

But when I need to pass in the IMetaName, I don't know how shoould I get it.

Here is my code:

com.sapportals.wcm.service.propertyconfig.IMetaModel mm = null;
		IPropertyConfigurationService configService;
		try {
			configService =
				(IPropertyConfigurationService) ResourceFactory
					.getInstance()
					.getServiceFactory()
					.getService("PropertyConfigurationService");
			mm = configService.getMetaModel();
		} catch (ResourceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (PropertyConfigurationServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		DefaultMetadataExtension mext = new DefaultMetadataExtension(mm);
		IMetaName mname = ???? //where do I get this IMetaName?
		mext.getAllowedValues(mname);


Said I what to get the property with this information:

1) Namespace = xyz

2) PropertyName = abc

3) Property Type is String

How should I get the IMetaName out of this?

Thanks for advices.

Kent