Represents the root of a website. A "website" in this context is a product, ie the customer facing side of some activity, such as a learning management system or a business website. Resources within a WebsiteRootFolder will often behave differently than if they were located under an OrganisationRootFolder, because the assumption is that websites are for customers, while administrators access the organisation directly. While WebsiteRootFolder is a view of a repository, or rather a branch within a repository, it also provides access to other repositories. Any repository within the containing organisation can be accessed by name from the root folder. For example, if an org has a repository called "maven" as well as the "milton.io" website, requests to http://milton.io/maven will show the maven repository.

Group: Resources

Extends: BranchFolder

Implements: WebsiteBranchResource, RootFolder, CommonCollectionResource, GetableResource, PropFindableResource, WebsiteResource, RepositoryResource


Properties

PropertyReturnsDescription
adminDomainNameStringThe admin domain name for the organisation that owns this website, with the dev-mode port appended when running against a loopbackdns.com domain.
allGroupFoldersList<GroupFolder>All group folders defined by the organisation that owns this website. A group folder organises related groups together, eg a set of teams or regions.
allGroupsList<Group>All groups defined by the organisation that owns this website.
attributesMap<String,Object>A general purpose, request scoped map of attributes attached to this root folder, created empty on first access.
commentsList<CommentBean>The comments posted against this website resource.
domainNameStringThe domain name this website branch is served on, eg the custom domain for the live branch or a generated subdomain for a draft branch.
emailAddressStringThe default "from" address used for automated emails sent by this website, built as "noreply@" followed by the website's domain name.
externalUrlStringThe fully qualified base URL of this website, with no path appended.
idStringA unique identifier for this website root folder, combining the website's name and the branch's name.
languagesList<Language>The languages available for translated content on this platform instance.
modifiedDateDateWhen this website branch was last modified, taken from the head commit's date, or from the branch's own created date if it has no commits yet.
nameStringAlways empty. A website root folder has no name of its own, since it is the root of the URL space for its domain.
newCommentStringAlways null. This getter exists only so that newComment is recognised as a bean property, pairing with setNewComment which does the actual work of posting a comment.
numCommentsintThe number of comments posted against this website resource.
orgDataOrgDataThe OrgData for the organisation that owns this website. This can be used to get a list of members within the organisation.
orgTypesList<OrgType>All organisation types defined by the organisation holding this website, computed once and cached for the lifetime of this instance.
readonlybooleanTrue if the underlying branch is read only, eg a published archive branch that content can no longer be committed to.
requiresHttpsbooleanTrue if this website branch is configured to force https.
settingsWebsiteSettingsThe website settings, eg theme name and other configuration, stored for this website branch's data session.
themeNameStringThe name of the theme currently applied to this website branch.
usersFolderUsersFolderThe folder of user profile resources for this website, created on first access and cached for the lifetime of this instance.
versionedbooleanTrue if this website was resolved on a versioned host address, eg a draft version accessed via the "_host" request parameter or cookie rather than the branch's normal domain.
websiteWebsiteThe underlying Website entity this root folder is a branch of.
websiteNameStringThe path-safe, unique name of the underlying Website entity, as opposed to its display title.

Inherited from RootFolder

Properties

PropertyReturnsDescription
selectedLangCodeStringThe language code currently selected for the request, as determined by TranslationService.
selectedLanguageLanguageThe Language matching the currently selected language code, looked up from getLanguages.

Methods

findEntity(Profile user) · getSelectedLangCode() · getSelectedLanguage() · childOrg(long id) · childOrg(String orgId) · findOrgType(String name) · addOrgType(String orgId, String orgType) · createOrgType(String name, String title) · removeOrgType(String orgId, String orgType) · findWebsite(long id) · findWebsite(String name)

findEntity(Profile user)

Returns: PrincipalResource

Locates the resource representing the given profile - a user, group or organisation - within this folder.

ParameterDescription
userthe profile to find a resource for

getSelectedLangCode()

Returns: String

The language code currently selected for the request, as determined by TranslationService.

getSelectedLanguage()

Returns: Language

The Language matching the currently selected language code, looked up from getLanguages.

childOrg(long id)

Returns: Organisation

Locates a descendant organisation of this root folder's organisation by its internal Kademi id.

ParameterDescription
idthe internal id of the organisation to find

childOrg(String orgId)

Returns: Organisation

Locates a descendant organisation of this root folder's organisation by its external org id.

ParameterDescription
orgIdthe external org id of the organisation to find

findOrgType(String name)

Returns: OrgType

Finds an org type with the given name, searching this root folder's organisation and then its ancestors.

ParameterDescription
namethe name of the org type to find

addOrgType(String orgId, String orgType)

Returns: void

Adds an existing org type to the organisation identified by orgId, a child of this root folder's organisation, and fires an indexed-item-updated event for it.

ParameterDescription
orgIdthe external org id of the organisation to update
orgTypethe name of the org type to add

createOrgType(String name, String title)

Returns: OrgType

Creates and persists a new org type on this root folder's organisation, and fires an indexed-item-updated event for it.

ParameterDescription
namethe name of the org type to create
titlethe display name for the new org type

removeOrgType(String orgId, String orgType)

Returns: void

Removes an org type from the organisation identified by orgId, a child of this root folder's organisation, and fires an indexed-item-updated event for it.

ParameterDescription
orgIdthe external org id of the organisation to update
orgTypethe name of the org type to remove

findWebsite(long id)

Returns: Website

Finds a website of this root folder's organisation by its internal id.

ParameterDescription
idthe internal id of the website to find

findWebsite(String name)

Returns: Website

Finds a website of this root folder's organisation by its name.

ParameterDescription
namethe name of the website to find

Methods

getUsersFolder() · getName() · getWebsiteName() · getId() · getDomainName() · getModifiedDate() · getWebsite() · getAttributes() · getEmailAddress() · is(String type) · getThemeName() · isReadonly() · getComments() · getNumComments() · setNewComment(String s) · getNewComment() · getExternalUrl() · externalUrl(String path) · group(String name) · isVersioned() · getLoginToken(UserResource user) · getLoginToken(ProfileBean profileBean) · getLoginToken(Profile p) · getOrgData() · getOrgTypes() · getAdminDomainName() · getAllGroups() · getAllGroupFolders() · getLanguages() · getSettings() · returnWithCurrent(Function<RootFolder,Object> c) · doWithCurrent(Consumer<RootFolder> c) · isRequiresHttps()

getUsersFolder()

Returns: UsersFolder

The folder of user profile resources for this website, created on first access and cached for the lifetime of this instance.

getName()

Returns: String

Always empty. A website root folder has no name of its own, since it is the root of the URL space for its domain.

getWebsiteName()

Returns: String

The path-safe, unique name of the underlying Website entity, as opposed to its display title.

getId()

Returns: String

A unique identifier for this website root folder, combining the website's name and the branch's name.

getDomainName()

Returns: String

The domain name this website branch is served on, eg the custom domain for the live branch or a generated subdomain for a draft branch.

getModifiedDate()

Returns: Date

When this website branch was last modified, taken from the head commit's date, or from the branch's own created date if it has no commits yet.

getWebsite()

Returns: Website

The underlying Website entity this root folder is a branch of.

getAttributes()

Returns: Map<String,Object>

A general purpose, request scoped map of attributes attached to this root folder, created empty on first access.

getEmailAddress()

Returns: String

The default "from" address used for automated emails sent by this website, built as "noreply@" followed by the website's domain name.

is(String type)

Returns: boolean

True if type is "website", or if the superclass recognises type as one of its own resource types. Used throughout templates and roles to test what kind of resource is being looked at without an instanceof check.

ParameterDescription
typethe resource type name to test for

getThemeName()

Returns: String

The name of the theme currently applied to this website branch.

isReadonly()

Returns: boolean

True if the underlying branch is read only, eg a published archive branch that content can no longer be committed to.

getComments()

Returns: List<CommentBean>

The comments posted against this website resource.

getNumComments()

Returns: int

The number of comments posted against this website resource.

setNewComment(String s)

Returns: void

Post a new comment against this resource, from the currently logged in user. Exists as a write-only bean property, paired with getNewComment, so a form can post a comment by setting this field.

ParameterDescription
sthe comment text to post

getNewComment()

Returns: String

Always null. This getter exists only so that newComment is recognised as a bean property, pairing with setNewComment which does the actual work of posting a comment.

getExternalUrl()

Returns: String

The fully qualified base URL of this website, with no path appended.

externalUrl(String path)

Returns: String

Build a fully qualified URL for an (optional) path to this website. If path is already a fully qualified http or https URL it is returned unchanged.

ParameterDescription
pathan absolute or relative path to append, or an already fully qualified URL, may be null

group(String name)

Returns: Group

Look up a group of the organisation that owns this website, by name.

ParameterDescription
namethe group's name

isVersioned()

Returns: boolean

True if this website was resolved on a versioned host address, eg a draft version accessed via the "_host" request parameter or cookie rather than the branch's normal domain.

getLoginToken(UserResource user)

Returns: String

As getLoginToken(Profile), for the profile behind the given user resource.

ParameterDescription
userthe user resource to build a login token for

getLoginToken(ProfileBean profileBean)

Returns: String

As getLoginToken(Profile), for the profile wrapped by the given profile bean.

ParameterDescription
profileBeanthe profile bean to build a login token for

getLoginToken(Profile p)

Returns: String

Build the signed cookie query string parameters that log the given profile in when appended to a URL on this website, eg for SSO links from emails or other websites.

ParameterDescription
pthe profile to build a login token for, must not be null

getOrgData()

Returns: OrgData

The OrgData for the organisation that owns this website. This can be used to get a list of members within the organisation.

getOrgTypes()

Returns: List<OrgType>

All organisation types defined by the organisation holding this website, computed once and cached for the lifetime of this instance.

getAdminDomainName()

Returns: String

The admin domain name for the organisation that owns this website, with the dev-mode port appended when running against a loopbackdns.com domain.

getAllGroups()

Returns: List<Group>

All groups defined by the organisation that owns this website.

getAllGroupFolders()

Returns: List<GroupFolder>

All group folders defined by the organisation that owns this website. A group folder organises related groups together, eg a set of teams or regions.

getLanguages()

Returns: List<Language>

The languages available for translated content on this platform instance.

getSettings()

Returns: WebsiteSettings

The website settings, eg theme name and other configuration, stored for this website branch's data session.

returnWithCurrent(Function<RootFolder,Object> c)

Returns: Object

Run the given function with this website root folder set as the current root folder, and return its result. Fails if this website's organisation is not the current tenant organisation.

ParameterDescription
c- the function to run

doWithCurrent(Consumer<RootFolder> c)

Returns: void

Run the given task with this website root folder set as the current root folder. Fails if this website's organisation is not the current tenant organisation.

ParameterDescription
c- the task to run inside this websiterootfolder context

isRequiresHttps()

Returns: boolean

True if this website branch is configured to force https.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.