1 package org.kuali.ole.loaders.common.constants;
2
3 import org.kuali.ole.OLEPropertyConstants;
4 import org.kuali.rice.core.api.config.property.ConfigContext;
5
6 import java.text.DateFormat;
7 import java.text.SimpleDateFormat;
8
9
10
11
12 public class OLELoaderConstants {
13
14 public static final String API_ROOT = ConfigContext.getCurrentContextConfig().getProperty(OLEPropertyConstants.OLE_URL_BASE) + "/api";
15 public static final String LOCATION_URI = API_ROOT + "/location";
16 public static final String LOCATION_LEVEL_URI = API_ROOT + "/locationLevel";
17 public static final String SHELVING_SCHEME_URI = API_ROOT + "/callNumberType";
18 public static final String ITEM_TYPE_URI = API_ROOT + "/itemType";
19 public static final String BORROWER_TYPE_URI = API_ROOT + "/borrowerType";
20 public static final String ITEM_STATUS_URI = API_ROOT + "/itemAvailabilityStatus";
21 public static final String STAT_SEARCH_CODE_URI = API_ROOT + "/statSearchCode";
22 public static final String BIB_RECORD_STATUS_URI = API_ROOT + "/bibStatus";
23 public static final String PATRON_URI = API_ROOT + "/patron";
24
25 public static final String SLASH = "/";
26
27
28 public static final class OLEloaderStatus{
29 public static final int LOCATION_NOT_EXIST = 404;
30 public static final int LOCATION_LEVEL_NOT_EXIST = 404;
31 public static final int PARENT_LOCATION_NOT_EXIST = 404;
32 public static final int LOCATION_SUCCESS = 200;
33 public static final int LOCATION_FAILED = 500;
34 public static final int LOCATION_INVALID_CONTENT = 400;
35 public static final int PARENT_LOCATION_LEVEL_NOT_EXIST = 404;
36 public static final int PARENT_LOCATION_LEVEL_ALREADY_EXIST = 500;
37 public static final int LOCATION_LEVEL_SUCCESS = 200;
38 public static final int LOCATION_LEVEL_FAILED = 500;
39 public static final int SHELVING_SCHEME_NOT_EXIST = 404;
40 public static final int SHELVING_SCHEME_SUCCESS = 200;
41 public static final int SHELVING_SCHEME_FAILED = 500;
42 public static final int SHELVING_SCHEME_INVALID_CONTENT = 400;
43
44 public static final int PATRON_NOT_EXIST = 404;
45 public static final int PATRON_SUCCESS = 200;
46 public static final int PATRON_FAILED = 500;
47 public static final int PATRON_INVALID_CONTENT = 500;
48
49 public static final int BORROWER_TYPE_NOT_EXIST = 404;
50 public static final int BORROWER_TYPE_SUCCESS = 200;
51 public static final int BORROWER_TYPE_FAILED = 500;
52 public static final int BORROWER_TYPE_INVALID_CONTENT = 500;
53
54 public static final int ITEM_STATUS_NOT_EXIST = 404;
55 public static final int ITEM_STATUS_SUCCESS = 200;
56 public static final int ITEM_STATUS_FAILED = 500;
57 public static final int ITEM_STATUS_INVALID_CONTENT = 500;
58
59 public static final int STAT_SEARCH_CODE_NOT_EXIST = 404;
60 public static final int STAT_SEARCH_CODE_SUCCESS = 200;
61 public static final int STAT_SEARCH_CODE_FAILED = 500;
62 public static final int STAT_SEARCH_CODE_INVALID_CONTENT = 500;
63
64 public static final int BIB_RECORD_STATUS_NOT_EXIST = 404;
65 public static final int BIB_RECORD_STATUS_SUCCESS = 200;
66 public static final int BIB_RECORD_STATUS_FAILED = 500;
67 public static final int BIB_RECORD_STATUS_INVALID_CONTENT = 500;
68
69 public static final int ITEM_TYPE_NOT_EXIST = 404;
70 public static final int ITEM_TYPE_SUCCESS = 200;
71 public static final int ITEM_TYPE_FAILED = 500;
72 public static final int ITEM_TYPE_INVALID_CONTENT = 500;
73
74 public static final int BAD_REQUEST = 400;
75 public static final int INVALID_BOOLEAN = 400;
76 public static final int INVALID_DATE = 400;
77 }
78
79 public static final class OLEloaderMessage {
80 public static final String LOCATION_NOT_EXIST = "Location does not exist";
81 public static final String LOCATION_LEVEL_NOT_EXIST = "Location level does not exist.";
82 public static final String PARENT_LOCATION_NOT_EXIST = "Parent Location does not exist.";
83 public static final String LOCATION_SUCCESS= "Successfully Updated the location.";
84 public static final String LOCATION_FAILED = "Location update failed.";
85 public static final String LOCATION_INVALID_CONTENT = "Invalid Input Content for location import";
86 public static final String PARENT_LOCATION_LEVEL_NOT_EXIST = "Parent Location Level does not exist.";
87 public static final String PARENT_LOCATION_LEVEL_ALREADY_EXIST = "Parent Location Level already exist with same code.";
88 public static final String LOCATION_LEVEL_SUCCESS = "Successfully Updated the location level";
89 public static final String LOCATION_LEVEL_FAILED = "Location Level update failed.";
90 public static final String SHELVING_SCHEME_NOT_EXIST = "Shelving Scheme does not exist";
91 public static final String SHELVING_SCHEME_SUCCESS = "Successfully Updated the shelving scheme.";
92 public static final String SHELVING_SCHEME_FAILED = "Shelving scheme update failed.";
93 public static final String SHELVING_SCHEME_INVALID_CONTENT = "Invalid input content for shelving scheme import";
94
95 public static final String PATRON_NOT_EXIST = "Patron does not exits.";
96 public static final String PATRON_SUCCESS = "Successfully Updated the patron.";
97 public static final String PATRON_FAILED = "Patron update failed.";
98 public static final String PATRON_INVALID_CONTENT = "Invalid input content for Patron import";
99 public static final String PATRON_ID_INVALID = "Invalid patron id";
100 public static final String PATRON_EXIST = "Patron already exist";
101 public static final String PATRON_INVALID_SALARY = "Invalid salary amount";
102
103 public static final String BORROWER_TYPE_NOT_EXIST = "Borrower type does not exits.";
104 public static final String BORROWER_TYPE_SUCCESS = "Successfully Updated the Borrower type.";
105 public static final String BORROWER_TYPE_FAILED = "Borrower type update failed.";
106 public static final String BORROWER_TYPE_INVALID_CONTENT = "Invalid input content for Borrower type import";
107
108 public static final String ITEM_STATUS_NOT_EXIST = "Item available status does not exits.";
109 public static final String ITEM_STATUS_SUCCESS = "Successfully Updated the item available status.";
110 public static final String ITEM_STATUS_FAILED = "Item available status update failed.";
111 public static final String ITEM_STATUS_INVALID_CONTENT = "Invalid input content for item available status import";
112
113 public static final String ITEM_TYPE_NOT_EXIST = "Item type does not exits.";
114 public static final String ITEM_TYPE_SUCCESS = "Successfully Updated the Item type.";
115 public static final String ITEM_TYPE_FAILED = "Item type update failed.";
116 public static final String ITEM_TYPE_INVALID_CONTENT = "Invalid input content for Item type import";
117
118 public static final String STAT_SEARCH_CODE_NOT_EXIST = "Statistical Search Code does not exits.";
119 public static final String STAT_SEARCH_CODE_SUCCESS = "Successfully Updated the Statistical Search Code.";
120 public static final String STAT_SEARCH_CODE_FAILED = "Statistical Search Code update failed.";
121 public static final String STAT_SEARCH_CODE_INVALID_CONTENT = "Invalid input content for Statistical Search Code";
122
123 public static final String BIB_RECORD_STATUS_NOT_EXIST = "Bibliographic Record Status does not exits.";
124 public static final String BIB_RECORD_STATUS_SUCCESS = "Successfully Updated the bibliographic record status.";
125 public static final String BIB_RECORD_STATUS_FAILED = "Bibliographic record status update failed.";
126 public static final String BIB_RECORD_STATUS_INVALID_CONTENT = "Invalid input content for bibliographic record status";
127
128 public static final String BAD_REQUEST = "Bad Request";
129 public static final String INVALID_BOOLEAN = "Invalid content for boolean field";
130 public static final String INVALID_DATE = "Invalid content/format for date field";
131 }
132
133 public static final class OLELoaderContext {
134
135 public static String LOCATION = "http://ole.kuali.org/standards/api/location.jsonld";
136 public static String LOCATION_LEVEL = "http://ole.kuali.org/standards/api/locationLevel.jsonld";
137 public static String ITEM_TYPE = "http://ole.kuali.org/standards/api/itemType.jsonld";
138 public static String ITEM_STATUS = "http://ole.kuali.org/standards/api/itemAvailabilityStatus.jsonld";
139 public static String SHELVING_SCHEME = "http://ole.kuali.org/standards/api/callNumberType.jsonld";
140 public static String STAT_SEARCH_CODE = "http://ole.kuali.org/standards/api/statSearchCode.jsonld";
141 public static String BIB_RECORD_STATUS = "http://ole.kuali.org/standards/api/bibStatus.jsonld";
142 public static String BORROWER_TYPE = "http://ole.kuali.org/standards/api/borrowerType.jsonld";
143 public static String PATRON = "http://ole.kuali.org/standards/api/patron.jsonld";
144 public static String CIRCULATION_DESK = "http://ole.kuali.org/standards/api/circulationDesk.jsonld";
145 }
146
147 public static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
148
149
150 }