Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 41298 invoked from network); 7 Feb 2011 15:07:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Feb 2011 15:07:15 -0000 Received: (qmail 4513 invoked by uid 500); 7 Feb 2011 15:07:15 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 4334 invoked by uid 500); 7 Feb 2011 15:07:12 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 4326 invoked by uid 99); 7 Feb 2011 15:07:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 15:07:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.82.53] (HELO mail-ww0-f53.google.com) (74.125.82.53) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 15:07:06 +0000 Received: by wwi18 with SMTP id 18so4578123wwi.10 for ; Mon, 07 Feb 2011 07:06:45 -0800 (PST) Received: by 10.227.166.194 with SMTP id n2mr1339709wby.172.1297091204613; Mon, 07 Feb 2011 07:06:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.230.137 with HTTP; Mon, 7 Feb 2011 07:06:24 -0800 (PST) X-Originating-IP: [71.92.39.5] In-Reply-To: References: From: Carl Hall Date: Mon, 7 Feb 2011 10:06:24 -0500 Message-ID: Subject: Re: correct syntax for multi-valued properties in fileinstall cfg files? To: dev@felix.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, Guillaume! I somehow misread that bit of the code and thought .config was reserved for XML. On Mon, Feb 7, 2011 at 4:32 AM, Guillaume Nodet wrote: > Well, that's already in fileinstall since some time. > Though the extension has to be slightly different, iirc, it needs to > be ".config" > > On Sun, Feb 6, 2011 at 16:48, Carl Hall wrote: >> Reposting to dev since this is a development question. =A0I can get a >> patch in for this pretty soon once the direction agreed upon. >> >> >> ---------- Forwarded message ---------- >> From: Carl Hall >> Date: Thu, Jan 27, 2011 at 7:35 PM >> Subject: Re: correct syntax for multi-valued properties in fileinstall >> cfg files? >> To: users@felix.apache.org >> >> >> What if the syntax that is used by the config admin is used for this? >> The processing in ConfigurationHandler can be abstracted and >> fileinstall already has a dependency on config admin. =A0The code has >> been used in Felix for a while, so we would get free testing with it. >> :) >> >> The syntax is this: >> value =3D type ( "[" values "]" | "(" values ")" | simple ) . >> values =3D value { "," value } . >> simple =3D "{" stringsimple "}" . >> type =3D // 1-char type code . >> stringsimple =3D // quoted string representation of the value . >> >> Examples of this, >> * ["thing1","thing2"] =3D> String[2] >> * i[10,250,365] =3D> int[3] >> >> I would like to add this feature, so any discussion on how best to >> proceed is greatly welcomed. >> >> >> >> On Thu, 18 Mar 2010 13:19:36 -0700 Justin Edelson said, >> >> Ah, so the >>> =A0 =A0 header ::=3D
( ':' | '=3D' ) ( '\ = ) * >> >> part is saying that a single value can be split over multiple lines... >> gotcha. >> >> I think the scr javadoc annotation way is reasonable, although it's not >> backwards-compatible. >> >> Justin >> >> >> >> On 3/18/10 4:03 PM, Chris Custine wrote: >>> OK, I see what you are after now :-) =A0The fileinstall config handler >>> doesn't currently support multivalue properties, so whatever you set on >>> a property value gets parsed as a single string (the code simply uses >>> load(inputstream) from the Properties class). =A0This functionality cou= ld >>> probably be added, but we would have to decide on a way to differentiat= e >>> between scalar values and arrays ("this, is, one, string" vs. String[] >>> property =3D {"this","is","one","string"} ). =A0Another option would be= to >>> support syntax similar to the scr javadoc annotations and munge the >>> properties into an array (value.1=3D"this", value.2=3D"is", etc >>> become String[] property =3D {"this","is", etc} ). =A0If you are intere= sted >>> in that feature, please create a Jira and someone will take a look. >>> =A0http://issues.apache.org/jira/browse/FELIX >>> >>> Until then, you could either add your own config admin code to do >>> something like this, or you can add a method with a single string >>> argument to accept the property and then parse and process into your >>> component after it is set by scr from the config admin. >>> >>> Thanks, >>> Chris >>> >>> -- >>> Chris Custine >>> FUSESource :: http://fusesource.com >>> My Blog :: http://blog.organicelement.com >>> Apache ServiceMix :: http://servicemix.apache.org >>> Apache Felix :: http://felix.apache.org >>> Apache Directory Server :: http://directory.apache.org >>> >>> >>> On Thu, Mar 18, 2010 at 10:11 AM, Justin Edelson >>> > wrote: >>> >>> =A0 =A0 Thanks Chris. >>> >>> =A0 =A0 I was actually referring to the configuration files (with .cfg >>> =A0 =A0 extension) which is described here: >>> >>> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFelix= FileInstall-Configurations >>> >>> =A0 =A0 I would like to set a property to a String array. With scr qdox >>> =A0 =A0 annotations, this would look like this: >>> =A0 =A0 =A0 =A0/** >>> =A0 =A0 =A0 =A0 * @scr.property values.1=3D"/foo" values.2=3D"/bar" >>> =A0 =A0 =A0 =A0 */ >>> >>> =A0 =A0 I saw this line in the documentation: >>> =A0 =A0 header ::=3D
( ':' | '=3D' ) ( '\ = ) * >>> >>> =A0 =A0 which implied to me that the syntax I used below would work. >>> >>> =A0 =A0 If no one knows, I'll look through the code. Maybe this isn't p= ossible. >>> >>> =A0 =A0 Justin >>> >>> >>> =A0 =A0 On 3/17/10 11:37 PM, Chris Custine wrote: >>> =A0 =A0 > There really aren't any config properties for fileinstall tha= t accept >>> =A0 =A0 > multiple values as far as I know. =A0If you need to monitor m= ultiple >>> =A0 =A0 > directories you can create multiple config files as shown in = the >>> =A0 =A0 > fileinstall docs >>> =A0 =A0 > here: >>> >>> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFelix= FileInstall-WatchingmultipledirectorieswithFileInstall >>> =A0 =A0 > >>> =A0 =A0 > Chris >>> =A0 =A0 > >>> >>> >>> =A0 =A0 > -- >>> =A0 =A0 > Chris Custine >>> =A0 =A0 > FUSESource :: http://fusesource.com >>> =A0 =A0 > My Blog :: http://blog.organicelement.com >>> =A0 =A0 > Apache ServiceMix :: http://servicemix.apache.org >>> =A0 =A0 > Apache Felix :: http://felix.apache.org >>> =A0 =A0 > Apache Directory Server :: http://directory.apache.org >>> =A0 =A0 > >>> =A0 =A0 > >>> =A0 =A0 > On Wed, Mar 17, 2010 at 7:07 PM, Justin Edelson >>> =A0 =A0 >>> =A0 =A0 > >> >>> =A0 =A0 wrote: >>> =A0 =A0 > >>> =A0 =A0 > =A0 =A0 What is the correct syntax for multi-valued propertie= s in a >>> =A0 =A0 fileinstall >>> =A0 =A0 > =A0 =A0 cfg file? I tried a few variations on: >>> =A0 =A0 > >>> =A0 =A0 > =A0 =A0 name=3Dvalue1 \ >>> =A0 =A0 > =A0 =A0 =A0value2 \ >>> =A0 =A0 > =A0 =A0 =A0value3 >>> =A0 =A0 > >>> =A0 =A0 > =A0 =A0 but they didn't work. >>> =A0 =A0 > >>> =A0 =A0 > =A0 =A0 Thanks, >>> =A0 =A0 > =A0 =A0 Justin >>> =A0 =A0 > >>> =A0 =A0 > >>> =A0 =A0 ---------------------------------------------------------------= ------ >>> =A0 =A0 > =A0 =A0 To unsubscribe, e-mail: users-unsubscr...@felix.apach= e.org >>> =A0 =A0 >>> =A0 =A0 > =A0 =A0 >> =A0 =A0 > >>> =A0 =A0 > =A0 =A0 For additional commands, e-mail: users-h...@felix.apa= che.org >>> =A0 =A0 >>> =A0 =A0 > =A0 =A0 >> =A0 =A0 > >>> =A0 =A0 > >>> =A0 =A0 > >>> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org >> For additional commands, e-mail: users-h...@felix.apache.org >> > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com >