]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
efe97c7d6105cb3f95792ad7a70a603c4f301943
[tmp/jakarta-migration.git] /
1 /**
2  * LocationAuthorityClient.java
3  *
4  * This document is a part of the source code and related artifacts for
5  * CollectionSpace, an open source collections management system for museums and
6  * related institutions:
7  *
8  * http://www.collectionspace.org http://wiki.collectionspace.org
9  *
10  * Copyright © 2009 The Regents of the University of California
11  *
12  * Licensed under the Educational Community License (ECL), Version 2.0. You may
13  * not use this file except in compliance with this License.
14  *
15  * You may obtain a copy of the ECL 2.0 License at
16  * https://source.collectionspace.org/collection-space/LICENSE.txt
17  */
18 package org.collectionspace.services.client;
19
20 import org.collectionspace.services.location.LocationauthoritiesCommon;
21 import org.collectionspace.services.location.LocationsCommon;
22
23 /**
24  * The Class LocationAuthorityClient.
25  */
26 public class LocationAuthorityClient extends AuthorityClientImpl<LocationauthoritiesCommon, LocationsCommon, LocationAuthorityProxy> {
27
28     public static final String SERVICE_NAME = "locationauthorities";
29     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
30     public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
31     public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
32     public static final String TERM_INFO_GROUP_XPATH_BASE = "locTermGroupList";
33     //
34     // Subitem constants
35     //
36     public static final String SERVICE_ITEM_NAME = "locations";
37     public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
38     //
39     // Payload Part/Schema part names
40     //
41     public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
42             + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
43     public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
44             + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
45
46     //
47     // Constructors
48     //
49     public LocationAuthorityClient() throws Exception {
50         super();
51     }
52     
53     public LocationAuthorityClient(String clientPropertiesFilename) throws Exception {
54                 super(clientPropertiesFilename);
55         }
56
57     @Override
58     public String getServiceName() {
59         return SERVICE_NAME;
60     }
61
62     @Override
63     public String getServicePathComponent() {
64         return SERVICE_PATH_COMPONENT;
65     }
66
67     @Override
68     public String getItemCommonPartName() {
69         return getCommonPartName(SERVICE_ITEM_NAME);
70     }
71
72     @Override
73     public Class<LocationAuthorityProxy> getProxyClass() {
74         return LocationAuthorityProxy.class;
75     }
76
77     @Override
78     public String getInAuthority(LocationsCommon item) {
79         return item.getInAuthority();
80     }
81
82     @Override
83     public void setInAuthority(LocationsCommon item, String inAuthorityCsid) {
84         item.setInAuthority(inAuthorityCsid);
85     }
86
87         @Override
88         public String createAuthorityInstance(String shortIdentifier, String displayName) {
89                 PoxPayloadOut poxPayloadout = LocationAuthorityClientUtils.createLocationAuthorityInstance(displayName, shortIdentifier, SERVICE_COMMON_PART_NAME);
90                 return poxPayloadout.asXML();
91         }
92
93         @Override
94         public String createAuthorityItemInstance(String shortIdentifier, String displayName) {
95                 // TODO Auto-generated method stub
96                 return null;
97         }
98 }