publishConditions
module allows you to block content publishing until conditions specified in this module are satisfied.
All existing connect conditions are supported by this module.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
{
"modules": {
"publishConditions": [
{
"errorMessage": {
"value": "My error message"
},
"context": "addon",
"dialog": {
"height": "100px",
"url": "/your_api",
"conditions": [
{
"condition": "has_attachment",
"invert": false
}
],
"header": {
"value": "My custom header"
},
"width": "500px"
},
"conditions": [
{
"or": [
{
"condition": "user_is_admin",
"invert": false
},
{
"condition": "has_attachment",
"invert": false
}
]
},
{
"condition": "user_is_logged_in",
"invert": false
}
],
"name": {
"value": "My Publish Condition"
},
"key": "my-publish-condition"
}
]
}
}
errorMessage
Type | |
Required | Yes |
Description | An error message will help you to understand the issue and take necessary action to satisfy the publish condition.
Note: If Represents a string that can be resolved via a localization properties file. You can use the same Example1 2 3 4
|
value |
| ||||||||
i18n |
|
key
Type | |
Max length | 100 |
Required | Yes |
Pattern | ^[a-zA-Z0-9-]+$ |
Description | A key to identify this module. This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique. Keys must only contain alphanumeric characters and dashes. The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like: { "key": "my-addon", "modules": { "configurePage": { "key": "configure-me", } } }
Will have a configuration page module with a URL of |
name
Type | |
Required | Yes |
Description | A human readable name. Represents a string that can be resolved via a localization properties file. You can use the same Example1 2 3 4
|
value |
| ||||||||
i18n |
|
conditions
Type | |
Description | Conditions can be added to display only when all the given conditions are true. |
context
Type | |
Defaults to | addon |
Allowed values |
|
Description | The context for the URL parameter. As of now only supported value is
|
dialog
Type | |
Description | Triggers the dialog on click of Publish button. The dialog allows you to display their custom content within iFrame in the dialog during publish button click. Trigger dialog close using postMessageYou can close dialog by sending postMessage with action =closeConditionalPublishDialog 1 2 3 4 5 6 7 8 9
|
url |
| ||||||||
conditions |
| ||||||||
header |
| ||||||||
height |
| ||||||||
width |
|
params
Type | |
Description | This object represents a map of key/value pairs, where each property name and value corresponds to the parameter name and value respectively. Example 1 2 3 4 5 6 7
|
Rate this page: