Package org.craftercms.engine.targeting
Interface TargetIdManager
- All Known Implementing Classes:
AbstractTargetIdManager
,LocaleTargetIdManager
,ProxyTargetIdManager
public interface TargetIdManager
Contains methods for resolving specific target IDs.
- Author:
- avasquez
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of all available target IDs used by the site.Returns the target ID for the current request, or null or empty if there's no target ID.Returns the fallback target ID.
-
Method Details
-
getCurrentTargetId
Returns the target ID for the current request, or null or empty if there's no target ID.- Throws:
IllegalStateException
-
getFallbackTargetId
Returns the fallback target ID. The fallback target ID is used in case none of the resolved candidate targeted URLs map to existing content. A null or an empty string indicates that the non-targeted version should be the last candidate URL.For example, if the candidate targeted URLs are /site/website/index_es_CR.xml and /site/website/index_es.xml, and the fallback target ID is "en", then /site/website/index_en.xml is added to the list of candidate URLs, but if an empty or null string is the fallback target ID instead, /site/website/index.xml is the last candidate URL.
- Throws:
IllegalStateException
-
getAvailableTargetIds
Returns the list of all available target IDs used by the site.- Throws:
IllegalStateException
-