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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
24 package org.collectionspace.services.vocabulary;
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;
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;
63 * The Class VocabularyResource.
65 @Path("/vocabularies")
66 @Consumes("multipart/mixed")
67 @Produces("multipart/mixed")
68 public class VocabularyResource extends
69 AuthorityResource<VocabulariesCommon, VocabulariesCommonList, VocabularyitemsCommonList,
70 VocabularyItemDocumentModelHandler> {
72 private final static String vocabularyServiceName = "vocabularies";
73 private final static String VOCABULARIES_COMMON = "vocabularies_common";
75 private final static String vocabularyItemServiceName = "vocabularyitems";
76 private final static String VOCABULARYITEMS_COMMON = "vocabularyitems_common";
79 final Logger logger = LoggerFactory.getLogger(VocabularyResource.class);
82 * Instantiates a new VocabularyResource.
84 public VocabularyResource() {
85 super(VocabulariesCommon.class, VocabularyResource.class,
86 VOCABULARIES_COMMON, VOCABULARYITEMS_COMMON);
90 * @see org.collectionspace.services.common.AbstractCollectionSpaceResourceImpl#getServiceName()
93 public String getServiceName() {
94 return vocabularyServiceName;
98 * Gets the item service name.
100 * @return the item service name
103 public String getItemServiceName() {
104 return vocabularyItemServiceName;
108 * @see org.collectionspace.services.common.CollectionSpaceResource#getCommonPartClass()
111 public Class<VocabulariesCommon> getCommonPartClass() {
112 return VocabulariesCommon.class;