Here is an example of adding parameters

  protected void describePost(MethodInfo info) {
    super.describePost(info);

    info.addRequestRepresentation(new
Variant(MediaType.MULTIPART_FORM_DATA));

    info.addRequestParameter("numRequests", false, "xsd:long",
      ParameterStyle.QUERY,
      "The number of requests to be processed in this Batch Job");
    info.addRequestParameter(
      "inputDataContentType",
      true,
      "xsd:string",
      ParameterStyle.QUERY,
      "The MIME type of the input data specified by an inputData or
inputDataUrl parameter");
    info.addRequestParameter("inputDataUrl", false, "xsd:anyURI",
      ParameterStyle.QUERY, "The URL to the input data");
    info.addRequestParameter("inputData", false, "xsd:base64Binary",
      ParameterStyle.QUERY, "The inline input data");
}

So basically you override the method, call the super class version of the
method and then modify the object with your extensions.

Paul

On Fri, Feb 20, 2009 at 11:12 AM, John Wismar <[email protected]>wrote:

> Are there any samples available that show how to use WadlApplication and
> WadlResource to generate a customized WADL document?  I have the bare
> minimum implemented, where I derive from these classes, and get a minimal
> WADL doc that describes the URIs, and mentions the "GET" operations for a
> resource, but I don't understand the API well enough to customize the
> output, for example, by specifying possible error returns.
>
> For example, if I have a resource that can return HTML messages for errors
> (400, 401 or 404), or XML for redirection (300 or 303), or a normal 200,
> what steps do I need to do?  Clearly I need to override
> WadlResource.describeGet(), but beyond that, I get somewhat lost.
>
> Thanks for any pointers!
>
> --------------------------------
> John Wismar
> [email protected]
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1200079
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1200094

Reply via email to