Interface UrlAliasRepository


  • public interface UrlAliasRepository
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int delete​(List<UUID> urlAliasUuids)
      Remove the entries with the provided UUIDs (PK).
      de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases> find​(de.digitalcollections.model.list.paging.PageRequest pageRequest)
      Generic request method for getting a parametrized list.
      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findAllPrimaryLinks​(String slug)
      Retrieve all primary links corresponding to a slug.
      default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite​(UUID websiteUuid, String slug)
      Retrieve the primary links corresponding to a slug and the target's language.
      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite​(UUID websiteUuid, String slug, boolean considerLanguage)
      Retrieve the primary links corresponding to a slug.
      de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getAllForTarget​(UUID uuid)
      Retrieve all slugs of a link target.
      de.digitalcollections.model.identifiable.alias.UrlAlias getByUuid​(UUID uuid)
      Retrieve the UrlAlias with the supplied UUID (PK).
      boolean hasUrlAlias​(String slug, UUID websiteUuid, Locale targetLanguage)
      Check whether an entry exists for the passed website UUID, slug and language.
      de.digitalcollections.model.identifiable.alias.UrlAlias save​(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)
      Save an UrlAlias object.
      de.digitalcollections.model.identifiable.alias.UrlAlias update​(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)
      Update an existing object.
    • Method Detail

      • find

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

        de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getAllForTarget​(UUID uuid)
                                                                                    throws UrlAliasRepositoryException
        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:
        UrlAliasRepositoryException
      • findAllPrimaryLinks

        de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findAllPrimaryLinks​(String slug)
                                                                                        throws UrlAliasRepositoryException
        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:
        UrlAliasRepositoryException
      • findPrimaryLinksForWebsite

        default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite​(UUID websiteUuid,
                                                                                                              String slug)
                                                                                                       throws UrlAliasRepositoryException
        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:
        UrlAliasRepositoryException
      • findPrimaryLinksForWebsite

        de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite​(UUID websiteUuid,
                                                                                                      String slug,
                                                                                                      boolean considerLanguage)
                                                                                               throws UrlAliasRepositoryException
        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:
        UrlAliasRepositoryException
      • hasUrlAlias

        boolean hasUrlAlias​(String slug,
                            UUID websiteUuid,
                            Locale targetLanguage)
                     throws UrlAliasRepositoryException
        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:
        UrlAliasRepositoryException
      • save

        de.digitalcollections.model.identifiable.alias.UrlAlias save​(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)
                                                              throws UrlAliasRepositoryException
        Save an UrlAlias object.
        Parameters:
        urlAlias - the object to save
        Returns:
        the newly created dataset or null
        Throws:
        UrlAliasRepositoryException
      • update

        de.digitalcollections.model.identifiable.alias.UrlAlias update​(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)
                                                                throws UrlAliasRepositoryException
        Update an existing object.
        Parameters:
        urlAlias - the existing object with changed properties
        Returns:
        the updated dataset or null
        Throws:
        UrlAliasRepositoryException