public boolean buildWeeklyTask(String name, String domain, Date period) {
Date start = period;
Date end = new Date(start.getTime() + TimeHelper.ONE_DAY * 7);
StateReport stateReport = queryDailyReportsByDuration(domain, start, end);
WeeklyReport report = new WeeklyReport();
report.setContent("");
report.setCreationDate(new Date());
report.setDomain(domain);
report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
report.setName(name);
report.setPeriod(period);
report.setType(1);
byte[] binaryContent = DefaultNativeBuilder.build(stateReport);
return m_reportService.insertWeeklyReport(report, binaryContent);
}