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.module.admininterface.config;
35
36
37 import java.util.ArrayList;
38 import java.util.List;
39
40 import org.apache.commons.lang.StringUtils;
41
42 public class RepositoryConfiguration extends BaseConfiguration implements Comparable{
43
44 private List permissions = new ArrayList();
45
46 private List aclTypes = new ArrayList();
47
48 boolean chooseButton = true;
49
50 public List getPermissions() {
51 return this.permissions;
52 }
53
54 public void setPermissions(List permissions) {
55 this.permissions = permissions;
56 }
57
58 public void addPermission(PermissionConfiguration permission) {
59 this.permissions.add(permission);
60 }
61
62 public List getAclTypes() {
63 return this.aclTypes;
64 }
65
66 public void setAclTypes(List patternTypes) {
67 this.aclTypes = patternTypes;
68 }
69
70 public void addAclType(AclTypeConfiguration type) {
71 this.aclTypes.add(type);
72 }
73
74 public String toViewPattern(String path) {
75 String cleanPattern = StringUtils.removeEnd(path, "/*");
76
77 if (StringUtils.isEmpty(cleanPattern)) {
78 return "/";
79 }
80 return cleanPattern;
81 }
82
83
84 public boolean isChooseButton() {
85 return this.chooseButton;
86 }
87
88
89 public void setChooseButton(boolean chooseButton) {
90 this.chooseButton = chooseButton;
91 }
92
93 public int compareTo(Object o) {
94 return this.getI18nLabel().compareToIgnoreCase(((RepositoryConfiguration)o).getI18nLabel());
95 }
96
97 }