Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@locus.apache.org Received: (qmail 38924 invoked from network); 4 Apr 2008 22:23:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Apr 2008 22:23:20 -0000 Received: (qmail 61499 invoked by uid 500); 4 Apr 2008 22:23:20 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 61465 invoked by uid 500); 4 Apr 2008 22:23:20 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 61456 invoked by uid 99); 4 Apr 2008 22:23:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2008 15:23:20 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2008 22:22:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A22011A9832; Fri, 4 Apr 2008 15:22:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r644959 - in /incubator/sling/trunk/api/src/main/java/org/apache/sling/api: SlingHttpServletRequest.java wrappers/SlingHttpServletRequestWrapper.java Date: Fri, 04 Apr 2008 22:22:55 -0000 To: sling-commits@incubator.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080404222255.A22011A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmeschbe Date: Fri Apr 4 15:22:50 2008 New Revision: 644959 URL: http://svn.apache.org/viewvc?rev=644959&view=rev Log: SLING-363 Add new getResourceBundle(String baseName, Locale locale) method Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java?rev=644959&r1=644958&r2=644959&view=diff ============================================================================== --- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java (original) +++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java Fri Apr 4 15:22:50 2008 @@ -57,7 +57,7 @@ /** * Returns the {@link Resource} object on whose behalf the servlet acts. - * + * * @return The Resource object of this request. */ Resource getResource(); @@ -65,14 +65,14 @@ /** * Returns the {@link ResourceResolver} which resolved the * {@link #getResource() resource} of this request. - * + * * @return The resource resolver */ ResourceResolver getResourceResolver(); /** * Returns the {@link RequestPathInfo} pertaining to this request. - * + * * @return the request path info. */ RequestPathInfo getRequestPathInfo(); @@ -91,7 +91,7 @@ *

* This method is a shortcut for * getRequestParameterMap().getValue(String). - * + * * @param name a String specifying the name of the parameter * @return a {@link RequestParameter} representing the single value of the * parameter @@ -110,7 +110,7 @@ *

* This method is a shortcut for * getRequestParameterMap().getValues(String). - * + * * @param name a String containing the name of the parameter * the value of which is requested * @return an array of {@link RequestParameter} objects containing the @@ -128,7 +128,7 @@ * {@link RequestParameter} array (RequestParameter[]). *

* If no parameters exist this method returns an empty Map. - * + * * @return an immutable Map containing parameter names as * keys and parameter values as map values, or an empty * Map if no parameters exist. The keys in the @@ -145,7 +145,7 @@ *

* Returns null if a RequestDispatcher cannot * be returned for any reason. - * + * * @param path a String specifying the pathname to the * resource. If it is relative, it must be relative against the * current servlet. @@ -165,7 +165,7 @@ *

* Returns null if a RequestDispatcher cannot * be returned for any reason. - * + * * @param resource The {@link Resource} instance whose response content may * be included by the returned dispatcher. * @param options influence the rendering of the included Resource @@ -185,7 +185,7 @@ /** * Returns the named cookie from the HTTP request or null if * no such cookie exists in the request. - * + * * @param name The name of the cookie to return. * @return The named cookie or null if no such cookie exists. */ @@ -198,7 +198,7 @@ * For included resources this method will returned the same string as * returned by the ServletResponse.getContentType() without * the character set. - * + * * @return preferred MIME type of the response */ String getResponseContentType(); @@ -213,20 +213,34 @@ * containing a single entry which is the same string as returned by the * ServletResponse.getContentType() without the character * set. - * + * * @return ordered list of MIME types for the response */ Enumeration getResponseContentTypes(); /** * Returns the resource bundle for the given locale. - * + * * @param locale the locale for which to retrieve the resource bundle. If * this is null, the locale returned by * {@link #getLocale()} is used to select the resource bundle. * @return the resource bundle for the given locale */ ResourceBundle getResourceBundle(Locale locale); + + /** + * Returns the resource bundle of the given base name for the given locale. + * + * @param baseName The base name of the resource bundle to returned. If this + * parameter is null, the same resource bundle + * must be returned as if the {@link #getResourceBundle(Locale)} + * method is called. + * @param locale the locale for which to retrieve the resource bundle. If + * this is null, the locale returned by + * {@link #getLocale()} is used to select the resource bundle. + * @return the resource bundle for the given locale + */ + ResourceBundle getResourceBundle(String baseName, Locale locale); /** * Returns the {@link RequestProgressTracker} of this request. Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java?rev=644959&r1=644958&r2=644959&view=diff ============================================================================== --- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java (original) +++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/wrappers/SlingHttpServletRequestWrapper.java Fri Apr 4 15:22:50 2008 @@ -106,6 +106,10 @@ return getSlingRequest().getResourceBundle(locale); } + public ResourceBundle getResourceBundle(String baseName, Locale locale) { + return getSlingRequest().getResourceBundle(baseName, locale); + } + public String getResponseContentType() { return getSlingRequest().getResponseContentType(); }