Provider Link Modifications [message #1439114] |
Mon, 06 October 2014 22:15  |
Eclipse User |
|
|
|
Are there any examples for updating an existing link on the provider side? Also, are there any examples demonstrating how to delete an existing link?
For example, create a references link in DOORS/DWA via Lyo. Now update the existing link's name || description || uri. Maybe later delete the link.
Thanks,
Matt
|
|
|
Re: Provider Link Modifications [message #1439784 is a reply to message #1439114] |
Tue, 07 October 2014 14:01   |
Eclipse User |
|
|
|
Matt,
Lyo has a Link class that holds the link URI and a label. If you use the Lyo client Requirement class, it should work out of the box.
/org.eclipse.lyo.client.java/src/main/java/org/eclipse/lyo/client/oslc/resources/Requirement.java
You might know, but there is a sample that works with DOORS showing how to update a Requirement.
/org.eclipse.lyo.client.java.sample/src/main/java/org/eclipse/lyo/client/oslc/samples/DoorsOauthSample.java
The sample creates a link, but modifying an existing link works the same way. Removing a link from the set should delete the link.
Good luck,
Sam
|
|
|
Re: Provider Link Modifications [message #1440240 is a reply to message #1439784] |
Wed, 08 October 2014 05:35   |
Eclipse User |
|
|
|
Sam,
Thanks for the reply. That makes sense. I was still using the DoorsOauthSample code which works around the DOORS related Lyo bug 438163 by using Jena directly.
I know there are a couple ways to work around the strict data type enforcement but nothing which is provider specific. For example, I know I can modify the JenaModelHelper to use getString() instead of getValue() to avoid the Date format exception. Or set the "org.eclipse.lyo.oslc4j.strictDatatypes" system's property to false. The problem is these are global changes that can impact the validation of data types when consuming other providers within the same runtime.
What do you think of making the "org.eclipse.lyo.oslc4j.strictDatatypes" property a Thread based value which can be toggled at runtime? That way the consumer application can specify when to enforce the strictness of the data type values based on the providers they're connecting to.
Thanks again,
Matt
|
|
|
Re: Provider Link Modifications [message #1440562 is a reply to message #1440240] |
Wed, 08 October 2014 14:19  |
Eclipse User |
|
|
|
Hey, Matt. The sample has been updated to work with Requirement class again, working around the date problem. You might git pull for the latest.
It's reasonable to limit the strict datatypes property to a thread or a request, although I'd have to think about how to do it. Note you should be able to turn it on and off using System.setProperty(), but it affects all threads.
Sam
|
|
|
Powered by
FUDForum. Page generated in 0.07835 seconds