Managing the Repository¶
Sections¶
Sections enable you to divide content into groups which can later be used e.g. as basis for permissions.
Creating Sections¶
To create a new Section, you need to make use of the SectionCreateStruct
and pass it to the SectionService::createSection
method:
1 2 3 4 |
|
Getting Section information¶
You can use SectionService
to retrieve Section information such as whether it is in use:
1 |
|
Listing content in a Section¶
To list Content items assigned to a Section you need to make a query
for Content belonging to this section, by applying the SearchService
.
You can also use the query to get the total number of assigned Content items:
1 2 3 4 5 6 7 8 9 10 11 |
|
Assigning Section to content¶
To assign content to a Section, use the SectionService::assignSection
method.
You need to provide it with the ContentInfo
object of the Content item,
and the Section
object:
1 2 3 |
|
Note that assigning a Section to content does not automatically assign it to the Content item's children.
Object states¶
Object states enable you to set a custom state to any content. States are grouped into Object state groups.
Creating Object states¶
To create an Object state group and add Object states to it,
you need to make use of the ObjectStateService
:
1 2 3 4 |
|
ObjectStateService::createObjectStateGroup
takes as argument an ObjectStateGroupCreateStruct
,
in which you need to specify the identifier, default language and at least one name for the group.
To create an Object state inside a group,
use ObjectStateService::newObjectStateCreateStruct
and provide it with an ObjectStateCreateStruct
:
1 2 3 4 5 6 7 8 9 10 11 |
|
Assigning Object state¶
To assign an Object state to a Content item,
use ObjectStateService::setContentState
.
Provide it with a ContentInfo
object of the Content item, the Object state group and the Object state:
1 2 3 4 5 |
|
Enterprise
Workflow¶
Getting workflow information¶
To get information about a specific workflow for a Content item, use WorkflowServiceInterface::loadWorkflowMetadataForContent
:
1 2 3 4 |
|
Tip
marking
, a term from Symfony Workflow,
refers to a state in a workflow.
To get a list of all workflows that can be used for a given Content item, use WorkflowRegistry
:
1 |
|
Applying workflow transitions¶
To place a Content item in a workflow, use WorkflowService::start
:
1 |
|
To apply a transition to a Content item, use WorkflowService::apply
.
Additionally, you can check if the transition is possible for the given object using WorkflowService::can
:
1 2 3 |
|
Bookmarks¶
BookmarkService
enables you to read, add and remove bookmarks from content.
To view a list of all bookmarks, use BookmarkService::loadBookmarks
:
1 2 3 4 5 6 7 |
|
You can add a bookmark to a Content item by providing its Location object
to the BookmarkService::createBookmark
method:
1 2 3 |
|
You can remove a bookmark from a Location with BookmarkService::deleteBookmark
:
1 |
|
Languages¶
Getting Language information¶
To get a list of all Languages in the system use LanguageService::loadLanguages
:
1 2 3 4 5 |
|
Creating a Language¶
To create a new language, you need to create a LanguageCreateStruct
and provide it with the language code and language name.
Then, use LanguageService::createLanguage
and pass the LanguageCreateStruct
to it:
1 2 3 4 |
|