Currently, vocabularies are represented with the AssetVocabulary instance and can be referenced by a primary key. This is good enough when the references themselves are created dynamically, but in some cases the reference needs to be set ahead of time, potentially through code. One example of this is the Content Dashboard, which leverages specific vocabularies which are created out of the box (see
LPS-112735) and which needs to be referenced in the Content Dashboard application code.
The goal of this story is to solve this need. It does so by providing new API methods to create a vocabulary with a specific unique name (unique within the context of a group) and retrieve a Vocabulary by its unique name, following the existing pattern of many other Liferay entities. The code that creates the out of the box vocabulary should be able to specify the unique name through the vocabulary creation API and the same key value can be used in the Content Dashboard safely to refer to the vocabulary.
For vocabularies that are created through the UI, will be automatically given a key based on the name used for creation. The key should not change automatically thereafter.