|
9 | 9 | * [JMX](#jmx) |
10 | 10 | * [Startup Hook](#startup-hook) |
11 | 11 | * [Upload Listener Service](#upload-listener-service) |
| 12 | + * [Ad hoc installation of small fragments](#ad-hoc-installation-of-small-fragments) |
12 | 13 |
|
13 | 14 | <!--- This table of contents has been generated with https://github.com/ekalinin/github-markdown-toc#gh-md-toc --> |
14 | 15 |
|
@@ -141,5 +142,31 @@ NOTE: Usually it is better to rely on the install hook and manual executions via |
141 | 142 | The upload listener service requires the `AC Tool Installation Service` (PID `biz.netcentric.cq.tools.actool.impl.AcInstallationServiceImpl`) to be configured correctly, i.e. its configuration path must point to the nodes containing the `YAML` files. |
142 | 143 | <img src="images/installation-service.png"> |
143 | 144 |
|
| 145 | +### Ad hoc installation of small fragments |
| 146 | + |
| 147 | +Generally it is best practice to keep the yaml files in source control and only use one of the above methods to trigger the installation of those files. |
| 148 | +However, for some support scenarios it can be useful to be able to apply small yaml fragments directly. This can be achieved by using the following |
| 149 | +groovy script (using the [AEM Groovy Console](https://github.com/icfnext/aem-groovy-console)): |
| 150 | + |
| 151 | +``` |
| 152 | +import static org.apache.jackrabbit.commons.JcrUtils.* |
| 153 | +import static org.apache.commons.io.IOUtils.* |
| 154 | +import biz.netcentric.cq.tools.actool.api.AcInstallationService |
| 155 | +def runAcTool(adhocFolder, adhocFile, yaml) { |
| 156 | + putFile(getOrCreateByPath(adhocFolder, "nt:folder", session), adhocFile, "text/yaml", toInputStream(yaml)); session.save(); |
| 157 | + return getService(AcInstallationService.class).apply(adhocFolder) |
| 158 | +} |
| 159 | +
|
| 160 | +runAcTool("/tmp/actool-adhoc", "actool.yaml", """ |
| 161 | + |
| 162 | +- user_config: |
| 163 | + - test-user: |
| 164 | + - name: "My test user" |
| 165 | + path: /home/users/testusers |
| 166 | +
|
| 167 | +""") |
| 168 | +``` |
| 169 | + |
| 170 | +As for any executions, the log of ad hoc installations are found underneath `/var/statistics/achistory`. |
144 | 171 |
|
145 | 172 |
|
0 commit comments