diff --git a/app/controllers/ReportController.java b/app/controllers/ReportController.java index 418c1d87..26e45d3a 100644 --- a/app/controllers/ReportController.java +++ b/app/controllers/ReportController.java @@ -47,7 +47,7 @@ public static Result index() throws ActException { return redirect(routes.ReportController.processFilterReports( 0,-1L, -1L, CrawlPermissionStatus.PENDING.name(), //default filter - "", + //"", "","","","")); }; @@ -59,18 +59,11 @@ public static Result index() throws ActException { * @throws ActException */ public static Result search() throws ActException { - Logger.debug("search() ---- STEP NO 1 "); - DynamicForm requestData = form().bindFromRequest(); String crawlPermissionsStatus22 = form().bindFromRequest().get("crawlPermissionsStatus22"); - Logger.debug("search() ---- requestData22, crawlPermissionsStatus22 = " + crawlPermissionsStatus22); - String action = requestData.get("action"); - Logger.debug("action: " + action); - String curator = requestData.get("curator"); - String organisation = requestData.get("organisation"); Long curatorId = null; if (StringUtils.isNotBlank(curator)) { @@ -80,41 +73,28 @@ public static Result search() throws ActException { if (StringUtils.isNotBlank(organisation)) { organisationId = Long.parseLong(organisation); } + String generalFromDate = requestData.get("startDate"); + String generalToDate = requestData.get("endDate"); - String request = requestData.get("request"); - String requestType = requestData.get("requestType"); - - Logger.debug("request ---- = " + request); - Logger.debug("requestType ---- = " + requestType); - -// if (request_name != null && !request_name.toLowerCase().equals(Const.NONE) -// && !request_name.toLowerCase().equals(Const.ALL)) { -// request = request_name; -// } - String requestedFromDate = requestData.get("startDate"); - String requestedToDate = requestData.get("endDate"); + //String requestedFromDate = requestData.get("startDate"); + //String requestedToDate = requestData.get("endDate"); String grantedFromDate = requestData.get("grantedFromDate"); String grantedToDate = requestData.get("grantedToDate"); - Logger.debug("Parameters: " + curatorId + ", " + organisationId + ", " + crawlPermissionsStatus22 + ", " + requestedFromDate + ", " + requestedToDate + ", " + grantedFromDate + ", " + grantedToDate); + Logger.debug("Parameters: " + curatorId + ", " + organisationId + ", " + crawlPermissionsStatus22 + ", " + generalFromDate + ", " + generalToDate + ", " + grantedFromDate + ", " + grantedToDate); List users = User.findAll(); List organisations = Organisation.findAllSorted(); - RequestType[] requestTypes = Const.RequestType.values(); + //RequestType[] requestTypes = Const.RequestType.values(); User user = User.findByEmail(request().username()); //Form data - int pageNo = Integer.parseInt(requestData.get("p")); + //int pageNo = Integer.parseInt(requestData.get("p")); String sort = requestData.get("s"); String order = requestData.get("o"); //Long curatorId = Long.parseLong(requestData.get("curator")); //Long organisationId = Long.parseLong(requestData.get("organisation")); - String startDate = requestData.get("startDate"); - Logger.debug("startDate: " + startDate); - -// String endDate = requestData.get("endDate"); - // default String searchByCrawlPermissionsStatus = (crawlPermissionsStatus22 != null && !crawlPermissionsStatus22.trim().isEmpty())?crawlPermissionsStatus22:CrawlPermissionStatus.PENDING.name(); if (action.equals("searchRequested")){ @@ -130,12 +110,11 @@ public static Result search() throws ActException { Logger.debug("crawlPermissionsStatus, aka searchType ---- = " + searchByCrawlPermissionsStatus); - Page pages = Target.pageReports(pageNo, curatorId, organisationId, - searchByCrawlPermissionsStatus, "", - "", "", "", ""); - - Logger.debug("crawlPermissionsStatus after ---- = " + searchByCrawlPermissionsStatus); - Logger.debug("search() --- crawlPermissionsStatus, requestData22, crawlPermissionsStatus22 = " + crawlPermissionsStatus22); + Page pages = Target.pageReports(0, curatorId, organisationId, + searchByCrawlPermissionsStatus, + generalFromDate, generalToDate, + //requestedFromDate, requestedToDate, + grantedFromDate, grantedToDate); if (StringUtils.isEmpty(action)) { return badRequest("You must provide a valid action"); @@ -151,29 +130,31 @@ public static Result search() throws ActException { sort, order, searchByCrawlPermissionsStatus, curatorId, organisationId, - "", "", "", "", "", - users, organisations, requestTypes + generalFromDate, generalToDate, + //requestedFromDate, requestedToDate, + grantedFromDate, grantedToDate, + users, organisations//, requestTypes ) ); } else if (action.equals("export")) { - String status = searchByCrawlPermissionsStatus;//requestData.get("status"); + String status = searchByCrawlPermissionsStatus; Logger.debug("in export: " + status); if (StringUtils.isNotEmpty(status)) { - Logger.debug("export requested size: " + pages.getList().size());// resListRequest.size()); - - List pagesFull = Target.pageReportsFull(pageNo, curatorId, organisationId, - searchByCrawlPermissionsStatus, "", - "", "", "", ""); - - String file = export(pagesFull); + Logger.debug("export requested size: " + pages.getList().size()); + List pagesFull = Target.pageReportsFull(0, curatorId, organisationId, + searchByCrawlPermissionsStatus, + generalFromDate, generalToDate, + //requestedFromDate, requestedToDate, + grantedFromDate, grantedToDate); + + String file = exportCrawlPermissions(pagesFull, searchByCrawlPermissionsStatus); response().setContentType("text/csv; charset=utf-8"); - response().setHeader("Content-disposition", "attachment; filename=\"" + Const.EXPORT_REQUESTED_LICENCE_FILE + "\""); + response().setHeader("Content-disposition", "attachment; filename=\"" + searchByCrawlPermissionsStatus + "_" + (generalFromDate.equals("")?"":generalFromDate) + "-" + (generalToDate.equals("")?"":generalToDate) + "_" + Const.EXPORT_REQUESTED_LICENCE_FILE + "\""); return ok(file); } Logger.debug("returning in export"); - } return badRequest("This action is not allowed"); } @@ -194,35 +175,83 @@ else if (action.equals("export")) { * @param file name * @return */ - public static String export(List permissionList) { - Logger.debug("export() permissionList size: " + permissionList.size()); + public static String export(List permissionList) { + Logger.debug("export() permissionList size: " + permissionList.size()); StringBuilder sw = new StringBuilder(); - sw.append("Target title"); + sw.append("Target title"); sw.append(Const.CSV_SEPARATOR); - sw.append("Target URL"); + sw.append("Target URL"); sw.append(Const.CSV_SEPARATOR); - sw.append("Date requested"); + sw.append("Date requested"); sw.append(Const.CSV_SEPARATOR); - sw.append(Const.CSV_LINE_END); - - if (permissionList != null && permissionList.size() > 0) { - Iterator itr = permissionList.iterator(); - while (itr.hasNext()) { - Target target = itr.next(); - sw.append(StringEscapeUtils.escapeCsv(target.title)); - sw.append(Const.CSV_SEPARATOR); - sw.append(StringEscapeUtils.escapeCsv(target.fieldUrl())); - sw.append(Const.CSV_SEPARATOR); - sw.append(StringEscapeUtils.escapeCsv(target.createdAt.toString())); - sw.append(Const.CSV_SEPARATOR); - sw.append(Const.CSV_LINE_END); - } - } + sw.append(Const.CSV_LINE_END); + + if (permissionList != null && permissionList.size() > 0) { + Iterator itr = permissionList.iterator(); + while (itr.hasNext()) { + Target target = itr.next(); + sw.append(StringEscapeUtils.escapeCsv(target.title)); + sw.append(Const.CSV_SEPARATOR); + sw.append(StringEscapeUtils.escapeCsv(target.fieldUrl())); + sw.append(Const.CSV_SEPARATOR); + sw.append(StringEscapeUtils.escapeCsv(target.createdAt.toString())); + sw.append(Const.CSV_SEPARATOR); + sw.append(Const.CSV_LINE_END); + } + } // File file = Utils.INSTANCE.generateCsvFile(fileName, sw.toString()); - return sw.toString(); - } - - /** + return sw.toString(); + } + public static String exportCrawlPermissions(List permissionList, String crawlPermissionStatus) { + Logger.debug("export() permissionList size: " + permissionList.size()); + StringBuilder sw = new StringBuilder(); + sw.append("Target title"); + sw.append(Const.CSV_SEPARATOR); + sw.append("Target URL"); + sw.append(Const.CSV_SEPARATOR); + sw.append("Date requested"); + sw.append(Const.CSV_SEPARATOR); + + if (crawlPermissionStatus.equals("GRANTED")) { + sw.append("Date granted"); + sw.append(Const.CSV_SEPARATOR); + } + else if (crawlPermissionStatus.equals("REFUSED")) { + sw.append("Date refused"); + sw.append(Const.CSV_SEPARATOR); + } + + sw.append(Const.CSV_LINE_END); + + if (permissionList != null && permissionList.size() > 0) { + Iterator itr = permissionList.iterator(); + while (itr.hasNext()) { + Target target = itr.next(); + sw.append(StringEscapeUtils.escapeCsv(target.title)); + sw.append(Const.CSV_SEPARATOR); + sw.append(StringEscapeUtils.escapeCsv(target.fieldUrl())); + sw.append(Const.CSV_SEPARATOR); + sw.append(StringEscapeUtils.escapeCsv(target.crawlPermissions.get(0).requestedAt!=null?(target.crawlPermissions.get(0).requestedAt.toString()):"")); + sw.append(Const.CSV_SEPARATOR); + + if (crawlPermissionStatus.equals("GRANTED")) { + sw.append(StringEscapeUtils.escapeCsv(target.crawlPermissions.get(0).grantedAt!=null?(target.crawlPermissions.get(0).grantedAt.toString()):"")); + sw.append(Const.CSV_SEPARATOR); + } + else if (crawlPermissionStatus.equals("REFUSED")) { + sw.append(StringEscapeUtils.escapeCsv(target.isRefused()==true?"":"")); + sw.append(Const.CSV_SEPARATOR); + } + + + sw.append(Const.CSV_LINE_END); + } + } +// File file = Utils.INSTANCE.generateCsvFile(fileName, sw.toString()); + return sw.toString(); + } + + /** * This method applies filters to the list of crawl reports. * @param curator The curator URL * @param organisation The organisation URL @@ -249,26 +278,28 @@ public static String export(List permissionList) { * @throws ActException */ public static Result processFilterReports(int pageNo, Long curatorId, Long organisationId, - String crawlPermissionsStatus, String request, String requestedFromDate, String requestedToDate, String grantedFromDate, String grantedToDate) throws ActException { + String crawlPermissionsStatus, //String request, + String requestedFromDate, + String requestedToDate, + String grantedFromDate, + String grantedToDate) throws ActException { User user = User.findByEmail(request().username()); List users = User.findAll(); List organisations = Organisation.findAllSorted(); - RequestType[] requestTypes = Const.RequestType.values(); - + //RequestType[] requestTypes = Const.RequestType.values(); Logger.debug("pageNo: " + pageNo); - Logger.debug("curatorId: " + curatorId); Logger.debug("organisationId: " + organisationId); Logger.debug("crawlPermissionsStatus: " + crawlPermissionsStatus); - Logger.debug("request: " + request); + //Logger.debug("request: " + request); Logger.debug("requestedFromDate: " + requestedFromDate); Logger.debug("requestedToDate: " + requestedToDate); Logger.debug("grantedFromDate: " + grantedFromDate); Logger.debug("grantedToDate: " + grantedToDate); Page pages = Target.pageReports(pageNo, curatorId, organisationId, - crawlPermissionsStatus, "", - "", "", "", ""); + crawlPermissionsStatus, + requestedFromDate, requestedToDate, grantedFromDate, grantedToDate); return ok(reports.render( "Reports", user, @@ -276,8 +307,9 @@ public static Result processFilterReports(int pageNo, Long curatorId, Long organ "", "", crawlPermissionsStatus, curatorId, organisationId, - "", "", "", "", "", - users, organisations, requestTypes + requestedFromDate, requestedToDate, grantedFromDate, grantedToDate, + users, organisations + //, requestTypes )); } @@ -330,7 +362,6 @@ public static Result targets(int pageNo, String sortBy, String order, Long curat Page pages = Target.pageReportsCreation(pageNo, Const.PAGINATION_OFFSET, sortBy, order, curatorId, organisationId, startDate, endDate, npld, crawlFrequency, tld); - List users = User.findAll(); List organisations = Organisation.findAll(); @@ -358,9 +389,6 @@ public static Result targets(int pageNo, String sortBy, String order, Long curat ); } - - - /** * This method enables searching for given URL and redirection in order to add new entry * if required. diff --git a/app/models/Target.java b/app/models/Target.java index a009aaa6..617c250b 100644 --- a/app/models/Target.java +++ b/app/models/Target.java @@ -159,7 +159,9 @@ public void setEdit_url(String edit_url) { //@JsonProperty("crawl_permissions") @OneToMany(mappedBy = "target", cascade = CascadeType.ALL) + //TODO: orderBy? // @OrderBy("createdAt DESC") + @OrderBy("requestedAt ASC") public List crawlPermissions; @JsonIgnore @@ -1125,18 +1127,24 @@ public static Page pageTargets(int page, int pageSize, public static Page pageReports(int pageNo, Long curatorId, Long organisationId, - String crawlPermissionsStatus, String request, - String requestedFromDate, String requestedToDate, String grantedFromDate, String grantedToDate) throws ActException { + String crawlPermissionsStatus, + //String request, + String generalFromDate, String generalToDate, + //String requestedFromDate, String requestedToDate, + String grantedFromDate, String grantedToDate) throws ActException { + + ExpressionList exp = Target.find + .fetch("crawlPermissions").where(); - ExpressionList exp = Target.find.where(); exp = exp.eq("active", true); Logger.debug("curatorId: " + curatorId); Logger.debug("organisationId: " + organisationId); Logger.debug("crawlPermissionsStatus: " + crawlPermissionsStatus); - Logger.debug("request: " + request); - Logger.debug("requestedFromDate: " + requestedFromDate); - Logger.debug("requestedToDate: " + requestedToDate); + Logger.debug("generalFromDate: " + generalFromDate); + Logger.debug("generalToDate: " + generalToDate); +// Logger.debug("requestedFromDate: " + requestedFromDate); +// Logger.debug("requestedToDate: " + requestedToDate); Logger.debug("grantedFromDate: " + grantedFromDate); Logger.debug("grantedToDate: " + grantedToDate); @@ -1147,41 +1155,42 @@ public static Page pageReports(int pageNo, Long curatorId, Long organisa exp = exp.eq("organisation.id", organisationId); } -// if (curatorId != null) { -// exp = exp.eq("authorUser.id", curatorId); -// } -// if (organisationId != null) { -// exp = exp.eq("organisation.id", organisationId); -// } -// if (StringUtils.isNotEmpty(crawlPermissionsStatus)) { -// //exp = exp.eq("crawlPermissions.status", "PENDING");//crawlPermissionsStatus); -// exp = exp.eq("crawlPermissions.status", "GRANTED");//crawlPermissionsStatus); -// //exp = exp.eq("crawlPermissions.status", "REFUSED");//crawlPermissionsStatus); -// } - exp = exp.eq("crawlPermissions.status", crawlPermissionsStatus); + if (StringUtils.isNotEmpty(crawlPermissionsStatus)) + exp = exp.eq("crawlPermissions.status", crawlPermissionsStatus); - if (StringUtils.isNotEmpty(requestedFromDate)) { + //TODO: IF REJECTED + if (StringUtils.isNotEmpty(generalFromDate)) { try { - Date date = Utils.INSTANCE.convertDate(requestedFromDate); - exp = exp.ge("crawlPermissions.requestedAt", date); + Date date = Utils.INSTANCE.convertDate(generalFromDate); + //ge - greater or equal + exp = crawlPermissionsStatus.equals("PENDING")? + exp.ge("crawlPermissions.requestedAt", date): + exp.ge("crawlPermissions.grantedAt", date); } catch (ParseException e) { throw new ActException(e); } } - if (StringUtils.isNotEmpty(requestedToDate)) { + if (StringUtils.isNotEmpty(generalToDate)) { try { - String modRequestedToDate = Utils.INSTANCE.getaddDayToDate(requestedToDate); + String modRequestedToDate = Utils.INSTANCE.getaddDayToDate(generalToDate); Date date = Utils.INSTANCE.convertDate(modRequestedToDate); - exp = exp.le("crawlPermissions.requestedAt", date); + //le - less or equal + exp = crawlPermissionsStatus.equals("PENDING")? + exp.le("crawlPermissions.requestedAt", date): + exp.le("crawlPermissions.grantedAt", date); + + } catch (ParseException e) { throw new ActException(e); } } + /* if (StringUtils.isNotEmpty(grantedFromDate)) { try { Date date = Utils.INSTANCE.convertDate(grantedFromDate); + //GE - GREATER OT EQUAL TO VALUE exp = exp.ge("crawlPermissions.grantedAt", date); } catch (ParseException e) { throw new ActException(e); @@ -1192,19 +1201,32 @@ public static Page pageReports(int pageNo, Long curatorId, Long organisa try { String modGrantedToDate = Utils.INSTANCE.getaddDayToDate(grantedToDate); Date date = Utils.INSTANCE.convertDate(modGrantedToDate); + //LE - LESS OT EQUAL TO VALUE exp = exp.le("crawlPermissions.grantedAt", date); } catch (ParseException e) { throw new ActException(e); } } + */ - Logger.debug("exp: " + exp.toString()); + //TODO: why hardcoding?! - Page res;// = null; + String sortBy = crawlPermissionsStatus.equals("PENDING")? + "crawlPermissions.requestedAt": + "crawlPermissions.grantedAt"; + //= "crawlPermissions.requestedAt"; + //String sortBy = "crawlPermissions.grantedAt";//"u1.granted_at";//" MIN(u1.granted_at) "; + String order = " asc "; + //.orderBy(sortBy) + //exp = exp.orderBy("crawlPermissions.grantedAt "); - Query query = exp.query(); - //TODO: sort and order - res = query//.orderBy(sortBy + " " + order) + Logger.debug("sortBy : " + sortBy); + + Page res; + + Query query = exp.query().orderBy(sortBy + " " + order); + + res = query//.orderBy(sortBy ) .findPagingList(Const.PAGINATION_OFFSET) .setFetchAhead(false) .getPage(pageNo); @@ -1216,20 +1238,18 @@ public static Page pageReports(int pageNo, Long curatorId, Long organisa public static List pageReportsFull(int pageNo, Long curatorId, Long organisationId, - String crawlPermissionsStatus, String request, - String requestedFromDate, String requestedToDate, String grantedFromDate, String grantedToDate) throws ActException { - - Logger.debug("pageReports ---- "); - - ExpressionList exp = Target.find.where(); + String crawlPermissionsStatus, + //String request, + String generalFromDate, String generalToDate, + String grantedFromDate, String grantedToDate) throws ActException { + ExpressionList exp = Target.find.fetch("crawlPermissions").where(); exp = exp.eq("active", true); Logger.debug("curatorId: " + curatorId); Logger.debug("organisationId: " + organisationId); Logger.debug("crawlPermissionsStatus: " + crawlPermissionsStatus); - Logger.debug("request: " + request); - Logger.debug("requestedFromDate: " + requestedFromDate); - Logger.debug("requestedToDate: " + requestedToDate); + Logger.debug("generalFromDate: " + generalFromDate); + Logger.debug("generalToDate: " + generalToDate); Logger.debug("grantedFromDate: " + grantedFromDate); Logger.debug("grantedToDate: " + grantedToDate); @@ -1240,40 +1260,33 @@ public static List pageReportsFull(int pageNo, Long curatorId, Long orga exp = exp.eq("organisation.id", organisationId); } -// if (curatorId != null) { -// exp = exp.eq("authorUser.id", curatorId); -// } -// if (organisationId != null) { -// exp = exp.eq("organisation.id", organisationId); -// } -// if (StringUtils.isNotEmpty(crawlPermissionsStatus)) { -// //exp = exp.eq("crawlPermissions.status", "PENDING");//crawlPermissionsStatus); -// exp = exp.eq("crawlPermissions.status", "GRANTED");//crawlPermissionsStatus); -// //exp = exp.eq("crawlPermissions.status", "REFUSED");//crawlPermissionsStatus); -// } - exp = exp.eq("crawlPermissions.status", crawlPermissionsStatus);//crawlPermissionsStatus); - + if (StringUtils.isNotEmpty(crawlPermissionsStatus)) + exp = exp.eq("crawlPermissions.status", crawlPermissionsStatus); - - if (StringUtils.isNotEmpty(requestedFromDate)) { + if (StringUtils.isNotEmpty(generalFromDate)) { try { - Date date = Utils.INSTANCE.convertDate(requestedFromDate); - exp = exp.ge("crawlPermissions.requestedAt", date); + Date date = Utils.INSTANCE.convertDate(generalFromDate); + exp = crawlPermissionsStatus.equals("PENDING")? + exp.ge("crawlPermissions.requestedAt", date): + exp.ge("crawlPermissions.grantedAt", date); } catch (ParseException e) { throw new ActException(e); } } - if (StringUtils.isNotEmpty(requestedToDate)) { + if (StringUtils.isNotEmpty(generalToDate)) { try { - String modRequestedToDate = Utils.INSTANCE.getaddDayToDate(requestedToDate); + String modRequestedToDate = Utils.INSTANCE.getaddDayToDate(generalToDate); Date date = Utils.INSTANCE.convertDate(modRequestedToDate); - exp = exp.le("crawlPermissions.requestedAt", date); + exp = crawlPermissionsStatus.equals("PENDING")? + exp.le("crawlPermissions.requestedAt", date): + exp.le("crawlPermissions.grantedAt", date); } catch (ParseException e) { throw new ActException(e); } } + /* if (StringUtils.isNotEmpty(grantedFromDate)) { try { Date date = Utils.INSTANCE.convertDate(grantedFromDate); @@ -1292,14 +1305,26 @@ public static List pageReportsFull(int pageNo, Long curatorId, Long orga throw new ActException(e); } } + */ - Logger.debug("exp: " + exp.toString()); + //Logger.debug("exp: " + exp.toString()); //TODO: in Target class - need method returns Page List res;// = null; + String sortBy = crawlPermissionsStatus.equals("PENDING")? + "crawlPermissions.requestedAt": + "crawlPermissions.grantedAt"; +// String sortBy = " crawlPermissions.grantedAt "; + String order = "asc"; Query query = exp.query(); - res = query.findList(); + //Logger.info("query.toString = " + query.toString()); + //.orderBy(sortBy + " " + order); + //TODO: why hardcoding?! + //find.where().orderBy("fieldname desc").findList() + + res = query.orderBy(sortBy + " " + order).findList(); + //res = query.findList(); Logger.debug("pageReports - Expression list for targets created size: " + res.size()); @@ -1396,7 +1421,12 @@ public static Page pageReportsCreation(int page, int pageSize, String sortBy, String order, Long curatorId, Long organisationId, String startDate, String endDate, String npld, String crawlFrequencyName, String tld) throws ActException { - ExpressionList exp = Target.find.fetch("fieldUrls").fetch("flags").fetch("licenses").fetch("subjects").fetch("collections").where(); + ExpressionList exp = Target.find + .fetch("fieldUrls") + .fetch("flags") + .fetch("licenses") + .fetch("subjects") + .fetch("collections").where(); Page res = null; exp = exp.eq(Const.ACTIVE, true); @@ -1481,7 +1511,6 @@ public static Page pageReportsCreation(int page, int pageSize, } // TODO: NONE SELECTED??? - Logger.debug("pageReportsCreation() NPLD: " + npld); /** @@ -1528,17 +1557,17 @@ public static Page pageReportsCreation(int page, int pageSize, Query query = exp.query(); - res = query.orderBy(sortBy + " " + order).findPagingList(pageSize) - .setFetchAhead(false).getPage(page); + res = query.orderBy(sortBy + " " + order) + .findPagingList(pageSize) + .setFetchAhead(false) + .getPage(page); Logger.debug("Expression list for targets created size: " + res.getTotalRowCount()); return res; - } - /** * Target List Count after filtering * diff --git a/app/views/reports/reports.scala.html b/app/views/reports/reports.scala.html index 7ffd1c17..26dd1e0d 100644 --- a/app/views/reports/reports.scala.html +++ b/app/views/reports/reports.scala.html @@ -1,4 +1,6 @@ -@(title: String, user: User, currentPage: com.avaje.ebean.Page[Target], currentSortBy: String, currentOrder: String, crawlPermissionsStatus2: String,curatorId: Long, organisationId: Long, startDate: String, endDate: String, requestType: String, grantedFromDate: String, grantedToDate: String, users: List[User], organisations: List[Organisation], requestTypes: Array[uk.bl.Const.RequestType]) +@import uk.bl.Const +@import uk.bl.Const +@(title: String, user: User, currentPage: com.avaje.ebean.Page[Target], currentSortBy: String, currentOrder: String, crawlPermissionsStatus2: String,curatorId: Long, organisationId: Long, startDate: String, endDate: String, grantedFromDate: String, grantedToDate: String, users: List[User], organisations: List[Organisation]) @styles = { @@ -85,7 +87,7 @@ // Generate the link routes.ReportController.processFilterReports(newPage, curatorId, organisationId, - crawlPermissionsStatus2, "", + crawlPermissionsStatus2, startDate, endDate, grantedFromDate, grantedToDate) } @@ -144,7 +146,7 @@

Targets > Reports

- +@* *@ @@ -152,8 +154,14 @@

Targets > Reports

-
- + +
+
+ +
+
+ +
@@ -203,7 +211,7 @@

Targets > Reports

- +
@@ -222,51 +230,6 @@

Targets > Reports

-
-
-
-
- -
- -
-
-
-
- -
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
- -
-
-
-
-
-
@@ -292,6 +255,12 @@

Targets > Reports

Target Title Target URL Date requested + @if(crawlPermissionsStatus2.equals(Const.CrawlPermissionStatus.GRANTED.toString())){ + Date granted + } + @if(crawlPermissionsStatus2.equals(Const.CrawlPermissionStatus.REFUSED.toString())){ + Date refused + } @@ -314,6 +283,11 @@

Targets > Reports

} else { } + @if(target.url != null && target.getLatestCrawlPermission.grantedAt != null) { + @target.getLatestCrawlPermission.grantedAt + } else { + + } }