TouchpointAdapter.java
1.16 KB
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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.wcm.api.Page
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ValueMap
*/
package com.day.cq.mcm.api;
import com.day.cq.mcm.api.Touchpoint;
import com.day.cq.mcm.util.NormalizedResource;
import com.day.cq.wcm.api.Page;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
public abstract class TouchpointAdapter
implements Touchpoint {
private NormalizedResource normalizedResource;
public void init(Resource r) {
if (r == null) {
throw new NullPointerException("Passed null as Resource r.");
}
this.normalizedResource = new NormalizedResource();
this.normalizedResource.setResource(r);
}
@Override
public Page getPage() {
return (Page)this.normalizedResource.getResource().adaptTo(Page.class);
}
@Override
public String getTitle() {
return (String)this.getProperties().get("jcr:title", String.class);
}
@Override
public ValueMap getProperties() {
return this.normalizedResource.getContentVals();
}
}