[campcaster-dev] help with XML-RPC API
  • Hi,

    I was trying to use the CC XML-RPC API for searching through the audio library but couldn't find a
    way to specify certain constraints.

    For example, this works:
    $criteria = array('filetype'=>'audioclip',
    'operator'=>'and',
    'limit'=>'10',
    'offset'=>'10',
    'conditions'=>array());
    $res = $xrc->xr_searchMetadata($g_sessionId, $criteria);

    But if I replace the line:
    'conditions'=>array());
    with:
    'conditions'=>array('dc:title', '=', 'Blues'));
    it displays an error (see attached file).

    Please give me a link to documentation on how to compose the criteria or explain it to me here (it
    would be best to be documented on the site).

    Thanks,
    Mugur




    ____________________________________________________________________________________
    Want to start your own business?
    Learn how on Yahoo! Small Business.
    http://smallbusiness.yahoo.com/r-index
  • 4 Comments sorted by
  • On Fri, 10 Nov 2006 23:12:52 +0100 (CET) Mugur Rus wrote:
    > Hi,
    >
    > I was trying to use the CC XML-RPC API for searching through the audio library but couldn't find a
    > way to specify certain constraints.
    >
    > For example, this works:
    > $criteria = array('filetype'=>'audioclip',
    > 'operator'=>'and',
    > 'limit'=>'10',
    > 'offset'=>'10',
    > 'conditions'=>array());
    > $res = $xrc->xr_searchMetadata($g_sessionId, $criteria);
    >
    > But if I replace the line:
    > 'conditions'=>array());
    > with:
    > 'conditions'=>array('dc:title', '=', 'Blues'));
    > it displays an error (see attached file).
    >
    > Please give me a link to documentation on how to compose the criteria or explain it to me here (it
    > would be best to be documented on the site).
    >
    > Thanks,
    > Mugur

    Hi Mugur,
    the problem is here:
    > 'conditions'=>array('dc:title', '=', 'Blues')
    the expected structure is:
    'conditions'=>array('cat'=>'dc:title', 'op'=>'=', 'val'=>'Blues')

    It's little bit more complicated, but it's inherited from XMLRPC search
    query structure where is IMO better to have named fields.

    The structure is described in this source file:
    http://code.campware.org/projects/campcaster/browser/trunk/campcaster/src/modules/storageServer/var/DataEngine.php#L9
    but now it seems to be wrongly processed by doxygen (probably prepared
    for PHPdocumentor) - class description with search query structure is
    not included in html output, it's probably in the source comments only.

    Tom
  • Actually the condition is an array of arrays, and it makes sense Smile
    'conditions'=>array(array('cat'=>'dc:type', 'op'=>'=', 'val'=>'Blues'),
    array('cat'=>'...', ...))

    Thank you for your help!

    Mugur

    --- Tomas Hlava wrote:
    > On Fri, 10 Nov 2006 23:12:52 +0100 (CET) Mugur Rus wrote:
    > > Hi,
    > >
    > > I was trying to use the CC XML-RPC API for searching through the audio library but couldn't
    > find a
    > > way to specify certain constraints.
    > >
    > > For example, this works:
    > > $criteria = array('filetype'=>'audioclip',
    > > 'operator'=>'and',
    > > 'limit'=>'10',
    > > 'offset'=>'10',
    > > 'conditions'=>array());
    > > $res = $xrc->xr_searchMetadata($g_sessionId, $criteria);
    > >
    > > But if I replace the line:
    > > 'conditions'=>array());
    > > with:
    > > 'conditions'=>array('dc:title', '=', 'Blues'));
    > > it displays an error (see attached file).
    > >
    > > Please give me a link to documentation on how to compose the criteria or explain it to me here
    > (it
    > > would be best to be documented on the site).
    > >
    > > Thanks,
    > > Mugur
    >
    > Hi Mugur,
    > the problem is here:
    > > 'conditions'=>array('dc:title', '=', 'Blues')
    > the expected structure is:
    > 'conditions'=>array('cat'=>'dc:title', 'op'=>'=', 'val'=>'Blues')
    >
    > It's little bit more complicated, but it's inherited from XMLRPC search
    > query structure where is IMO better to have named fields.
    >
    > The structure is described in this source file:
    >
    http://code.campware.org/projects/campcaster/browser/trunk/campcaster/src/modules/storageServer/var/DataEngine.php#L9
    > but now it seems to be wrongly processed by doxygen (probably prepared
    > for PHPdocumentor) - class description with search query structure is
    > not included in html output, it's probably in the source comments only.
    >
    > Tom
  • On Sat, 11 Nov 2006 10:48:54 +0100 (CET) Mugur Rus wrote:
    > Actually the condition is an array of arrays, and it makes sense Smile
    > 'conditions'=>array(array('cat'=>'dc:type', 'op'=>'=', 'val'=>'Blues'),
    > array('cat'=>'...', ...))
    >
    > Thank you for your help!
    >
    > Mugur

    Oh sorry,
    but you've detected my mistake well! Smile

    Tom