Skip to Content
0
Former Member
Nov 23, 2005 at 05:05 AM

Adding and Setting New Custom Properties in KM

17 Views

Hello,

I am creating and setting the custom properties using KM APIs

Here is a code for that

IResource resource= ResourceFactory.getInstance().getResource(aRid, rContext);

IPropertyName propertyName = (IPropertyName)new PropertyName(NAMESPACE, "Test");

IProperty propertyValued = (IProperty)resource.getProperty(propertyName);

if (propertyValued == null) {

propertyValued = new Property(propertyName,"testing123");

resource.setProperty(propertyValued);

}

But I am getting a null pointer exception.

Can anybody suggest?

Thanks

Raj