Return-Path: Delivered-To: apmail-sling-commits-archive@www.apache.org Received: (qmail 14995 invoked from network); 29 Apr 2010 08:30:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Apr 2010 08:30:41 -0000 Received: (qmail 6028 invoked by uid 500); 29 Apr 2010 08:30:41 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 5991 invoked by uid 500); 29 Apr 2010 08:30:41 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 5981 invoked by uid 99); 29 Apr 2010 08:30:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 08:30:40 +0000 X-ASF-Spam-Status: No, hits=-1393.6 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 08:30:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C64FD23889DA; Thu, 29 Apr 2010 08:29:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@sling.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100429082949.C64FD23889DA@eris.apache.org> 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(); this.scriptResolvers = new ConcurrentHashMap(); 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.