Return-Path: X-Original-To: apmail-ace-users-archive@minotaur.apache.org Delivered-To: apmail-ace-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C08A1009E for ; Tue, 6 Aug 2013 12:38:00 +0000 (UTC) Received: (qmail 90756 invoked by uid 500); 6 Aug 2013 12:38:00 -0000 Delivered-To: apmail-ace-users-archive@ace.apache.org Received: (qmail 90702 invoked by uid 500); 6 Aug 2013 12:37:59 -0000 Mailing-List: contact users-help@ace.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@ace.apache.org Delivered-To: mailing list users@ace.apache.org Received: (qmail 90693 invoked by uid 99); 6 Aug 2013 12:37:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 12:37:58 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [194.109.24.31] (HELO smtp-vbr11.xs4all.nl) (194.109.24.31) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 12:37:51 +0000 Received: from macpro.fritz.box (planetmarrs.xs4all.nl [82.95.193.148]) (authenticated bits=0) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id r76CbAQG074241 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 6 Aug 2013 14:37:10 +0200 (CEST) (envelope-from marcel.offermans@luminis.nl) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Client REST API From: Marcel Offermans In-Reply-To: <5200DBD2.40706@pipesbox.de> Date: Tue, 6 Aug 2013 14:37:10 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <92DF3132-68C9-41E8-B6A1-C3B7591EC402@luminis.nl> References: <5200DBD2.40706@pipesbox.de> To: X-Mailer: Apple Mail (2.1508) X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org Hello Elmar, On Aug 6, 2013, at 13:19 , Elmar Zeeb wrote: > i'm looking into apache ace to check if i can use it as backend for a = web based market to install software extensions on an osgi based = application. In this use case i can't use the vaadin based ui but = started to implement a java based client for the client REST API. Underneath the Vaadin, REST and (very recently) GoGo client API's lies = the same Java Client API. In other words, that's a good place to start = with your own client. In this case, the "Workspace" class that is an = abstraction on top of that (part of the REST client) can be used to = start. > I'm aware of the amdatu ace client, but i wanted to implement a client = on my own to understand the api and apache ace. Currently i'm able to = create, modify and delete different client resources (artifact, feature, = distribution and target) but have problems with associations. I have = looked at the client rest api docu on ace.apache.org and at = https://issues.apache.org/jira/browse/ACE-151 to get a better = understanding of associations filters and queries. Ok. > I don't understand how to set the leftEndpoint and rightEndpoint = attributes of associations. As written on the web site these attributes = are LDAP filters. Does this mean that i have to parse the LDAP filter on = the client side to check which resources are associated? Yes, they are LDAP filters. No you don't need to parse them yourself, that is something the = associations will do for you. Just provide the filter condition and it = will be evaluated against objects on the left or right hand side of the = association. > Is there a way to let ace do the filtering and return resource ids? = I'm aware of the = ace/clients/tmp/9876/artifact2feature?left=3D&right=3Dquery. Is there = something like = ace/clients/tmp/9876/artifact2feature/12345/leftResourceIdsto query all = left resource ids of an association? If you create an association, you can set the left and right hand = filters yourself. > The vaadin UI uses attribute based LDAP filters to create = associations. I would like to have static associations based on resource = ids - so i use LDAP filters like "(id=3D[resource id])" to specify = endpoints. Take a look at the Workspace.cas() method (a generic way to create an = association) where you can do something like: ws.cas("distribution2target", "(name=3Dfoo)", "(id=3Dbar)"); Optional arguments to specify the cardinality can be used to force ACE = to use a 1:1 (or 1:N, N:1 or N:N) cardinality. > The vaadin ui can't display these associations. Actually, if you click on some object, it will always highlight = everything that is associated, even if you do it via these = programmatically created associations. > ACE-151 mentions that there are no checks for LDAP filters so the = filter may not work. >=20 > So my question is how to specify association endpoints and how to = query resource ids of associates resources with the client REST API? My advice is to use the Java API. If you have an Assocation object, you = can simply ask it to getLeft() or getRight() and you will get a list of = all associated objects on either side. Greetings, Marcel