try {
WeeklyReport weeklyReport = m_weeklyReportDao.findReportByDomainNamePeriod(report.getPeriod(),
report.getDomain(), report.getName(), WeeklyReportEntity.READSET_FULL);
if (weeklyReport != null) {
WeeklyReportContent reportContent = m_weeklyReportContentDao.createLocal();
reportContent.setKeyReportId(weeklyReport.getId());
reportContent.setReportId(weeklyReport.getId());
m_weeklyReportContentDao.deleteByPK(reportContent);
m_weeklyReportDao.deleteReportByDomainNamePeriod(report);
}
} catch (Exception e) {
Cat.logError(e);
}
try {
m_weeklyReportDao.insert(report);
int id = report.getId();
WeeklyReportContent proto = m_weeklyReportContentDao.createLocal();
proto.setReportId(id);
proto.setContent(content);
m_weeklyReportContentDao.insert(proto);
return true;
} catch (DalException e) {
Cat.logError(e);
return false;