Class ProxyTargetIdManager
- java.lang.Object
-
- org.craftercms.engine.util.spring.AbstractProxyBean<TargetIdManager>
-
- org.craftercms.engine.targeting.impl.ProxyTargetIdManager
-
- All Implemented Interfaces:
TargetIdManager
public class ProxyTargetIdManager extends AbstractProxyBean<TargetIdManager> implements TargetIdManager
ProxyTargetIdManager
that proxies to the manager defined in the site application context, or if not defined, to the default one in the general application context.- Author:
- avasquez
-
-
Field Summary
-
Fields inherited from class org.craftercms.engine.util.spring.AbstractProxyBean
applicationContext, beanName
-
-
Constructor Summary
Constructors Constructor Description ProxyTargetIdManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAvailableTargetIds()
Returns the list of all available target IDs used by the site.protected Class<? extends TargetIdManager>
getBeanClass()
String
getCurrentTargetId()
Returns the target ID for the current request, or null or empty if there's no target ID.String
getFallbackTargetId()
Returns the fallback target ID.-
Methods inherited from class org.craftercms.engine.util.spring.AbstractProxyBean
getBean, setApplicationContext, setBeanName
-
-
-
-
Method Detail
-
getCurrentTargetId
public String getCurrentTargetId() throws IllegalStateException
Description copied from interface:TargetIdManager
Returns the target ID for the current request, or null or empty if there's no target ID.- Specified by:
getCurrentTargetId
in interfaceTargetIdManager
- Throws:
IllegalStateException
-
getFallbackTargetId
public String getFallbackTargetId() throws IllegalStateException
Description copied from interface:TargetIdManager
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.
- Specified by:
getFallbackTargetId
in interfaceTargetIdManager
- Throws:
IllegalStateException
-
getAvailableTargetIds
public List<String> getAvailableTargetIds() throws IllegalStateException
Description copied from interface:TargetIdManager
Returns the list of all available target IDs used by the site.- Specified by:
getAvailableTargetIds
in interfaceTargetIdManager
- Throws:
IllegalStateException
-
getBeanClass
protected Class<? extends TargetIdManager> getBeanClass()
- Specified by:
getBeanClass
in classAbstractProxyBean<TargetIdManager>
-
-