Class DashboardRecentPagesService

java.lang.Object
sk.iway.iwcm.components.welcome.DashboardRecentPagesService

public class DashboardRecentPagesService extends Object
Provides dashboard search previews and page access checks using current permissions and domain membership.
  • Constructor Details

    • DashboardRecentPagesService

      public DashboardRecentPagesService()
  • Method Details

    • getPagePreviews

      public Map<Integer,DocDetailsDto> getPagePreviews(Identity user, String domain, List<Integer> docIds)
      Loads current thumbnail paths and the latest save by any author for accessible search results. Pages outside the active domain or the user's editing permissions are omitted; pages without a history save date use their creation date.
      Parameters:
      user - user whose web page access and editing permissions are checked
      domain - active domain name used to filter the pages
      docIds - non-null list of at most twenty page IDs in the requested order
      Returns:
      previews keyed by page ID in request order, excluding inaccessible or missing pages
      Throws:
      IllegalArgumentException - if more than twenty page IDs are requested
      org.springframework.security.access.AccessDeniedException - if the user lacks web page access
      IllegalStateException - if preview data cannot be loaded from the database
    • getPagePreviews

      public Map<Integer,DocDetailsDto> getPagePreviews(Identity user, String domain, List<Integer> docIds, boolean cacheOnly)
      Loads authorized previews, optionally using only cached page metadata for autocomplete. Cached previews omit the latest save date, which requires a database query.
      Parameters:
      user - user whose web page access and editing permissions are checked
      domain - active domain name used to filter the pages
      docIds - non-null list of at most twenty page IDs in the requested order
      cacheOnly - whether to skip database enrichment of thumbnails and save dates
      Returns:
      previews keyed by page ID in request order, excluding inaccessible or missing pages
      Throws:
      IllegalArgumentException - if more than twenty page IDs are requested
      org.springframework.security.access.AccessDeniedException - if the user lacks web page access
      IllegalStateException - if requested database enrichment fails
    • isAccessible

      public static boolean isAccessible(DocDetails currentDoc, Identity user, String domain)
      Checks whether a page is editable in the active domain using its current location. Missing pages and pages in hidden groups or the trash are excluded.
      Parameters:
      currentDoc - current page details, or null
      user - user whose web page access and editing permissions are checked, or null
      domain - required domain name; a missing or empty value denies access
      Returns:
      true if the page passes the location and permission checks