Represents a single blog as a content resource, appearing in the site tree as a folder whose children are the blog's articles. It handles admin form posts for renaming the blog, adding, editing and removing tags and categories, and copying the blog to another website, and it exposes articles filtered and sorted by tag or category for use in templates. Each child resource is a BlogArticleFolder wrapping one BlogArticle entity.
Group: Resources
Extends: AbstractCollectionResource
Implements: WebsiteBranchResource, ContentDirectoryResource, GetableResource, TitledPage, PostableResource, MoveableResource, DeletableCollectionResource, BlogResource, ParameterisedResource, WebsiteResource
Properties
| Property | Returns | Description |
|---|---|---|
| articles | BlogsResourceList | All matching articles in this blog, applying the same tag and category request parameter filtering as getArticles(boolean), and also applying the current user's preferred tags when no tag parameter is present. |
| articleTemplate | String | The template used to render an individual article in this blog. |
| blogRootDir | DirectoryNode | |
| blogSite | Website | The website this blog belongs to. |
| branch | Branch | The live branch of this blog's underlying repository. |
| branches | List<String> | Names of this blog's website's branches that have not been hidden. |
| breadCrumbs | Map<String,String> | The breadcrumb trail for this blog, as a map of path to display label, used by the admin template layer to build breadcrumb navigation. Currently always a single entry pointing back to the blogs listing. |
| categories | List<String> | All category titles defined on this blog, regardless of whether any article currently uses them. |
| categoryCounts | List<ItemCount> | Categories used by this blog's articles, each paired with the number of articles in that category, sorted alphabetically by category title. Each entry is an ItemCount with item and count properties. |
| categoryCountsByCount | List<ItemCount> | Categories used by this blog's articles, each paired with the number of articles in that category, sorted by that count. Each entry is an ItemCount with item and count properties. |
| children | List<? extends Resource> | All article resources in this blog, one BlogArticleFolder per BlogArticle. On a live (non-versioned) address only currently published articles are included; on a versioned draft address all articles are included regardless of publish state. The result is computed once and cached for the life of this instance. |
| contentManagedPermissions | boolean | Whether permissions on this blog's contents are managed independently per item rather than inherited as a whole. Always false for a blog folder. |
| dataSession | DataSession | |
| directoryNode | DirectoryNode | The underlying directory node backing this resource in the content repository. Not supported for a blog folder; calling it always throws. |
| domainName | String | The domain name this blog's website is served on, resolved against the website's live branch so that unpublished articles remain accessible on the versioned address. |
| draft | boolean | Whether this blog is being viewed in a draft context where unpublished articles should be visible: true when viewed under an organisation folder, or when viewed under a versioned website address, false otherwise. The result is computed once and cached for the life of this instance. |
| externalUrl | String | The full public URL of this blog, including protocol and host, built from the website's domain name and its force-HTTPS setting. |
| files | List<ContentResource> | The child resources of this blog that are files rather than directories, excluding the internal .mil metadata folder. |
| hash | String | The content hash of the current commit on this blog's live branch, used to detect whether its content has changed. |
| homeTemplate | String | The template used to render this blog's home page, listing its articles. |
| itemType | String | The item type identifier of the underlying blog entity, used to distinguish blogs from other repository types. |
| modifiedBy | Profile | The profile who authored the most recent commit on this blog's live branch. |
| name | String | The URL-safe, unique name of the blog, used as the path segment under which it is served (for example /blogs/{name}/). |
| ownerProfile | Profile | The profile that owns this blog's repository, where the repository's base entity is itself a profile. |
| paramNames | List<String> | The names of the template parameters available on this blog's home template. |
| parent | CommonCollectionResource | The collection resource that contains this blog, typically the blogs application folder for a website or organisation. |
| preferredTags | List<String> | The tag titles the current user has previously chosen to follow for this blog's website, read from their saved tag preferences. |
| recentArticles | ResourceList | The five most recently created articles in this blog, filtered the same way as getArticles: only published articles on a live address, or all articles when viewed on a versioned draft address. The result is computed once and cached for the life of this instance. |
| repository | Repository | The underlying repository backing this blog's content and version history. |
| subFolders | List<ContentDirectoryResource> | The child resources of this blog that are themselves directories, excluding the internal .mil metadata folder. |
| tagCounts | List<ItemCount> | Tags used by this blog's articles, each paired with the number of articles carrying that tag, sorted alphabetically by tag title. Each entry is an ItemCount with item and count properties. |
| tagCountsByCount | List<ItemCount> | Tags used by this blog's articles, each paired with the number of articles carrying that tag, sorted by that count. Each entry is an ItemCount with item and count properties. |
| tags | List<String> | All tag titles defined on this blog, regardless of whether any article currently uses them. |
| title | String | The display title of the blog, shown in menus and page headings. Falls back to whatever value was set when the blog was created; may differ from its URL-safe name. |
| website | Website | The website this blog belongs to, same as getBlogSite. |
| websiteName | String | The name of the website this blog belongs to. |
Methods
getTitle() · getChildren() · getParent() · getName() · getTags() · getCategories() · category(String cat) · isContentManagedPermissions() · getRecentArticles() · getWebsiteName() · getBlogSite() · getArticles() · getArticles(boolean ignorePrefs) · getArticles(List<String> tags) · getArticles(List<String> tags, List<String> categories) · getPreferredTags() · getCategoryCounts() · getCategoryCountsByCount() · getTagCounts() · getTagCountsByCount() · getDirectoryNode() · getSubFolders() · getFiles() · getHash() · getModifiedBy() · getBranch() · getRepository() · getOwnerProfile() · getItemType() · isDraft() · getDomainName() · getVersionedDomainName(Branch b) · getExternalUrl() · getVersionedExternalUrl(Branch b) · getBranches() · getHomeTemplate() · getArticleTemplate() · getParamNames() · getWebsite() · getBreadCrumbs()
getTitle()
Returns: String
The display title of the blog, shown in menus and page headings. Falls back to whatever value was set when the blog was created; may differ from its URL-safe name.
getChildren()
Returns: List<? extends Resource>
All article resources in this blog, one BlogArticleFolder per BlogArticle. On a live (non-versioned) address only currently published articles are included; on a versioned draft address all articles are included regardless of publish state. The result is computed once and cached for the life of this instance.
getParent()
Returns: CommonCollectionResource
The collection resource that contains this blog, typically the blogs application folder for a website or organisation.
getName()
Returns: String
The URL-safe, unique name of the blog, used as the path segment under which it is served (for example /blogs/{name}/).
getTags()
Returns: List<String>
All tag titles defined on this blog, regardless of whether any article currently uses them.
getCategories()
Returns: List<String>
All category titles defined on this blog, regardless of whether any article currently uses them.
category(String cat)
Returns: BlogCategory
Looks up a category defined on this blog by its title.
| Parameter | Description |
|---|---|
cat | the category title to look up |
isContentManagedPermissions()
Returns: boolean
Whether permissions on this blog's contents are managed independently per item rather than inherited as a whole. Always false for a blog folder.
getRecentArticles()
Returns: ResourceList
The five most recently created articles in this blog, filtered the same way as getArticles: only published articles on a live address, or all articles when viewed on a versioned draft address. The result is computed once and cached for the life of this instance.
getWebsiteName()
Returns: String
The name of the website this blog belongs to.
getBlogSite()
Returns: Website
The website this blog belongs to.
getArticles()
Returns: BlogsResourceList
All matching articles in this blog, applying the same tag and category request parameter filtering as getArticles(boolean), and also applying the current user's preferred tags when no tag parameter is present.
getArticles(boolean ignorePrefs)
Returns: BlogsResourceList
All matching articles in this blog, filtered by the 'tag' and 'cat' request parameters if present. Each may hold a comma separated list of tag or category names to match. When no 'tag' parameter is present and ignorePrefs is false, the current user's preferred tags (see getPreferredTags) are used instead.
| Parameter | Description |
|---|---|
ignorePrefs | true to skip applying the current user's preferred tags when no 'tag' parameter is present |
getArticles(List<String> tags)
Returns: BlogsResourceList
All matching articles in this blog, filtered by tag titles rather than by request parameters. The returned list has additional methods for further filtering and sorting.
| Parameter | Description |
|---|---|
tags | the tag titles to match, or null to include articles regardless of tag |
getArticles(List<String> tags, List<String> categories)
Returns: BlogsResourceList
All articles in this blog that match both the given tags and the given categories, and that the current user is in the target group for. The result is computed once and cached for the life of this instance.
| Parameter | Description |
|---|---|
tags | the tag titles to match, or null to match regardless of tag |
categories | the category titles to match, or null to match regardless of category |
getPreferredTags()
Returns: List<String>
The tag titles the current user has previously chosen to follow for this blog's website, read from their saved tag preferences.
getCategoryCounts()
Returns: List<ItemCount>
Categories used by this blog's articles, each paired with the number of articles in that category, sorted alphabetically by category title. Each entry is an ItemCount with item and count properties.
getCategoryCountsByCount()
Returns: List<ItemCount>
Categories used by this blog's articles, each paired with the number of articles in that category, sorted by that count. Each entry is an ItemCount with item and count properties.
getTagCounts()
Returns: List<ItemCount>
Tags used by this blog's articles, each paired with the number of articles carrying that tag, sorted alphabetically by tag title. Each entry is an ItemCount with item and count properties.
getTagCountsByCount()
Returns: List<ItemCount>
Tags used by this blog's articles, each paired with the number of articles carrying that tag, sorted by that count. Each entry is an ItemCount with item and count properties.
getDirectoryNode()
Returns: DirectoryNode
The underlying directory node backing this resource in the content repository. Not supported for a blog folder; calling it always throws.
getSubFolders()
Returns: List<ContentDirectoryResource>
The child resources of this blog that are themselves directories, excluding the internal .mil metadata folder.
getFiles()
Returns: List<ContentResource>
The child resources of this blog that are files rather than directories, excluding the internal .mil metadata folder.
getHash()
Returns: String
The content hash of the current commit on this blog's live branch, used to detect whether its content has changed.
getModifiedBy()
Returns: Profile
The profile who authored the most recent commit on this blog's live branch.
getBranch()
Returns: Branch
The live branch of this blog's underlying repository.
getRepository()
Returns: Repository
The underlying repository backing this blog's content and version history.
getOwnerProfile()
Returns: Profile
The profile that owns this blog's repository, where the repository's base entity is itself a profile.
getItemType()
Returns: String
The item type identifier of the underlying blog entity, used to distinguish blogs from other repository types.
isDraft()
Returns: boolean
Whether this blog is being viewed in a draft context where unpublished articles should be visible: true when viewed under an organisation folder, or when viewed under a versioned website address, false otherwise. The result is computed once and cached for the life of this instance.
getDomainName()
Returns: String
The domain name this blog's website is served on, resolved against the website's live branch so that unpublished articles remain accessible on the versioned address.
getVersionedDomainName(Branch b)
Returns: String
The domain name this blog's website is served on for a specific branch, resolved as a versioned address so unpublished articles on that branch remain accessible.
| Parameter | Description |
|---|---|
b | the branch to resolve the domain name for |
getExternalUrl()
Returns: String
The full public URL of this blog, including protocol and host, built from the website's domain name and its force-HTTPS setting.
getVersionedExternalUrl(Branch b)
Returns: String
The full public URL of this blog for a specific branch, built from that branch's versioned domain name.
| Parameter | Description |
|---|---|
b | the branch to build the URL for |
getBranches()
Returns: List<String>
Names of this blog's website's branches that have not been hidden.
getHomeTemplate()
Returns: String
The template used to render this blog's home page, listing its articles.
getArticleTemplate()
Returns: String
The template used to render an individual article in this blog.
getParamNames()
Returns: List<String>
The names of the template parameters available on this blog's home template.
getWebsite()
Returns: Website
The website this blog belongs to, same as getBlogSite.
getBreadCrumbs()
Returns: Map<String,String>
The breadcrumb trail for this blog, as a map of path to display label, used by the admin template layer to build breadcrumb navigation. Currently always a single entry pointing back to the blogs listing.