syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject Re: AnyObjects query
Date Wed, 28 Jun 2017 07:54:01 GMT
On 27/06/2017 18:18, Colm O hEigeartaigh wrote:
> Thanks Francesco! On a related note, let's say I have some AnyObjects
> (Printer) with a relationship to other AnyObjects (Cartridge). Now I want
> to search for a Printer which has a relationship with a Cartridge with a
> "colour" attribute of "blue". Is there a way to do this via a FIQL
> expression?

No, you cannot express such condition ATM; you could do for example:

         SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").
inRelationships("ce75249b-76e4-44b6-88ae-0841846faceb").
                 and().is("colour").equalTo("blue").query();

which translates to FIQL

$type==PRINTER;$relationships==ce75249b-76e4-44b6-88ae-0841846faceb;colour==blue

but this would rather search for blue printers having a relationship 
with an any object with key 'ce75249b-76e4-44b6-88ae-0841846faceb'.

or alternatively

         SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").
                 inRelationshipTypes("WITH_CARTDRIGE").
                 and().is("color").equalTo("blue").query();

which translates to FIQL

$type==PRINTER;$relationshipTypes==WITH_CARTDRIGE;color==blue

but this would rather search for blue printers having a relationship on 
type  WITH_CARTDRIGE.

Regards.

> On Tue, Jun 27, 2017 at 4:29 PM, Francesco Chicchiriccò <ilgrosso@apache.org>
wrote:
>
>> On 27/06/2017 17:24, Colm O hEigeartaigh wrote:
>>
>>> Hi all,
>>>
>>> How can I retrieve a list of AnyObjects? The following returns a 400:
>>>
>>> curl -I -X GET -u admin:password
>>> http://localhost:9080/syncope/rest/anyObjects
>>>
>> You must at least provide the AnyType, e.g.
>>
>> http://localhost:9080/syncope/rest/anyObjects;fiql=%24type%3D%3DPRINTER
>>
>> Regards.

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Mime
View raw message