1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.exoplatform.services.cms.taxonomy;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23
24
25
26
27 public class TaxonomyTreeData implements Comparable<TaxonomyTreeData> {
28
29 private String taxoTreeName;
30
31 private String repository;
32
33 private String taxoTreeWorkspace;
34
35 private String taxoTreePermissions;
36
37 private String taxoTreeHomePath;
38
39 private String taxoTreeActionName;
40
41 private String taxoTreeActionTargetPath;
42
43 private String taxoTreeActionTargetWorkspace;
44
45 private String taxoTreeActionTypeName;
46
47 private boolean edit = false;
48
49 public static final String ACTION_TAXONOMY_TREE = "exo:taxonomyAction";
50
51 public TaxonomyTreeData() {
52
53 }
54
55
56
57
58 public String getRepository() {
59 return repository;
60 }
61
62
63
64
65
66
67 public void setRepository(String rp) {
68 repository = rp;
69 }
70
71
72
73
74 public String getPermissions() {
75 return this.taxoTreePermissions;
76 }
77
78
79
80
81
82
83
84 public boolean hasPermission(String[] allPermissions, String permission) {
85 List<String> permissionList = new ArrayList<String>();
86 for (String per : allPermissions) {
87 permissionList.add(per.trim());
88 }
89 if (permission == null)
90 return false;
91 if (permission.indexOf(":/") > -1) {
92 String[] array = permission.split(":/");
93 if (array == null || array.length < 2)
94 return false;
95 if (permissionList.contains("*:/" + array[1]))
96 return true;
97 }
98 return permissionList.contains(permission);
99 }
100
101 public int compareTo(TaxonomyTreeData arg) {
102 return taxoTreeName.compareToIgnoreCase(arg.getTaxoTreeName());
103 }
104
105
106
107
108
109
110 public String getTaxoTreeHomePath() {
111 return taxoTreeHomePath;
112 }
113
114
115
116
117
118 public void setTaxoTreeHomePath(String taxoTreeHomePath) {
119 this.taxoTreeHomePath = taxoTreeHomePath;
120 }
121
122
123
124
125 public String getTaxoTreeName() {
126 return taxoTreeName;
127 }
128
129
130
131
132
133 public void setTaxoTreeName(String taxoTreeName) {
134 this.taxoTreeName = taxoTreeName;
135 }
136
137 public String getTaxoTreePermissions() {
138 return taxoTreePermissions;
139 }
140
141
142
143
144
145 public void setTaxoTreePermissions(String permission) {
146 this.taxoTreePermissions = permission;
147 }
148
149
150
151
152 public String getTaxoTreeWorkspace() {
153 return taxoTreeWorkspace;
154 }
155
156
157
158
159
160 public void setTaxoTreeWorkspace(String taxoTreeWorkspace) {
161 this.taxoTreeWorkspace = taxoTreeWorkspace;
162 }
163
164
165
166
167 public String getTaxoTreeActionName() {
168 return taxoTreeActionName;
169 }
170
171
172
173
174
175 public void setTaxoTreeActionName(String taxoTreeActionName) {
176 this.taxoTreeActionName = taxoTreeActionName;
177 }
178
179 public String getTaxoTreeActionTypeName() {
180 return taxoTreeActionTypeName;
181 }
182
183 public void setTaxoTreeActionTypeName(String taxoTreeActionTypeName) {
184 this.taxoTreeActionTypeName = taxoTreeActionTypeName;
185 }
186
187
188
189
190 public boolean isEdit() {
191 return edit;
192 }
193
194
195
196
197
198 public void setEdit(boolean edit) {
199 this.edit = edit;
200 }
201 }