-
Notifications
You must be signed in to change notification settings - Fork 10
/
portal_properties_report.groovy
78 lines (61 loc) · 1.99 KB
/
portal_properties_report.groovy
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
73
74
75
76
77
78
import com.liferay.portal.kernel.service.*
import com.liferay.portal.kernel.model.*
import com.liferay.portal.kernel.portlet.*
import com.liferay.portal.kernel.util.*
import java.util.HashMap
import java.util.Map
import java.util.Set
import java.io.File
import java.io.StringWriter
EXCLUDE_PREFIXES = [
'hibernate.',
'image.default.company.logo',
'image.hook.file.system.root.dir',
'include-and-override',
'auto.deploy.deploy.dir',
'auto.deploy.tomcat.dest.dir',
'auto.deploy.websphere.wsadmin.app.manager.update.options',
'dl.char.blacklist',
'module.framework.',
'source.forge.mirrors',
'spring.infrastructure.configs',
'jsonws.web.service.parameter.type.whitelist.class.names',
'javax.persistence.validation.mode',
'message.boards.user.ranks',
'liferay.home',
'setup.database.url[hypersonic]',
'browser.launcher.url',
'resource.repositories.root'
];
try {
Properties defaultProps = new Properties();
defaultProps.load(com.liferay.portal.util.PropsValues.class.getResourceAsStream("/portal.properties"));
Properties props = PropsUtil.getProperties();
Properties overridenProps = new Properties();
props.keySet().each { key ->
value = props.get(key);
defaultValue = defaultProps.get(key);
if(!key.isEmpty() && !value.equals(defaultValue)) {
excluded = false
EXCLUDE_PREFIXES.each { prefix ->
if(key.startsWith(prefix)) {
excluded = true
}
}
if(excluded) {
return;
}
overridenProps.put(key, value);
}
}
overridenKeys = new Sequence(String.class);
overridenKeys.addAll(overridenProps.keySet());
overridenKeys.sort();
overridenKeys.each { key ->
value = overridenProps.get(key);
out.println("${key}=${value}");
}
} catch(e) {
out.println("""<div class="portlet-msg-error" >${e}</div>""")
e.printStackTrace(out)
}