import com.indexdata.masterkey.config.MasterkeyConfiguration;\r
import com.indexdata.masterkey.config.ModuleConfiguration;\r
import com.indexdata.pz2utils4jsf.utils.Utils;\r
+import static com.indexdata.pz2utils4jsf.utils.Utils.nl;\r
\r
@Named @SessionScoped @Alternative\r
public class Pz2ConfigureByMk2Config implements Pz2Configurator {\r
private static final long serialVersionUID = 8865086878660568870L;\r
private static Logger logger = Logger.getLogger(Pz2ConfigureByMk2Config.class);\r
private Pz2Config pz2config = null;\r
+ private String configFilePathAndName = "none";\r
\r
public Pz2ConfigureByMk2Config () throws IOException {\r
logger.info(Utils.objectId(this) + " is instantiating Pazpar2 service configuration by MasterKey configuration scheme.");\r
\r
private void createConfig () throws IOException {\r
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\r
- ServletContext servletContext = (ServletContext) externalContext.getContext(); \r
+ ServletContext servletContext = (ServletContext) externalContext.getContext(); \r
MasterkeyConfiguration mkConfigContext =\r
MasterkeyConfiguration.getInstance(servletContext,\r
"pazpar-application-jsf", ((HttpServletRequest) externalContext.getRequest()).getServerName());\r
+ configFilePathAndName = mkConfigContext.getConfigFileLocation().getConfigFilePath();\r
ModuleConfiguration moduleConfig = mkConfigContext.getModuleConfiguration("pz2client");\r
pz2config = new Pz2Config(moduleConfig);\r
logger.info(document());\r
\r
public List<String> document() {\r
List<String> doc = new ArrayList<String>();\r
- \r
- doc.add("-- App set to access Pazpar2 at: " +pz2config.get("PAZPAR2_URL"));\r
+ doc.add("Attempted to configure service using the file " + configFilePathAndName);\r
+ doc.add(nl+"-- Configured to access Pazpar2 at: " +pz2config.get("PAZPAR2_URL"));\r
if (pz2config.get("PAZPAR2_SERVICE_XML") != null) {\r
- doc.add("-- App set to use the service definition contained in " + pz2config.getConfigFilePath() + "/" + pz2config.get("PAZPAR2_SERVICE_XML"));\r
+ doc.add(nl+"-- Configured to use the service definition contained in " + pz2config.getConfigFilePath() + "/" + pz2config.get("PAZPAR2_SERVICE_XML"));\r
if (pz2config.get("PAZPAR2_SETTINGS_XML") != null) {\r
- doc.add("-- App set to use the target settings contained in " + pz2config.getConfigFilePath() + "/" + pz2config.get("PAZPAR2_SETTINGS_XML"));\r
+ doc.add(nl+"-- Configured to use the target settings contained in " + pz2config.getConfigFilePath() + "/" + pz2config.get("PAZPAR2_SETTINGS_XML"));\r
} else {\r
- doc.add("-- App set to use the server side target settings as defined in the service definition.");\r
+ doc.add(nl+"-- Configured to use the server side target settings as defined in the service definition.");\r
}\r
} else if (pz2config.get("PAZPAR2_SERVICE_ID") != null) {\r
- doc.add("-- App set to use the server side service definition identified by service id \""+pz2config.get("PAZPAR2_SERVICE_ID") + "\"");\r
+ doc.add(nl+"-- Configured to use the server side service definition identified by service id \""+pz2config.get("PAZPAR2_SERVICE_ID") + "\"");\r
} else {\r
- doc.add("Error: Did not find service ID nor service definition XML file to set up pazpar2 service.");\r
+ doc.add(nl+"Error: Did not find service ID nor service definition XML file for setting up a pazpar2 service.");\r
}\r
return doc;\r
}\r