Package org.fenixedu.cms.domain
Class Site
- java.lang.Object
-
- pt.ist.fenixframework.core.AbstractDomainObject
-
- org.fenixedu.cms.domain.Site_Base
-
- org.fenixedu.cms.domain.Site
-
- All Implemented Interfaces:
Serializable,Cloneable,Sluggable,Wrappable,pt.ist.fenixframework.DomainObject
public class Site extends Site_Base implements Wrappable, Sluggable, Cloneable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSite.SiteActivitiesclassSite.SiteWrap
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Site>CREATION_DATE_COMPARATORstatic Comparator<Site>NAME_COMPARATORstatic StringSIGNAL_CREATEDstatic StringSIGNAL_DELETEDstatic StringSIGNAL_EDITED
-
Method Summary
-
Methods inherited from class org.fenixedu.cms.domain.Site_Base
addActivityLines, addArchivedPages, addArchivedPosts, addCategories, addFiles, addMenus, addPages, addPost, addRoles, getActivityLinesSet, getAlternativeSite, getAnalyticsAccountId, getAnalyticsCode, getArchivedPagesSet, getArchivedPostsSet, getBennu, getBuilder, getCategoriesSet, getCreatedBy, getCreationDate, getDefaultRoleTemplate, getDescription, getEmbedded, getFilesSet, getFolder, getFunctionality, getInitialPage, getLastActivityLine, getMenusSet, getName, getPagesSet, getPostSet, getPrimaryBennu, getPublished, getRelationActivitySite, getRelationBennuSite, getRelationCategorySite, getRelationFileHasPostFiles, getRelationFolderHasSites, getRelationLastActivitySite, getRelationMenuSite, getRelationPrimarySite, getRelationSiteArchivedPage, getRelationSiteArchivedPosts, getRelationSiteBuilderSite, getRelationSiteCMSTheme, getRelationSiteHasDefaultRoleTemplates, getRelationSiteHasRoles, getRelationSiteInitialPage, getRelationSiteMenuFunctionality, getRelationSitePage, getRelationSitePost, getRelationSiteUser, getRelationSiteViewersGroup, getRelationSiteViewGroup, getRolesSet, getSlug, getStyle, getThemeType, getViewerGroup, getViewGroup, removeActivityLines, removeArchivedPages, removeArchivedPosts, removeCategories, removeFiles, removeMenus, removePages, removePost, removeRoles, setAlternativeSite, setAnalyticsAccountId, setAnalyticsCode, setBennu, setBuilder, setCreatedBy, setCreationDate, setDefaultRoleTemplate, setDescription, setEmbedded, setFunctionality, setInitialPage, setLastActivityLine, setPrimaryBennu, setPublished, setStyle, setThemeType, setViewerGroup, setViewGroup
-
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
-
NAME_COMPARATOR
public static final Comparator<Site> NAME_COMPARATOR
-
CREATION_DATE_COMPARATOR
public static final Comparator<Site> CREATION_DATE_COMPARATOR
-
-
Constructor Detail
-
Site
protected Site()
-
Site
public Site(org.fenixedu.commons.i18n.LocalizedString name, org.fenixedu.commons.i18n.LocalizedString description)the loggedUsercreates a newSite.- Parameters:
name- namedescription- description
-
-
Method Detail
-
getCanViewGroup
public org.fenixedu.bennu.core.groups.Group getCanViewGroup()
returns the group of people who can view this site.- Returns:
- group the access group for this site
-
setCanViewGroup
public void setCanViewGroup(org.fenixedu.bennu.core.groups.Group group)
sets the access group for this site- Parameters:
group- the group of people who can view this site
-
fromSlug
public static Site fromSlug(String slug)
searches for aSiteby slug.- Parameters:
slug- the slug of theSitewanted.- Returns:
- the
Sitewith the given slug if it exists - Throws:
CmsDomainException- if the site doesn't exist
-
categoryForSlug
public Category categoryForSlug(String slug)
- Parameters:
slug- the slug of theCategorywanted.- Returns:
- the
Categorywith the given slug if it exists on this site. - Throws:
CmsDomainException- if the category is not found
-
getOrCreateCategoryForSlug
public Category getOrCreateCategoryForSlug(String slug, org.fenixedu.commons.i18n.LocalizedString name)
-
setSlug
public void setSlug(String slug)
-
setNameToSuper
public void setNameToSuper(org.fenixedu.commons.i18n.LocalizedString name)
-
setName
public void setName(org.fenixedu.commons.i18n.LocalizedString name)
saves the name of the site and creates a new slug for the site.
-
updateMenuFunctionality
public void updateMenuFunctionality()
Updates the site's slug and it's respective MenuFunctionality. It should be used after setting the site's description, name and slug.
-
clone
public Site clone(CloneCache cloneCache)
-
delete
public void delete()
-
getViewPostPage
public Page getViewPostPage()
-
isDefault
public boolean isDefault()
- Returns:
- true if a site is the default site, meaning if this site should respond to '/' requests
-
getViewCategoryPage
public Page getViewCategoryPage()
- Returns:
- the
ListCategoryPostsof thisSiteif it is defined, or null otherwise.
-
isValidSlug
public boolean isValidSlug(String slug)
- Specified by:
isValidSlugin interfaceSluggable
-
getBaseUrl
public String getBaseUrl()
-
getFullUrl
public String getFullUrl()
-
getRssUrl
public String getRssUrl()
-
getEditUrl
public String getEditUrl()
-
checkHasEitherFunctionalityOrFolder
public boolean checkHasEitherFunctionalityOrFolder()
-
getDefaultRoleTemplateRole
public Role getDefaultRoleTemplateRole()
-
pushActivity
public void pushActivity(SiteActivity siteActivity)
-
getLastFiveDaysOfActivity
public List<Site.SiteActivities> getLastFiveDaysOfActivity()
-
-