Class UserPortalContentTenantStateHelper


  • public final class UserPortalContentTenantStateHelper
    extends Object
    Helper for resolving tenant-dependent content state and tenant caching for user portal content creation.
    Since:
    8.6.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • resolveTenantState

        public static UserPortalContentTenantStateHelper.TenantStateSnapshot resolveTenantState​(UUID selectedTenantUuid,
                                                                                                Map<UUID,​UserPortalTenantContentLoader.TenantContentLoadResult> tenantContentLoadResultCache,
                                                                                                Mandant currentClient,
                                                                                                IUser user)
        Resolves the tenant-dependent content state for the currently selected tenant.
        Parameters:
        selectedTenantUuid - UUID of the selected tenant
        tenantContentLoadResultCache - cache for already loaded tenant content results
        currentClient - current client from the view context, or null when no client is fixed
        user - current user used for permission checks
        Returns:
        snapshot of the resolved tenant state, or an empty snapshot when the tenant could not be resolved
      • resolveTenantState

        public static UserPortalContentTenantStateHelper.TenantStateSnapshot resolveTenantState​(UUID selectedTenantUuid,
                                                                                                Map<UUID,​UserPortalTenantContentLoader.TenantContentLoadResult> tenantContentLoadResultCache,
                                                                                                Mandant currentClient,
                                                                                                IUser user,
                                                                                                EUserPortalContentConfigType contentTypeToRefresh)
        Resolves the tenant-dependent content state for the currently selected tenant, with the option to refresh specific content types in the cache.
        Parameters:
        selectedTenantUuid - UUID of the selected tenant
        tenantContentLoadResultCache - cache for already loaded tenant content results
        currentClient - current client from the view context, or null when no client is fixed
        user - current user used for permission checks
        contentTypeToRefresh - when specified, forces the refresh of the given content type in the cache; when null, the cache is reused without refreshing
        Returns:
        snapshot of the resolved tenant state, or an empty snapshot when the tenant could not be resolved
      • resolveSelectedTenant

        public static UserPortalContentTenantStateHelper.ResolvedTenant resolveSelectedTenant​(IEntityContext entityContext,
                                                                                              UUID selectedTenantUuid,
                                                                                              UUID loadedTenantUuid,
                                                                                              Mandant loadedTenant,
                                                                                              Mandant currentClient)
        Resolves the selected tenant entity while reusing the current cached tenant if possible.
        Parameters:
        entityContext - entity context used for the lookup
        selectedTenantUuid - UUID of the selected tenant
        loadedTenantUuid - UUID of the currently cached tenant
        loadedTenant - currently cached tenant
        currentClient - current client from the view context, or null when no client is fixed
        Returns:
        resolved tenant snapshot