KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > serverimpl > acl > DummyDocForAppliesToTest


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.serverimpl.acl;
17
18 import org.outerj.daisy.repository.*;
19 import org.outerx.daisy.x10.DocumentDocument;
20 import org.outerx.daisy.x10.CollectionDocument;
21 import org.outerx.daisy.x10.CollectionsDocument;
22
23 import java.util.Date JavaDoc;
24 import java.util.Map JavaDoc;
25
26 public class DummyDocForAppliesToTest implements Document {
27     private final static String JavaDoc FAIL_MSG = "Tried to access document information which is not available while testing 'applies to'. This is a bug in Daisy, please report it.";
28     private final long documentTypeId;
29     private final DocumentCollections documentCollections;
30
31     public DummyDocForAppliesToTest(long documentTypeId, long collectionId) {
32         this.documentTypeId = documentTypeId;
33         DocumentCollection[] collections = new DocumentCollection[1];
34         collections[0] = new DummyDocumentCollection(collectionId);
35         documentCollections = new DummyDocumentCollections(collections);
36     }
37
38     static final class DummyDocumentCollection implements DocumentCollection {
39         private final long id;
40
41         public DummyDocumentCollection(long id) {
42             this.id = id;
43         }
44
45         public long getId() {
46             return id;
47         }
48
49         public String JavaDoc getName() {
50             throw new RuntimeException JavaDoc(FAIL_MSG);
51         }
52
53         public void setName(String JavaDoc name) {
54             throw new RuntimeException JavaDoc(FAIL_MSG);
55         }
56
57         public void save() {
58             throw new RuntimeException JavaDoc(FAIL_MSG);
59         }
60
61         public CollectionDocument getXml() {
62             throw new RuntimeException JavaDoc(FAIL_MSG);
63         }
64
65         public Date JavaDoc getLastModified() {
66             throw new RuntimeException JavaDoc(FAIL_MSG);
67         }
68
69         public long getLastModifier() {
70             throw new RuntimeException JavaDoc(FAIL_MSG);
71         }
72
73         public long getUpdateCount() {
74             throw new RuntimeException JavaDoc(FAIL_MSG);
75         }
76     }
77
78     static final class DummyDocumentCollections implements DocumentCollections {
79         private final DocumentCollection[] collections;
80
81         public DummyDocumentCollections(DocumentCollection[] collections) {
82             this.collections = collections;
83         }
84
85         public DocumentCollection[] getArray() {
86             return collections;
87         }
88
89         public CollectionsDocument getXml() {
90             throw new RuntimeException JavaDoc(FAIL_MSG);
91         }
92     }
93
94     public long getId() {
95         throw new RuntimeException JavaDoc(FAIL_MSG);
96     }
97
98     public long getBranchId() {
99         throw new RuntimeException JavaDoc(FAIL_MSG);
100     }
101
102     public long getLanguageId() {
103         throw new RuntimeException JavaDoc(FAIL_MSG);
104     }
105
106     public VariantKey getVariantKey() {
107         throw new RuntimeException JavaDoc(FAIL_MSG);
108     }
109
110     public boolean isVariantNew() {
111         throw new RuntimeException JavaDoc(FAIL_MSG);
112     }
113
114     public AvailableVariants getAvailableVariants() throws RepositoryException {
115         throw new RuntimeException JavaDoc(FAIL_MSG);
116     }
117
118     public long getDocumentTypeId() {
119         return documentTypeId;
120     }
121
122     public void changeDocumentType(long documentTypeId) throws RepositoryException {
123         throw new RuntimeException JavaDoc(FAIL_MSG);
124     }
125
126     public void changeDocumentType(String JavaDoc documentTypeName) throws RepositoryException {
127         throw new RuntimeException JavaDoc(FAIL_MSG);
128     }
129
130     public String JavaDoc getName() {
131         throw new RuntimeException JavaDoc(FAIL_MSG);
132     }
133
134     public void setName(String JavaDoc name) {
135         throw new RuntimeException JavaDoc(FAIL_MSG);
136     }
137
138     public long getOwner() {
139         throw new RuntimeException JavaDoc(FAIL_MSG);
140     }
141
142     public void setOwner(long userId) {
143         throw new RuntimeException JavaDoc(FAIL_MSG);
144     }
145
146     public boolean isPrivate() {
147         throw new RuntimeException JavaDoc(FAIL_MSG);
148     }
149
150     public void setPrivate(boolean _private) {
151         throw new RuntimeException JavaDoc(FAIL_MSG);
152     }
153
154     public Date JavaDoc getCreated() {
155         throw new RuntimeException JavaDoc(FAIL_MSG);
156     }
157
158     public boolean isRetired() {
159         throw new RuntimeException JavaDoc(FAIL_MSG);
160     }
161
162     public void setRetired(boolean retired) {
163         throw new RuntimeException JavaDoc(FAIL_MSG);
164     }
165
166     public Date JavaDoc getLastModified() {
167         throw new RuntimeException JavaDoc(FAIL_MSG);
168     }
169
170     public long getLastModifier() {
171         throw new RuntimeException JavaDoc(FAIL_MSG);
172     }
173
174     public Date JavaDoc getVariantLastModified() {
175         throw new RuntimeException JavaDoc(FAIL_MSG);
176     }
177
178     public long getVariantLastModifier() {
179         throw new RuntimeException JavaDoc(FAIL_MSG);
180     }
181
182     public Versions getVersions() throws RepositoryException {
183         throw new RuntimeException JavaDoc(FAIL_MSG);
184     }
185
186     public Version getVersion(long id) throws RepositoryException {
187         throw new RuntimeException JavaDoc(FAIL_MSG);
188     }
189
190     public long getLastVersionId() {
191         throw new RuntimeException JavaDoc(FAIL_MSG);
192     }
193
194     public Version getLastVersion() throws RepositoryException {
195         throw new RuntimeException JavaDoc(FAIL_MSG);
196     }
197
198     public Version getLiveVersion() throws RepositoryException {
199         throw new RuntimeException JavaDoc(FAIL_MSG);
200     }
201
202     public long getLiveVersionId() {
203         throw new RuntimeException JavaDoc(FAIL_MSG);
204     }
205
206     public boolean canReadLiveOnly() {
207         throw new RuntimeException JavaDoc(FAIL_MSG);
208     }
209
210     public void setField(String JavaDoc name, Object JavaDoc value) throws DocumentTypeInconsistencyException {
211         throw new RuntimeException JavaDoc(FAIL_MSG);
212     }
213
214     public void setField(long fieldTypeId, Object JavaDoc value) throws DocumentTypeInconsistencyException {
215         throw new RuntimeException JavaDoc(FAIL_MSG);
216     }
217
218     public void deleteField(String JavaDoc name) {
219         throw new RuntimeException JavaDoc(FAIL_MSG);
220     }
221
222     public void deleteField(long fieldTypeId) {
223         throw new RuntimeException JavaDoc(FAIL_MSG);
224     }
225
226     public Field getField(String JavaDoc fieldTypeName) throws FieldNotFoundException {
227         throw new RuntimeException JavaDoc(FAIL_MSG);
228     }
229
230     public Field getField(long fieldTypeId) throws FieldNotFoundException {
231         throw new RuntimeException JavaDoc(FAIL_MSG);
232     }
233
234     public boolean hasField(long fieldTypeId) {
235         throw new RuntimeException JavaDoc(FAIL_MSG);
236     }
237
238     public boolean hasField(String JavaDoc fieldTypeName) {
239         throw new RuntimeException JavaDoc(FAIL_MSG);
240     }
241
242     public Fields getFields() {
243         throw new RuntimeException JavaDoc(FAIL_MSG);
244     }
245
246     public Fields getFieldsInOrder() {
247         throw new RuntimeException JavaDoc(FAIL_MSG);
248     }
249
250     public void save() throws RepositoryException {
251         throw new RuntimeException JavaDoc(FAIL_MSG);
252     }
253
254     public void save(boolean validate) throws RepositoryException {
255         throw new RuntimeException JavaDoc(FAIL_MSG);
256     }
257
258     public void validate() throws DocumentTypeInconsistencyException {
259         throw new RuntimeException JavaDoc(FAIL_MSG);
260     }
261
262     public void setNewVersionState(VersionState versionState) {
263         throw new RuntimeException JavaDoc(FAIL_MSG);
264     }
265
266     public VersionState getNewVersionState() {
267         throw new RuntimeException JavaDoc(FAIL_MSG);
268     }
269
270     public boolean lock(long duration, LockType lockType) throws RepositoryException {
271         throw new RuntimeException JavaDoc(FAIL_MSG);
272     }
273
274     public boolean releaseLock() throws RepositoryException {
275         throw new RuntimeException JavaDoc(FAIL_MSG);
276     }
277
278     public LockInfo getLockInfo(boolean fresh) throws RepositoryException {
279         throw new RuntimeException JavaDoc(FAIL_MSG);
280     }
281
282     public void setCustomField(String JavaDoc name, String JavaDoc value) {
283         throw new RuntimeException JavaDoc(FAIL_MSG);
284     }
285
286     public void deleteCustomField(String JavaDoc name) {
287         throw new RuntimeException JavaDoc(FAIL_MSG);
288     }
289
290     public String JavaDoc getCustomField(String JavaDoc name) {
291         throw new RuntimeException JavaDoc(FAIL_MSG);
292     }
293
294     public boolean hasCustomField(String JavaDoc name) {
295         throw new RuntimeException JavaDoc(FAIL_MSG);
296     }
297
298     public void clearCustomFields() {
299         throw new RuntimeException JavaDoc(FAIL_MSG);
300     }
301
302     public Map JavaDoc getCustomFields() {
303         throw new RuntimeException JavaDoc(FAIL_MSG);
304     }
305
306     public void setPart(String JavaDoc partTypeName, String JavaDoc mimeType, byte[] data) throws DocumentTypeInconsistencyException {
307         throw new RuntimeException JavaDoc(FAIL_MSG);
308     }
309
310     public void setPart(long partTypeId, String JavaDoc mimeType, byte[] data) throws DocumentTypeInconsistencyException {
311         throw new RuntimeException JavaDoc(FAIL_MSG);
312     }
313
314     public void setPart(String JavaDoc partTypeName, String JavaDoc mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException {
315         throw new RuntimeException JavaDoc(FAIL_MSG);
316     }
317
318     public void setPart(long partTypeId, String JavaDoc mimeType, PartDataSource partDataSource) throws DocumentTypeInconsistencyException {
319         throw new RuntimeException JavaDoc(FAIL_MSG);
320     }
321
322     public void setPartFileName(String JavaDoc partTypeName, String JavaDoc fileName) {
323         throw new RuntimeException JavaDoc(FAIL_MSG);
324     }
325
326     public void setPartFileName(long partTypeId, String JavaDoc fileName) {
327         throw new RuntimeException JavaDoc(FAIL_MSG);
328     }
329
330     public void setPartMimeType(String JavaDoc partTypeName, String JavaDoc mimeType) {
331         throw new RuntimeException JavaDoc(FAIL_MSG);
332     }
333
334     public void setPartMimeType(long partTypeId, String JavaDoc mimeType) {
335         throw new RuntimeException JavaDoc(FAIL_MSG);
336     }
337
338     public void deletePart(long partTypeId) {
339         throw new RuntimeException JavaDoc(FAIL_MSG);
340     }
341
342     public void deletePart(String JavaDoc name) {
343         throw new RuntimeException JavaDoc(FAIL_MSG);
344     }
345
346     public Part getPart(long partTypeId) throws PartNotFoundException {
347         throw new RuntimeException JavaDoc(FAIL_MSG);
348     }
349
350     public Part getPart(String JavaDoc name) throws PartNotFoundException {
351         throw new RuntimeException JavaDoc(FAIL_MSG);
352     }
353
354     public boolean hasPart(long partTypeId) {
355         throw new RuntimeException JavaDoc(FAIL_MSG);
356     }
357
358     public boolean hasPart(String JavaDoc name) {
359         throw new RuntimeException JavaDoc(FAIL_MSG);
360     }
361
362     public Parts getParts() {
363         throw new RuntimeException JavaDoc(FAIL_MSG);
364     }
365
366     public Parts getPartsInOrder() {
367         throw new RuntimeException JavaDoc(FAIL_MSG);
368     }
369
370     public void addLink(String JavaDoc title, String JavaDoc target) {
371         throw new RuntimeException JavaDoc(FAIL_MSG);
372     }
373
374     public void deleteLink(int index) {
375         throw new RuntimeException JavaDoc(FAIL_MSG);
376     }
377
378     public void clearLinks() {
379         throw new RuntimeException JavaDoc(FAIL_MSG);
380     }
381
382     public Links getLinks() {
383         throw new RuntimeException JavaDoc(FAIL_MSG);
384     }
385
386     public void addToCollection(DocumentCollection collection) {
387         throw new RuntimeException JavaDoc(FAIL_MSG);
388     }
389
390     public void removeFromCollection(DocumentCollection collection) {
391         throw new RuntimeException JavaDoc(FAIL_MSG);
392     }
393
394     public DocumentCollections getCollections() {
395         return documentCollections;
396     }
397
398     public boolean inCollection(DocumentCollection collection) {
399         throw new RuntimeException JavaDoc(FAIL_MSG);
400     }
401
402     public boolean inCollection(long collectionId) {
403         throw new RuntimeException JavaDoc(FAIL_MSG);
404     }
405
406     public DocumentDocument getXml() throws RepositoryException {
407         throw new RuntimeException JavaDoc(FAIL_MSG);
408     }
409
410     public DocumentDocument getXmlWithoutVariant() throws RepositoryException {
411         throw new RuntimeException JavaDoc(FAIL_MSG);
412     }
413
414     public DocumentDocument getXmlWithoutVersionedData() throws RepositoryException {
415         throw new RuntimeException JavaDoc(FAIL_MSG);
416     }
417
418     public DocumentDocument getXml(long versionId) throws RepositoryException {
419         throw new RuntimeException JavaDoc(FAIL_MSG);
420     }
421
422     public void clearCollections() {
423         throw new RuntimeException JavaDoc(FAIL_MSG);
424     }
425
426     public String JavaDoc getSummary() {
427         throw new RuntimeException JavaDoc(FAIL_MSG);
428     }
429
430     public long getVariantCreatedFromBranchId() {
431         throw new RuntimeException JavaDoc(FAIL_MSG);
432     }
433
434     public long getVariantCreatedFromLanguageId() {
435         throw new RuntimeException JavaDoc(FAIL_MSG);
436     }
437
438     public long getVariantCreatedFromVersionId() {
439         throw new RuntimeException JavaDoc(FAIL_MSG);
440     }
441
442     public long getUpdateCount() {
443         throw new RuntimeException JavaDoc(FAIL_MSG);
444     }
445
446     public long getVariantUpdateCount() {
447         throw new RuntimeException JavaDoc(FAIL_MSG);
448     }
449 }
450
Popular Tags