Author: keith
Date: Sun Jan  6 01:23:41 2008
New Revision: 11881

Log:

Fixing bug reported by Beren where mashups of newly created users are nt 
deployed.



Modified:
   
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java

Modified: 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
==============================================================================
--- 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
   (original)
+++ 
trunk/mashup/java/modules/core/src/org/wso2/mashup/transport/MashupServerInitializer.java
   Sun Jan  6 01:23:41 2008
@@ -45,6 +45,26 @@
                 .getParameterValue(RegistryConstants.REGISTRY);
 
         try {
+
+            String[] userNames = realm.getUserStoreAdmin().getAllUserNames();
+            for (int i = 0; i < userNames.length; i++) {
+                String username = userNames[i];
+                if (RegistryConstants.ANONYMOUS_USER.equals(username) ||
+                        MashupConstants.SYSTEM_USER.equals(username) ||
+                        MashupConstants.SAMPLES_USER.equals(username)) {
+                    continue;
+                }
+                DeploymentEngine deploymentEngine =
+                        (DeploymentEngine) 
configurationContext.getAxisConfiguration()
+                                .getConfigurator();
+                ArrayList arrayList = new ArrayList(1);
+                arrayList.add("js");
+                HashMap map = 
deploymentEngine.getDirectoryToExtensionMappingMap();
+                HashMap newMap = (HashMap) map.clone();
+                newMap.put("scripts/" + username, arrayList);
+                deploymentEngine.setDirectoryToExtensionMappingMap(newMap);
+            }
+            
             // Applying a dummy tag so that searching works
             // https://wso2.org/jira/browse/REGISTRY-24
             SecureRegistry secureRegistry =
@@ -94,25 +114,6 @@
             secureRegistry.applyTag("/mashups/samples/yahooGeoCode", 
"geocode");
             secureRegistry.applyTag("/mashups/samples/yahooGeoCode", "sample");
             secureRegistry.applyTag("/mashups/samples/yahooGeoCode", "maps");
-
-            String[] userNames = realm.getUserStoreAdmin().getAllUserNames();
-            for (int i = 0; i < userNames.length; i++) {
-                String username = userNames[i];
-                if (RegistryConstants.ANONYMOUS_USER.equals(username) ||
-                        MashupConstants.SYSTEM_USER.equals(username) ||
-                        MashupConstants.SAMPLES_USER.equals(username)) {
-                    continue;
-                }
-                DeploymentEngine deploymentEngine =
-                        (DeploymentEngine) 
configurationContext.getAxisConfiguration()
-                                .getConfigurator();
-                ArrayList arrayList = new ArrayList(1);
-                arrayList.add("js");
-                HashMap map = 
deploymentEngine.getDirectoryToExtensionMappingMap();
-                HashMap newMap = (HashMap) map.clone();
-                newMap.put("scripts/" + username, arrayList);
-                deploymentEngine.setDirectoryToExtensionMappingMap(newMap);
-            }
         } catch (UserManagerException e) {
             log.error("Error deploying user nashups", e);
         } catch (RegistryException e) {

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to