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.parameters; |
35 |
|
|
36 |
|
import info.magnolia.cms.core.HierarchyManager; |
37 |
|
import info.magnolia.cms.core.NodeData; |
38 |
|
import info.magnolia.cms.util.HierarchyManagerUtil; |
39 |
|
import info.magnolia.imaging.ParameterProvider; |
40 |
|
import info.magnolia.imaging.caching.CachingStrategy; |
41 |
|
import info.magnolia.imaging.caching.NodeDataBasedCachingStrategy; |
42 |
|
|
43 |
|
import javax.jcr.RepositoryException; |
44 |
|
import javax.jcr.Session; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@deprecated@link@link |
50 |
|
|
51 |
|
@Deprecated |
|
|
| 81.8% |
Uncovered Elements: 2 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
52 |
|
public class NodeDataParameterProviderFactory extends AbstractWorkspaceAndPathParameterProviderFactory<NodeData> { |
53 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
54 |
4 |
@Override... |
55 |
|
protected ParameterProvider<NodeData> newParameterProviderForPath(final HierarchyManager hm, String path) throws RepositoryException { |
56 |
4 |
final NodeData nodeData; |
57 |
|
|
58 |
|
|
59 |
4 |
final String subPath = path.substring(0, path.lastIndexOf('/')); |
60 |
4 |
if (hm.isNodeData(subPath)) { |
61 |
0 |
nodeData = hm.getNodeData(subPath); |
62 |
|
} else { |
63 |
4 |
nodeData = hm.getNodeData(path); |
64 |
|
} |
65 |
4 |
return new NodeDataParameterProvider(new SimpleEqualityNodeDataWrapper(nodeData)); |
66 |
|
} |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
4 |
@Override... |
69 |
|
protected ParameterProvider newParameterProviderForPath(Session session, String path) throws RepositoryException { |
70 |
4 |
return newParameterProviderForPath(HierarchyManagerUtil.asHierarchyManager(session), path); |
71 |
|
} |
72 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
73 |
|
@Override... |
74 |
|
public CachingStrategy<NodeData> getCachingStrategy() { |
75 |
|
return new NodeDataBasedCachingStrategy(); |
76 |
|
} |
77 |
|
} |