public class XmlToPropertiesConverter
extends java.lang.Object
Supported XML files (types, templates and workflows) are processed as follow :
xml:lang
such as
<label.../>
, <title.../>
and <description.../>
labelList* attributes of enumerate fields
XmlToPropertiesConverter MyPluginDirectory SomeOtherPluginDirectoryExample through Java code:
XmlToPropertiesConverter conv = new XmlToPropertiesConverter(); // Convert plugin XML files File pluginRootDir = [...]; // MUST point the root directory of an clean unzipped plugin conv.processDirectory(myPluginRootDir); // Convert core JCMS XML files - for Jalios only File webappRootDir = [...]; // point the root directory of the webapp, which MUST NOT contain any plugin conv.processDirectory(myWebappRootDir);
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_BAD_PARAMETERS
XmlToPropertiesConverter exit code if invalid parameters were specified
|
static int |
STATUS_ERROR
XmlToPropertiesConverter exit code in case any error occurs
|
static int |
STATUS_OK
XmlToPropertiesConverter exit code when everything went fine
|
Constructor and Description |
---|
XmlToPropertiesConverter() |
Modifier and Type | Method and Description |
---|---|
void |
logConfiguration()
Log the current configuration.
|
static void |
main(java.lang.String[] args)
XmlToPropertiesConverter main entry point.
|
boolean |
processDirectory(java.io.File rootDir)
Process a whole directory to search for XML file to convert.
|
void |
setAppendComment(boolean appendComment)
Enable or disable comment in properties.
|
void |
setBackupFiles(boolean backupFiles)
Enable or disable backup.
|
void |
setDryRun(boolean dryRun)
Enable dryrun mode.
|
void |
setUpdateXmlFiles(boolean updateXmlFiles)
Enable or disable update of XML files.
|
public static final int STATUS_OK
public static final int STATUS_BAD_PARAMETERS
public static final int STATUS_ERROR
public boolean processDirectory(java.io.File rootDir)
rootDir
- the directory in which perform XML file search, MUST be either apublic void setDryRun(boolean dryRun)
If set to true, no operation will be performe, just log what would have been done.
dryRun
- true to enable dryrun mode, false to perform operation normally. default is falsepublic void setBackupFiles(boolean backupFiles)
Set whether XML and properties files should be backed up before any modification is performed.
backupFiles
- true to create backup, false to overwrite file directly. default is truepublic void setAppendComment(boolean appendComment)
Set whether comment should be appended to properties file before writing I18N properties.
appendComment
- true to append comment, false to write properties directly. default is truepublic void setUpdateXmlFiles(boolean updateXmlFiles)
Set whether XML files should be updated to remove all I18N strings.
updateXmlFiles
- true to update, false to leave file intact. default is truepublic void logConfiguration()
public static void main(java.lang.String[] args)
args
- command line parameterCopyright © 2001-2010 Jalios SA. All Rights Reserved.