# OrganisationRootFolder Root WebDAV and HTTP resource for one organisation's admin site, the entry point through which that organisation's users, websites and other admin-domain resources are reached. One instance is created per organisation whenever its admin domain is resolved, and it is used both to render the browser-facing admin UI and as the root object exposed to GraalJS for that organisation. An organisation with no parent organisation is treated as a root account. Package: `io.milton.cloud.server.apps.orgs` Group: Resources Extends: `OrganisationFolder` Implements: [RootFolder](RootFolder.md) ## Properties | Property | Returns | Description | |---|---|---| | `allGroups` | List<[Group](Group.md)> | All groups defined directly on this organisation. | | `attributes` | `Map` | A scratch map for stashing arbitrary values against this root folder, for the lifetime of the request or session that holds it. Created empty on first access. | | `branch` | [Branch](Branch.md) | Branch this resource belongs to, required by the WebsiteBranchResource interface. A root folder is not part of a website branch, so this always returns null. | | `domainName` | `String` | Fully qualified admin domain name for this organisation, built from the organisation's admin domain segment and the server's primary domain. | | `emailAddress` | `String` | Default "noreply" sender address used for system emails sent on behalf of this organisation, built from the organisation's org id and the server's primary domain. | | `externalUrl` | `String` | Fully qualified base URL of this organisation's admin site, for example "https://acme.admin.example.com/". | | `formattedName` | `String` | Display-formatted name of this organisation, for use in UI labels. | | `id` | `String` | Identifier of this root folder, which is the organisation's org id. | | `name` | `String` | Resource name of this root folder within the WebDAV tree. Always the empty string, since a root folder has no name relative to its own domain. | | `photoHash` | `String` | Hash used to build a cache-busting URL for this organisation's logo photo. Null if the organisation has no photo. | | `requiresHttps` | `boolean` | Whether this organisation's admin site requires HTTPS. Reflects the organisation's own forceHttps setting, and defaults to false when that setting is not configured. | | `root` | `boolean` | Whether this organisation is a top-level account, that is, it has no parent organisation. | | `usersFolder` | `UsersFolder` | The users folder for this organisation's admin site, lazily created and cached on first access. | ## Methods ### `isRoot()` Returns: `boolean` Whether this organisation is a top-level account, that is, it has no parent organisation. ### `getUsersFolder()` Returns: `UsersFolder` The users folder for this organisation's admin site, lazily created and cached on first access. ### `getName()` Returns: `String` Resource name of this root folder within the WebDAV tree. Always the empty string, since a root folder has no name relative to its own domain. ### `getId()` Returns: `String` Identifier of this root folder, which is the organisation's org id. ### `getDomainName()` Returns: `String` Fully qualified admin domain name for this organisation, built from the organisation's admin domain segment and the server's primary domain. ### `getPhotoHash()` Returns: `String` Hash used to build a cache-busting URL for this organisation's logo photo. Null if the organisation has no photo. ### `getFormattedName()` Returns: `String` Display-formatted name of this organisation, for use in UI labels. ### `findEntity(Profile u)` Returns: `PrincipalResource` Locates the resource representing the given profile, whether a user, group or organisation, within this organisation's admin site. | Parameter | Description | |---|---| | `u` | the profile to find a resource for | ### `getAttributes()` Returns: `Map` A scratch map for stashing arbitrary values against this root folder, for the lifetime of the request or session that holds it. Created empty on first access. ### `getEmailAddress()` Returns: `String` Default "noreply" sender address used for system emails sent on behalf of this organisation, built from the organisation's org id and the server's primary domain. ### `getExternalUrl()` Returns: `String` Fully qualified base URL of this organisation's admin site, for example "https://acme.admin.example.com/". ### `externalUrl(String path)` Returns: `String` Builds a fully qualified URL for an optional path within this organisation's admin site. A path that is already fully qualified (starts with "http:" or "https:") is returned unchanged. | Parameter | Description | |---|---| | `path` | the path to append to the site's base URL, or null for the site's root URL | ### `getBranch()` Returns: [Branch](Branch.md) Branch this resource belongs to, required by the WebsiteBranchResource interface. A root folder is not part of a website branch, so this always returns null. ### `getAllGroups()` Returns: List<[Group](Group.md)> All groups defined directly on this organisation. ### `findWebsiteRootFolder(String name)` Returns: [WebsiteRootFolder](WebsiteRootFolder.md) Looks up the named website within this organisation and returns its root folder. | Parameter | Description | |---|---| | `name` | the website's name | ### `isRequiresHttps()` Returns: `boolean` Whether this organisation's admin site requires HTTPS. Reflects the organisation's own forceHttps setting, and defaults to false when that setting is not configured. ## Inherited from RootFolder ### Properties | Property | Returns | Description | |---|---|---| | `languages` | List<[Language](Language.md)> | The languages configured for translation in this root folder, as reported by TranslationService. | | `orgData` | [OrgData](OrgData.md) | The organisation-level data record associated with this root folder. | | `selectedLangCode` | `String` | The language code currently selected for the request, as determined by TranslationService. | | `selectedLanguage` | [Language](Language.md) | The Language matching the currently selected language code, looked up from getLanguages. | ### Methods #### `findEntity(Profile user)` Returns: `PrincipalResource` Locates the resource representing the given profile - a user, group or organisation - within this folder. | Parameter | Description | |---|---| | `user` | the profile to find a resource for | #### `getOrgData()` Returns: [OrgData](OrgData.md) The organisation-level data record associated with this root folder. #### `getSelectedLangCode()` Returns: `String` The language code currently selected for the request, as determined by TranslationService. #### `getSelectedLanguage()` Returns: [Language](Language.md) The Language matching the currently selected language code, looked up from getLanguages. #### `getLanguages()` Returns: List<[Language](Language.md)> The languages configured for translation in this root folder, as reported by TranslationService. #### `childOrg(long id)` Returns: [Organisation](Organisation.md) Locates a descendant organisation of this root folder's organisation by its internal Kademi id. | Parameter | Description | |---|---| | `id` | the internal id of the organisation to find | #### `childOrg(String orgId)` Returns: [Organisation](Organisation.md) Locates a descendant organisation of this root folder's organisation by its external org id. | Parameter | Description | |---|---| | `orgId` | the external org id of the organisation to find | #### `findOrgType(String name)` Returns: [OrgType](OrgType.md) Finds an org type with the given name, searching this root folder's organisation and then its ancestors. | Parameter | Description | |---|---| | `name` | the 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. | Parameter | Description | |---|---| | `orgId` | the external org id of the organisation to update | | `orgType` | the name of the org type to add | #### `createOrgType(String name, String title)` Returns: [OrgType](OrgType.md) Creates and persists a new org type on this root folder's organisation, and fires an indexed-item-updated event for it. | Parameter | Description | |---|---| | `name` | the name of the org type to create | | `title` | the 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. | Parameter | Description | |---|---| | `orgId` | the external org id of the organisation to update | | `orgType` | the name of the org type to remove | #### `findWebsite(long id)` Returns: [Website](Website.md) Finds a website of this root folder's organisation by its internal id. | Parameter | Description | |---|---| | `id` | the internal id of the website to find | #### `findWebsite(String name)` Returns: [Website](Website.md) Finds a website of this root folder's organisation by its name. | Parameter | Description | |---|---| | `name` | the name of the website to find |