- case PAZPAR2_404:\r
- suggestions.add("Pazpar2 service not found (404). ");\r
- suggestions.add("Please check the PAZPAR2_URL configuration and verify "\r
- + "that a pazpar2 service is running at the given address.");\r
- addConfigurationDocumentation(suggestions); \r
- break;\r
- case PAZPAR2_UNEXPECTED_RESPONSE:\r
- suggestions.add("Unexpected response code from Pazpar2. " + nl\r
- + "Please check the PAZPAR2_URL configuration and verify "\r
- + "that a pazpar2 service is running at the given address." + nl);\r
- break; \r
- case MASTERKEY_CONFIG_FILE_NOT_FOUND: \r
- suggestions.add("The main configuration file that is looked up using parameters" +\r
- " in web.xml (MASTERKEY_ROOT_CONFIG_DIR,MASTERKEY_COMPONENT_CONFIG_DIR,MASTERKEY_CONFIG_FILE_NAME)" +\r
- " could not be found. Please check the web.xml parameters and the expected file system location. "); \r
- break;\r
- case LOCAL_SERVICE_DEF_FILE_NOT_FOUND:\r
- suggestions.add("The service definition file could not be loaded.");\r
- suggestions.add("Please check the configuration and verify that the file exists");\r
- addConfigurationDocumentation(suggestions); \r
- break;\r
- case REMOTE_SERVICE_DEF_NOT_FOUND:\r
- break;\r
- case LOCAL_SETTINGS_FILE_NOT_FOUND:\r
- suggestions.add("A configuration using local target settings file was found, but " +\r
- " the file itself could not be found. Please check the configuration.");\r
- addConfigurationDocumentation(suggestions);\r
- break;\r
- case MISSING_MANDATORY_PARAMETER:\r
- suggestions.add("A mandatory configuration parameter was not found in the MK2 config properties" +\r
- " file used. Please check the property file for the parameter given in the error message ");\r
- addConfigurationDocumentation(suggestions);\r
- break;\r
- case MISSING_MK2_CONFIG_INIT_PARAMETER:\r
- suggestions.add("A mandatory init parameter was not found in the deployment descriptor (web.xml)." +\r
- " Following init parameters must be present in web.xml when using the Masterkey (MK2) configuration scheme:" +\r
- " MASTERKEY_ROOT_CONFIG_DIR (i.e. '/etc/masterkey'), MASTERKEY_COMPONENT_CONFIG_DIR (i.e. '/myapp'), " +\r
- "MASTERKEY_CONFIG_FILE_NAME (i.e. 'myapp.properties'"); \r
- break;\r
- case NOT_RESOLVED:\r
- suggestions.add("Unforeseen error situation. No suggestions prepared.");\r
- break;\r
- case SKIP_SUGGESTIONS:\r
- break;\r
- case PAZPAR2_12: \r
- suggestions.add("The Pazpar2 service does not have a service definition with the requested ID ");\r
- suggestions.add("Please check the service ID set in the configuration and compare it with the " +\r
- " pazpar2 (server side) configuration.");\r
- addConfigurationDocumentation(suggestions); \r
- break;\r
- case PAZPAR2_ERRORS:\r
- if (error.hasPazpar2Error()) {\r
- if (error.getPazpar2Error().getCode().equals("0")) {\r
- \r
+ case MISSING_MK2_CONFIG_INIT_PARAMETER:\r
+ suggestions.add("A mandatory init parameter (context-param) was not found in the deployment descriptor (web.xml)." +\r
+ " Following init parameters must be present when using the MasterKey configuration scheme (Pz2ConfigureByMk2Config):" +\r
+ " MASTERKEY_ROOT_CONFIG_DIR (i.e. '/etc/masterkey'), MASTERKEY_COMPONENT_CONFIG_DIR (i.e. '/myapp'), " +\r
+ " MASTERKEY_CONFIG_FILE_NAME (i.e. 'myapp.properties'"); \r
+ break;\r
+ case MISSING_CONTEXT_PARAMETER:\r
+ suggestions.add("A mandatory init parameter (context-param) was not found in the deployment descriptor (web.xml)." +\r
+ " Following init parameters must be present when using Pz2ConfigureByWebXml:" +\r
+ " PAZPAR2_URL, PAZPAR2_SERVICE_ID"); \r
+ break;\r
+ case MISSING_MANDATORY_PROPERTY:\r
+ suggestions.add("A mandatory configuration parameter was not found in the MK2 config properties" +\r
+ " file used. Please check the property file for the parameter given in the error message ");\r
+ addConfigurationDocumentation(suggestions);\r
+ break; \r
+ case MASTERKEY_CONFIG_FILE_NOT_FOUND: \r
+ suggestions.add("The main configuration file that is looked up using parameters" +\r
+ " in web.xml (MASTERKEY_ROOT_CONFIG_DIR,MASTERKEY_COMPONENT_CONFIG_DIR,MASTERKEY_CONFIG_FILE_NAME)" +\r
+ " could not be found. Please check the web.xml parameters and the expected file system location. "); \r
+ break;\r
+ case LOCAL_SERVICE_DEF_FILE_NOT_FOUND:\r
+ suggestions.add("The service definition file could not be loaded.");\r
+ suggestions.add("Please check the configuration and verify that the file exists");\r
+ addConfigurationDocumentation(suggestions); \r
+ break;\r
+ case REMOTE_SERVICE_DEF_NOT_FOUND:\r
+ break;\r
+ case LOCAL_SETTINGS_FILE_NOT_FOUND:\r
+ suggestions.add("A configuration using local target settings file was found, but " +\r
+ " the file itself could not be found. Please check the configuration.");\r
+ addConfigurationDocumentation(suggestions);\r
+ break;\r
+ case PAZPAR2_404:\r
+ suggestions.add("Pazpar2 service not found (404). ");\r
+ suggestions.add("Please check the PAZPAR2_URL configuration and verify "\r
+ + "that a pazpar2 service is running at the given address.");\r
+ addConfigurationDocumentation(suggestions); \r
+ break;\r
+ case PAZPAR2_UNEXPECTED_RESPONSE:\r
+ suggestions.add("Unexpected response code from Pazpar2. " + nl\r
+ + "Please check the PAZPAR2_URL configuration and verify "\r
+ + "that a pazpar2 service is running at the given address." + nl);\r
+ break; \r
+ case PAZPAR2_ERRORS:\r
+ if (error.hasPazpar2Error()) {\r
+ String pz2code = error.getPazpar2Error().getCode();\r
+ switch (pz2code) {\r
+ case "3":\r
+ suggestions.add("Query terms not supported.");\r
+ break;\r
+ case "12":\r
+ suggestions.add("The Pazpar2 server does not have a service defined by the requested ID ");\r
+ suggestions.add("Please check the service ID set in the configuration and compare it with the " +\r
+ " configuration on the Pazpar2 server-side.");\r
+ addConfigurationDocumentation(suggestions); \r
+ break; \r
+ default:\r
+ suggestions.add("Pazpar2 error: " + error.getPazpar2Error().getMsg() + " (Pazpar2 # "+error.getPazpar2Error().getCode()+")");\r
+ }\r
+ break;\r
+ } else {\r
+ logger.error("Programming problem. An application error was categorized as a Papzar2 error yet does not have Pazpar2 error information as expected.");\r