import org.apache.log4j.Logger;\r
\r
import com.indexdata.pz2utils4jsf.config.Pz2Configurator;\r
-import com.indexdata.pz2utils4jsf.config.Pz2ConfigureByMk2Config;\r
import com.indexdata.pz2utils4jsf.pazpar2.data.Pazpar2Error;\r
import com.indexdata.pz2utils4jsf.utils.Utils;\r
\r
REMOTE_SERVICE_DEF_NOT_FOUND,\r
LOCAL_SETTINGS_FILE_NOT_FOUND,\r
MASTERKEY_CONFIG_FILE_NOT_FOUND,\r
+ MISSING_MANDATORY_PARAMETER,\r
NOT_RESOLVED,\r
SKIP_SUGGESTIONS};\r
\r
this.configurator = configurator;\r
}\r
\r
- public ErrorHelper.ErrorCode getErrorCode(ApplicationError appError) {\r
+ public ErrorHelper.ErrorCode getErrorCode(ErrorInterface appError) {\r
if (appError.hasPazpar2Error()) {\r
Pazpar2Error pz2err = appError.getPazpar2Error();\r
String pz2errcode = pz2err.getCode();\r
return ErrorCode.LOCAL_SERVICE_DEF_FILE_NOT_FOUND; \r
} else if (appError.getMessage().contains("Cannot query Pazpar2 while there are configuration errors")) {\r
return ErrorCode.SKIP_SUGGESTIONS;\r
+ } else if (appError.getMessage().contains("Missing mandatory parameter")) {\r
+ return ErrorCode.MISSING_MANDATORY_PARAMETER;\r
}\r
return ErrorCode.NOT_RESOLVED;\r
}\r
\r
- public ArrayList<String> getSuggestions(ApplicationError error) {\r
+ public ArrayList<String> getSuggestions(ErrorInterface error) {\r
ArrayList<String> suggestions = new ArrayList<String>();\r
ErrorCode code = getErrorCode(error);\r
switch (code) {\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 NOT_RESOLVED:\r
suggestions.add("Unforeseen error situation. No suggestions prepared.");\r
break;\r