View Javadoc
1   package org.kuali.ole.sip2.constants;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.sip2.service.NettyServer;
5   import org.kuali.ole.sip2.service.OLENettyServer;
6   import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator;
7   import org.kuali.rice.coreservice.api.parameter.Parameter;
8   import org.kuali.rice.coreservice.api.parameter.ParameterKey;
9   
10  /**
11   * CreCated by sheiksalahudeenm on 12/30/14.
12   */
13  public class OLESIP2Constants {
14  
15      public static OLENettyServer olesip2Server = null;
16      public static NettyServer sip2Server = null;
17  
18      public static final String NON_ROMAN_REGEX="[^\\w\\s\\-_,:\\(\\)\\[\\]\\/\\!]";
19      public static final String SIP2_FORMAT = "sip";
20      public static final String SIP_SERVICE = "sipService";
21      public static final String REQUEST_DATA = "requestData";
22      public static final String LOGIN_USER = "loginUser";
23      public static final String FAIL_TO_LOAD = "Failed to start Socket server";
24      public static final String SERVER_RUNNING = "Server Status: Socket Server is Running";
25      public static final String REFRESH_PAGE = "Already request is send by someone else to start server. Please wait for few seconds and refresh the page";
26      public static final String STARTED_SUCCESSFULLY = "Socket server started Successfully";
27      public static final String PROBLEM_WITH_SERVER = "Problem with starting Socket Server";
28      public static final String PARAMETER_MISSING = "Some parameters are missing from request";
29      public static final String SERVER_STOPPED = "Server Status: Socket Server Stopped";
30      public static final String SERVER_DOWN = "Server Status: Socket Server is Down";
31      public static final String INSTITUTION = getParameter("SIP2_INSTITUTION_NAME");  
32      public static final String REQUEST_TYPE = getParameter("SIP2_REQUEST_TYPE");  
33      public static final String OPERATOR_ID = getParameter("SIP2_OPERATOR_ID"); 
34      public static String ALREADY_REQUEST_PROCESSING = "N";
35      public static final String SIP2_DATE_FORMAT = "yyyyMMdd    HHmmss";
36      public static final String SPLIT = "|";
37  
38      //SIP Version
39      public static final String SIP_VERSION = "2.00";
40      //YES or NO
41      public static final String Y="Y";
42      public static final String N="N";
43  
44      public static final String TIME_OUT_PERIOD="600";
45      public static final String RETRIES_ALLOWED="010";
46      public static final String ACS_SCREEN_MSG="System is Available";
47  
48      //SIP2 Codes
49      public static final String PATRON_IDENTIFIER_CODE="AA";
50      public static final String ITEM_IDENTIFIER_CODE="AB";
51      public static final String TERMINAL_PWD_CODE="AC";
52      public static final String PATRON_PWD_CODE="AD";
53      public static final String PERSONAL_NAME_CODE="AE";
54      public static final String SCREEN_MSG_CODE="AF";
55      public static final String PRINT_LINE_CODE="AG";
56      public static final String DUE_DATE_CODE="AH";
57      public static final String TITLE_IDENTIFIER_CODE="AJ";
58      public static final String BLOCKED_CARD_MSG="AL";
59      public static final String LIBRARY_NAME_CODE="AN";
60      public static final String TERMINAL_LOCATION_CODE="AM";
61      public static final String INSTITUTION_ID_CODE="AO";
62      public static final String CURRENT_LOCATION_CODE="AP";
63      public static final String PERMANENT_LOCATION_CODE="AQ";
64      public static final String HOLE_ITEMS_CODE="AS";
65      public static final String OVERDUE_ITEMS_CODE="AT";
66      public static final String CHARGED_ITEMS_CODE="AU";
67      public static final String FINE_ITEMS_CODE="AV";
68      public static final String SEQUENCE_NUM_CODE="AY";
69      public static final String CHECKSUM_CODE="AZ";
70      public static final String HOME_ADDRESS_CODE="BD";
71      public static final String EMAIL_ADDRESS_CODE="BE";
72      public static final String HOME_PHONE_NUM_CODE="BF";
73      public static final String OWNER_CODE="BG";
74      public static final String CURRENCY_TYPE_CODE="BH";
75      public static final String CANCEL_CODE="BI";
76      public static final String TRANSACTION_ID_CODE="BK";
77      public static final String VALID_PATRON_CODE="BL";
78      public static final String RENEWED_ITEMS_CODE="BM";
79      public static final String UN_RENEWED_ITEMS_CODE="BN";
80      public static final String FEE_ACKNOWLEDGED_CODE="BO";
81      public static final String START_ITEM_CODE="BP";
82      public static final String END_ITEM_CODE="BQ";
83      public static final String QUEUE_POSITION_CODE="BR";
84      public static final String PICKUP_LOCATION_CODE="BS";
85      public static final String FEE_TYPE_CODE="BT";
86      public static final String RECALL_ITEMS_CODE="BU";
87      public static final String FEE_AMOUNT_CODE="BV";
88      public static final String EXPIRATION_DATE_CODE="BW";
89      public static final String SUPPORTED_MSG_CODE="BX";
90      public static final String HOLD_TYPE_CODE="BY";
91      public static final String HOLD_ITEMS_LIMIT_CODE="BZ";
92      public static final String OVERDUE_ITEMS_LIMIT_CODE="CA";
93      public static final String CHARGED_ITEMS_LIMIT_CODE="CB";
94      public static final String FEE_LIMIT_CODE="CC";
95      public static final String UN_AVA_HOLD_ITEMS_CODE="CD";
96      public static final String HOLD_QUEUE_LENGTH_CODE="CF";
97      public static final String FEE_IDENTIFIER_CODE="CG";
98      public static final String ITEM_PROPERTIES_CODE="CH";
99      public static final String SECURITY_INHIBIT_CODE="CI";
100     public static final String RECALL_DATE_CODE="CJ";
101     public static final String MEDIA_TYPE_CODE="CK";
102     public static final String SORT_BIN_CODE="CL";
103     public static final String HOLD_PICKUP_DATE_CODE="CM";
104     public static final String LOGIN_USER_ID_CODE="CN";
105     public static final String LOGIN_PWD_ID_CODE="CO";
106     public static final String LOCATION_CODE_SIP="CP";
107     public static final String VALID_PATRON_PWD="CQ";
108 
109     //SIP2 Request Code
110     public static final String PATRON_STATUS_REQUEST="23";
111     public static final String CHECKOUT_REQUEST="11";
112     public static final String CHECK_IN_REQUEST="09";
113     public static final String BLOCK_PATRON_REQUEST="01";
114     public static final String SC_STATUS_REQUEST="99";
115     public static final String ACS_REQUEST="97";
116     public static final String LOGIN_REQUEST="93";
117     public static final String PATRON_INFORMATION_REQUEST="63";
118     public static final String END_PATRON_SESSION_REQUEST="35";
119     public static final String FEE_PAID_REQUEST="37";
120     public static final String ITEM_INFORMATION_REQUEST="17";
121     public static final String ITEM_STATUS_UPDATE_REQUEST="19";
122     public static final String PATRON_ENABLE_REQUEST="25";
123     public static final String HOLD_REQUEST="15";
124     public static final String RENEW_REQUEST="29";
125     public static final String RENEW_ALL_REQUEST="65";
126 
127     //SIP2 Response Code
128     public static final String PATRON_STATUS_RESPONSE="24";
129     public static final String CHECKOUT_RESPONSE="12";
130     public static final String CHECK_IN_RESPONSE="10";
131     public static final String ACS_STATUS_RESPONSE="98";
132     public static final String SC_RESEND_RESPONSE="96";
133     public static final String LOGIN_RESPONSE="94";
134     public static final String PATRON_INFORMATION_RESPONSE="64";
135     public static final String END_PATRON_SESSION_RESPONSE="36";
136     public static final String FEE_PAID_RESPONSE="38";
137     public static final String ITEM_INFORMATION_RESPONSE="18";
138     public static final String ITEM_STATUS_UPDATE_RESPONSE="20";
139     public static final String PATRON_ENABLE_RESPONSE="26";
140     public static final String HOLD_RESPONSE="16";
141     public static final String RENEW_RESPONSE="30";
142     public static final String RENEW_ALL_RESPONSE="66";
143 
144     //SIP2 Hold Type
145     public static final String ADD_HOLD="add";
146     public static final String DELETE_HOLD="delete";
147     public static final String UPDATE_HOLD="updateHold";
148 
149     public static final String CHECK_IN_SUCCESS="SuccessFully Checked-in";
150     public static final String RENEW_SUCCESS="Item successFully renewed";
151     public static final String CHECK_OUT_SUCCESS="Successfully loaned";
152     public static final String CHECK_OUT_SUCCESSFULLY="Item Successfully loaned";
153     public static final String CHECK_OUT_FAILED="Item cannot be loaned : any query see help desk";
154     public static final String PATRON_SESSION_END="Patron Session Ended Successfully";
155     public static final String FEE_PAID="Successfully Paid the Amount";
156     public static final String SERVICE_ERROR="Cannot Able to process this service";
157     public static final String REQUEST_RAISED="Request Raised Succesfully";
158     public static final String SUCCESSFULLY="Succesfully";
159     public static final String SERVICE_UNAVAILABLE="Update Hold Request Service Currently Not Available in OLE";
160     public static final String ITEM_UNAVAILABLE="Item is Not Available";
161     public static final String ITEM_SERVICE_NOT_SUPPORTED="Item Status Update Service - Not supported in OLE";
162     public static final String PATRON_ENABLED="Patron Enabled successfully";
163     public static final String YES="YES";
164     public static final String ONHOLD="ONHOLD";
165     public static final String REQUEST_PROCESSED="Requested process completed successfully.";
166 
167     public static String getParameter(String name) {
168         ParameterKey parameterKey = ParameterKey.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT,name);
169         Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
170         if(parameter==null){
171             parameterKey = ParameterKey.create(OLEConstants.APPL_ID_OLE, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT,name);
172             parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
173         }
174         return parameter!=null?parameter.getValue():null;
175     }
176 }