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 107DBD87A for ; Fri, 1 Mar 2013 21:24:08 +0000 (UTC) Received: (qmail 43882 invoked by uid 500); 1 Mar 2013 21:24:08 -0000 Delivered-To: apmail-ace-users-archive@ace.apache.org Received: (qmail 43839 invoked by uid 500); 1 Mar 2013 21:24:07 -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 43827 invoked by uid 99); 1 Mar 2013 21:24:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Mar 2013 21:24:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [134.221.1.26] (HELO fromintouta.tno.nl) (134.221.1.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Mar 2013 21:24:00 +0000 X-IronPort-AV: E=Sophos;i="4.84,762,1355094000"; d="scan'208";a="4860163" Received: from unknown (HELO mail.tno.nl) ([134.221.225.221]) by mailhost1a.tno.nl with ESMTP; 01 Mar 2013 22:23:38 +0100 Received: from EXC-MBX03.tsn.tno.nl ([169.254.3.241]) by EXC-CASHUB02.tsn.tno.nl ([134.221.225.221]) with mapi id 14.02.0318.004; Fri, 1 Mar 2013 22:23:37 +0100 From: "Passchier, I. (Igor)" To: "users@ace.apache.org" Subject: RE: deploying configuration data Thread-Topic: deploying configuration data Thread-Index: Ac4Wmj37OgW7wgjgSJy50dVE7AXwZP//+pOA//+qe5A= Date: Fri, 1 Mar 2013 21:23:36 +0000 Message-ID: <502E576EF60C794092D158A61A9D02131E831222@EXC-MBX03.tsn.tno.nl> References: <502E576EF60C794092D158A61A9D02131E830D75@EXC-MBX03.tsn.tno.nl> <2C4FB872-6C21-4D69-82A5-D11F20E435BB@luminis.nl> In-Reply-To: <2C4FB872-6C21-4D69-82A5-D11F20E435BB@luminis.nl> Accept-Language: en-US, nl-NL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [134.221.225.191] Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello Marcel, Thanks for your reply. Adding the auto configuration resource processor mad= e that indeed the configuration files are accepted and deployed. However, t= hey now fail on non conformance of my config file by the auto configuration= resource processor. I think I have some xsd version issue, which I will tr= ace down. Ace seems to be doing what I need. After fixing the non conforman= ce, I will give Velocity a try. Regards, Igor Passchier -----Original Message----- From: Marcel Offermans [mailto:marcel.offermans@luminis.nl] = Sent: vrijdag 1 maart 2013 18:12 To: users@ace.apache.org Subject: Re: deploying configuration data Hello Igor, On Mar 1, 2013, at 17:35 , "Passchier, I. (Igor)" w= rote: > I am operating a set of OSGi platforms, based on apache Felix, which I wo= uld like to manage with apache ace. Most bundles are developed by ourselves= , where dependency and configuration is automated with SCR. Currently platf= orm management and configuration is done via Felix webconsole. I tried to f= ind a way to supply configuration data via apache ace, but to no avail. ACE supports the "Auto Configuration Specification" as described in the OSG= i Compendium chapter 115. We should probably do a better job at documenting how this works though. > In the various mailing list and source code, I found references to the xm= l metatype description, but deploying these via Ace fails in the deployment= stage. I also found references to the use .cfg files containing key/value = pairs, but these I cannot add on the server side ("no artifact recognizer"). You should not use the .cfg files, unless you write a resource processor fo= r them yourself, but that is not the easiest way. > How can I deploy configuration data to my osgi targets via Ace, preferabl= y depending on some properties of my targets? There are a couple of things you need to do: 1) Add an artifact to ACE that implements the Auto Configuration resource p= rocessor. I suggest you either download the latest release from [1] or buil= d it from source (it's part of Apache Felix) yourself. Note that when you a= dd this artifact to ACE, it will *not* become visible in the left most colu= mn, but it will be in the OBR. If you omit this step, things will seem to w= ork, but you cannot deploy configurations as at deploy time it will try to = ship the resource processor automatically along with the xml configurations. 2) Create an xml configuration that complies to the specification, and uplo= ad that as an artifact as well. It should be visible, and you should be abl= e to assign it to a feature and get it on a target just like you would with= bundles. 3) Now deploy. :) To answer your final question, there is one extra feature that ACE supports= for these xml config files, and that is they can be processed using Veloci= ty. That means you can make a configuration file that really is a template,= and in the template you can define variables that will be replaced with va= lues. Now how can you provide values for these variables? Go to a target in the UI, double click it, then go to the tag editor. Here = you can enter key/value pairs and these will be used to fill out your templ= ate. If you have a variable called "hostname" there, you should use the fol= lowing in the xml file: "${context.hostname}". So, always prefix them with = "context.". If you want to do more fancy things, check out the Velocity website. For more advanced use, you can also add tags to features or distributions. = That is sometimes useful if you have a configuration value for a whole grou= p of targets. Hope this helps. If not, let me know! Greetings, Marcel [1] http://felix.apache.org/downloads.cgi This e-mail and its contents are subject to the DISCLAIMER at http://www.tn= o.nl/emaildisclaimer