# States
todo
Showcase Platform uses the Default Field Status to store on which state the Material currently is. The status field is just an ordinary select field which can also be placed inside the Properties but SCP has a lot more powerful tool for performing pre-defined updates on Material Data – Transitions.
By default SCP comes with the following statuses preconfigured:
| Status Value | Description |
|---|---|
| briefing | The default entry state for new Materials, allows to edit content and Meta Data. |
| review | Content and Meta Data is closed for all users except users who own the Role REVIEWER. |
| in_development | The content is being produced by an automatic Built Service or some real humans. |
| developed | The content is developed and ready for the next step. |
| pushing | The content is being pushed to its final position (mostly an external space). |
| pushed | The content is pushed and SCP cannot do anything else for it. |
| expired | The content has reached its end of life. |
# Material Status
As the Material Status is just an ordinary field with additional options, it can exactly be controlled like other Fields inside SCP. Check out the Field Guide to get more details on how it works.
# Transitions
Transitions are mainly used to move Materials over from one Status to another Status. They are quite powerful as you can modify Materials Meta Data when a transition is processed:
<?php
// CLIENT_CONFIG/transitions.php
return [
'ftp_push' => [
'actionLabel' => 'Push to FTP',
'headline' => 'Pushing to FTP',
'description' => 'This is a message which is visible on the modal in the GUI',
'buttonLabel' => 'Send now to FTP',
'successMessage' => 'Material is now stored on the FTP',
'filter' => [],
'updates' => [
'status' => 'some_new_status'
],
'run' => null
],
];
But why not just using a field inside the properties, when transitions just change the field? Transition may modify multiple Field Values at once and are able to execute some additional checks on top of the Meta Data before they can be excuted.
Let's imagine your Boss is reaching out to you to ensure that the field country has to be set before a Material can actually be pushed to a new status:
<?php
// CLIENT_CONFIG/transitions.php
return [
'ftp_push' => [
'actionLabel' => 'Push to FTP',
'headline' => 'Pushing to FTP',
'description' => 'This is a message which is visible on the modal in the GUI',
'buttonLabel' => 'Send now to FTP',
'successMessage' => 'Material is now stored on the FTP',
'filter' => [],
'updates' => [
'status' => 'some_new_status'
],
'conditions' => [
'country' => [
[
'rules' => [
'min' => 1,
],
'message' => 'Please fill in a valid country'
]
],
]
],
];
As you can see, you can use Conditions also for validating specific Meta Data parts before SCP will finally execute the transition. The faulty fields will be highlighted in the Properties Section so the user can easily add the missing data.
There is a detailed reference for Transitions available.
# Material Options
Materials have specific options which are highly relevant when it comes to the day-to-day use of SCP:
- Is a Material editable?
- Can the Meta Data of a Material be edited?
- Is Material ready to be copied?
- Can the Material be updated by remote agencies?
These questions refer to Material Options as these define the business rules on which SCPs decide whether a material is copyable or not (and more of course).
<?php
// CLIENT_CONFIG/material_options.php
return [
// default options
[
'filter' => [],
'options' => [
'briefingEditable' => false,
'propertiesEditable' => false,
'materialCopyable' => false,
'remoteUpdateAllowed' => false,
]
],
];
As you can see from the example, Material Options uses Filters to determine what a user can do with a Material.
Merged Configuration
SCP always use either the Merge or First-Match strategy when it comes to configuration. For Material Options, it uses the Merge-Strategy.
Lets move on with the next challenge:
Boss: Well, we want only Materials from Germany to be copyable! Do it...
Not a big deal, we can add an additional business rule to our Material Options configuration:
<?php
// CLIENT_CONFIG/material_options.php
return [
// default options
[
'filter' => [],
'options' => [
'briefingEditable' => false,
'propertiesEditable' => false,
'materialCopyable' => false,
'remoteUpdateAllowed' => false,
]
],
// germany is copyable
[
'filter' => [
'country' => 'germany'
],
'options' => [
'materialCopyable' => true,
]
],
];
That's basically it – you are able to control what a user can do with a material.
# Options
| Name | Description |
|---|---|
| materialCopyable | The material can be copied following the given rules for copying |
| briefingEditable | Briefing editable just means that the content of a material can be edited |
| propertiesEditable | Properties can be changed when this option is set to true |
| remoteUpdateAllowed | Tools which are interfacing SCP to upload Material data are allowed to do so |
← Filters Notifications →