[Yanel-commits] rev 27307 - in public/yanel/trunk: conf src/core/java/org/wyona/yanel/core/map

simon at wyona.com simon at wyona.com
Wed Sep 12 15:18:31 CEST 2007


Author: simon
Date: 2007-09-12 15:18:30 +0200 (Wed, 12 Sep 2007)
New Revision: 27307

Modified:
   public/yanel/trunk/conf/spring-yanel-config.xml
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/Realm.java
Log:
see bug#5544 thanks to josias.

Modified: public/yanel/trunk/conf/spring-yanel-config.xml
===================================================================
--- public/yanel/trunk/conf/spring-yanel-config.xml	2007-09-12 11:38:43 UTC (rev 27306)
+++ public/yanel/trunk/conf/spring-yanel-config.xml	2007-09-12 13:18:30 UTC (rev 27307)
@@ -12,6 +12,7 @@
   <bean id="ACIdentitiesRepositoryFactory" class="org.wyona.yarep.core.RepositoryFactory">
     <!-- <constructor-arg type="java.lang.String" value="ac-identities-yarep.properties"/> -->
   </bean>
+  <bean id="ExtraRepositoryFactory" class="org.wyona.yarep.core.RepositoryFactory"/>
   <bean id="map" class="org.wyona.yanel.impl.map.MapImpl"/>
   <!--
   <bean id="policyManager" class="org.wyona.security.impl.PolicyManagerImpl"/>

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/Realm.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/Realm.java	2007-09-12 11:38:43 UTC (rev 27306)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/Realm.java	2007-09-12 13:18:30 UTC (rev 27307)
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import org.wyona.commons.io.FileUtil;
 import org.wyona.commons.io.Path;
@@ -109,6 +110,7 @@
         RepositoryFactory rtiRepoFactory = yanel.getRepositoryFactory("RTIRepositoryFactory");
         RepositoryFactory policiesRepoFactory = yanel.getRepositoryFactory("ACPoliciesRepositoryFactory");
         RepositoryFactory identitiesRepoFactory = yanel.getRepositoryFactory("ACIdentitiesRepositoryFactory");
+        RepositoryFactory extraRepoFactory = yanel.getRepositoryFactory("ExtraRepositoryFactory");
 
         String repoConfigSrc = config.getChild("data", false).getValue();
         File repoConfig = FileUtil.resolve(getConfigFile(), new File(repoConfigSrc));
@@ -169,6 +171,17 @@
             setRootDir(FileUtil.resolve(getConfigFile(), new File(rootDirConfig.getValue())));
         }
 
+        Configuration reposElement = config.getChild("yarep-repositories", false);
+        ArrayList repos = new ArrayList();
+        if (reposElement != null) {
+            Configuration[] repoElements = reposElement.getChildren("repository");
+            for (int i = 0; i < repoElements.length; i++) {
+                String id = repoElements[i].getAttribute("id");
+                String repoConfigPath = repoElements[i].getAttribute("config");
+                repoConfig = FileUtil.resolve(getConfigFile(), new File(repoConfigPath));
+                Repository repo = extraRepoFactory.newRepository(id, repoConfig);
+            }
+        }
     }
 
     /**
@@ -365,4 +378,14 @@
     public void setTranslationManager(TranslationManager translationManager) {
         this.translationManager = translationManager;
     }
+    
+    public Repository getRepository(String id) throws Exception {
+        Yanel yanel = Yanel.getInstance();
+        RepositoryFactory extraRepoFactory = yanel.getRepositoryFactory("ExtraRepositoryFactory");
+        if (extraRepoFactory.exists(id)) {
+            return extraRepoFactory.newRepository(id);
+        } else {
+            return null;
+        }
+    }
 }



More information about the Yanel-commits mailing list