]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
590ca024734db1aa0e89cae34e09ef6e930268c2
[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.intake.IntakeResource;
32 import org.collectionspace.services.loanin.LoaninResource;
33 import org.collectionspace.services.loanout.LoanoutResource;
34 import org.collectionspace.services.objectexit.ObjectExitResource;
35 import org.collectionspace.services.location.LocationAuthorityResource;
36 import org.collectionspace.services.movement.MovementResource;
37 import org.collectionspace.services.report.ReportResource;
38 import org.collectionspace.services.relation.NewRelationResource;
39 import org.collectionspace.services.acquisition.AcquisitionResource;
40 import org.collectionspace.services.dimension.DimensionResource;
41 import org.collectionspace.services.contact.ContactResource;
42 import org.collectionspace.services.vocabulary.VocabularyResource;
43 import org.collectionspace.services.organization.OrgAuthorityResource;
44 import org.collectionspace.services.person.PersonAuthorityResource;
45
46 //import org.collectionspace.services.query.QueryResource;
47
48 import javax.ws.rs.core.Application;
49 import java.util.HashSet;
50 import java.util.Set;
51
52 import org.collectionspace.services.common.FileUtils;
53 import org.collectionspace.services.authorization.PermissionResource;
54 import org.collectionspace.services.authorization.RoleResource;
55 import org.collectionspace.services.common.security.SecurityInterceptor;
56 import org.collectionspace.services.common.document.DocumentUtils;
57 import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
58 import org.collectionspace.services.common.profile.Profiler;
59
60 /**
61  * CollectionSpaceJaxRsApplication, the root application
62  * for enumerating Resource classes in the Services Layer,
63  * which in turn respond to and route REST-based requests.
64  *
65  * $LastChangedRevision$
66  * $LastChangedDate$
67  */
68 public class CollectionSpaceJaxRsApplication extends Application {
69
70     private Set<Object> singletons = new HashSet<Object>();
71     private Set<Class<?>> empty = new HashSet<Class<?>>();    
72
73     public CollectionSpaceJaxRsApplication() {          
74         //
75         // Instantiate all our JaxRS resources
76         //
77         singletons.add(new SecurityInterceptor());
78         singletons.add(new AccountResource());
79         singletons.add(new RoleResource());
80         singletons.add(new PermissionResource());
81         singletons.add(new CollectionObjectResource());
82         singletons.add(new IDResource());
83         singletons.add(new NoteResource());
84         singletons.add(new IntakeResource());
85         singletons.add(new LoaninResource());
86         singletons.add(new LoanoutResource());
87         singletons.add(new ObjectExitResource());
88         singletons.add(new LocationAuthorityResource());
89         singletons.add(new MediaResource());
90         singletons.add(new BlobResource());
91         singletons.add(new MovementResource());
92         singletons.add(new ReportResource());
93         singletons.add(new AcquisitionResource());
94         singletons.add(new NewRelationResource());
95         singletons.add(new VocabularyResource());
96         singletons.add(new OrgAuthorityResource());
97         singletons.add(new PersonAuthorityResource());
98         singletons.add(new DimensionResource());
99         singletons.add(new ContactResource());
100
101 //        singletons.add(new QueryResource());
102 //        singletons.add(new DomainIdentifierResource());
103 //        singletons.add(new PingResource());
104     }
105
106     @Override
107     public Set<Class<?>> getClasses() {
108         return empty;
109     }
110
111     @Override
112     public Set<Object> getSingletons() {
113         return singletons;
114     }
115 }
116