List websiteDatas = new ArrayList();
for (int i = 0; i < c.getEntries().length; i++) {
WeblogEntry entry = (WeblogEntry)c.getEntries()[i];
User user = mgr.getUserByUserName(entry.getCreatingUser());
Weblog wd = new Weblog(
entry.getHandle(),
user,
entry.getName(),
entry.getDescription(),
entry.getEmailAddress(),
entry.getEmailAddress(),
DEFAULT_THEME,
entry.getLocale().toString(),
entry.getTimezone().getID());
Date dateCreated = entry.getDateCreated();
if (dateCreated == null) {
dateCreated = new Date();
}
wd.setDateCreated(dateCreated);
Boolean enabled = entry.getEnabled();
if (enabled != null) {
wd.setEnabled(enabled);
}
try {
String def = WebloggerRuntimeConfig.getProperty("users.editor.pages");
String[] defs = Utilities.stringToStringArray(def,",");
wd.setEditorPage(defs[0]);
} catch (Exception ex) {
log.error("ERROR setting default editor page for weblog", ex);
}
mgr.addWebsite(wd);