aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-07-03 12:47:58 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-07-03 12:47:58 +0200
commita1ee0567607fe43909cd7fc1b75ace3197a2fa0b (patch)
tree46eb59136ead983aada956c6238cfa434e440d9e /id/server/moa-id-commons
parent409e23a07616387d675e065ceac7172997fef5b7 (diff)
downloadmoa-id-spss-a1ee0567607fe43909cd7fc1b75ace3197a2fa0b.tar.gz
moa-id-spss-a1ee0567607fe43909cd7fc1b75ace3197a2fa0b.tar.bz2
moa-id-spss-a1ee0567607fe43909cd7fc1b75ace3197a2fa0b.zip
fix some configuration problems
Diffstat (limited to 'id/server/moa-id-commons')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java19
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java6
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java11
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java6
6 files changed, 25 insertions, 21 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java
index 801e765c3..d5ea2342a 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java
@@ -28,11 +28,13 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.transaction.annotation.Transactional;
/**
* @author tlenz
*
*/
+@Transactional("transactionManager")
public abstract class AbstractConfigurationImpl implements Configuration {
private static final Logger logger = LoggerFactory
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
index 59c6687d5..974646ef0 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
@@ -218,6 +218,10 @@ public class ConfigurationMigrationUtils {
result.put(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE, Boolean.FALSE.toString());
}
+ //convert KeyBoxSelector
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_KEYBOXIDENTIFIER,
+ oa.getKeyBoxIdentifier().value());
+
//convert securtiyLayer templates
TemplatesType templates = oaauth.getTemplates();
if (templates != null) {
@@ -1172,16 +1176,19 @@ public class ConfigurationMigrationUtils {
if (seclayer != null) {
List<TransformsInfoType> list = seclayer.getTransformsInfo();
if (!list.isEmpty()) {
- try {
+// try {
+ //TODO: check if Transformation is always BASE64 encoded
+// result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64,
+// Base64Utils.encode(list.get(0).getTransformation()));
result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64,
- Base64Utils.encode(list.get(0).getTransformation()));
+ new String(list.get(0).getTransformation()));
result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME,
list.get(0).getFilename());
-
- } catch (IOException e) {
- Logger.warn("AuthBlockTransformation can not converted.", e);
- }
+// } catch (IOException e) {
+// Logger.warn("AuthBlockTransformation can not converted.", e);
+//
+// }
} else {
Logger.warn("AuthBlockTransformation can not converted.");
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
index 884587d36..78eec24ee 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
@@ -244,9 +244,9 @@ public final class MOAIDConfigurationConstants {
public static final String GENERAL_PROTOCOLS_PVP2X_METADATA = GENERAL_PROTOCOLS_PVP2X + ".metadata";
public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".servicename";
public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG = GENERAL_PROTOCOLS_PVP2X_METADATA + ".org";
- public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".name.short";
- public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".name.full";
- public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X_METADATA + ".url";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".name.short";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".name.full";
+ public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".url";
public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT = GENERAL_PROTOCOLS_PVP2X_METADATA + ".contact";
public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT + ".familyname";
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java
index 2a8cd9c1c..7dbbac5b4 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java
@@ -37,7 +37,7 @@ public class MigrationTest {
public static void main(String[] args) {
- String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_test.xml";
+ String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_labda_12.05.2015.xml";
String outputFile = "D:/Projekte/svn/moa-id/MOAID-3.0_config.propery";
String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id/moa-id.properties";
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
index 06e174942..832c82e78 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
@@ -9,8 +9,6 @@ import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import org.springframework.stereotype.Component;
-import org.springframework.stereotype.Repository;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
import at.gv.egiz.components.configuration.api.Configuration;
@@ -25,8 +23,7 @@ import at.gv.egovernment.moa.logging.Logger;
* The implementation of a key-value configuration implementing the {@link Configuration} interface.
* It employs the {@link ConfigPropertyDao} to persist configuration data.
*/
-@Repository
-@EnableTransactionManagement
+@Component
@Transactional("transactionManager")
public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implements MOAIDConfiguration {
@@ -52,8 +49,8 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement
}
- TypedQuery<ConfigProperty> configQuery = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class);
- configQuery.setParameter("key", preFix + ".%");
+ TypedQuery<ConfigProperty> configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class);
+ configQuery.setParameter("key", preFix + "%");
List<ConfigProperty> configResult = configQuery.getResultList();
if (configResult == null || configResult.isEmpty()) {
@@ -83,7 +80,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement
}
- TypedQuery<ConfigProperty> configQuery = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class);
+ TypedQuery<ConfigProperty> configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class);
configQuery.setParameter("key", searchKey.replace("*", "%"));
List<ConfigProperty> configResult = configQuery.getResultList();
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java
index 72cb2fdf4..8e845478b 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java
@@ -6,12 +6,9 @@ import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
-import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
import at.gv.egiz.components.configuration.api.AbstractConfigurationImpl;
@@ -96,7 +93,8 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl {
property.setKey(key);
property.setValue(value);
log.debug("Storing '{}'.", property.toString());
- em.persist(property);
+// em.persist(property);
+ em.merge(property);
}