use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.
the class AdminEmailLogPageActionTest method verifyActionResult.
private void verifyActionResult(int[][] expectedLogs, String... params) {
AdminEmailLogPageAction action = getAction(params);
ShowPageResult result = getShowPageResult(action);
AdminEmailLogPageData pageData = (AdminEmailLogPageData) result.data;
List<EmailLogEntry> actualLogs = getLogsFromLogTemplateRows(pageData.getLogs());
verifyLogs(expectedLogs, actualLogs);
}
use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.
the class AdminEmailLogPageActionTest method verifyContinueSearch.
private void verifyContinueSearch(String[] params, int[][] expected, int totalLogs) {
AdminEmailLogPageAction action = getAction(params);
ShowPageResult result = getShowPageResult(action);
AdminEmailLogPageData pageData = (AdminEmailLogPageData) result.data;
verifyStatusMessage(result.getStatusMessage(), totalLogs);
verifyLogs(expected, getLogsFromLogTemplateRows(pageData.getLogs()));
}
use of teammates.ui.pagedata.AdminEmailLogPageData in project teammates by TEAMMATES.
the class AdminEmailLogPageAction method execute.
@Override
protected ActionResult execute() {
gateKeeper.verifyAdminPrivileges(account);
AdminEmailLogPageData data = new AdminEmailLogPageData(account, sessionToken, getRequestParamValue("filterQuery"), getRequestParamAsBoolean("all"));
if (data.getFilterQuery() == null) {
data.setFilterQuery("");
}
// This is used to parse the filterQuery. If the query is not parsed, the filter function would ignore the query
data.generateQueryParameters(data.getFilterQuery());
String timeOffset = getRequestParamValue("offset");
if (timeOffset != null && !timeOffset.isEmpty()) {
data.setToDate(Long.parseLong(timeOffset));
}
if (data.isFromDateInQuery()) {
searchEmailLogsWithExactTimePeriod(data);
} else {
searchEmailLogsWithTimeIncrement(data);
}
statusToAdmin = "adminEmailLogPage Page Load";
if (timeOffset == null) {
return createShowPageResult(Const.ViewURIs.ADMIN_EMAIL_LOG, data);
}
return createShowPageResult(Const.ViewURIs.ADMIN_EMAIL_LOG_AJAX, data);
}
Aggregations