Enabled matchInfo service without availability check.

Change-Id: If26dfac2553312f22fe59e1a5c6f4094550d91e2
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 586d08f..24f631a 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -165,27 +165,37 @@
         ldapConfig = properties.getProperty("ldap.config");
         
         // EM: regex for matching availability in Krill matches
-        freeLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.free",""));
-        publicLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.public",""));
-        allLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.all",""));
+        setPattern(properties.getProperty("kustvakt.regex.free",""), freeLicensePattern);
+        setPattern(properties.getProperty("kustvakt.regex.public",""), publicLicensePattern);
+        setPattern(properties.getProperty("kustvakt.regex.all",""), allLicensePattern);
         
         // EM: not use in the future
         //policyConfig = properties.getProperty("policies.config");
         //setFoundriesAndLayers(policyConfig);
         
-        KUSTVAKT_USER.put(Attributes.ID, Integer.parseInt(properties.getProperty("kustvakt.init.user.id")));
-        KUSTVAKT_USER.put(Attributes.USERNAME, properties.getProperty("kustvakt.init.user.username"));
-        KUSTVAKT_USER.put(Attributes.PASSWORD, properties.getProperty("kustvakt.init.user.password"));
-        KUSTVAKT_USER.put(Attributes.EMAIL, properties.getProperty("kustvakt.init.user.email"));
-        KUSTVAKT_USER.put(Attributes.COUNTRY, properties.getProperty("kustvakt.init.user.country"));
-        KUSTVAKT_USER.put(Attributes.ADDRESS, properties.getProperty("kustvakt.init.user.address"));
-        KUSTVAKT_USER.put(Attributes.FIRSTNAME, properties.getProperty("kustvakt.init.user.firstname"));
-        KUSTVAKT_USER.put(Attributes.LASTNAME, properties.getProperty("kustvakt.init.user.lastname"));
-        KUSTVAKT_USER.put(Attributes.INSTITUTION, properties.getProperty("kustvakt.init.user.institution"));
-        KUSTVAKT_USER.put(Attributes.IS_ADMIN, properties.getProperty("kustvakt.init.user.admin"));
+//        KUSTVAKT_USER.put(Attributes.ID, Integer.parseInt(properties.getProperty("kustvakt.init.user.id")));
+//        KUSTVAKT_USER.put(Attributes.USERNAME, properties.getProperty("kustvakt.init.user.username"));
+//        KUSTVAKT_USER.put(Attributes.PASSWORD, properties.getProperty("kustvakt.init.user.password"));
+//        KUSTVAKT_USER.put(Attributes.EMAIL, properties.getProperty("kustvakt.init.user.email"));
+//        KUSTVAKT_USER.put(Attributes.COUNTRY, properties.getProperty("kustvakt.init.user.country"));
+//        KUSTVAKT_USER.put(Attributes.ADDRESS, properties.getProperty("kustvakt.init.user.address"));
+//        KUSTVAKT_USER.put(Attributes.FIRSTNAME, properties.getProperty("kustvakt.init.user.firstname"));
+//        KUSTVAKT_USER.put(Attributes.LASTNAME, properties.getProperty("kustvakt.init.user.lastname"));
+//        KUSTVAKT_USER.put(Attributes.INSTITUTION, properties.getProperty("kustvakt.init.user.institution"));
+//        KUSTVAKT_USER.put(Attributes.IS_ADMIN, properties.getProperty("kustvakt.init.user.admin"));
         return properties;
     }
 
+    private void setPattern (String patternStr, Pattern pattern) {
+        if (!patternStr.isEmpty()){
+            pattern = Pattern.compile(patternStr);    
+        }
+        else{
+            pattern = null;
+        }
+        
+    }
+
     public void setFoundriesAndLayers(String config) throws IOException {
     	foundries = new ArrayList<String>();
     	layers = new ArrayList<String>();
diff --git a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index 355ce67..eca0a23 100644
--- a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -43,7 +43,6 @@
     // todo: use korap.config to get index location
     public SearchKrill (String path) {
     	
-//    	System.out.println("Debug: SearchKrill: path='" + path + "'.");
         try {
             if (path.equals(":temp:")) {
                 this.index = new KrillIndex();
diff --git a/src/main/resources/default-config.xml b/src/main/resources/default-config.xml
index 98a5d92..a688882 100644
--- a/src/main/resources/default-config.xml
+++ b/src/main/resources/default-config.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
-	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:p="http://www.springframework.org/schema/p" 
+	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop" 
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans" 
+	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:cache="http://www.springframework.org/schema/cache"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
@@ -41,8 +44,8 @@
 				<value>classpath:jdbc.properties</value>
 				<value>classpath:hibernate.properties</value>
 				<!-- <value>file:./jdbc.properties</value> -->
-				<value>file:./kustvakt.conf</value>
 				<value>classpath:kustvakt.conf</value>
+				<value>file:./kustvakt.conf</value>
 			</array>
 		</property>
 	</bean>