Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-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 696F117884 for ; Mon, 9 Mar 2015 14:11:14 +0000 (UTC) Received: (qmail 34607 invoked by uid 500); 9 Mar 2015 14:11:14 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 34544 invoked by uid 500); 9 Mar 2015 14:11:14 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 34532 invoked by uid 99); 9 Mar 2015 14:11:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 14:11:13 +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 (nike.apache.org: domain of 10527@liferay.com designates 209.85.216.177 as permitted sender) Received: from [209.85.216.177] (HELO mail-qc0-f177.google.com) (209.85.216.177) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Mar 2015 14:10:47 +0000 Received: by qcvs11 with SMTP id s11so32761757qcv.6 for ; Mon, 09 Mar 2015 07:08:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=3UVKXbV1ylV9XCq/QCB8lHBoDReTnogglMlKSHG9j8M=; b=Lk+zWPYJ0B30IsvBVd6pSEdVjJzvA83M/E+KMbwb/Jygn3myW1cl0zPhmK+68sbRtN ywtaiV9hPUNRhLzhkMdWl7494aRNCAfmCQlpookWPc/I+V2n+VCtEdkrHvePlq3s5KeY yVV4QBTx6nPRLOiQmnU5MixIO/wO83LqGCXwSAK70Dwx7Whoxt90V0bjmotRcFz9wuS+ hYXr4pO9bzP7WAz2cVENqg/W7pZBdycyTu0IxrSNxnvYY2OhhdHs7ttpFYLucPif+GOD TC6oj1zhxIK1ZRSQ+Ubzra1s46GrONULLyTfT2Zh14ddJRC4gnCP/G3wxsAGsin2K3m8 FeRQ== X-Gm-Message-State: ALoCoQlTtQLw/MoJS88wvb38+Fpf0QBXXKoCblovrM8Ml0yDusDAr0Jz/HbWIqChcC5LJplMZCZV MIME-Version: 1.0 X-Received: by 10.229.48.131 with SMTP id r3mr25190020qcf.29.1425910110570; Mon, 09 Mar 2015 07:08:30 -0700 (PDT) Received: by 10.96.4.194 with HTTP; Mon, 9 Mar 2015 07:08:30 -0700 (PDT) In-Reply-To: <54FD7391.1010709@apache.org> References: <54FD7391.1010709@apache.org> Date: Mon, 9 Mar 2015 10:08:30 -0400 Message-ID: Subject: Re: DS property replacement? From: Raymond Auge To: felix users Content-Type: multipart/alternative; boundary=001a1133c5be9f5ff90510db9184 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133c5be9f5ff90510db9184 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Mar 9, 2015 at 6:18 AM, Carsten Ziegeler wrote: > Am 08.03.15 um 16:24 schrieb Raymond Auge: > > Would people be opposed to felix scr supporting property replacement > > something like (=C3=A0 la spring PropertyPlaceholderConfigurer): > > > > // implied from bundle runtime details > > @Reference(target =3D "(service.bundleid=3D${bundle.id})") > > > > // implied from bundle headers > > @Reference(target =3D "(context.path=3D${Web-ContextPath})") > > > > etc. > > > > One might overload the KXml2SAXParser.getAttributeValue(i) method which > > scans for replaceable tokens where KXml2SAXParser is passed the bundle = in > > it's constructor. > > > I think this one will be troublesome. Apart from having a proprietary > extension where do those values come from? > Bundle headers, and bundle details. > Then you have the "properties" element which you could use to point to > a properties file in your bundle overriding the values - I guess that's > not working for your case. > This can't work. You can only get information which exists before coming into the runtime which is not the goal. > And finally you can change the values through a configuration, so > instead of coming up with a new way to get a value for the placeholders > you create a configuration that set the [reference].target property to > the appropriate value. > This also isn't the goal. The goal is to automate/simplify parts which you don't want to handle via configuration. For instance you would never use the bundle.id because that would be foolish since uninstall and reinstall would make the configuration invalid. However, there are many details for which it might be useful to be able to apply filters on, but due to their dynamic nature its impractical to use them because you must hard code the values currently. This is true for almost all details of a bundle at runtime. It's also true that some information you don't want to duplicate. For instance, anything that is in the manifest you probably want to keep centralized there, and not require a developer to duplicate it since this causes a change management problem. So, my thought about where the information for replacement is that it would come from only - bundle runtime info - manifest Sincerely, - Ray > > Regards > Carsten > -- > Carsten Ziegeler > Adobe Research Switzerland > cziegeler@apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org > > --=20 *Raymond Aug=C3=A9* (@rotty3000) Senior Software Architect *Liferay, Inc.* (@Liferay) Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance= ) --001a1133c5be9f5ff90510db9184--