Interface UrlAliasService
-
- All Known Implementing Classes:
UrlAliasServiceImpl
public interface UrlAliasServiceService for UrlAliasses
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleandelete(List<UUID> uuids)Delete a list of UrlAliases by their UUIDsdefault booleandelete(UUID uuid)Delete a single UrlAlias by its UUIDdefault booleandeleteAllForTarget(UUID uuid)Delete all UrlAliases targetting the passed UUID except those that have already been published.booleandeleteAllForTarget(UUID uuid, boolean force)Delete all UrlAliases targetting the passed UUID except those that have already been published.de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases>find(de.digitalcollections.model.list.paging.PageRequest pageRequest)Find UrlAliasesStringgenerateSlug(Locale pLocale, String label, UUID websiteUuid)Generates a not yet existing slug for the provided label, language and websiteUuid.de.digitalcollections.model.identifiable.alias.UrlAliasgetByUuid(UUID uuid)Retrieve one UrlAlias by its UUIDde.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesgetLocalizedUrlAliases(UUID uuid)Returns the LocalizedUrlAliases for an identifiable, identified by its UUIDde.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesgetPrimaryUrlAliases(UUID websiteUuid, String slug, Locale pLocale)Returns the primary Links (one per language) as LocalizedUrlAliases for a given slug for a given website (identified by its uuid).List<de.digitalcollections.model.identifiable.alias.UrlAlias>getPrimaryUrlAliasesForTarget(UUID targetUuid)Returns all primary links of the passed target identifiable.default de.digitalcollections.model.identifiable.alias.UrlAliassave(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)Create an UrlAlias in the database (with validation)de.digitalcollections.model.identifiable.alias.UrlAliassave(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias, boolean force)Create an UrlAlias in the databasede.digitalcollections.model.identifiable.alias.UrlAliasupdate(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)Updates an UrlAlias in the databasevoidvalidate(de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases localizedUrlAliases)Validates the given localizedUrlAliases according to the following criteria: For each (website,target,language) tuple, exactly one primary UrlAlias must exist, and as many non primary UrlAliases can exist
-
-
-
Method Detail
-
save
default de.digitalcollections.model.identifiable.alias.UrlAlias save(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias) throws CudamiServiceExceptionCreate an UrlAlias in the database (with validation)- Parameters:
urlAlias- the UrlAlias (with yet empty UUID)- Returns:
- the persisted UrlAlias with its generated UUID
- Throws:
CudamiServiceException
-
save
de.digitalcollections.model.identifiable.alias.UrlAlias save(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias, boolean force) throws CudamiServiceExceptionCreate an UrlAlias in the database- Parameters:
urlAlias- the UrlAlias (with yet empty UUID)force- if true, do not validate- Returns:
- the persisted UrlAlias with its generated UUID
- Throws:
CudamiServiceException
-
delete
default boolean delete(UUID uuid) throws CudamiServiceException
Delete a single UrlAlias by its UUID- Parameters:
uuid- the UUID- Returns:
- true if the UrlAliases existed and could be deleted or false, it it did not exist and thus could not be deleted
- Throws:
CudamiServiceException- in case of an error
-
delete
boolean delete(List<UUID> uuids) throws CudamiServiceException
Delete a list of UrlAliases by their UUIDs- Parameters:
uuids- a List of UUIDs- Returns:
- true if at least one UrlAlias existed and could be deleted or false, if no UrlAlias existed at all and thus nothing could be deleted
- Throws:
CudamiServiceException
-
deleteAllForTarget
default boolean deleteAllForTarget(UUID uuid) throws CudamiServiceException
Delete all UrlAliases targetting the passed UUID except those that have already been published.- Parameters:
uuid- thetargetUuidwhose UrlAliases should be deleted- Returns:
- true if at least one UrlAlias existed and could be deleted or false, if no UrlAlias existed at all and thus nothing could be deleted
- Throws:
CudamiServiceException
-
deleteAllForTarget
boolean deleteAllForTarget(UUID uuid, boolean force) throws CudamiServiceException
Delete all UrlAliases targetting the passed UUID except those that have already been published.- Parameters:
uuid- thetargetUuidwhose UrlAliases should be deletedforce- iftrueremove published ones as well- Returns:
- true if at least one UrlAlias existed and could be deleted or false, if no UrlAlias existed at all and thus nothing could be deleted
- Throws:
CudamiServiceException
-
find
de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases> find(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws CudamiServiceExceptionFind UrlAliases- Parameters:
pageRequest- the PageRequest- Returns:
- a SearchPageResponse with the found LocalizedUrlAliases as paged content
- Throws:
CudamiServiceException- in case of an error
-
getLocalizedUrlAliases
de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getLocalizedUrlAliases(UUID uuid) throws CudamiServiceException
Returns the LocalizedUrlAliases for an identifiable, identified by its UUID- Parameters:
uuid- the UUID of the identifiable- Returns:
- the LocalizedUrlAliases, if found, or null
- Throws:
CudamiServiceException- in case of an error
-
getPrimaryUrlAliases
de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getPrimaryUrlAliases(UUID websiteUuid, String slug, Locale pLocale) throws CudamiServiceException
Returns the primary Links (one per language) as LocalizedUrlAliases for a given slug for a given website (identified by its uuid). The given website can be null. Additionally you can provide aLocalelanguage to retrieve primary links of this particular target language only.- Parameters:
websiteUuid- the UUID of the website, the slug belongs to, or nullslug- the slug (=relative path)pLocale- the locale for which the result is filtered. Optional.- Returns:
- LocalizedUrlAliases, if a primary link exists; otherwise: null.
- Throws:
CudamiServiceException- in case of an error
-
getPrimaryUrlAliasesForTarget
List<de.digitalcollections.model.identifiable.alias.UrlAlias> getPrimaryUrlAliasesForTarget(UUID targetUuid) throws CudamiServiceException
Returns all primary links of the passed target identifiable.- Parameters:
targetUuid- UUID of the identifiable that the primaries should be found for- Returns:
List, notnull- Throws:
CudamiServiceException- in case of an error
-
generateSlug
String generateSlug(Locale pLocale, String label, UUID websiteUuid) throws CudamiServiceException
Generates a not yet existing slug for the provided label, language and websiteUuid. If the websiteUuid is empty, the configured default website uuid is used.If for the (locale,label,websiteUuid) triple a slug already exists, a new slug is calculated by appending suffixes to it.
- Parameters:
pLocale- The locale for which the slug is generated.label- The label as a stringwebsiteUuid- The uuid of the website, for which the slug is generated. If not set, the UUID of the default website is used- Returns:
- slug as String, or null, if no website under the provided websiteUuid exists
- Throws:
CudamiServiceException
-
getByUuid
de.digitalcollections.model.identifiable.alias.UrlAlias getByUuid(UUID uuid) throws CudamiServiceException
Retrieve one UrlAlias by its UUID- Parameters:
uuid- the UUID- Returns:
- the UrlAlias or null
- Throws:
CudamiServiceException- in case of an error
-
update
de.digitalcollections.model.identifiable.alias.UrlAlias update(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias) throws CudamiServiceExceptionUpdates an UrlAlias in the database- Parameters:
urlAlias- the UrlAlias (with set UUID)- Returns:
- the updated UrlAlias
- Throws:
CudamiServiceException
-
validate
void validate(de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases localizedUrlAliases) throws ValidationExceptionValidates the given localizedUrlAliases according to the following criteria:- For each (website,target,language) tuple, exactly one primary UrlAlias must exist, and as many non primary UrlAliases can exist
- Parameters:
localizedUrlAliases- the LocalizedUrlAliases to validate- Throws:
ValidationException- when the critera are not met
-
-