Interface WhatsNewService

All Known Implementing Classes:
WhatsNewServiceImpl

public interface WhatsNewService
Creates reports that can be shown on the web pages or in social media feeds.

Reports are always generated from an anonymous user's perspective, so the counts match what a logged-out visitor can actually see.

"New" means created in Gemma — the action='C' row on the entity's audit trail, i.e. when the dataset was first loaded. It is deliberately not "made public".

MakePublicEvent had 0 occurrences across a 200-dataset / ~5,000-event sample of prod on 2026-08-21, because only two REST endpoints recorded it. It is now emitted by SecurityServiceImpl.makePublic, so every path records it and the earliest one on a trail is the first time that dataset became public.

🛑 That is going forward only — nothing was backfilled. A dataset made public before 2026-08-27 carries no such event, and no query can recover its publication date. These counts are still "added to Gemma" and not "made public".

These reports are expensive enough that callers should cache them rather than compute per request; HomeStats carries the corpus-wide counts in its daily snapshot.

Author:
paul
  • Method Details

    • getDailyReport

      WhatsNew getDailyReport()
      Generate the report from yesterday.
      Returns:
      new or updated objects from within a day ago.
    • getWeeklyReport

      WhatsNew getWeeklyReport()
      Generate the report from last week.
      Returns:
      new or updated objects from within one week ago.
    • getReport

      WhatsNew getReport(Date since)
      Generate the report covering everything that changed since a given date.

      This is the full report: it loads the new and updated experiments and platforms, splits them by taxon, and counts their biomaterials. Cost scales with the size of the window — a year-wide window touches most of the corpus. When only the headline count is needed, use countNewExpressionExperiments(Date) instead.

      Parameters:
      since - start of the reporting window
      Returns:
      new and updated objects since since, from an anonymous user's perspective
    • countNewExpressionExperiments

      long countNewExpressionExperiments(Date since)
      Count the public experiments first created in Gemma since a given date.

      The cheap counterpart to getReport(Date): it resolves ids through the audit trail's creation events and applies the same anonymous-user ACL filter, without loading the associated platforms, taxa or biomaterials.

      Parameters:
      since - start of the counting window
      Returns:
      the number of experiments an anonymous visitor can see that were created on or after since