All Superinterfaces:
PagingSortingFilteringRepository<de.digitalcollections.model.identifiable.alias.UrlAlias>, UniqueObjectRepository<de.digitalcollections.model.identifiable.alias.UrlAlias>

public interface UrlAliasRepository extends UniqueObjectRepository<de.digitalcollections.model.identifiable.alias.UrlAlias>
  • Method Details

    • grabLanguage

      static String grabLanguage(Locale locale)
      Returns the language of the passed locale w/o anything else e.g. country or script.

      This is a safe method to always get a language code even if a language is not set at all or Locale.ROOT is used ("und" is returned). If the locale is null then "und" (Undetermined) is returned. See also Locale.toLanguageTag().

      Parameters:
      locale -
      Returns:
    • grabLanguageLocale

      static Locale grabLanguageLocale(Locale locale)
      Parameters:
      locale -
      Returns:
    • grabLocalesByScript

      static List<Locale> grabLocalesByScript(Collection<Locale> locales)
      Filter the locales by their script and return only those with
      • "" (no script)
      • "Latn"
      Parameters:
      locales -
      Returns:
    • deleteByIdentifiable

      default boolean deleteByIdentifiable(de.digitalcollections.model.identifiable.Identifiable identifiable, boolean force) throws RepositoryException
      Throws:
      RepositoryException
    • deleteByIdentifiable

      boolean deleteByIdentifiable(UUID identifiableUuid, boolean force) throws RepositoryException
      Throws:
      RepositoryException
    • findAllPrimaryLinks

      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findAllPrimaryLinks(String slug) throws RepositoryException
      Retrieve all primary links corresponding to a slug. The owning website is ignored.
      Parameters:
      slug - the slug to retrieve the primary aliases for
      Returns:
      all UrlAliases with isPrimary() == true
      Throws:
      RepositoryException
    • findLocalizedUrlAliases

      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases> findLocalizedUrlAliases(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws RepositoryException
      Generic request method for getting a parametrized list.
      Parameters:
      pageRequest - request params for list
      Returns:
      pagable result list
      Throws:
      RepositoryException
    • findPrimaryLinksForWebsite

      default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite(UUID websiteUuid, String slug) throws RepositoryException
      Retrieve the primary links corresponding to a slug and the target's language.
      Parameters:
      websiteUuid - the owning website's UUID, can be null and will be selected as is
      slug - the slug to retrieve the primary aliases for
      Returns:
      UrlAliases with isPrimary() == true
      Throws:
      RepositoryException
    • findPrimaryLinksForWebsite

      default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite(de.digitalcollections.model.identifiable.entity.Website website, String slug) throws RepositoryException
      Throws:
      RepositoryException
    • findPrimaryLinksForWebsite

      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite(UUID websiteUuid, String slug, boolean considerLanguage) throws RepositoryException
      Retrieve the primary links corresponding to a slug.
      Parameters:
      websiteUuid - the owning website's UUID, can be null and will be selected as is
      slug - the slug to retrieve the primary aliases for
      considerLanguage - if true consider the language(s) of the target when searching for the primary links
      Returns:
      UrlAliases with isPrimary() == true
      Throws:
      RepositoryException
    • findPrimaryLinksForWebsite

      default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite(de.digitalcollections.model.identifiable.entity.Website website, String slug, boolean considerLanguage) throws RepositoryException
      Throws:
      RepositoryException
    • getByIdentifiable

      default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getByIdentifiable(de.digitalcollections.model.identifiable.Identifiable identifiable) throws RepositoryException
      Throws:
      RepositoryException
    • getByIdentifiable

      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getByIdentifiable(UUID uuid) throws RepositoryException
      Retrieve all slugs of a link target.
      Parameters:
      uuid - the target's (Webpage, Collection,...) UUID
      Returns:
      LocalizedUrlAliases containing all UrlAlias objects for that target
      Throws:
      RepositoryException
    • hasUrlAlias

      boolean hasUrlAlias(String slug, UUID websiteUuid, Locale targetLanguage) throws RepositoryException
      Check whether an entry exists for the passed website UUID, slug and language.
      Parameters:
      slug - not null
      websiteUuid - can be null
      targetLanguage - can be null
      Returns:
      true if slug of website has an url alias for given language
      Throws:
      RepositoryException
    • hasUrlAlias

      default boolean hasUrlAlias(String slug, de.digitalcollections.model.identifiable.entity.Website website, Locale targetLanguage) throws RepositoryException
      Throws:
      RepositoryException