sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r939228 - in /sling/trunk/bundles/servlets/resolver/src/main: java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java resources/OSGI-INF/metatype/metatype.properties
Date Thu, 29 Apr 2010 08:29:49 GMT
Author: cziegeler
Date: Thu Apr 29 08:29:49 2010
New Revision: 939228

URL: http://svn.apache.org/viewvc?rev=939228&view=rev
Log:
Check workspace name for empty script, convert properties into boolean props and add metatype
information.

Modified:
    sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
    sling/trunk/bundles/servlets/resolver/src/main/resources/OSGI-INF/metatype/metatype.properties

Modified: sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java?rev=939228&r1=939227&r2=939228&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
Thu Apr 29 08:29:49 2010
@@ -132,15 +132,19 @@ public class SlingServletResolver implem
     public static final String PROP_DEFAULT_SCRIPT_WORKSPACE = "servletresolver.defaultScriptWorkspace";
 
     /**
-     * @scr.property options true="True" false="False"
+     * @scr.property valueRef="DEFAULT_USE_REQUEST_WORKSPACE"
      */
     public static final String PROP_USE_REQUEST_WORKSPACE = "servletresolver.useRequestWorkspace";
 
+    private static final boolean DEFAULT_USE_REQUEST_WORKSPACE = false;
+
     /**
-     * @scr.property options true="True" false="False"
+     * @scr.property valueRef="DEFAULT_USE_DEFAULT_WORKSPACE"
      */
     public static final String PROP_USE_DEFAULT_WORKSPACE = "servletresolver.useDefaultWorkspace";
 
+    private static final boolean DEFAULT_USE_DEFAULT_WORKSPACE = false;
+
     /**
      * The default servlet root is the first search path (which is usally /apps)
      */
@@ -814,13 +818,16 @@ public class SlingServletResolver implem
 
         }
 
-        this.useDefaultWorkspace = OsgiUtil.toBoolean(properties.get(PROP_USE_DEFAULT_WORKSPACE),
false);
-        this.useRequestWorkspace = OsgiUtil.toBoolean(properties.get(PROP_USE_REQUEST_WORKSPACE),
false);
+        this.useDefaultWorkspace = OsgiUtil.toBoolean(properties.get(PROP_USE_DEFAULT_WORKSPACE),
DEFAULT_USE_DEFAULT_WORKSPACE);
+        this.useRequestWorkspace = OsgiUtil.toBoolean(properties.get(PROP_USE_REQUEST_WORKSPACE),
DEFAULT_USE_REQUEST_WORKSPACE);
 
         this.scriptSessions = new ConcurrentHashMap<String, Session>();
         this.scriptResolvers = new ConcurrentHashMap<String, WorkspaceResourceResolver>();
 
         String defaultWorkspaceProp = (String) properties.get(PROP_DEFAULT_SCRIPT_WORKSPACE);
+        if ( defaultWorkspaceProp != null && defaultWorkspaceProp.trim().length()
== 0 ) {
+            defaultWorkspaceProp = null;
+        }
         this.defaultScriptSession = createScriptSession(defaultWorkspaceProp);
 
         // we load the workspaceName out of the session to ensure the value is

Modified: sling/trunk/bundles/servlets/resolver/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=939228&r1=939227&r2=939228&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/main/resources/OSGI-INF/metatype/metatype.properties
(original)
+++ sling/trunk/bundles/servlets/resolver/src/main/resources/OSGI-INF/metatype/metatype.properties
Thu Apr 29 08:29:49 2010
@@ -47,4 +47,16 @@ servletresolver.scriptUser.description =
 servletresolver.cacheSize.name = Cache Size
 servletresolver.cacheSize.description = This property configures the size of the \
  cache used for script resolution. A value lower than 5 disables the cache.
- 
\ No newline at end of file
+
+servletresolver.defaultScriptWorkspace.name = Script Workspace
+servletresolver.defaultScriptWorkspace.description = The workspace name which \
+ should be used as a default for script resolution.
+
+servletresolver.useRequestWorkspace.name = Use Request Workspace
+servletresolver.useRequestWorkspace.description = If enabled, the primary workspace \
+ name for script resolution will be the same as that used to resolve the request's resource.
+
+servletresolver.useDefaultWorkspace.name = Use Default Workspace
+servletresolver.useDefaultWorkspace.description = If enabled and if use request workspace
\
+ is enabled and no scripts are found using the request workspace, also use the default workspace.
\
+ If use request workspace is disabled, this value is ignored.



Mime
View raw message