Package org.craftercms.core.url.impl
Class ContentBundleShortToLongUrlTransformer
- java.lang.Object
-
- org.craftercms.core.url.impl.ShortToLongUrlTransformer
-
- org.craftercms.core.url.impl.ContentBundleShortToLongUrlTransformer
-
- All Implemented Interfaces:
UrlTransformer
public class ContentBundleShortToLongUrlTransformer extends ShortToLongUrlTransformer
This transformer is similar toShortToLongUrlTransformer, but also looks in a content bundle for an item name (long name) that can be mapped to the short name. SeeContentBundleMergeStrategyfor more information about content bundles. E.g., from the request/main/website/groups/sport/base_fr_nhl/sport_page_one.xmlit looks in folders in the following orderbase_fr_nhl,base_frandbase. Then suppose thatsport_page_one.xmlexists only inbasefolder with name013_sport_page_one.xml. So the transformation result will be/main/website/groups/007_sport/base_fr_nhl/013_sport_page_one.xml(the original base is kept).- Author:
- Sumer Jabri, Alfonso Vásquez
- See Also:
ContentBundleMergeStrategy
-
-
Constructor Summary
Constructors Constructor Description ContentBundleShortToLongUrlTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetBaseDelimiter(String baseDelimiter)voidsetUrlParser(ContentBundleUrlParser urlParser)StringtransformUrl(Context context, CachingOptions cachingOptions, String url)-
Methods inherited from class org.craftercms.core.url.impl.ShortToLongUrlTransformer
getLongName, getLongUrl, setContainsShortNameRegex, setShortNameRegexGroup
-
-
-
-
Method Detail
-
setUrlParser
public void setUrlParser(ContentBundleUrlParser urlParser)
-
setBaseDelimiter
public void setBaseDelimiter(String baseDelimiter)
-
transformUrl
public String transformUrl(Context context, CachingOptions cachingOptions, String url) throws UrlTransformationException
- Specified by:
transformUrlin interfaceUrlTransformer- Overrides:
transformUrlin classShortToLongUrlTransformer- Throws:
UrlTransformationException
-
-