12e5b6d6dSopenharmony_ci<HTML><!-- #BeginTemplate "/Templates/MainTemplate.dwt" --> 22e5b6d6dSopenharmony_ci<HEAD> 32e5b6d6dSopenharmony_ci<!-- #BeginEditable "doctitle" --> 42e5b6d6dSopenharmony_ci<TITLE>RBReporter Scan File</TITLE> 52e5b6d6dSopenharmony_ci<!-- #EndEditable --> 62e5b6d6dSopenharmony_ci<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> 72e5b6d6dSopenharmony_ci<STYLE TYPE="TEXT/CSS"> 82e5b6d6dSopenharmony_ci<!-- 92e5b6d6dSopenharmony_ci.topicHead { font-family: "Times New Roman", Times, serif; font-size: 14pt; font-weight: bold; text-align: center; color: #333333} 102e5b6d6dSopenharmony_ci.topicList { font-family: Georgia, "Times New Roman", Times, serif; font-size: 9pt; color: #FF0099; list-style-image: url(images/diamond_bullet.gif); text-decoration: none; font-weight: bold} 112e5b6d6dSopenharmony_ci.mainBlock { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 10px; padding-bottom: 5px; padding-left: 10px; text-align: justify} 122e5b6d6dSopenharmony_ci--> 132e5b6d6dSopenharmony_ci</STYLE> 142e5b6d6dSopenharmony_ci</HEAD> 152e5b6d6dSopenharmony_ci 162e5b6d6dSopenharmony_ci<BODY BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"> 172e5b6d6dSopenharmony_ci<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 182e5b6d6dSopenharmony_ci <TR> 192e5b6d6dSopenharmony_ci <TD ROWSPAN="2" COLSPAN="2" BACKGROUND="images/template_ul.gif" HEIGHT="75"><IMG SRC="images/spacer.gif" WIDTH="280" HEIGHT="1" HSPACE="0"></TD> 202e5b6d6dSopenharmony_ci <TD HEIGHT="15" WIDTH="100%" BACKGROUND="images/template_u.gif"></TD> 212e5b6d6dSopenharmony_ci </TR> 222e5b6d6dSopenharmony_ci <TR> 232e5b6d6dSopenharmony_ci <TD HEIGHT="60" > 242e5b6d6dSopenharmony_ci <CENTER><IMG SRC="images/TitleLogo_transparent.gif" VSPACE="0"></CENTER> 252e5b6d6dSopenharmony_ci </TD> 262e5b6d6dSopenharmony_ci </TR> 272e5b6d6dSopenharmony_ci <TR> 282e5b6d6dSopenharmony_ci 292e5b6d6dSopenharmony_ci <TD WIDTH="200" BACKGROUND="images/template_l.gif" VALIGN="top"> 302e5b6d6dSopenharmony_ci <TABLE WIDTH="180" CELLSPACING="0" CELLPADDING="1"> 312e5b6d6dSopenharmony_ci <TR> 322e5b6d6dSopenharmony_ci <TD CLASS="topicHead">General</TD> 332e5b6d6dSopenharmony_ci </TR> 342e5b6d6dSopenharmony_ci <TR> 352e5b6d6dSopenharmony_ci <TD VALIGN="center"><IMG SRC="images/template_line.gif"></TD> 362e5b6d6dSopenharmony_ci </TR> 372e5b6d6dSopenharmony_ci <TR> 382e5b6d6dSopenharmony_ci <TD CLASS="topicList"> 392e5b6d6dSopenharmony_ci <UL> 402e5b6d6dSopenharmony_ci <LI><A HREF="system_requirements.html">System Requirements</A></LI> 412e5b6d6dSopenharmony_ci <LI><A HREF="faq.html">FAQ</A></LI> 422e5b6d6dSopenharmony_ci <LI><A HREF="future_features.html">Future Releases</A></LI> 432e5b6d6dSopenharmony_ci <LI CLASS="topicList"><A HREF="future_features.html">Version 442e5b6d6dSopenharmony_ci History</A></LI> 452e5b6d6dSopenharmony_ci </UL> 462e5b6d6dSopenharmony_ci </TD> 472e5b6d6dSopenharmony_ci </TR> 482e5b6d6dSopenharmony_ci <TR> 492e5b6d6dSopenharmony_ci <TD CLASS="topicHead">RB Manager</TD> 502e5b6d6dSopenharmony_ci </TR> 512e5b6d6dSopenharmony_ci <TR> 522e5b6d6dSopenharmony_ci <TD VALIGN="center"><IMG SRC="images/template_line.gif"></TD> 532e5b6d6dSopenharmony_ci </TR> 542e5b6d6dSopenharmony_ci <TR> 552e5b6d6dSopenharmony_ci <TD CLASS="topicList"> 562e5b6d6dSopenharmony_ci <UL> 572e5b6d6dSopenharmony_ci <LI><A HREF="index.html">Home</A></LI> 582e5b6d6dSopenharmony_ci <LI><A HREF="tutorial/index.html">Tutorial</A></LI> 592e5b6d6dSopenharmony_ci <LI><A HREF="views/index.html">Functionality and Views</A></LI> 602e5b6d6dSopenharmony_ci <LI><A HREF="lookandfeel.html">Look and Feel</A></LI> 612e5b6d6dSopenharmony_ci <LI><A HREF="menu.html">Menu Items</A></LI> 622e5b6d6dSopenharmony_ci <LI CLASS="topicList"><A HREF="tutorial/step1.html">Preferences</A></LI> 632e5b6d6dSopenharmony_ci </UL> 642e5b6d6dSopenharmony_ci </TD> 652e5b6d6dSopenharmony_ci </TR> 662e5b6d6dSopenharmony_ci <TR> 672e5b6d6dSopenharmony_ci <TD CLASS="topicHead">RB Reporter</TD> 682e5b6d6dSopenharmony_ci </TR> 692e5b6d6dSopenharmony_ci <TR> 702e5b6d6dSopenharmony_ci <TD VALIGN="center"><IMG SRC="images/template_line.gif"></TD> 712e5b6d6dSopenharmony_ci </TR> 722e5b6d6dSopenharmony_ci <TR> 732e5b6d6dSopenharmony_ci <TD CLASS="topicList"> 742e5b6d6dSopenharmony_ci <UL> 752e5b6d6dSopenharmony_ci <LI><A HREF="RBReporter.html">Home</A></LI> 762e5b6d6dSopenharmony_ci <LI>Report Types</LI> 772e5b6d6dSopenharmony_ci <LI><A HREF="scanfile.html">Code Scanning</A></LI> 782e5b6d6dSopenharmony_ci </UL> 792e5b6d6dSopenharmony_ci </TD> 802e5b6d6dSopenharmony_ci </TR> 812e5b6d6dSopenharmony_ci </TABLE> 822e5b6d6dSopenharmony_ci 832e5b6d6dSopenharmony_ci <P> </P> 842e5b6d6dSopenharmony_ci </TD> 852e5b6d6dSopenharmony_ci 862e5b6d6dSopenharmony_ci <TD COLSPAN="2" VALIGN="top" CLASS="mainBlock"><!-- #BeginEditable "Main" --> 872e5b6d6dSopenharmony_ci <H1 ALIGN="CENTER">RBReporter Scan XML Configuration File</H1> 882e5b6d6dSopenharmony_ci <P><B>Introduction</B></P> 892e5b6d6dSopenharmony_ci <P>The configuration file for RBReporter scans is a text file stored in 902e5b6d6dSopenharmony_ci XML. The design on the format for this configuration file was kept simple 912e5b6d6dSopenharmony_ci and so the general application of the scanner is not meant for complicated 922e5b6d6dSopenharmony_ci analysis. The design works around three types of rules: Directory Rules, 932e5b6d6dSopenharmony_ci File Rules, and Parse Rules. Each of these will be explained below. First, 942e5b6d6dSopenharmony_ci here is an example file for reference. This file is the configuration 952e5b6d6dSopenharmony_ci file used to scan the resource bundle associated with RBManager.</P> 962e5b6d6dSopenharmony_ci <P><B>Sample Scan File </B>(rbmanager_scan.xml<B>)</B></P> 972e5b6d6dSopenharmony_ci <BLOCKQUOTE><CODE> 982e5b6d6dSopenharmony_ci <PRE> 992e5b6d6dSopenharmony_ci<?xml version="1.0" ?> 1002e5b6d6dSopenharmony_ci<RBFILESCANNER NAME="RBManager Scanner" FILENAME="rbmanager_scanner.xml"> 1012e5b6d6dSopenharmony_ci <FILERULES> 1022e5b6d6dSopenharmony_ci <!-- FileRules can have attributes starts_with, ends_with, and contains --> 1032e5b6d6dSopenharmony_ci <FILERULE NAME="Java File" ENDS_WITH=".java" /> 1042e5b6d6dSopenharmony_ci <FILERULE NAME="XSL File" ENDS_WITH=".xsl" /> 1052e5b6d6dSopenharmony_ci </FILERULES> 1062e5b6d6dSopenharmony_ci <PARSERULES> 1072e5b6d6dSopenharmony_ci <!-- ParseRules can have attributes follows and precedes --> 1082e5b6d6dSopenharmony_ci <PARSERULE NAME="Java static resource" FOLLOWS="Resources.getTranslation(&quot;" PRECEDES="&quot;" /> 1092e5b6d6dSopenharmony_ci </PARSERULES> 1102e5b6d6dSopenharmony_ci <SCAN> 1112e5b6d6dSopenharmony_ci <DIRECTORY LOCATION="\C:\Development\RBManager\Source" RECURSE_DIRECTORIES="true"> 1122e5b6d6dSopenharmony_ci <RULES> 1132e5b6d6dSopenharmony_ci <APPLYFILERULE NAME="Java File"> 1142e5b6d6dSopenharmony_ci <APPLYPARSERULE NAME="Java static resource" /> 1152e5b6d6dSopenharmony_ci </APPLYFILERULE> 1162e5b6d6dSopenharmony_ci </RULES> 1172e5b6d6dSopenharmony_ci </DIRECTORY> 1182e5b6d6dSopenharmony_ci </SCAN> 1192e5b6d6dSopenharmony_ci</RBFILESCANNER> 1202e5b6d6dSopenharmony_ci </PRE> 1212e5b6d6dSopenharmony_ci </CODE></BLOCKQUOTE> 1222e5b6d6dSopenharmony_ci<P><B>Details</B></P> 1232e5b6d6dSopenharmony_ci <P>The root element of the XML file is named 'RBFILESCANNER'. This root 1242e5b6d6dSopenharmony_ci element has two optional attributes for naming the scan file in a human 1252e5b6d6dSopenharmony_ci readable manner and specifying the file name. These attributes are for 1262e5b6d6dSopenharmony_ci the developers reference; they mean nothing to RBReporter. Beneath the 1272e5b6d6dSopenharmony_ci root element are three required elements 'FILERULES', 'PARSERULES' and 1282e5b6d6dSopenharmony_ci 'SCAN'. </P> 1292e5b6d6dSopenharmony_ci <P>Beneath the FILERULES element are found FILERULE elements. Any number 1302e5b6d6dSopenharmony_ci of these rules can be specified, though each must have a unique name as 1312e5b6d6dSopenharmony_ci specified in the element's NAME attribute. Along with this name attribute, 1322e5b6d6dSopenharmony_ci the attributes STARTS_WITH, ENDS_WITH, and CONTAINS may be optionally 1332e5b6d6dSopenharmony_ci specified. These are the rules applied to each file in a directory to 1342e5b6d6dSopenharmony_ci determine whether or not they will be scanned. The attribute rules are 1352e5b6d6dSopenharmony_ci applied to the file names of each file in the directory and if each is 1362e5b6d6dSopenharmony_ci found to be true, that file is evaluated against the parse rules.</P> 1372e5b6d6dSopenharmony_ci <P>Beneath the PARSERULES element are found PARSERULE elements. Any number 1382e5b6d6dSopenharmony_ci of these rules can be specified, though each must have a uniques name 1392e5b6d6dSopenharmony_ci as specifiedn in the element's NAME attrinute. Along with this name attribute, 1402e5b6d6dSopenharmony_ci the attributes FOLLOWS and PRECEDES may optionally be specified. These 1412e5b6d6dSopenharmony_ci are the rules applied to each line of text in a selected file to determine 1422e5b6d6dSopenharmony_ci if that line of text contains one or more resource keys.</P> 1432e5b6d6dSopenharmony_ci <P>Beneath the SCAN element are found DIRECTORY elements. Any number of 1442e5b6d6dSopenharmony_ci these elements can be specified. The required LOCATION attribute specifies 1452e5b6d6dSopenharmony_ci in a machine dependent manner the location of a directory for which the 1462e5b6d6dSopenharmony_ci files are to be scanned for resource bundles. An optional RECURSE_DIRECTORIES 1472e5b6d6dSopenharmony_ci attribute may be specified. If the value of this attribute is set to 'true', 1482e5b6d6dSopenharmony_ci then all directories beneath the directory specified are also scanned.</P> 1492e5b6d6dSopenharmony_ci <P>Beneath each DIRECTORY element, exactly one RULES elements can be specified.Beneath 1502e5b6d6dSopenharmony_ci this element, any number of APPLY FILE RULE elements may be specified. 1512e5b6d6dSopenharmony_ci The required NAME attribute specifies which of the file rules defined 1522e5b6d6dSopenharmony_ci previously are to be applied. Beneath these element any number of APPLYPARSERULE 1532e5b6d6dSopenharmony_ci elements may be specified. The required NAME attribute specifies which 1542e5b6d6dSopenharmony_ci of the parse rules defined previously are to be applied to the files accepted 1552e5b6d6dSopenharmony_ci by the parent file rule.</P> 1562e5b6d6dSopenharmony_ci <P><B>The Example File Explained</B></P> 1572e5b6d6dSopenharmony_ci <P>Given the details of the file structure, we can now examine how the example 1582e5b6d6dSopenharmony_ci file specifies which files to scan, and then how it specifies how to find 1592e5b6d6dSopenharmony_ci the resource keys contained in those files.</P> 1602e5b6d6dSopenharmony_ci <P>RBReporter first begins by going through each of the directories specified. 1612e5b6d6dSopenharmony_ci In the example file case, there is only one directory. It then goes through 1622e5b6d6dSopenharmony_ci each of the files contained in that directory and its subdirectories looking 1632e5b6d6dSopenharmony_ci for files that pass the 'Java File' file test. The 'Java File' test simply 1642e5b6d6dSopenharmony_ci checks the file name to see if it ends in the extension '.java'. If the 1652e5b6d6dSopenharmony_ci file has such an extension the parse rule 'Java static resource' is applied 1662e5b6d6dSopenharmony_ci to every line of text within that file.</P> 1672e5b6d6dSopenharmony_ci <P>Thus if the following file, named Sample.java, were to be found in the 1682e5b6d6dSopenharmony_ci directory. The two resource keys 'Hello' and 'World' would be found.</P> 1692e5b6d6dSopenharmony_ci <blockquote><code> 1702e5b6d6dSopenharmony_ci <pre> 1712e5b6d6dSopenharmony_cipublic class Sample { 1722e5b6d6dSopenharmony_ci public static void main(String args[]) { 1732e5b6d6dSopenharmony_ci System.out.println(Resources.getTranslation("Hello") + " " + Resources.getTranslation("World")); 1742e5b6d6dSopenharmony_ci } 1752e5b6d6dSopenharmony_ci} 1762e5b6d6dSopenharmony_ci</pre> 1772e5b6d6dSopenharmony_ci </code></blockquote> 1782e5b6d6dSopenharmony_ci 1792e5b6d6dSopenharmony_ci <!-- #EndEditable --></TD> 1802e5b6d6dSopenharmony_ci </TR> 1812e5b6d6dSopenharmony_ci <TR> 1822e5b6d6dSopenharmony_ci <TD BACKGROUND="images/template_ll.gif" HEIGHT="40" WIDTH="200"> 1832e5b6d6dSopenharmony_ci <!-- Comment --> 1842e5b6d6dSopenharmony_ci </TD> 1852e5b6d6dSopenharmony_ci <TD WIDTH="80"> 1862e5b6d6dSopenharmony_ci <!-- Comment --> 1872e5b6d6dSopenharmony_ci </TD> 1882e5b6d6dSopenharmony_ci <TD> 1892e5b6d6dSopenharmony_ci <CENTER><SPAN CLASS="Copyright">Copyright 2000-2001 International Business Machines, All Rights Reserved</SPAN></CENTER> 1902e5b6d6dSopenharmony_ci </TD> 1912e5b6d6dSopenharmony_ci </TR> 1922e5b6d6dSopenharmony_ci</TABLE> 1932e5b6d6dSopenharmony_ci 1942e5b6d6dSopenharmony_ci</BODY> 1952e5b6d6dSopenharmony_ci<!-- #EndTemplate --></HTML> 196