wt.tools.localization
Class LocalizationPostProcessor

java.lang.Object
  extended bywt.tools.localization.LocalizationPostProcessor

public class LocalizationPostProcessor
extends Object

TemplatePostProcessor contains the methods needed to localize the default .html files to the language desired. This is a tool provided for administrators and presumably will be run once after installation.


Field Summary
private static String RESOURCE
           
private static String versionID
           
 
Constructor Summary
LocalizationPostProcessor()
           
 
Method Summary
private static boolean copyFile(String from, String to)
           
private static void doLocalization(String file, String directory, String extension, boolean multicopy)
           
private static String getMessage(String resourceBundle, String messageKey, Object[] textInserts)
           
static void localizeFiles(String extension, String locale, boolean multicopy)
          Go through the directory specified by wt.home\\codebase all subdirectories.
static void localizeFiles(String directory, String extension, String locale, boolean multicopy)
          Go through the directory specified and all of its subdirectories.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values
Constructor Detail

LocalizationPostProcessor

public LocalizationPostProcessor()
Method Detail

localizeFiles

public static void localizeFiles(String extension,
                                 String locale,
                                 boolean multicopy)
                          throws WTException
Go through the directory specified by wt.home\\codebase all subdirectories. Find files with the extension specified and the string specified by locale ending the 'base' file name. Copy those files to the default file, and if multicopy is true, to all sub-locales of the file. By default, the default files are english.

Parameters:
extension - String specifying the file extensions to search on.
locale - String specifying the locale to make the html default.
multicopy - Boolean indicating whether to copy the file to all sub-locale files, or just to the default file.
Throws:
WTException - Thrown if an IO Exception occurs.

localizeFiles

public static void localizeFiles(String directory,
                                 String extension,
                                 String locale,
                                 boolean multicopy)
                          throws WTException
Go through the directory specified and all of its subdirectories. Find the files with the extension specified and the string specified by locale ending the 'base' file name. Copy those files to the default file, and if multicopy is true, to all sub-locales of the file. By default, the default files are english.

Parameters:
directory - String specifying the root directory.
extension - String specifying the file extensions to search on.
locale - String specifying the locale to make the html default.
multicopy - Boolean indicating whether to copy the file to all sub-locale files, or just the default file.
Throws:
WTException - Thrown if an IO Exception occurs.

copyFile

private static boolean copyFile(String from,
                                String to)

doLocalization

private static void doLocalization(String file,
                                   String directory,
                                   String extension,
                                   boolean multicopy)
                            throws WTException
Throws:
WTException

getMessage

private static String getMessage(String resourceBundle,
                                 String messageKey,
                                 Object[] textInserts)

main

public static void main(String[] args)