Package org.fenixedu.cms.domain
Class Menu
- java.lang.Object
-
- pt.ist.fenixframework.core.AbstractDomainObject
-
- org.fenixedu.cms.domain.Menu_Base
-
- org.fenixedu.cms.domain.Menu
-
- All Implemented Interfaces:
Serializable,Comparable<Menu>,Cloneable,Sluggable,Wrappable,pt.ist.fenixframework.DomainObject
public class Menu extends Menu_Base implements Wrappable, Sluggable, Cloneable, Comparable<Menu>
Model of a Menu for a givenPage- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSIGNAL_CREATEDstatic StringSIGNAL_DELETEDstatic StringSIGNAL_EDITED
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(MenuItem mi)Adds a givenMenuItemas the last item.booleancheckMenuOrder()Menuclone(CloneCache cloneCache)intcompareTo(Menu o)voiddelete()Stream<MenuItem>getItemsSorted()SitegetSite()Stream<MenuItem>getToplevelItemsSorted()booleanisValidSlug(String slug)A slug is valid if there are no other page on that site that have the same slug.WrapmakeWrap()WrapmakeWrap(Page page)MenuItemmenuItemForOid(String menuItemOid)voidputAt(MenuItem item, int position)Puts aMenuItemat a given position, shifting the existing ones to the right.voidremove(MenuItem mi)Removes a givenMenuItemfrom the Menu.voidsetName(org.fenixedu.commons.i18n.LocalizedString name)saves the name of the post and creates a new slug for the post.voidsetSlug(String slug)-
Methods inherited from class org.fenixedu.cms.domain.Menu_Base
addItems, addToplevelItems, getCreatedBy, getCreationDate, getItemsSet, getName, getOrder, getPrivileged, getRelationMenuMenuItem, getRelationMenuSite, getRelationMenuTopMenuItem, getRelationMenuUser, getSlug, getToplevelItemsSet, getTopMenu, removeItems, removeToplevelItems, setCreatedBy, setCreationDate, setOrder, setPrivileged, setSite, setTopMenu
-
Methods inherited from class pt.ist.fenixframework.core.AbstractDomainObject
checkForDeletionBlockers, deleteDomainObject, ensureOid, equals, getDeletionBlockers, getDomainModel, getExternalId, getOid, hashCode, init$Instance, makeSerializedForm, toString, writeReplace
-
-
-
-
Field Detail
-
SIGNAL_CREATED
public static final String SIGNAL_CREATED
- See Also:
- Constant Field Values
-
SIGNAL_DELETED
public static final String SIGNAL_DELETED
- See Also:
- Constant Field Values
-
SIGNAL_EDITED
public static final String SIGNAL_EDITED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Menu
public Menu(Site site, org.fenixedu.commons.i18n.LocalizedString name)
-
-
Method Detail
-
delete
public void delete()
-
setSlug
public void setSlug(String slug)
-
isValidSlug
public boolean isValidSlug(String slug)
A slug is valid if there are no other page on that site that have the same slug.- Specified by:
isValidSlugin interfaceSluggable- Parameters:
slug- slug- Returns:
- true if it is a valid slug.
-
setName
public void setName(org.fenixedu.commons.i18n.LocalizedString name)
saves the name of the post and creates a new slug for the post.
-
putAt
public void putAt(MenuItem item, int position)
Puts aMenuItemat a given position, shifting the existing ones to the right.- Parameters:
item- TheMenuItemto be added.position- the position to save the item.
-
remove
public void remove(MenuItem mi)
Removes a givenMenuItemfrom the Menu.- Parameters:
mi- theMenuItemto be removed.
-
add
public void add(MenuItem mi)
Adds a givenMenuItemas the last item.- Parameters:
mi- theMenuItemto be added.
-
clone
public Menu clone(CloneCache cloneCache)
-
compareTo
public int compareTo(Menu o)
- Specified by:
compareToin interfaceComparable<Menu>
-
checkMenuOrder
public boolean checkMenuOrder()
-
-