Hi,
Many thanks for the update.
Where is 6.5.1 available (not yet on Maven?) - I replaced the jax-rx jar manually for now, but is jax-rx jar a dependency of basex-api jar (so will be auto-updated with next revision of basex-api.jar)?
Also, because I upload data (initial creation of XML Collection and populating it) via the jax-rx interface, I end up with 3 documents with the same name in the same collection. I want to perform my queries on all those documents at once but do not want 3 top level elements (want just one). In other words, I want the following query to return one result (should one xquery like this not return one result, i.e., one top-level element?), not three results (i.e., not three APPLICATIONS elements):
xquery version "1.0";
declare namespace fn="http://www.w3.org/2005/xpath-functions";
declare variable $region as xs:string external;
declare variable $dataSet as xs:string external;
declare variable $databaseName as xs:string external;
let $finalURL := fn:concat($databaseName, "/",$dataSet,"/",$region,"/data.xml")
for $all in db:open($finalURL)
let $count := count($all/APPLICATION)
return
<APPLICATIONS>
{
for $anApp in $all/APPLICATION
let $appName := $anApp/NAME/text()
let $appID := $anApp/ID/text()
order by $appName
return
<APP count='{$count}'>
<NAME>{$appName}</NAME>
<ID>{$appID}</ID>
</APP>
}
</APPLICATIONS>
Hi,
the choice of the response media type has been revised in the latest
version of the JAX-RX interface, which you find here:
http://www.inf.uni-konstanz.de/dbis/basex/maven/org/jaxrx/jax-rx/1.2.9/
I've updated our documentation to reflect the changes; the single
steps can be found here:
http://docs.basex.org/wiki/REST#Response_Media_Type
Hope this helps,
Christian
On Mon, Jan 31, 2011 at 1:23 PM, Christian Grün
<christian.gruen@gmail.com> wrote:
>> output does allow media-type to be specified...
>
> Thanks for the observation.. True, I overlooked this parameter.
> Currently, it is only used for adding a meta tag if "xhtml" or "html"
> is chosen as output method. An example:
>
> curl -i "http://localhost:8984/basex/jax-rx?wrap=no&query=<head/>&output=method=xhtml&output=include-content-type=yes"
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> </head>
>
> …but it would perfectly make sense to adopt this parameter as general
> media type. Looks as if this will lead to some more changes, as the
> JAX-RX Interface passes on all output (serialization) parameters to
> the underlying implementation (BaseX) without touching them – but,
> nevertheless, it defines the media type of the result, depending on
> the value of the "wrap" parameter.
>
> The JAX-RX Interface is currently implemented by at least two
> implementations (BaseX and TreeTank), so I'll have to check first when
> the extension can be integrated; we'll keep you updated.
>
> Christian
>