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.cms.core;
35
36 import info.magnolia.jcr.util.NodeTypes;
37
38 import java.io.Serializable;
39
40 import org.apache.jackrabbit.JcrConstants;
41
42
43
44
45
46
47 public final class ItemType implements Serializable {
48
49
50
51
52 public static final String NT_BASE = JcrConstants.NT_BASE;
53
54
55
56
57 public static final String NT_UNSTRUCTURED = JcrConstants.NT_UNSTRUCTURED;
58
59
60
61
62 public static final String NT_HIERARCHY = JcrConstants.NT_HIERARCHYNODE;
63
64
65
66
67 public static final String NT_FOLDER = NodeTypes.Folder.NAME;
68
69
70
71
72 public static final String NT_FILE = JcrConstants.NT_FILE;
73
74
75
76
77 public static final String NT_RESOURCE = NodeTypes.Resource.NAME;
78
79
80
81
82 public static final String NT_METADATA = NodeTypes.MetaData.NAME;
83
84
85
86
87 public static final ItemType WORKITEM = new ItemType("workItem");
88
89
90
91
92 public static final ItemType EXPRESSION = new ItemType("expression");
93
94
95
96
97 public static final String MIX_ACCESSCONTROLLABLE = MgnlNodeType.MIX_ACCESSCONTROLLABLE;
98
99
100
101
102 public static final String MIX_REFERENCEABLE = JcrConstants.MIX_REFERENCEABLE;
103
104
105
106
107 public static final String MIX_VERSIONABLE = JcrConstants.MIX_VERSIONABLE;
108
109 public static final String MIX_LOCKABLE = JcrConstants.MIX_LOCKABLE;
110
111 public static final String DELETED_NODE_MIXIN = NodeTypes.Deleted.NAME;
112
113
114
115
116 public static final String NT_CONTENT = NodeTypes.Content.NAME;
117
118 public static final String MGNL_NODE_DATA = MgnlNodeType.MGNL_NODE_DATA;
119
120 public static final String NT_FROZENNODE = JcrConstants.NT_FROZENNODE;
121
122 public static final String JCR_FROZENNODE = JcrConstants.JCR_FROZENNODE;
123
124 public static final String JCR_FROZEN_PRIMARY_TYPE = JcrConstants.JCR_FROZENPRIMARYTYPE;
125
126 public static final String JCR_PRIMARY_TYPE = JcrConstants.JCR_PRIMARYTYPE;
127
128 public static final String JCR_DATA = JcrConstants.JCR_DATA;
129
130
131
132
133
134
135 @Deprecated
136 public static final String NT_CONTENTNODE = NodeTypes.ContentNode.NAME;
137
138 public static final ItemType CONTENT = new ItemType(NT_CONTENT);
139
140 public static final ItemType CONTENTNODE = new ItemType(NT_CONTENTNODE);
141
142 public static final ItemType USER = new ItemType(NodeTypes.User.NAME);
143
144 public static final ItemType ROLE = new ItemType(NodeTypes.Role.NAME);
145
146 public static final ItemType GROUP = new ItemType(NodeTypes.Group.NAME);
147
148 public static final ItemType SYSTEM = new ItemType(NodeTypes.System.NAME);
149
150 public static final ItemType JCR_CONTENT = new ItemType(JcrConstants.JCR_CONTENT);
151
152 public static final ItemType FOLDER = new ItemType(NT_FOLDER);
153
154 public static final ItemType PAGE = new ItemType(NodeTypes.Page.NAME);
155 public static final ItemType AREA = new ItemType(NodeTypes.Area.NAME);
156 public static final ItemType COMPONENT = new ItemType(NodeTypes.Component.NAME);
157
158
159
160
161 private final String systemName;
162
163
164
165
166
167
168 public ItemType(String systemName) {
169 this.systemName = systemName;
170 }
171
172
173
174
175
176
177 public String getSystemName() {
178 return this.systemName;
179 }
180
181
182
183
184 @Override
185 public boolean equals(Object object) {
186 if (!(object instanceof ItemType)) {
187 return false;
188 }
189 ItemType rhs = (ItemType) object;
190 return this.systemName.equals(rhs.systemName);
191 }
192
193
194
195
196 @Override
197 public String toString() {
198 return this.systemName;
199 }
200
201
202
203
204 @Override
205 public int hashCode() {
206 return this.systemName.hashCode();
207 }
208
209 }