]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
595db523b50d0ce91849c792f6edf014ff1193a3
[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 University of California at Berkeley
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
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 package org.collectionspace.services.vocabulary;
25
26 import javax.ws.rs.Consumes;
27 import javax.ws.rs.DELETE;
28 import javax.ws.rs.GET;
29 import javax.ws.rs.POST;
30 import javax.ws.rs.PUT;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.PathParam;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.WebApplicationException;
36 import javax.ws.rs.core.Context;
37 import javax.ws.rs.core.MultivaluedMap;
38 import javax.ws.rs.core.Response;
39 import javax.ws.rs.core.UriBuilder;
40 import javax.ws.rs.core.UriInfo;
41
42 import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema;
43 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
44 import org.collectionspace.services.common.vocabulary.AuthorityResource;
45 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
46 import org.collectionspace.services.common.ClientType;
47 import org.collectionspace.services.common.ServiceMain;
48 import org.collectionspace.services.common.context.ServiceContext;
49 import org.collectionspace.services.common.document.BadRequestException;
50 import org.collectionspace.services.common.document.DocumentFilter;
51 import org.collectionspace.services.common.document.DocumentHandler;
52 import org.collectionspace.services.common.document.DocumentNotFoundException;
53 import org.collectionspace.services.common.security.UnauthorizedException;
54 import org.collectionspace.services.common.query.IQueryManager;
55 import org.collectionspace.services.vocabulary.nuxeo.VocabularyItemDocumentModelHandler;
56 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
57 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
58 import org.jboss.resteasy.util.HttpResponseCodes;
59 import org.slf4j.Logger;
60 import org.slf4j.LoggerFactory;
61
62 /**
63  * The Class VocabularyResource.
64  */
65 @Path("/vocabularies")
66 @Consumes("multipart/mixed")
67 @Produces("multipart/mixed")
68 public class VocabularyResource extends 
69         AuthorityResource<VocabulariesCommon, VocabulariesCommonList, VocabularyitemsCommonList,
70                                                 VocabularyItemDocumentModelHandler> {
71
72     private final static String vocabularyServiceName = "vocabularies";
73         private final static String VOCABULARIES_COMMON = "vocabularies_common";
74     
75     private final static String vocabularyItemServiceName = "vocabularyitems";
76         private final static String VOCABULARYITEMS_COMMON = "vocabularyitems_common";
77     
78     /** The logger. */
79     final Logger logger = LoggerFactory.getLogger(VocabularyResource.class);
80
81         /**
82          * Instantiates a new VocabularyResource.
83          */
84         public VocabularyResource() {
85                 super(VocabulariesCommon.class, VocabularyResource.class,
86                                 VOCABULARIES_COMMON, VOCABULARYITEMS_COMMON);
87         }
88
89     /* (non-Javadoc)
90      * @see org.collectionspace.services.common.AbstractCollectionSpaceResourceImpl#getServiceName()
91      */
92     @Override
93     public String getServiceName() {
94         return vocabularyServiceName;
95     }
96
97     /**
98      * Gets the item service name.
99      * 
100      * @return the item service name
101      */
102     @Override
103     public String getItemServiceName() {
104         return vocabularyItemServiceName;
105     }
106     
107         /* (non-Javadoc)
108          * @see org.collectionspace.services.common.CollectionSpaceResource#getCommonPartClass()
109          */
110         @Override
111         public Class<VocabulariesCommon> getCommonPartClass() {
112                 return VocabulariesCommon.class;
113         }
114
115 }