On Sep 14, 2011, at 8:02 AM, Rubén Pérez wrote:
>
> How is it that you get the xml schema of the returned entity? Does it work
> with all services?
>
Yes. When you add your REST doc annotations, you can specify the JAXB class
that the endpoint returns. Here's an example:
@RestParameter(name = "mediapackage", isRequired = true, description = "The XML
representation of a mediapackage", type = TEXT, defaultValue =
"${this.sampleMediaPackage}", jaxbClass = MediaPackageImpl.class),
In this case, the endpoint accepts (requires, actually) a media package as the
'medipackage' POST parameter. In the Java world, MediaPackage happens to be a
JAXB annotated class, so it can be specified here to further describe the
parameter to the REST docs. If you're using JAXB to annotate your classes, you
get this functionality for free. All you need to do is add it to your doc
annotations.
Just in case you're curious, this annotation also demonstrates another
relatively new feature: the ability to specify sample data by calling a method
on the endpoint itself. Take a look at the defaultValue attribute.
"$this.sampleMediaPackage" causes the REST documentation generator to call
getSampleMediaPackage() on the endpoint object. In this case, it's generating
sample data for one of the testing forms, but I'm sure this could be used for
other purposes too.
There are lots of goodies in the REST doc annotations, so I encourage all
Matterhorn service developers to take a close look at them.
Have fun,
Josh
> 2011/9/14 Josh Holtzman <[email protected]>
> That's because the workflow service isn't running on that machine. I chose
> another service, at random, the "annotation" service:
>
> http://opencastbasecamp.media.uvigo.es/annotation/?_wadl&_type=xml
>
> Josh
>
> On Sep 14, 2011, at 7:41 AM, Rubén Pérez wrote:
>
>> Sorry, it isn't.
>>
>> But you can check this one: http://opencastbasecamp.media.uvigo.es , which
>> neither works...
>>
>> 2011/9/14 Josh Holtzman <[email protected]>
>>
>> _______________________________________________
>> Matterhorn mailing list
>> [email protected]
>> http://lists.opencastproject.org/mailman/listinfo/matterhorn
>>
>>
>> To unsubscribe please email
>> [email protected]
>> _______________________________________________
>
>
> _______________________________________________
> Matterhorn mailing list
> [email protected]
> http://lists.opencastproject.org/mailman/listinfo/matterhorn
>
>
> To unsubscribe please email
> [email protected]
> _______________________________________________
>
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn
To unsubscribe please email
[email protected]
_______________________________________________