wt.prefs
Class PreferenceExport

java.lang.Object
  extended bywt.prefs.PreferenceExport

public class PreferenceExport
extends Object

This class is used to export values from the Preference Backing Store ( It should read from the Database, file etc. depending on the Preference Mapping ). The output of the export is the same as the load file input used, such that the Preferences for a given context could be exported and transported to a new system (such as an individual user's preferences). This will ease development, and migration of Preferences.

This class may either be instantiated directly or run from the console. For command line arguments simply run


And a command syntax will be printed.
When instantiated there are three properties which are important that the user should be aware of.

Nodes The nodes to select for export. The default is '*'
Context The contexts to select for export. The default is WTPreferences.DEFAULT_CONTEXT which are the system defaults.
Writer/Filename The name of the file to output the results to or the BufferedWriter to use for output. The default is null, which will export results to the console (System.out)

To utilize this class within another class, the following sample could be used. In it, the all preferences with the text content and part are searched and returned for the System Default context. The output is placed in the filename outfile.



Output Format