Interface UrlAliasRepository
- 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 Summary
Modifier and TypeMethodDescriptiondefault booleandeleteByIdentifiable(de.digitalcollections.model.identifiable.Identifiable identifiable, boolean force) booleandeleteByIdentifiable(UUID identifiableUuid, boolean force) de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindAllPrimaryLinks(String slug) Retrieve all primary links corresponding to a slug.de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases>findLocalizedUrlAliases(de.digitalcollections.model.list.paging.PageRequest pageRequest) Generic request method for getting a parametrized list.default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(de.digitalcollections.model.identifiable.entity.Website website, String slug) default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(de.digitalcollections.model.identifiable.entity.Website website, String slug, boolean considerLanguage) default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(UUID websiteUuid, String slug) Retrieve the primary links corresponding to a slug and the target's language.de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(UUID websiteUuid, String slug, boolean considerLanguage) Retrieve the primary links corresponding to a slug.default de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesgetByIdentifiable(de.digitalcollections.model.identifiable.Identifiable identifiable) de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesgetByIdentifiable(UUID uuid) Retrieve all slugs of a link target.static StringgrabLanguage(Locale locale) Returns the language of the passed locale w/o anything else e.g.static LocalegrabLanguageLocale(Locale locale) Same asgrabLanguage(Locale).grabLocalesByScript(Collection<Locale> locales) Filter the locales by their script and return only those with "" (no script) "Latn"default booleanhasUrlAlias(String slug, de.digitalcollections.model.identifiable.entity.Website website, Locale targetLanguage) booleanhasUrlAlias(String slug, UUID websiteUuid, Locale targetLanguage) Check whether an entry exists for the passed website UUID, slug and language.Methods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.PagingSortingFilteringRepository
findMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.UniqueObjectRepository
count, create, delete, delete, deleteByUuid, deleteByUuids, getByExample, getByExampleAndFiltering, getByExamples, getByExamplesAndFiltering, getByUuid, getByUuidAndFiltering, getByUuids, getByUuidsAndFiltering, getRandom, save, save, saveOrUpdate, update, update
-
Method Details
-
grabLanguage
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.ROOTis used ("und" is returned). If the locale isnullthen "und" (Undetermined) is returned. See alsoLocale.toLanguageTag().- Parameters:
locale-- Returns:
-
grabLanguageLocale
Same asgrabLanguage(Locale).- Parameters:
locale-- Returns:
-
grabLocalesByScript
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
- 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 withisPrimary() == 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 benulland will be selected as isslug- the slug to retrieve the primary aliases for- Returns:
UrlAliases withisPrimary() == 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 benulland will be selected as isslug- the slug to retrieve the primary aliases forconsiderLanguage- if true consider the language(s) of the target when searching for the primary links- Returns:
UrlAliases withisPrimary() == 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:
LocalizedUrlAliasescontaining allUrlAliasobjects 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 nullwebsiteUuid- can be nulltargetLanguage- 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
-