GuideAdModule.java
2.51 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.aemds.guide.common.GuideNode
* com.adobe.aemds.guide.service.GuideModuleImporter
* com.adobe.aemds.guide.utils.GuideUtils
* com.adobe.icc.ddg.api.HTML5ModuleResolverService
* com.adobe.icc.ddg.api.HTML5ModuleResolverService$ResolutionType
* org.apache.sling.api.SlingHttpServletRequest
* org.apache.sling.api.resource.ValueMap
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.fd.adaddon.common;
import com.adobe.aemds.guide.common.GuideNode;
import com.adobe.aemds.guide.service.GuideModuleImporter;
import com.adobe.aemds.guide.utils.GuideUtils;
import com.adobe.icc.ddg.api.HTML5ModuleResolverService;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.ValueMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GuideAdModule
extends GuideNode
implements Serializable {
private static Logger logger = LoggerFactory.getLogger(GuideAdModule.class);
private GuideModuleImporter guideModuleImporter = null;
public String getGuideNodeType() {
return "guideAdModule";
}
public String getSummaryContent() {
String resolvedHTML = "";
if (this.guideModuleImporter == null) {
this.guideModuleImporter = GuideUtils.getGuideModuleImporter((SlingHttpServletRequest)this.slingRequest);
}
if (this.guideModuleImporter != null) {
String assetRef = (String)this.resourceProps.get("assetRef", String.class);
HashMap<String, HTML5ModuleResolverService.ResolutionType> moduleParameter = new HashMap<String, HTML5ModuleResolverService.ResolutionType>();
moduleParameter.put("resolutionType", HTML5ModuleResolverService.ResolutionType.SUMMARY);
resolvedHTML = this.guideModuleImporter.getModuleResolution(assetRef, moduleParameter);
} else {
logger.error("getSummaryContent: GuideModuleImporter is null");
}
return resolvedHTML;
}
public String getStyles() {
String style = "";
String width = this.getWidth();
String height = this.getHeight();
style = style + (width.length() > 0 ? new StringBuilder().append("width:").append(width).append("%;").toString() : "");
style = style + (height.length() > 0 ? new StringBuilder().append("height:").append(height).append("px;").toString() : "");
return style;
}
}