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 EF5FA179D6 for ; Mon, 13 Apr 2015 16:55:12 +0000 (UTC) Received: (qmail 76000 invoked by uid 500); 13 Apr 2015 16:55:09 -0000 Delivered-To: apmail-ace-users-archive@ace.apache.org Received: (qmail 75982 invoked by uid 500); 13 Apr 2015 16:55:09 -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 75968 invoked by uid 99); 13 Apr 2015 16:55:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 16:55:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of robert.mather.rmm@gmail.com designates 209.85.216.41 as permitted sender) Received: from [209.85.216.41] (HELO mail-vn0-f41.google.com) (209.85.216.41) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 16:55:05 +0000 Received: by vnbf1 with SMTP id f1so21591787vnb.5 for ; Mon, 13 Apr 2015 09:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=pfbNi+VbhHk3gQ2RkgEpKZjr+F3zvCWqWxY8FqBHGkQ=; b=HItQTVW7vU1EnSUcURWH0DXq36RH6JapOGMkK78W14w9K86Vu0LiZhmePQ7SObaJBR zwVqcDEgbzRzjK05CDc9IEQy5MzwTccOoNMSQPiQKdCmSkTwA0brzEA2r/eSuBikeNd3 MJqc7uNHqjLovH29ZeG9fetV6cQ6iWVyJYCnpuDJLNrkyzoPtPxiqyi9rWpiU5pdtn73 jDnbH9Kn41/LqCl4UzGaU7VH556xQLUln3odBAI07XyVLX5RvjLDEFhId3hn7bi+7dE4 4R0HBFBZHbNnY0hFGNldRpJXJxHapQVRRWBqOeb1ckh3SJuzWmIwSSnX79qcdKXBCtWF r98w== X-Received: by 10.140.98.245 with SMTP id o108mr18597461qge.36.1428944039706; Mon, 13 Apr 2015 09:53:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.155.9 with HTTP; Mon, 13 Apr 2015 09:53:39 -0700 (PDT) In-Reply-To: References: From: "Robert M. Mather" Date: Mon, 13 Apr 2015 09:53:39 -0700 Message-ID: Subject: Re: Some clarifications about ACE template config engine To: users@ace.apache.org Content-Type: multipart/alternative; boundary=001a113a9a8ee408a105139df568 X-Virus-Checked: Checked by ClamAV on apache.org --001a113a9a8ee408a105139df568 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Mar 23, 2015 at 6:32 AM, Jan Willem Janssen < janwillem.janssen@luminis.eu> wrote: > Hi Robert, > > > On 21 Mar 2015, at 05:25, Robert M. Mather > wrote: > > > > Using the template engine > > < > https://ace.apache.org/docs/user-guide.html#using-the-template-engine-for= -targets > >, > > would a metatype.xml inside a bundle (ie in the OSGI-INF/metatype > > directory, per the spec) be processed and the variables substituted, or > > does the metatype need to be deployed as a separate artifact. > > By default, the ACE templating system only works on metatype resources > deployed > as separate files. The idea behind this is that you generally want to hav= e > a > =E2=80=9Cstandard=E2=80=9D set of bundles which can be configured individ= ually per target. > > > Just for my understanding, where does the interpolation actually take > > place? I've been assuming it's a process at the client/target=E2=80=A6 > > The processing is done at the server side right before the deployment > package > is transferred to the client. This way, each client can get its own > =E2=80=9Cunique=E2=80=9D > deployment set including the proper configuration files. > > > If the same "tag" key gets set at multiple stages (ie artifact, feature= , > > dist, and/or target), is the a "last one wins" rule or something when t= he > > interpolation takes place? > > IIRC, the last ones wins indeed, but I=E2=80=99d need to test that out my= self... > > > > > And finally, is this example metatype.xml the right idea for adding the > > ${context.blah} variables (in the content field)? > > > > > xmlns:metatype=3D"http://www.osgi.org/xmlns/metatype/v1.1.0"> > > > > > > > > > > > > > > > content=3D"${context.serverUrl}" /> > > > > > > Almost: the bundle-attribute needs to be prefixed with =E2=80=9Cosgi-dp:= =E2=80=9D to make > it clear that the configuration PID (org.amdatu.conf) is for a bundle > that is part of a deployment package. The AutoConf resource processor use= d > by ACE does not allow configurations to be provisioned to bundles that ar= e > *not* part of a deployment package. > Apart from that the example metatype is correct, including the template > variable. I haven't done anything to explicitly prepare my bundles as part of a deployment package. Does ACE do this automatically somehow, or do I need to modify the bundle to indicate that it's associated with the same deployment package as the metatype configuration? I've never worked with the deployment package part of the OSGi spec before... > > > I'm using declarative services with bnd(tools), which is generating > > metatype from my @OCD annotated interfaces, so I'm trying to find the > > best/most automated way to prepare those for Apache ACE with template > > variables. > > > > Any thoughts on the right way to do that would be much appreciated, I'm > > hoping I'm not the first person to want to do something like this! > > Its been a while since I played with the metatype support of Bnd, but > I believe it will embed the metatype resource files inside the bundles, > which (as I written above) are not considered by the ACE template > processor. If you want to keep using Bnd for generating metatype > resources (which I can understand, given its great support) you could > separate the actual configuration (read: Designate) from its definition > (read: OCD): the metatype spec does allow that. This would mean that you > provide the designates in separate files (which the ACE template > processor can act upon) while the OCDs are created from your Bnd build. > > Hope this helps, > > -- > Met vriendelijke groeten | Kind regards > > Jan Willem Janssen | Software Architect > +31 631 765 814 > > My world is revolving around INAETICS and Amdatu > > Luminis Technologies B.V. > Churchillplein 1 > 7314 BZ Apeldoorn > +31 88 586 46 00 > > http://www.luminis-technologies.com > http://www.luminis.eu > > KvK (CoC) 09 16 28 93 > BTW (VAT) NL8169.78.566.B.01 > > --001a113a9a8ee408a105139df568--