Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.1' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.1
  • Loading branch information
metaventis-build committed Nov 8, 2024
2 parents edc895e + d6db887 commit d9b9759
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@ protected void executeInternal(JobExecutionContext jobExecutionContext) throws J
}

private Void createStats() {
LocalDate now = LocalDate.now();
LocalDate to = now.minusDays(1);

LocalDate to = LocalDate.now();
if (customDate != null) {
to = customDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
to = to.minusDays(1);

LocalDate from = to.withDayOfMonth(1);
switch (type) {
Expand Down Expand Up @@ -195,30 +194,9 @@ private String generateFilename(LocalDate from, LocalDate to) {
StringBuilder sb = new StringBuilder(filename);
if (appendDate) {
sb.append("_");
switch (type) {
case Yearly:
sb.append(from.format(DateTimeFormatter.ofPattern(("yyyy"))));
if(to.getMonthValue() != 12 && to.getDayOfMonth() != to.lengthOfMonth()){
sb.append("_interim");
}
break;
case Quarterly:
sb.append(from.format(DateTimeFormatter.ofPattern(("yyyy"))));
sb.append("-Q");
sb.append(to.getMonthValue() / 3);
if(to.getMonth().firstMonthOfQuarter().getValue() + 3 != to.getMonthValue() && to.getDayOfMonth() != to.lengthOfMonth()){
sb.append("_interim");
}
break;
case Monthly:
sb.append(from.format(DateTimeFormatter.ofPattern(("yyyy-MM"))));
if(to.getDayOfMonth() != to.lengthOfMonth()){
sb.append("_interim");
}
break;
default:
throw new NotImplementedException(type.name());
}
sb.append(from.format(DateTimeFormatter.ofPattern(("yyMMdd"))));
sb.append("-");
sb.append(to.format(DateTimeFormatter.ofPattern(("yyMMdd"))));
}

sb.append(".csv");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
}

response = renderingService.getDetails(ApplicationInfoList.getHomeRepository().getAppId(), node_id, version,DEFAULT_DISPLAY_MODE, params).getDetails();
response = response.replace("{{{LMS_INLINE_HELPER_SCRIPT}}}", URLHelper.getNgRenderNodeUrl(node_id,version)+"?");
response = response.replace("{{{LMS_INLINE_HELPER_SCRIPT}}}", URLHelper.getNgRenderNodeUrl(node_id,version,true)+"?");
// add nonce to render styles
response = response.replace("<style", "<style nonce=\"" +SecurityHeadersFilter.ngCspNonce.get() + "\"");
TrackingServiceFactory.getTrackingService().trackActivityOnNode(new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, node_id), null, TrackingService.EventType.VIEW_MATERIAL_EMBEDDED);
Expand Down

0 comments on commit d9b9759

Please sign in to comment.