}
//TEST
Map args = new HashMap();
args.put("globalKey", "infoglue");
PropertySet ps = PropertySetManager.getInstance("jdbc", args);
Map<String,String> repositoryProperties = master.getRepositoryProperties();
Iterator<String> repositoryPropertiesIterator = repositoryProperties.keySet().iterator();
while(repositoryPropertiesIterator.hasNext())
{
String key = repositoryPropertiesIterator.next();
String value = repositoryProperties.get(key);
String[] splittedString = key.split("_");
if(splittedString.length == 3)
{
String oldRepId = splittedString[1];
key = key.replaceAll(oldRepId, "" + repositoryIdMap.get(oldRepId));
if(value != null && !value.equals("null"))
{
try
{
if(key.indexOf("_WYSIWYGConfig") > -1 || key.indexOf("_StylesXML") > -1 || key.indexOf("_extraProperties") > -1)
ps.setData(key, value.getBytes("utf-8"));
else
ps.setString(key, value);
}
catch (Exception e)
{
logger.error("Error saving property " + key + ":" + e.getMessage());
}
}
}
}
Map<String,String> contentProperties = master.getContentProperties();
Iterator<String> contentPropertiesIterator = contentProperties.keySet().iterator();
while(contentPropertiesIterator.hasNext())
{
String key = contentPropertiesIterator.next();
String value = contentProperties.get(key);
String[] splittedString = key.split("_");
if(splittedString.length == 3)
{
String oldContentId = splittedString[1];
key = key.replaceAll(oldContentId, (String)contentIdMap.get(oldContentId));
try
{
if(value != null && !value.equals("null"))
ps.setString(key, value);
}
catch (Exception e)
{
logger.error("Error saving property " + key + ":" + e.getMessage());
}
}
}
Map<String,String> siteNodeProperties = master.getSiteNodeProperties();
Iterator<String> siteNodePropertiesIterator = siteNodeProperties.keySet().iterator();
while(siteNodePropertiesIterator.hasNext())
{
String key = siteNodePropertiesIterator.next();
String value = siteNodeProperties.get(key);
String[] splittedString = key.split("_");
if(splittedString.length == 3)
{
String oldSiteNodeId = splittedString[1];
key = key.replaceAll(oldSiteNodeId, (String)siteNodeIdMap.get(oldSiteNodeId));
try
{
if(value != null && !value.equals("null"))
ps.setString(key, value);
}
catch (Exception e)
{
logger.error("Error saving property " + key + ":" + e.getMessage());
}