Package org.opencms.ade.sitemap
Class CmsSitemapNavPosCalculator
java.lang.Object
org.opencms.ade.sitemap.CmsSitemapNavPosCalculator
Helper class for recalculating navigation positions when a user has changed the order of navigation entries in the sitemap
editor.
This is harder than it sounds because we need to handle special cases like e.g. the user inserting an entry between two existing entries with the same navigation position, which means we need to update the navigation positions of multiple entries to force the ordering which the user wanted.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Dummy file name for the inserted dummy navigation element. -
Constructor Summary
ConstructorDescriptionCmsSitemapNavPosCalculator
(List<CmsJspNavElement> navigation, CmsResource movedElement, int insertPosition) Creates a new sitemap navigation position calculator and performs the navigation position calculation for a given insertion operation. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the insert position in the final result list.Gets the changed navigation entries from the final result list.Gets the final result list.
-
Field Details
-
DUMMY_PATH
Dummy file name for the inserted dummy navigation element.- See Also:
-
-
Constructor Details
-
CmsSitemapNavPosCalculator
public CmsSitemapNavPosCalculator(List<CmsJspNavElement> navigation, CmsResource movedElement, int insertPosition) Creates a new sitemap navigation position calculator and performs the navigation position calculation for a given insertion operation.- Parameters:
navigation
- the existing navigation element listmovedElement
- the resource which should be insertedinsertPosition
- the insertion position in the list
-
-
Method Details
-
getInsertPositionInResult
Gets the insert position in the final result list.- Returns:
- the insert position in the final result
-
getResultList
Gets the final result list.- Returns:
- the final result list
-