AEMFormsManagerConfiguration.java
3.13 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
65
66
67
68
69
70
71
72
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.RepositoryException
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Service
* org.apache.sling.commons.osgi.OsgiUtil
* org.osgi.service.component.ComponentContext
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.aem.formsndocuments.config;
import java.util.Dictionary;
import javax.jcr.RepositoryException;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.commons.osgi.OsgiUtil;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component(metatype=1, immediate=1, label="FormsManager Configuration", description="Configuration for Forms Manager")
@Service(value={AEMFormsManagerConfiguration.class})
public class AEMFormsManagerConfiguration {
protected final Logger log;
private static final boolean DEFAULT_INCLUDE_OOTB_TEMPLATES = true;
private static final boolean DEFAULT_INCLUDE_DEPRECATED_TEMPLATES = false;
private boolean includeOOTBTemplates;
private boolean includeDeprecatedTemplates;
@Property(boolValue={1}, label="Include Out of the box AF And AD Templates", description=" Select this option to include Out of the box Adaptive Form and Adaptive Document Templates. Defaults to true")
private static final String PROPERTY_INCLUDE_OOTB_TEMPLATES = "formsManagerConfig.includeOOTBTemplates";
@Property(boolValue={0}, label="Include AEM 6.0 AF Templates", description=" Select this option to include Adaptive Form Templates that were present in AEM 6.0 and are now deprecated in AEM ver 6.2. Defaults to false")
private static final String PROPERTY_INCLUDE_DEPRECATED_TEMPLATES = "formsManagerConfig.includeDeprecatedTemplates";
public AEMFormsManagerConfiguration() {
this.log = LoggerFactory.getLogger(this.getClass());
this.includeOOTBTemplates = true;
this.includeDeprecatedTemplates = false;
}
protected void activate(ComponentContext context) throws RepositoryException {
Dictionary props = context.getProperties();
try {
this.setIncludeOOTBTemplates(OsgiUtil.toBoolean(props.get("formsManagerConfig.includeOOTBTemplates"), (boolean)true));
this.setIncludeDeprecatedTemplates(OsgiUtil.toBoolean(props.get("formsManagerConfig.includeDeprecatedTemplates"), (boolean)false));
}
catch (Exception e) {
throw new RepositoryException((Throwable)e);
}
}
public boolean isIncludeOOTBTemplates() {
return this.includeOOTBTemplates;
}
public boolean isIncludeDeprecatedTemplates() {
return this.includeDeprecatedTemplates;
}
public void setIncludeOOTBTemplates(boolean includeOOTBTemplates) {
this.includeOOTBTemplates = includeOOTBTemplates;
}
public void setIncludeDeprecatedTemplates(boolean includeDeprecatedTemplates) {
this.includeDeprecatedTemplates = includeDeprecatedTemplates;
}
}