@include("../commons/styles.html") @include("../commons/images.html") @args() { List> items List> locitems Map info Locale locale String date_column String fromDate String toDate } @returnIf(items == null) @*Queries: * [ * { * "paramName" : "items", * "dateRangeSourceTable" : "r", * "query" : [ * "SELECT", * "r.saveset,", * "r.task,", * "r.state as backup_state,", * "r.start_time,", * "r.media_pool,", * "l.eol as saveset_eol,", * "l.pool as saveset_pool,", * "m.replication_type,", * "m.target_saveset", * "FROM", * "results r", * "LEFT OUTER JOIN", * "(", * "SELECT", * "r.saveset as s,", * "l.eol,", * "l.pool", * "FROM", * "result_lbls l,", * "results r", * "WHERE", * "num = 1", * "AND", * "segment != '-1'", * "AND", * "fdi_type in ('C','F','D','I')", * "AND", * "r.original_saveset IS NULL", * "AND", * "r.saveset = l.saveset", * "UNION ALL", * "SELECT", * "original_saveset as s,", * "l.eol,", * "l.pool", * "FROM", * "result_lbls l,", * "results r", * "WHERE", * "num = 1", * "AND", * "segment != '-1'", * "AND", * "fdi_type in ('C','F','D','I')", * "AND", * "r.original_saveset IS NOT NULL", * "AND", * "r.saveset = l.saveset", * "ORDER BY s", * ") AS l ON l.s = r.saveset", * "LEFT OUTER JOIN", * "migration_results m", * "ON", * "r.saveset = m.saveset", * "AND", * "saveset_pool = m.target_pool", * "WHERE", * "(r.original_saveset is null or r.original_saveset = '')", * "AND", * "r.fdi_type in ('C','F','D','I')", * "AND", * "@(dateRange:@(date_column))", * "@if(location_id != null) {", * "AND", * "r.client_id in (WITH RECURSIVE children(id) AS (SELECT l.id FROM locations l WHERE l.id=@(location_id)", * "UNION ALL SELECT l.id from children c,locations l where l.parent=c.id) SELECT * FROM children)", * "}", * "ORDER BY", * "r.task asc,", * "r.start_time desc" * ] * }, * { * "paramName" : "locitems", * "condition" : [ * "@returnIf(location_id == null)" * ], * "query" : [ * "SELECT", * "name", * "FROM", * "locations", * "WHERE", * "id", * "IN", * "(WITH RECURSIVE children(id) AS (SELECT l.id FROM locations l WHERE l.id=@(location_id)", * "UNION ALL SELECT l.id from children c,locations l where l.parent=c.id) SELECT * FROM children)" * ] * } * ] *@ @include("../commons/tags.html") @include("../commons/functions.html") @sepReportHeader("Report") @sepTitleBox("Title", sepFnGetToday(locale), (String) info.get("name")) @if (date_column == "sesam_date") { @sepDateRangeLabel(sepFnGetDate(sepFnStringToDate(fromDate), locale), sepFnGetDate(sepFnStringToDate(toDate), locale), date_column) } else { @sepDateRangeLabel(sepFnGetDateLong(sepFnStringToDate(fromDate), locale), sepFnGetDateLong(sepFnStringToDate(toDate), locale), date_column) }

@// if this is a location based report, insert information about location @if (locitems != null) {

@i18n("Location.list")

    @for (Map locitem : locitems) {
  • @(locitem.get("name"))
  • }

}
@{ String previousTask = null; String previousSaveset = null; boolean isFirstRow = true; } @for (Map item : items) { @{ String task = (String) item.get("task"); boolean isNewTask = previousTask == null || !previousTask.equals(task); String bState = "other"; String bStyle = ""; String backupState = (String) item.get("backup_state"); if ("0".equals(backupState)) { bState = "check"; bStyle = "svg-ok"; } if ("1".equals(backupState) || "3".equals(backupState) || "c".equalsIgnoreCase(backupState)) { bState = "warning"; bStyle = "svg-warning"; } if ("2".equals(backupState) || "e".equals(backupState) || "X".equals(backupState)) { bState = "bad"; bStyle = "svg-error"; } String rType = "other"; String replicationType = (String) item.get("replication_type"); if (replicationType != null) { String[] p = replicationType.split(" "); if (p.length > 0) { rType = p[p.length - 1].toLowerCase(); } } else { String backupPool = (String) item.get("media_pool"); if (backupPool != null && backupPool.equals(item.get("saveset_pool"))) { rType = "backup"; } } } @{ isFirstRow = false; } }
@i18n("Task") @i18n("BackupState") @i18n("SavesetId") @i18n("SourcePool") @i18n("Type") @i18n("TargetPool") @i18n("Eol")
@if (isNewTask) { @{ previousTask = task; } @(task) } @if(!"other".equals(bState)) { } @(item.get("saveset")) @(item.get("media_pool")) @if(!"other".equals(rType)) { @i18n(rType) } @(item.get("saveset_pool")) @(item.get("saveset_eol"))