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 |
|
package info.magnolia.imaging.setup; |
35 |
|
|
36 |
|
import info.magnolia.cms.core.Content; |
37 |
|
import info.magnolia.cms.core.ItemType; |
38 |
|
import info.magnolia.module.InstallContext; |
39 |
|
import info.magnolia.module.delta.AbstractRepositoryTask; |
40 |
|
import info.magnolia.module.delta.TaskExecutionException; |
41 |
|
|
42 |
|
import java.util.Collection; |
43 |
|
|
44 |
|
import javax.jcr.RepositoryException; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
49 |
|
public abstract class UpdateAllImagingGenerators extends AbstractRepositoryTask { |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
0 |
public UpdateAllImagingGenerators(String name, String description) {... |
52 |
0 |
super(name, description); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
55 |
0 |
@Override... |
56 |
|
protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException { |
57 |
0 |
Content modulesNode = ctx.getModulesNode(); |
58 |
|
|
59 |
0 |
if (modulesNode.hasContent("imaging")) { |
60 |
0 |
Content generators = modulesNode.getContent("imaging").getContent("config").getContent("generators"); |
61 |
0 |
Collection<Content> generatorsDefinitions = generators.getChildren(ItemType.CONTENTNODE); |
62 |
|
|
63 |
0 |
for (Content imagingDefinition : generatorsDefinitions) { |
64 |
0 |
updateImagingDefinition(ctx, imagingDefinition); |
65 |
|
} |
66 |
|
} |
67 |
|
} |
68 |
|
|
69 |
|
protected abstract void updateImagingDefinition(InstallContext ctx, Content imagingDefinition) throws RepositoryException, TaskExecutionException; |
70 |
|
|
71 |
|
} |