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

PropertyReturnsDescription
articlesList<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.
articleTemplateStringName of the template used to render an individual article in this blog. Null means the default article template is used.
categorysList<BlogCategory>Every category defined in this blog, including deleted ones. Use the categories helper for the titles of the ones still in use.
homeTemplateStringName of the template used to render the blog's home page, which lists its articles. Null means the default home template is used.
itemTypeStringThe 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.
repoTypeStringIdentifies this repository as a blog, returning "B". Use it instead of an instanceof check, because Hibernate hands out proxies rather than the real class.
tagsList<BlogTag>Every tag defined in this blog, including deleted ones. Use the tags helper for the titles of the ones still in use.
websiteWebsiteThe 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

PropertyReturnsDescription
baseEntityBaseEntityThe entity that contains this repository. The entity might be a user, organisation, etc The repository name must be unique within its parent entity
branchesList<Branch>
categoryRepositoryCategory
createdDateDate
deletedBooleanTo support soft deletes
idlong
liveBranchString
nameString
notesString
publicContentboolean
publishedByProfile
publishedDateDate
titleString
trunkBranch
typeString

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.

ParameterDescription
websitethe 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.

ParameterDescription
itemTypethe 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.

ParameterDescription
categorysthe categories belonging to this blog

setArticles(List<BlogArticle> articles)

Returns: void

Sets the blog's articles.

ParameterDescription
articlesthe 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.

ParameterDescription
tagsthe 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.

ParameterDescription
articleTemplatethe 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.

ParameterDescription
homeTemplatethe 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.

ParameterDescription
titlethe 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.

ParameterDescription
namethe 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.

ParameterDescription
namethe 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.

ParameterDescription
namethe 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.

ParameterDescription
catIdthe 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.

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