From: Niels Erik G. Nielsen Date: Tue, 12 Mar 2013 19:06:31 +0000 (-0400) Subject: Experimenting with tomcat/jboss/glassfish X-Git-Tag: v0.0.7~211^2 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=23d3b19cec1870969a3783d7070b23137c90a86c;p=mkjsf-moved-to-github.git Experimenting with tomcat/jboss/glassfish --- diff --git a/pom.xml b/pom.xml index 42a9c9a..3f686e4 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,9 @@ - src + target + target/classes + src/main/java src diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2Config.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2Config.java index c293649..4585fc0 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2Config.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2Config.java @@ -29,7 +29,7 @@ public class Pz2Config implements ModuleConfigurationGetter, Serializable { } public Pz2Config (Map parameters) { - logger.debug(Utils.objectId(this) + " being constructed with parameter map argument"); + //logger.debug(Utils.objectId(this) + " being constructed with parameter map argument"); setDefaults(); for (String key : parameters.keySet()) { properties.put(key, parameters.get(key)); @@ -87,7 +87,7 @@ public class Pz2Config implements ModuleConfigurationGetter, Serializable { @Override public String getConfigFilePath() { - return moduleConfig.getConfigFilePath(); + return ""; // moduleConfig.getConfigFilePath(); } diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByHardcoding.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByHardcoding.java new file mode 100644 index 0000000..354543b --- /dev/null +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByHardcoding.java @@ -0,0 +1,52 @@ +/** + * + */ +package com.indexdata.pz2utils4jsf.config; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.enterprise.context.SessionScoped; +import javax.enterprise.inject.Alternative; +import javax.inject.Named; + +@Named @SessionScoped @Alternative +public class Pz2ConfigureByHardcoding implements Pz2Configurator { + + /** + * + */ + private static final long serialVersionUID = -3833516705975419652L; + private Pz2Config pz2config = null; + + + @Override + public Pz2Config getConfig() throws IOException { + if (pz2config == null) { + createConfig(); + } + return pz2config; + } + + private void createConfig () throws IOException { + Map parameters = new HashMap(); + parameters.put("PAZPAR2_URL", "http://mk2-test.indexdata.com/test-pazpar2/"); + parameters.put("PAZPAR2_SERVICE_ID", "jsfdemo"); + pz2config = new Pz2Config(parameters); + } + + + /* (non-Javadoc) + * @see com.indexdata.pz2utils4jsf.config.Pz2Configurator#document() + */ + @Override + public List document() { + List docs = new ArrayList(); + docs.add("No docs"); + return docs; + } + +} diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByMk2Config.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByMk2Config.java index a085561..df0099d 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByMk2Config.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByMk2Config.java @@ -51,7 +51,7 @@ public class Pz2ConfigureByMk2Config implements Pz2Configurator { public List document() { List doc = new ArrayList(); - + doc.add("Application was configured using the file "+ pz2config.getConfigFilePath()); doc.add("-- App set to access Pazpar2 at: " +pz2config.get("PAZPAR2_URL")); if (pz2config.get("PAZPAR2_SERVICE_XML") != null) { doc.add("-- App set to use the service definition contained in " + pz2config.getConfigFilePath() + "/" + pz2config.get("PAZPAR2_SERVICE_XML")); diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByWebXml.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByWebXml.java index ff38ae7..4845ad0 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByWebXml.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Pz2ConfigureByWebXml.java @@ -27,6 +27,7 @@ public class Pz2ConfigureByWebXml implements Pz2Configurator { logger.info("Instantiating Pazpar2 service configuration by web.xml parameters"); } + @Override public Pz2Config getConfig() throws IOException { if (pz2config == null) { createConfig();