sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1657585 - /sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java
Date Thu, 05 Feb 2015 14:35:19 GMT
Author: bdelacretaz
Date: Thu Feb  5 14:35:18 2015
New Revision: 1657585

URL: http://svn.apache.org/r1657585
Log:
SLING-4386 - put tenant search path in front

Modified:
    sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java

Modified: sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java?rev=1657585&r1=1657584&r2=1657585&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java
(original)
+++ sling/whiteboard/bdelacretaz/multisling2015/cdtenants/src/main/java/org/apache/sling/ms2015/cdtenants/impl/ContentDrivenTenantImpl.java
Thu Feb  5 14:35:18 2015
@@ -18,9 +18,9 @@
  */
 package org.apache.sling.ms2015.cdtenants.impl;
 
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
 
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.resource.Resource;
@@ -83,8 +83,14 @@ public class ContentDrivenTenantImpl imp
         }
         
         // Compute search + exec path based on the tenant's list of modules
-        final Set<String> sp = new HashSet<String>();
-        final Set<String> ep = new HashSet<String>();
+        final List<String> sp = new ArrayList<String>();
+        final List<String> ep = new ArrayList<String>();
+        
+        // Add this tenant's custom scripts location to the search + exec path,
+        // before other paths so scripts found there override modules scripts
+        final String tenantSearchPath = tenantPath + SCRIPTS_PATH_SUFFIX;
+        sp.add(tenantSearchPath);
+        ep.add(tenantSearchPath);
         
         for(String m : modules) {
             final String modulePath = MODULES_ROOT_PATH + "/" + m;
@@ -110,10 +116,8 @@ public class ContentDrivenTenantImpl imp
             }
         }
         
-        // Add this tenant's custom scripts location to the search + exec path
-        final String tenantSearchPath = tenantPath + SCRIPTS_PATH_SUFFIX;
-        sp.add(tenantSearchPath);
-        ep.add(tenantSearchPath);
+        // TODO sp and ep might have duplicates at this point, we should remove
+        // them for efficiency
         
         this.searchPath = normalizePath(sp.toArray(EMPTY_STRING_ARRAY));
         this.executionPath = normalizePath(ep.toArray(EMPTY_STRING_ARRAY));



Mime
View raw message