Skip to content

Commit 17c623f

Browse files
committed
Add support for package properties "requiresRoot", "requiresRestart", "allowIndexDefinitions".
1 parent 621490b commit 17c623f

4 files changed

Lines changed: 43 additions & 2 deletions

File tree

changes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<release version="1.11.0" date="not released">
2727
<action type="add" dev="sseifert">
28-
Add support for new package property "contentPackage.packageType".
28+
Add support for package properties "packageType", "requiresRoot", "requiresRestart", "allowIndexDefinitions".
2929
</action>
3030
<action type="add" dev="sseifert">
3131
Add validator for content package based on Jackrabbit FileVault Validation (for packages with a packageType set).

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOptions.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,19 @@ private ContentPackageOptions() {
8888
*/
8989
public static final String PROPERTY_PACKAGE_PACKAGE_TYPE = "contentPackage.packageType";
9090

91+
/**
92+
* Package requires root.
93+
*/
94+
public static final String PROPERTY_PACKAGE_REQUIRES_ROOT = "contentPackage.requiresRoot";
95+
96+
/**
97+
* Package requires restart.
98+
*/
99+
public static final String PROPERTY_PACKAGE_REQUIRES_RESTART = "contentPackage.requiresRestart";
100+
101+
/**
102+
* Package allows index definitions.
103+
*/
104+
public static final String PROPERTY_PACKAGE_ALLOW_INDEX_DEFINITIONS = "contentPackage.allowIndexDefinitions";
105+
91106
}

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/util/ContentPackageUtil.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
package io.wcm.devops.conga.plugins.aem.util;
2121

2222
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_AC_HANDLING;
23+
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_ALLOW_INDEX_DEFINITIONS;
2324
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_DESCRIPTION;
2425
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_FILES;
2526
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_FILTERS;
2627
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_GROUP;
2728
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_NAME;
2829
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_PACKAGE_TYPE;
2930
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_PROPERTIES;
31+
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_REQUIRES_RESTART;
32+
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_REQUIRES_ROOT;
3033
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_ROOT_PATH;
3134
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_THUMBNAIL_IMAGE;
3235
import static io.wcm.devops.conga.plugins.aem.postprocessor.ContentPackageOptions.PROPERTY_PACKAGE_VERSION;
@@ -88,7 +91,10 @@ public static ContentPackageBuilder getContentPackageBuilder(Map<String, Object>
8891
.group(getMandatoryProp(options, PROPERTY_PACKAGE_GROUP))
8992
.name(getMandatoryProp(options, PROPERTY_PACKAGE_NAME))
9093
.version(getOptionalProp(options, PROPERTY_PACKAGE_VERSION))
91-
.packageType(getOptionalProp(options, PROPERTY_PACKAGE_PACKAGE_TYPE));
94+
.packageType(getOptionalProp(options, PROPERTY_PACKAGE_PACKAGE_TYPE))
95+
.requiresRoot(getOptionalPropBoolean(options, PROPERTY_PACKAGE_REQUIRES_ROOT))
96+
.requiresRestart(getOptionalPropBoolean(options, PROPERTY_PACKAGE_REQUIRES_RESTART))
97+
.allowIndexDefinitions(getOptionalPropBoolean(options, PROPERTY_PACKAGE_ALLOW_INDEX_DEFINITIONS));
9298

9399
// description
94100
if (fileHeader != null) {
@@ -292,6 +298,23 @@ else if (value != null) {
292298
return null;
293299
}
294300

301+
/**
302+
* Get boolean property from options or return null if not set.
303+
* @param options Options
304+
* @param key Key
305+
* @return Option value or false
306+
*/
307+
private static boolean getOptionalPropBoolean(Map<String, Object> options, String key) {
308+
Object value = getOptionalProp(options, key);
309+
if (value instanceof Boolean) {
310+
return (Boolean)value;
311+
}
312+
else if (value != null) {
313+
return BooleanUtils.toBoolean(value.toString());
314+
}
315+
return false;
316+
}
317+
295318
/**
296319
* Get property from options or return null if not set.
297320
* @param options Options

src/site/markdown/extensions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Both post processor plugins support a set of options that allow further configur
4242
| `contentPackage.files` | List of additional binary files to be included in content package. For each file you have to specify a `path` property (target path), and for the source an `url` property for an external file, or a `file` and `dir` property for a file that was generated by CONGA. If the file should be deleted after the inclusion you can additionally specify `delete: true`.
4343
| `contentPackage.properties` | Defines map with additional custom properties for package metadata.
4444
| `contentPackage.packageType` | Defines the [packageType][jackrabbit-filevault-packagetype] for the content package. Uses for [FileVault validation][jackrabbit-filevault-validation] of the package.
45+
| `contentPackage.requiresRoot` | Package requires root.
46+
| `contentPackage.requiresRestart`| Package requires restart.
47+
| `contentPackage.allowIndexDefinitions` | Package allows index definitions.
4548

4649

4750
Example for defining package properties with a set of filters:

0 commit comments

Comments
 (0)