private WeblogEntry toWeblogEntry(Weblog wd) throws HandlerException {
if (wd == null) {
throw new NullPointerException("ERROR: Null website data not allowed");
}
WeblogEntry we = new WeblogEntry(wd.getHandle(), getUrlPrefix());
we.setName(wd.getName());
we.setDescription(wd.getDescription());
we.setLocale(wd.getLocale());
we.setTimezone(wd.getTimeZone());
we.setCreatingUser(wd.getCreator().getUserName());
we.setEmailAddress(wd.getEmailAddress());
we.setDateCreated(wd.getDateCreated());
we.setEnabled(wd.getEnabled());
try {
AppUrl appUrl = new AppUrl(WebloggerRuntimeConfig.getAbsoluteContextURL(), wd.getHandle());
we.setAppEntriesUrl(appUrl.getEntryUrl().toString());
we.setAppResourcesUrl(appUrl.getResourceUrl().toString());
} catch (MalformedURLException mfue) {
throw new InternalException("ERROR: Could not get APP URLs", mfue);
}
return we;