]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
580ce929e78574fbfa2d1c61ba4b74694ee1f7ff
[tmp/jakarta-migration.git] /
1 /**
2  * This document is a part of the source code and related artifacts
3  * for CollectionSpace, an open source collections management system
4  * for museums and related institutions:
5  *
6  * http://www.collectionspace.org
7  * http://wiki.collectionspace.org
8  *
9  * Copyright © 2009 Regents of the University of California
10  *
11  * Licensed under the Educational Community License (ECL), Version 2.0.
12  * You may not use this file except in compliance with this License.
13  *
14  * You may obtain a copy of the ECL 2.0 License at
15  * https://source.collectionspace.org/collection-space/LICENSE.txt
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 package org.collectionspace.services.jaxrs;
24
25 import org.collectionspace.services.account.AccountResource;
26 import org.collectionspace.services.blob.BlobResource;
27 import org.collectionspace.services.collectionobject.CollectionObjectResource;
28 import org.collectionspace.services.id.IDResource;
29 import org.collectionspace.services.media.MediaResource;
30 import org.collectionspace.services.note.NoteResource;
31 import org.collectionspace.services.group.GroupResource;
32 import org.collectionspace.services.intake.IntakeResource;
33 import org.collectionspace.services.loanin.LoaninResource;
34 import org.collectionspace.services.loanout.LoanoutResource;
35 import org.collectionspace.services.objectexit.ObjectExitResource;
36 import org.collectionspace.services.imports.ImportsResource;
37 import org.collectionspace.services.location.LocationAuthorityResource;
38 import org.collectionspace.services.taxonomy.TaxonomyAuthorityResource;
39 import org.collectionspace.services.movement.MovementResource;
40 import org.collectionspace.services.relation.RelationResource;
41 import org.collectionspace.services.report.ReportResource;
42 import org.collectionspace.services.acquisition.AcquisitionResource;
43 import org.collectionspace.services.dimension.DimensionResource;
44 import org.collectionspace.services.contact.ContactResource;
45 import org.collectionspace.services.vocabulary.VocabularyResource;
46 import org.collectionspace.services.organization.OrgAuthorityResource;
47 import org.collectionspace.services.person.PersonAuthorityResource;
48 import org.collectionspace.services.workflow.WorkflowResource;
49
50 //import org.collectionspace.services.query.QueryResource;
51
52 import javax.ws.rs.core.Application;
53 import java.util.HashSet;
54 import java.util.Set;
55
56 //import org.collectionspace.services.common.FileUtils;
57 import org.collectionspace.services.authorization.PermissionResource;
58 import org.collectionspace.services.authorization.RoleResource;
59 import org.collectionspace.services.common.security.SecurityInterceptor;
60 //import org.collectionspace.services.common.document.DocumentUtils;
61 //import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
62 //import org.collectionspace.services.common.profile.Profiler;
63
64 /**
65  * CollectionSpaceJaxRsApplication, the root application
66  * for enumerating Resource classes in the Services Layer,
67  * which in turn respond to and route REST-based requests.
68  *
69  * $LastChangedRevision$
70  * $LastChangedDate$
71  */
72 public class CollectionSpaceJaxRsApplication extends Application {
73
74     private Set<Object> singletons = new HashSet<Object>();
75     private Set<Class<?>> empty = new HashSet<Class<?>>();    
76
77     public CollectionSpaceJaxRsApplication() {          
78         //
79         // Instantiate all our JaxRS resources
80         //
81         singletons.add(new SecurityInterceptor());
82         singletons.add(new AccountResource());
83         singletons.add(new RoleResource());
84         singletons.add(new PermissionResource());
85         singletons.add(new VocabularyResource());
86         singletons.add(new ContactResource());
87         singletons.add(new PersonAuthorityResource());
88         singletons.add(new OrgAuthorityResource());
89         singletons.add(new CollectionObjectResource());
90         singletons.add(new GroupResource());
91         singletons.add(new IntakeResource());
92         singletons.add(new DimensionResource());
93         singletons.add(new RelationResource());
94         singletons.add(new NoteResource());
95         singletons.add(new LoaninResource());
96         singletons.add(new LoanoutResource());
97         singletons.add(new AcquisitionResource());
98         singletons.add(new ObjectExitResource());
99         singletons.add(new ImportsResource());
100         singletons.add(new MediaResource());
101         singletons.add(new BlobResource());
102         singletons.add(new MovementResource());
103         singletons.add(new ReportResource());
104         singletons.add(new LocationAuthorityResource());
105         singletons.add(new TaxonomyAuthorityResource());
106         singletons.add(new IDResource());
107         /*
108         singletons.add(new WorkflowResource());
109         */
110 //        singletons.add(new QueryResource());
111 //        singletons.add(new DomainIdentifierResource());
112 //        singletons.add(new PingResource());
113     }
114
115     @Override
116     public Set<Class<?>> getClasses() {
117         return empty;
118     }
119
120     @Override
121     public Set<Object> getSingletons() {
122         return singletons;
123     }
124 }
125