[forge-dev] Plug-in for collect key properties list from source code with regular expressions

Pablo Palazon pablo.palazon at gmail.com
Thu May 10 14:19:40 EDT 2012


Thank you very much Lincoln!, For me it's a honour if you list this plugin
in the central repository index. And yeah, maybe, I'll do a video-cast, but
my spoken english is a bit poor. But, I'll try it.

On Wed, May 9, 2012 at 1:36 PM, Lincoln Baxter, III <lincolnbaxter at gmail.com
> wrote:

> Hey Pablo!
>
> This is awesome! *Really* useful!
>
> I am embarrassed that we still don't have the plugin repository/website
> online yet; this is one of those plugins that I think a lot of people could
> use :) But in the mean time, would you like your plugin to be listed in the
> central repository index?
>
> https://github.com/forge/plugin-repository/blob/master/repository.yaml
>
> It would be awesome if you wanted to do a little video-cast about how to
> use this plugin. We could put it up in the Forge channel on Vimeo:
> vimeo.com/channels/jbossforge
>
> ~Lincoln
>
> On Mon, May 7, 2012 at 5:16 PM, Pablo Palazon <pablo.palazon at gmail.com>wrote:
>
>> Hi everybody!,
>>
>> I'd like to present a plug-in for collect key properties and be added to
>> properties files (https://github.com/ppalazon/rxlist-forge). Basic, this
>> plug-in search regular expressions in the content of a group of files, for
>> example all java source code (*.java).
>>
>> I use this plug-in for collect multilingual key used in java and xhtml
>> code. For example:
>>
>> facesmessages.info(messages.getMessage("command.success.message"))
>>
>> or
>>
>> <h:outputText value="#{messages['person.preffix']}, #{user.lastname}"/>
>>
>> Normally, I wrote business code and I don't worry about write this in a
>> multilingual properties file. Later, I must review all code for collect
>> used multilingual keys. This is tedious when you have many sources files,
>> and you have some keys in properties file.
>>
>> For install: forge git-plugin git://github.com/ppalazon/rxlist-forge.git
>>
>> This plug-in only contains a commands with 3 arguments
>>
>> --rxProperties -> regular expression for find properties files
>> (Messages.*.properties)
>> --rxSearchFiles -> regular expression for say which files explore
>> (.*.java, .*.xhtml, etc)
>> --regexp -> regular expression for describe where is keys
>> (messages.getMessage\(''(.*?)''\), messages.getMessage\('(.*?)'\))
>>
>> Examples:
>> rxlist --rxProperties messages_.*.properties --rxSearchFiles .*.java
>> --regexp Componente1.getMessage\(''(.*?)''\) - (I use 2 simple quotes,
>> don't double quote)
>> rxlist --rxProperties messages_.*.properties --rxSearchFiles .*.xhtml
>> --regexp messages.getMessage\('(.*?)'\) - With simple quotes
>>
>> All regular expression is based on Java Pattern (
>> http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
>>
>> This plugin insert non declared properties keys in properties files, and
>> insert a default content (founded.key=>>founded.key).
>>
>> If you would like to see this in action, there are some test files in
>> src/test/resources with 2 properties files, 1 java file and 1 xhtml file.
>> You can open original properties files, and search updated properties files
>> with test (RegExpListPluginTest) in a generated directory.
>>
>> I used this plug-in in a web application, and It's useful when you'd been
>> used a lot of properties key for multilingual. I'd like to listen you any
>> suggest, error or improve for this plug-in, or maybe this help you for
>> create new plug-in for forge. Thanks you so much for this platform, it was
>> very easy and quick develop this plug-in.
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20120510/3ad251da/attachment.html 


More information about the forge-dev mailing list