Class DefaultItemConverter
java.lang.Object
org.craftercms.engine.navigation.impl.DefaultItemConverter
public class DefaultItemConverter
extends Object
implements org.craftercms.commons.converters.Converter<SiteItem,NavItem>
Default converter from
SiteItem
to NavItem
. To generate the URL, it uses a URL transformer, and to generate the
navigation label it uses the nav label element in the content, the internal name element or the file name, in that order. If the
SiteItem
has no content, null is returned (items with no content, like folders with no index.xml, should not be navigable).- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected String
protected UrlTransformationService
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultItemConverter
(String navLabelXPath, String internalNameXPath, String storeUrlToRenderUrlTransformerName, UrlTransformationService urlTransformationService) -
Method Summary
Modifier and TypeMethodDescriptiongetAdditionalAttributes
(SiteItem siteItem) protected String
getNavigationLabel
(SiteItem siteItem) protected String
getNavigationUrl
(SiteItem siteItem) Class
<?> Class
<?> toString()
-
Field Details
-
internalNameXPath
-
storeUrlToRenderUrlTransformerName
-
urlTransformationService
-
Constructor Details
-
DefaultItemConverter
public DefaultItemConverter(String navLabelXPath, String internalNameXPath, String storeUrlToRenderUrlTransformerName, UrlTransformationService urlTransformationService)
-
-
Method Details
-
getSourceClass
-
getTargetClass
-
convert
-
getAdditionalAttributes
-
toString
-