A blog on a website, holding its articles along with the tags and categories used to organise them. A blog is a kind of repository, so its content is versioned in branches like any other repository and it is addressed by its name under the website's blogs folder. Articles, tags and categories all belong to exactly one blog, and deleting the blog deletes its categories with it. Tags and categories are matched by title, and the helpers which list them leave out any that have been deleted. The home and article templates decide how the blog and its articles are rendered.
Group: Database Entities
Extends: Repository
Properties
| Property | Returns | Description |
|---|---|---|
| articles | List<BlogArticle> | Every article in this blog, including any which have been deleted, in no particular order. Filter on the article's deleted flag before showing them. |
| articleTemplate | String | Name of the template used to render an individual article in this blog. Null means the default article template is used. |
| categorys | List<BlogCategory> | Every category defined in this blog, including deleted ones. Use the categories helper for the titles of the ones still in use. |
| homeTemplate | String | Name of the template used to render the blog's home page, which lists its articles. Null means the default home template is used. |
| itemType | String | The type recorded against this blog's articles when they are indexed for search, which acts as their top level search category. The special value "noindex" keeps the articles out of the search index altogether. |
| repoType | String | Identifies this repository as a blog, returning "B". Use it instead of an instanceof check, because Hibernate hands out proxies rather than the real class. |
| tags | List<BlogTag> | Every tag defined in this blog, including deleted ones. Use the tags helper for the titles of the ones still in use. |
| website | Website | The website this blog belongs to and is served from. It is reset when the blog is moved to another organisation, which picks a website in the destination. |
Inherited from Repository
Properties
| Property | Returns | Description |
|---|---|---|
| baseEntity | BaseEntity | The entity that contains this repository. The entity might be a user, organisation, etc The repository name must be unique within its parent entity |
| branches | List<Branch> | |
| category | RepositoryCategory | |
| createdDate | Date | |
| deleted | Boolean | To support soft deletes |
| id | long | |
| liveBranch | String | |
| name | String | |
| notes | String | |
| publicContent | boolean | |
| publishedBy | Profile | |
| publishedDate | Date | |
| title | String | |
| trunk | Branch | |
| type | String |
Methods
getWebsite() · setWebsite(Website website) · getRepoType() · getArticles() · setItemType(String itemType) · getItemType() · getCategorys() · setCategorys(List<BlogCategory> categorys) · setArticles(List<BlogArticle> articles) · getTags() · setTags(List<BlogTag> tags) · getArticleTemplate() · setArticleTemplate(String articleTemplate) · getHomeTemplate() · setHomeTemplate(String homeTemplate) · tag(String title) · tags() · article(String name) · addArticle(String name) · category(String name) · category(Long catId) · categories()
getWebsite()
Returns: Website
The website this blog belongs to and is served from. It is reset when the blog is moved to another organisation, which picks a website in the destination.
setWebsite(Website website)
Returns: void
Sets the website this blog belongs to.
| Parameter | Description |
|---|---|
website | the owning website |
getRepoType()
Returns: String
Identifies this repository as a blog, returning "B". Use it instead of an instanceof check, because Hibernate hands out proxies rather than the real class.
getArticles()
Returns: List<BlogArticle>
Every article in this blog, including any which have been deleted, in no particular order. Filter on the article's deleted flag before showing them.
setItemType(String itemType)
Returns: void
Sets the item type used when indexing this blog's articles for search.
| Parameter | Description |
|---|---|
itemType | the search item type, or "noindex" to keep the articles out of the search index |
getItemType()
Returns: String
The type recorded against this blog's articles when they are indexed for search, which acts as their top level search category. The special value "noindex" keeps the articles out of the search index altogether.
getCategorys()
Returns: List<BlogCategory>
Every category defined in this blog, including deleted ones. Use the categories helper for the titles of the ones still in use.
setCategorys(List<BlogCategory> categorys)
Returns: void
Sets the blog's categories.
| Parameter | Description |
|---|---|
categorys | the categories belonging to this blog |
setArticles(List<BlogArticle> articles)
Returns: void
Sets the blog's articles.
| Parameter | Description |
|---|---|
articles | the articles belonging to this blog |
getTags()
Returns: List<BlogTag>
Every tag defined in this blog, including deleted ones. Use the tags helper for the titles of the ones still in use.
setTags(List<BlogTag> tags)
Returns: void
Sets the blog's tags.
| Parameter | Description |
|---|---|
tags | the tags belonging to this blog |
getArticleTemplate()
Returns: String
Name of the template used to render an individual article in this blog. Null means the default article template is used.
setArticleTemplate(String articleTemplate)
Returns: void
Sets the template used to render an individual article.
| Parameter | Description |
|---|---|
articleTemplate | the article template name, or null to use the default |
getHomeTemplate()
Returns: String
Name of the template used to render the blog's home page, which lists its articles. Null means the default home template is used.
setHomeTemplate(String homeTemplate)
Returns: void
Sets the template used to render the blog's home page.
| Parameter | Description |
|---|---|
homeTemplate | the home page template name, or null to use the default |
tag(String title)
Returns: BlogTag
Finds a tag in this blog by its title, matching exactly and including tags which have been deleted. It scans the loaded tag list rather than querying the database.
| Parameter | Description |
|---|---|
title | the tag title to look for |
tags()
Returns: List<String>
The titles of the tags still in use in this blog, leaving out any which have been deleted.
article(String name)
Returns: BlogArticle
Finds an article in this blog by its name, which is the path safe identifier used in its URL. It scans the loaded article list, including any articles which have been deleted.
| Parameter | Description |
|---|---|
name | the article name to look for |
addArticle(String name)
Returns: BlogArticle
Creates a new article in this blog and adds it to the blog's article list, with its title set from the name and its article date set to now. The article is not saved, so save it yourself once you have set its content.
| Parameter | Description |
|---|---|
name | the name for the new article, used as its path safe identifier and its initial title |
category(String name)
Returns: BlogCategory
Finds a category in this blog by its title, matching exactly and including categories which have been deleted. It scans the loaded category list rather than querying the database.
| Parameter | Description |
|---|---|
name | the category title to look for |
category(Long catId)
Returns: BlogCategory
Finds a category in this blog by its database id, scanning the loaded category list and including categories which have been deleted.
| Parameter | Description |
|---|---|
catId | the id of the category to look for |
categories()
Returns: List<String>
The titles of the categories still in use in this blog, leaving out any which have been deleted.