How to set custom attribute values of artifact using Eclipse lyo : OSLC + JAVA
Hello,
I have defined structure in DNG server. Now I am trying to add artifact in that structure.
I am able to add artifact with system artifacts (name, description, etc.)
My question is how to set custom attributes ?
I have tried by setting extendedProperties and updating the same (using correct urls of attribute types). but no luck .
Please suggest how we can add custom attributes in artifact by using eclipse lyo.
One answer
You should be able to do it by updating the extended properties.
You can refer to this article here: https://forum.open-services.net/t/how-to-get-a-custom-attribute-enumerated-value-using-oslc-java-api-in-dng/325/2
It was helpful for me. Keep in mind to:
- Make sure that the right QName is set i.e. the namespace URI, local part and prefix. You can verify this from the rdf+xml response that we get by fetch the resource/artifact or by checking in the Component properties in DNG in the browser.
- Next step would be to add this <QName, Object> pair to the extended properties and UPDATE the resource.
Comments
David Honey
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 06 '21, 4:57 a.m.Have you been able to do so using a web browser plugin like Postman/RESTED etc?
I'd try that first to make sure your HTTP PUT request is correct.