Class MenuItemImpl
java.lang.Object
org.broadleafcommerce.menu.domain.MenuItemImpl
- All Implemented Interfaces:
Serializable,org.broadleafcommerce.common.copy.MultiTenantCloneable<MenuItem>,org.broadleafcommerce.common.extensibility.jpa.copy.ProfileEntity,MenuItem
@Entity
public class MenuItemImpl
extends Object
implements MenuItem, org.broadleafcommerce.common.extensibility.jpa.copy.ProfileEntity
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends MenuItem>
org.broadleafcommerce.common.copy.CreateResponse<G>createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) Returns the URL (if applicable) that should be targeted when this menu is clicked.For items of typeMenuItemType.LINK, gets the alt text for the associated image.For items of typeMenuItemType.CUSTOM, returns the associated custom HTML.Convenience method that will always return the configured Label if specified.Convenience method that returns an anchor URL based on the configured MenuItemType.getId()Id of this menuItemFor items of typeMenuItemType.LINK, gets an Image associated with this Menu ItemgetLabel()Returns the label for this menu itemThe menu represented by this MenuItem.org.broadleafcommerce.cms.page.domain.PageFor items of typeMenuItemType.PAGE, returns the associated page.Returns theMenuItemTypeReturns theMenuto which this menuItem belongsReturns the order of this MenuItem in theMenuItem.getParentMenu()voidsetActionUrl(String actionUrl) Sets the URL to go to if this menu is clicked.voidsetAltText(String altText) For items of typeMenuItemType.LINK, stores the alt text for the associated image.voidsetCustomHtml(String customHtml) For items of typeMenuItemType.CUSTOM, sets the associated custom HTML.voidSets the id of this menuItem.voidsetImageUrl(String imageUrl) For items of typeMenuItemType.LINK, sets an Image for this Menu ItemvoidSets the value for this menu item to display on a site.voidsetLinkedMenu(Menu linkedMenu) Sets the linked menu.voidsetLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage) For items of typeMenuItemType.PAGE, sets the associated page.voidsetMenuItemType(MenuItemType menuItemType) Sets theMenuItemTypevoidsetParentMenu(Menu parentMenu) Sets theMenuto which this menuItem belongsvoidsetSequence(BigDecimal sequence) Sets the order of this MenuItem in theMenuItem.getParentMenu()
-
Field Details
-
id
-
label
-
type
-
sequence
-
parentMenu
-
actionUrl
-
imageUrl
-
altText
-
linkedMenu
-
linkedPage
protected org.broadleafcommerce.cms.page.domain.Page linkedPage -
customHtml
-
-
Constructor Details
-
MenuItemImpl
public MenuItemImpl()
-
-
Method Details
-
getId
Description copied from interface:MenuItemId of this menuItem -
setId
Description copied from interface:MenuItemSets the id of this menuItem. -
getMenuItemType
Description copied from interface:MenuItemReturns theMenuItemType- Specified by:
getMenuItemTypein interfaceMenuItem- Returns:
-
getLabel
Description copied from interface:MenuItemReturns the label for this menu item -
setLabel
Description copied from interface:MenuItemSets the value for this menu item to display on a site. -
getActionUrl
Description copied from interface:MenuItemReturns the URL (if applicable) that should be targeted when this menu is clicked.- Specified by:
getActionUrlin interfaceMenuItem- Returns:
-
setActionUrl
Description copied from interface:MenuItemSets the URL to go to if this menu is clicked.- Specified by:
setActionUrlin interfaceMenuItem
-
getImageUrl
Description copied from interface:MenuItemFor items of typeMenuItemType.LINK, gets an Image associated with this Menu Item- Specified by:
getImageUrlin interfaceMenuItem- Returns:
-
setImageUrl
Description copied from interface:MenuItemFor items of typeMenuItemType.LINK, sets an Image for this Menu Item- Specified by:
setImageUrlin interfaceMenuItem
-
getSequence
Description copied from interface:MenuItemReturns the order of this MenuItem in theMenuItem.getParentMenu()- Specified by:
getSequencein interfaceMenuItem- Returns:
-
setSequence
Description copied from interface:MenuItemSets the order of this MenuItem in theMenuItem.getParentMenu()- Specified by:
setSequencein interfaceMenuItem
-
getParentMenu
Description copied from interface:MenuItemReturns theMenuto which this menuItem belongs- Specified by:
getParentMenuin interfaceMenuItem- Returns:
-
getLinkedMenu
Description copied from interface:MenuItemThe menu represented by this MenuItem. (Allows for nested menus).- Specified by:
getLinkedMenuin interfaceMenuItem- Returns:
-
getAltText
Description copied from interface:MenuItemFor items of typeMenuItemType.LINK, gets the alt text for the associated image.- Specified by:
getAltTextin interfaceMenuItem- Returns:
-
setAltText
Description copied from interface:MenuItemFor items of typeMenuItemType.LINK, stores the alt text for the associated image.- Specified by:
setAltTextin interfaceMenuItem
-
getLinkedPage
public org.broadleafcommerce.cms.page.domain.Page getLinkedPage()Description copied from interface:MenuItemFor items of typeMenuItemType.PAGE, returns the associated page.- Specified by:
getLinkedPagein interfaceMenuItem- Returns:
-
setLinkedPage
public void setLinkedPage(org.broadleafcommerce.cms.page.domain.Page linkedPage) Description copied from interface:MenuItemFor items of typeMenuItemType.PAGE, sets the associated page.- Specified by:
setLinkedPagein interfaceMenuItem
-
getCustomHtml
Description copied from interface:MenuItemFor items of typeMenuItemType.CUSTOM, returns the associated custom HTML.- Specified by:
getCustomHtmlin interfaceMenuItem- Returns:
-
setCustomHtml
Description copied from interface:MenuItemFor items of typeMenuItemType.CUSTOM, sets the associated custom HTML.- Specified by:
setCustomHtmlin interfaceMenuItem
-
getDerivedUrl
Description copied from interface:MenuItemConvenience method that returns an anchor URL based on the configured MenuItemType. Will return getActionUrl() unless type isMenuItemType.PAGE,MenuItemType.PRODUCT, orMenuItemType.CATEGORYand will use corresponding linked URL.- Specified by:
getDerivedUrlin interfaceMenuItem- Returns:
-
getDerivedLabel
Description copied from interface:MenuItemConvenience method that will always return the configured Label if specified. If it is not specified and of typeMenuItemType.PRODUCT, orMenuItemType.CATEGORY, orMenuItemType.SUBMENU, it will return the corresponding linked name.- Specified by:
getDerivedLabelin interfaceMenuItem
-
createOrRetrieveCopyInstance
public <G extends MenuItem> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException - Specified by:
createOrRetrieveCopyInstancein interfaceorg.broadleafcommerce.common.copy.MultiTenantCloneable<MenuItem>- Throws:
CloneNotSupportedException
-