I've picked up the Lyo project and I'm hoping to use it to provide an OSLC interface to an existing product. The aim is to be an OSLC service provider that other people can consume.
My existing web based system is logically separated internally into differing areas that are compartmentalized and permissioned separately, much like Project Areas in IBM's Jazz product stack.
I would like to expose OSLC services that are specific to just one of these internal areas so that when being accessed I can provide permissioning as appropriate, and so the user doesn't need to specify the area on every REST call.
From looking at Rational Quality Manager's service catalog it has a Service Provider for every Project Area, so a consumer then needs to pick the top level provider they wish to use from that catalog before looking up the specific service URLs. I would like to achieve exactly the same pattern in my code.
I can't find a way to achieve this with Lyo. I've looked at the RIO reference implementation as a starting point. I can see there is one service provider for just one area, e.g. Quality Management and then the "Resource" classes have their base path set using the @Path annotation.
This leads to have fixed URLs, but as the Project Area's are dynamic at runtime, how would I use Lyo to expose a Resource on a dynamic URL? is it possible to drive the service exposure programmatically or is Lyo purely driven from the annotations?
You can use a parameter in the root level @Path annotation and then use a different method call on the ServiceProviderFactory to pass through a parameter map <String, Object> which will then perform a key/value substitution to resolve the parameters from the annotations.
So the top level path can be specified as:
Then when creating the ServiceProvider using the ServiceProvider factory use the method:
Hi, Sorry for the slow response - for some reason I'm not getting notifications on this forum. You can use the lyo-dev mailing list in the future for a quicker response.
In any case, yes, you've worked out the exact solution. See the Bugzilla OSLC adapter in the git://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.docs.git repository for code that does exactly this - it maps Bugzilla "products" to individual service providers in the same way IBM Rational Jazz products map project areas to service providers.
Please continue to share your experiences as you move forward with your provider.