Hi everybody!,<br><br>I'd like to present a plug-in for collect key properties and be added to properties files (<a href="https://github.com/ppalazon/rxlist-forge">https://github.com/ppalazon/rxlist-forge</a>). Basic, this plug-in search regular expressions in the content of a group of files, for example all java source code (*.java). <br>
<br>I use this plug-in for collect multilingual key used in java and xhtml code. For example:<br><pre><code><a href="http://facesmessages.info">facesmessages.info</a>(messages.getMessage("command.success.message"))</code></pre>
or<br><pre><code><h:outputText value="#{messages['person.preffix']}, #{user.lastname}"/></code></pre>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.<br>
<br>For install:<code> forge git-plugin git://<a href="http://github.com/ppalazon/rxlist-forge.git">github.com/ppalazon/rxlist-forge.git</a>
</code><br><br>This plug-in only contains a commands with 3 arguments<br><br>--rxProperties -> regular expression for find properties files (Messages.*.properties)<br>--rxSearchFiles -> regular expression for say which files explore (.*.java, .*.xhtml, etc)<br>
--regexp -> regular expression for describe where is keys (messages.getMessage\(''(.*?)''\), messages.getMessage\('(.*?)'\))<br><br>Examples:<br>rxlist --rxProperties messages_.*.properties --rxSearchFiles .*.java --regexp Componente1.getMessage\(''(.*?)''\) - (I use 2 simple quotes, don't double quote)<br>
rxlist --rxProperties messages_.*.properties --rxSearchFiles .*.xhtml --regexp messages.getMessage\('(.*?)'\) - With simple quotes<br><br>All regular expression is based on Java Pattern (<a href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html">http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html</a>)<br>
<br>This plugin insert non declared properties keys in properties files, and insert a default content (founded.key=>>founded.key).<br><br>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.<br>
<br>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.<br>