public StreamingOutput performQueryOnResource ( final String resourceName , final long nodeId , final String query , final Map < QueryParameter , String > queryParams ) { final StreamingOutput sOutput = new StreamingOutput ( ) { @ Override public void write ( final OutputStream output ) throws IOException , JaxRxException { final String revision = queryParams . get ( QueryParameter . REVISION ) ; final String wrap = queryParams . get ( QueryParameter . WRAP ) ; final String doNodeId = queryParams . get ( QueryParameter . OUTPUT ) ; final boolean wrapResult = ( wrap == null ) ? true : wrap . equalsIgnoreCase ( YESSTRING ) ; final boolean nodeid = ( doNodeId == null ) ? false : doNodeId . equalsIgnoreCase ( YESSTRING ) ; final Long rev = revision == null ? null : Long . valueOf ( revision ) ; final RestXPathProcessor xpathProcessor = new RestXPathProcessor ( mDatabase ) ; try { xpathProcessor . getXpathResource ( resourceName , nodeId , query , nodeid , rev , output , wrapResult ) ; } catch ( final TTException exce ) { throw new JaxRxException ( exce ) ; } } } ; return sOutput ; }
This method is responsible to perform a XPath query expression on the XML resource which is addressed through a unique node id .