Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A6AACE8C for ; Tue, 22 May 2012 08:27:16 +0000 (UTC) Received: (qmail 12302 invoked by uid 500); 22 May 2012 08:27:16 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 11555 invoked by uid 500); 22 May 2012 08:27:15 -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 11408 invoked by uid 99); 22 May 2012 08:27:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 08:27:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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; Tue, 22 May 2012 08:27:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 607952388C80 for ; Tue, 22 May 2012 08:25:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r818658 [10/23] - in /websites/staging/sling/trunk/content: ./ tutorials-how-tos/ Date: Tue, 22 May 2012 08:25:36 -0000 To: commits@sling.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120522082549.607952388C80@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: websites/staging/sling/trunk/content/internationalization-support-i18n.html ============================================================================== --- websites/staging/sling/trunk/content/internationalization-support-i18n.html (added) +++ websites/staging/sling/trunk/content/internationalization-support-i18n.html Tue May 22 08:25:32 2012 @@ -0,0 +1,209 @@ + + + + + Apache Sling - Internationalization Support (i18n) + + + + + +
+ +
+ + Apache + +
+
+ + + +
+
+ Home +
+

Internationalization Support (i18n)

+

Internationalization Support

+

Internationalization support in Sling consists of four methods in the SlingHttpServletRequest interface:

+
    +
  • getLocale() -- Returns the primary Locale for the current request. This method is inherited from the javax.servlet.ServletRequest interface.
  • +
  • getLocales() -- Returns the Locale instances for the current request. This method is inherited from the javax.servlet.ServletRequest interface.
  • +
  • getResourceBundle(Locale) -- Returns a ResourceBundle for the given Locale. This method is specific to Sling.
  • +
  • getResourceBundle(String, Locale) -- Returns a ResourceBundle of a given base name for the given Locale. This method is specific to Sling.
  • +
+

These methods have a default implementation in the org.apache.sling.core bundle and an extended and extensible implementation in the org.apache.sling.i18n bundle.

+

Default Implementation in the org.apache.sling.engine Bundle

+

The default implementation of the above mentioned four methods in the Sling Engine bundle is contained in the bundle-private class org.apache.sling.engine.impl.SlingHttpServletRequestImpl which is the primary implementation of the SlingHttpServletRequest interface:

+
    +
  • getLocale() -- Returns the Locale from the request object of the servlet container in which Sling is running. As per the Servlet API specification, this is either the primary Locale of the Accept-Language request header or the server default locale.
  • +
  • getLocales() -- Returns the Enumeration from the request object of the servlet container in which Sling is running. As per the Servlet API specification, this is either based on the Accept-Language request header or just the server default locale.
  • +
  • getResourceBundle(Locale) -- Returns a ResourceBundle whose getString(String key) method returns the key as the message and whose getKeys() method returns an empty Enumeration.
  • +
  • getResourceBundle(String, Locale) -- Returns a ResourceBundle whose getString(String key) method returns the key as the message and whose getKeys() method returns an empty Enumeration.
  • +
+

NOTE: Unlike the default implementations of the ResourceBundle abstract class in the Java Runtime -- PropertyResourceBundle and ListResourceBundle -- the ResourceBundle returned by the default implementation of the getResourceBundle(Locale) and getResourceBundle(String, Locale) always returns a string message for any key, which is the key itself. This prevents throwing MissingResourceException.

+

Extensible Implementation in the org.apache.sling.i18n Bundle

+

The org.apache.sling.i18n Bundle implements a request level Filter providing extensible implementations of the above mentioned three methods. Extensibility is attained by defining two service interfaces:

+
    +
  • +

    LocaleResolver -- The LocaleResolver interface defines a method which may be implemented by a service outside of the sling.i18n bundle. If no such service is registered the default behaviour is as described above for the sling.core bundle. The service described by this interface is used to implement the getLocale() and getLocales() method.

    +
  • +
  • +

    ResourceBundleProvider -- The ResourceBundleProvider interface defines two methods to acquire a ResourceBundle for any Locale and an optional base name. This service interface is not intended to be implemented outside of the sling.i18n bundle: A JCR Repository based implementation is contained in the sling.i18n bundle. The ResourceBundleProvider service is not only used within the sling.i18n bundle to implement the SlingHttpServletRequest.getResourceBundle(Locale) and SlingHttpServletRequest.getResourceBundle(String, Locale) methods. The service may also be used by Sling applications to acquire ResourceBundle instances without having a request object by getting the service and calling its getResourceBundle(Locale) or getResourceBundle(String, Locale) method directly.

    +
  • +
+

JCR Repository based ResourceBundleProvider

+

The sling.i18n Bundle provides the implementation of the ResourceBundleProvider interface, which may also be used outside of Sling requests for service tasks. This implementation gets the messages from a JCR Repository stored below nodes of the mixin node type mix:language. These language nodes have a jcr:language property naming the language of the resources. In the context of the JCR based ResourceBundleProvider this is of course expected to be the string value of respective Locale.

+

The (direct) child nodes of the mix:language node must contain two special properties naming the key string and the message:

+
    +
  • sling:key -- The sling:key property is a string property being the key for which the node contains the message(s).
  • +
  • sling:message -- The sling:message property represents the resource for the key.
  • +
+

The exact location of these nodes is not relevant as the ResourceBundleProvider finds them by applying a JCR search. It is only required that the message nodes are located below mix:language nodes. Such structures may also be scattered in the repository to allow storing message resources next to where they are most likely used, such as request scripts.

+

ResourceBundle with base names

+

Similar to standard Java ResourceBundle instances, Sling ResourceBundle instances may be created for base names through any of the getResourceBundle(String, Locale) methods. These methods use the base name parameter as a selector for the values of the sling:basename property of the mix:language nodes.

+

The base name argument can take one three values:

+ + + + + + + + + + + + + + + + + + + + + +
ValueResourceBundle selection
nullSelects messages of mix:language nodes ignoring the existence or absence of sling:basename properties
Empty StringSelects messages of mix:language nodes which have sling:basename properties, ignoring the actual values
Any other ValueSelects messages of mix:language nodes whose sling:basename properties has any value which matches the base name string
+

The sling:basename property may be multi-valued, that is the messages of a mix:language nodes may belong to multiple base names and thus ResourceBundle instances.

+

Sample Resources

+

Consider the following repository content:

+
   /libs/languages
+           +-- English (nt:folder, mix:language)
+           |    +-- jcr:language = en
+           |    +-- m1 (sling:messageEntry)
+           |    |    +-- sling:key = "msg001"
+           |    |    +-- slign:message = "This is a message"
+           |    +-- m2 (sling:messageEntry)
+           |         +-- sling:key = "msg002"
+           |         +-- slign:message = "Another message"
+           +-- Deutsch (nt:folder, mix:language)
+                +-- jcr:language = de
+                +-- m1 (sling:messageEntry)
+                |    +-- sling:key = "msg001"
+                |    +-- slign:message = "Das ist ein Text"
+                +-- m2 (sling:messageEntry)
+                     +-- sling:key = "msg002"
+                     +-- slign:message = "Ein anderer Text"
+
+   /apps/myApp
+           +-- English (nt:folder, mix:language)
+           |    +-- jcr:language = en
+           |    +-- mx (sling:messageEntry)
+           |         +-- sling:key = "msgXXX"
+           |         +-- slign:message = "An Application Text"
+           +-- Deutsch (nt:folder, mix:language)
+                +-- jcr:language = de
+                +-- mx (sling:messageEntry)
+                     +-- sling:key = "msgXXX"
+                     +-- slign:message = "Ein Anwendungstext"
+
+ + +

This content defines two languages en and de with three messages msg001, msg002 and msgXXX each. The names of the respective nodes have no significance at all because all information required is extracted from the jcr:language, sling:key and sling:message properties.

+

JCR Node Types supporting the JCR Repository based ResourceBundleProvider

+

The sling.i18n bundle asserts the following node types:

+

mix:language
+ [mix:language] + mixin + - jcr:language (string)

+

The mix:language mixin node type allows setting the jcr:language property required by the ResourceBundleProvider implementation to identify the message Locale.

+

sling:message and sling:messageEntry
+ [sling:message] + mixin + - sling:key (string) + - sling:message (undefined)

+
[sling:messageEntry] > nt:hierarchyNode, sling:message
+
+ + +

The sling:message and slign:messageEntry are helper node types which may be used to create the nodes with the sling:key and sling:message properties required by the ResourceBundleProvider. The node types themselves are not required but by defining the required properties, they may be of use.

+
+ Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000 +
+
+ Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project + logo are trademarks of The Apache Software Foundation. All other marks mentioned + may be trademarks or registered trademarks of their respective owners. +
+
+ + Modified: websites/staging/sling/trunk/content/issue-tracker.html ============================================================================== --- websites/staging/sling/trunk/content/issue-tracker.html (original) +++ websites/staging/sling/trunk/content/issue-tracker.html Tue May 22 08:25:32 2012 @@ -82,108 +82,129 @@ Home

Issue Tracker

-

Apache Sling uses Jira for tracking bug reports and requests for -improvements, new features, and other changes.

-

The issue tracker is available at -https://issues.apache.org/jira/browse/SLING and is readable by everyone. A -Jira account is needed to create new issues and to comment on existing -issues. Use the registration form - to request an account if you do not already have one.

+

Apache Sling uses Jira for tracking bug reports and requests for improvements, new features, and other changes.

+

The issue tracker is available at https://issues.apache.org/jira/browse/SLING and is readable by everyone. A Jira account is needed to create new issues and to comment on existing issues. Use the registration form to request an account if you do not already have one.

See below for guidelines on creating and managing issues.

-

Issue type

When creating a new issue, select the issue type based as follows:

- - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Issue type Description
*Bug* Bug reports are used for cases where Sling fails not -function as it should (as defined by some documentation). If you are not -certain whether the issue you've found is actually a bug, please ask the [Sling mailing lists](project-information#projectinformation-mailinglists.html) - first for help.
*New Feature* Use a feature request when Sling does not have some -functionality you need.
*Improvement* Use an improvement request to suggest improvements to -existing features. Typical improvement requests are about updating -documentation, increasing stability and performance, simplifying the -implementation, or other such changes that make Sling better without -introducing new features or fixing existing bugs.
*Test* Use this type when contributing test cases for -existing features. Normally test cases should be contributed as a part of -the original feature request or as regression tests associated with bug -reports, but sometimes you just want to extend test coverage by introducing -new test cases. This issue type is for such cases.
*Task* Used only for issues related to project -infrastructure.
Issue typeDescription
BugBug reports are used for cases where Sling fails not function as it should (as defined by some documentation). If you are not certain whether the issue you've found is actually a bug, please ask the Sling mailing lists first for help.
New FeatureUse a feature request when Sling does not have some functionality you need.
ImprovementUse an improvement request to suggest improvements to existing features. Typical improvement requests are about updating documentation, increasing stability and performance, simplifying the implementation, or other such changes that make Sling better without introducing new features or fixing existing bugs.
TestUse this type when contributing test cases for existing features. Normally test cases should be contributed as a part of the original feature request or as regression tests associated with bug reports, but sometimes you just want to extend test coverage by introducing new test cases. This issue type is for such cases.
TaskUsed only for issues related to project infrastructure.
- -

Summary

-

The issue summary should be a short and clear statement that indicates the -scope of the issue. You are probably being too verbose if you exceed the -length of the text field. Use the Environment and Description fields to -provide more detailed information.

-

+

The issue summary should be a short and clear statement that indicates the scope of the issue. You are probably being too verbose if you exceed the length of the text field. Use the Environment and Description fields to provide more detailed information.

Issue priority

Issue priority should be set according to the following:

- - - - - - + + + + + + + + + + + + + + + + + + + + + +
Issue priority Description
*Blocker* Legal or other fundamental issue that makes it -impossible to release Jackrabbit code
*Critical* Major loss of functionality that affects many -Slingusers
*Major* Important issue that should be resolved soon
*Minor* Nice to have issues
*Trivial* Trivial changes that can be applied whenever someone -has extra time
Issue priority
Blocker
Critical
Major
Minor
Trivial
- -

Issue States

-

Sling issues can transition through a number of states while being -processed:

+

Sling issues can transition through a number of states while being processed:

- - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
State Description Next States in Workflow
*Open* The issue has just been created _In Pogress_
*In Progress* Work has started on the issue _Documentation Required_, -_Testcase Required_, _Documentation/Testcase required_, _Resolved_, _Open_ -
*Documentation Required* Implementation work has finished for this -issue. To complete it documentation must be created and/or updated. -_Resolved_
*Testcase Required* Implementation work has finished for this issue. To -complete it test cases must be created and/or updated. _Resolved_
*Documentation/Testcase Required* Implementation work has finished for -this issue. To complete it documentation and test cases must be created -and/or updated. _Resolved_, _Documentation Required_, _Testcase Required_ -
*Resolved* The issue has been resolved from the developers point of -view. Documentation and Testcases have been created and updated as -required. Issue is ready for release. _Reopened_, _Closed_
*Reopened* A resolved issue has been recognized to contain bugs or to -be incomplete and thus has been reopened. _In Progress_, _Resolved_
*Closed* Work on this issue has finished and it is included in the -release. --
StateDescriptionNext States in Workflow
OpenThe issue has just been createdIn Pogress
In ProgressWork has started on the issueDocumentation Required, Testcase Required, Documentation/Testcase required, Resolved, Open
Documentation RequiredImplementation work has finished for this issue. To complete it documentation must be created and/or updated.Resolved
Testcase RequiredImplementation work has finished for this issue. To complete it test cases must be created and/or updated.Resolved
Documentation/Testcase RequiredImplementation work has finished for this issue. To complete it documentation and test cases must be created and/or updated.Resolved, Documentation Required, Testcase Required
ResolvedThe issue has been resolved from the developers point of view. Documentation and Testcases have been created and updated as required. Issue is ready for release.Reopened, Closed
ReopenedA resolved issue has been recognized to contain bugs or to be incomplete and thus has been reopened.In Progress, Resolved
ClosedWork on this issue has finished and it is included in the release.--
- -

Users generally create issues and provide feedback while work on the issue -is in progress. When the developer thinks the issue has been resolved, he -resolves the issue. At this point, the user may test the resolution and -reopen the issue if it has not really be solved. Otherwise the user may -just acknowledge the fix.

-

Developers transition the issue through the workflow while working on it. -When done with the issue, they mark the issue resolved with the appropriate -resolution and ask the reporting user to confirm.

-

Issues are closed once the project against which it has been reported has -been released. Issues once closed cannot be opened again. Rather new issues -should be created against the new release to have broken implementations -fixed or extended.

-

+

Users generally create issues and provide feedback while work on the issue is in progress. When the developer thinks the issue has been resolved, he resolves the issue. At this point, the user may test the resolution and reopen the issue if it has not really be solved. Otherwise the user may just acknowledge the fix.

+

Developers transition the issue through the workflow while working on it. When done with the issue, they mark the issue resolved with the appropriate resolution and ask the reporting user to confirm.

+

Issues are closed once the project against which it has been reported has been released. Issues once closed cannot be opened again. Rather new issues should be created against the new release to have broken implementations fixed or extended.

Patches

-

When reporting a bug, requesting a feature or propose an improvement, it is -a good thing to attach a patch to the issue. This may speed up issue -processing and helps you being recognized as a good community member -leading to closer involvement with Sling.

+

When reporting a bug, requesting a feature or propose an improvement, it is a good thing to attach a patch to the issue. This may speed up issue processing and helps you being recognized as a good community member leading to closer involvement with Sling.

- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Modified: websites/staging/sling/trunk/content/jcr-installer-provider.html ============================================================================== --- websites/staging/sling/trunk/content/jcr-installer-provider.html (original) +++ websites/staging/sling/trunk/content/jcr-installer-provider.html Tue May 22 08:25:32 2012 @@ -82,88 +82,47 @@ Home

JCR Installer Provider

-

The JCR installer provider scans the JCR repository for artifacts and -provides them to the OSGI installer -.

-

+

The JCR installer provider scans the JCR repository for artifacts and provides them to the OSGI installer.

Configuration and Scanning

-

The JCR installer provider can be configured with weighted paths which are -scanned. By default, the installer scans in /apps and /libs where -artifacts found in /apps get a higher priority. The installer does a deep -scan and uses a regular expression to detect folders containing artifacts -to be installed. By default, artifacts from within a folder named install -are provided to the OSGi installer.

-

If such an install folder contains a binary artifact (e.g. a bundle) this -is provided to the OSGi installer. In addition a node of type -sling:OsgiConfig is provided as a configuration to the installer.

-

The jcr installer provider does not check or scan the artifacts itself, the -detection and installation is deferred to the OSGi installer.

-

+

The JCR installer provider can be configured with weighted paths which are scanned. By default, the installer scans in /apps and /libs where artifacts found in /apps get a higher priority. The installer does a deep scan and uses a regular expression to detect folders containing artifacts to be installed. By default, artifacts from within a folder named install are provided to the OSGi installer.

+

If such an install folder contains a binary artifact (e.g. a bundle) this is provided to the OSGi installer. In addition a node of type sling:OsgiConfig is provided as a configuration to the installer.

+

The jcr installer provider does not check or scan the artifacts itself, the detection and installation is deferred to the OSGi installer.

Runmode Support

-

The JCR installer supports run modes for installing artifacts. By default folders named install are checked for artifacts. If Apache Sling is started with one (or more run modes), all folders named install.RUNMODE - are scanned as well. To be precise, the folder name can be followed by -any number of run modes separated by comma. For example, if started with -run modes dev, a1, and public, folders like install.dev, -install.a1, install.public are searched as well as install.dev.a1, or -install.a1.dev.

-

Artifacts from folders with a run mode get a higher priority. For example -by default, an install folder underneath /libs gets the priority 50. -For each run mode in the folder name, this priority is increased by 1, so -install.dev has 51 and install.a1.dev is 52.

-

+

The JCR installer supports run modes for installing artifacts. By default folders named install are checked for artifacts. If Apache Sling is started with one (or more run modes), all folders named install.RUNMODE are scanned as well. To be precise, the folder name can be followed by any number of run modes separated by comma. For example, if started with run modes dev, a1, and public, folders like install.dev, install.a1, install.public are searched as well as install.dev.a1, or install.a1.dev.

+

Artifacts from folders with a run mode get a higher priority. For example by default, an install folder underneath /libs gets the priority 50. For each run mode in the folder name, this priority is increased by 1, so install.dev has 51 and install.a1.dev is 52.

Example

Here's a quick walkthrough of the JCR installer functionality.

-

Installation

-

Start the Sling launchpad/app - and install and start the following additional bundles: - RunMode service - OSGi installer service (org.apache.sling.osgi.installer -) -* JCR installer provider (org.apache.sling.jcr.jcrinstall -)

-

To watch the logs produced by these modules, you can filter -sling/logs/error.log using egrep 'jcrinstall|osgi.installer'.

-

+

Start the Sling launchpad/app and install and start the following additional bundles: + RunMode service + OSGi installer service (org.apache.sling.osgi.installer) +* JCR installer provider (org.apache.sling.jcr.jcrinstall)

+

To watch the logs produced by these modules, you can filter sling/logs/error.log using egrep 'jcrinstall|osgi.installer'.

Install and remove a bundle

-

We'll use the Knopflerfish Desktop - bundle for this example, it is convenient as it displays a graphical user -interface when started.

-

We use curl to create content, to make it easy to reproduce the example -by copying and pasting the curl commands. Any other way to create -content in the repository will work, of course.

-

By default, JCRInstall picks up bundles found in folders named install -under /libs and /apps, so we start by creating such a folder:

+

We'll use the Knopflerfish Desktop bundle for this example, it is convenient as it displays a graphical user interface when started.

+

We use curl to create content, to make it easy to reproduce the example by copying and pasting the curl commands. Any other way to create content in the repository will work, of course.

+

By default, JCRInstall picks up bundles found in folders named install under /libs and /apps, so we start by creating such a folder:

curl -X MKCOL  http://admin:admin@localhost:8888/apps/jcrtest
 curl -X MKCOL  http://admin:admin@localhost:8888/apps/jcrtest/install
 
-

And we copy the bundle to install in that folder (a backslash in command -lines means continued on next line):

+

And we copy the bundle to install in that folder (a backslash in command lines means continued on next line):

curl -T desktop_awt_all-2.0.0.jar \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar
 
-

http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar

-

That's it. After 2-3 seconds, the bundle should be picked up by JCRInstall, -installed and started. If this works you'll see a small Knopflerfish -Desktop window on your desktop, and Sling's OSGi console can of course be -used to check the details.

-

Removing the bundle from the repository will cause it to be uninstalled, -so:

+

That's it. After 2-3 seconds, the bundle should be picked up by JCRInstall, installed and started. If this works you'll see a small Knopflerfish Desktop window on your desktop, and Sling's OSGi console can of course be used to check the details.

+

Removing the bundle from the repository will cause it to be uninstalled, so:

curl -X DELETE \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar
 
-

http://admin:admin@localhost:8888/apps/jcrtest/install/desktop_awt_all-2.0.0.jar

-

Should cause the Knopflerfish Desktop window to disappear as the bundle -is uninstalled.

-

+

Should cause the Knopflerfish Desktop window to disappear as the bundle is uninstalled.

Install, modify and remove a configuration

-

JCRInstall installs OSGi configurations from nodes having the -sling:OsgiConfig node type, found in folders named install under the -installation roots (/apps and /libs).

+

JCRInstall installs OSGi configurations from nodes having the sling:OsgiConfig node type, found in folders named install under the installation roots (/apps and /libs).

Let's try this feature by creating a configuration with two properties:

curl \
   -F "jcr:primaryType=sling:OsgiConfig" \
@@ -174,10 +133,10 @@ installation roots (/apps and /libs).

And verify the contents of our config node:

curl \
+  http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid.json
 
-

http://admin:admin@localhost:8888/apps/jcrtest/install/some.config.pid.json

Which should display something like

{"foo":"bar",
 "jcr:created":"Wed Aug 26 2009 17:06:40GMT+0200",
@@ -185,10 +144,7 @@ installation roots (/apps and /libs).

-

At this point, JCRInstall should have picked up our new config and -installed it. The logs would confirm that, but we can also use the OSGi -console's config status page (http://localhost:8888/system/console/config) -to check it. That page should now contain:

+

At this point, JCRInstall should have picked up our new config and installed it. The logs would confirm that, but we can also use the OSGi console's config status page (http://localhost:8888/system/console/config) to check it. That page should now contain:

PID=some.config.pid
   BundleLocation=Unbound
   _jcr_config_path=jcrinstall:/apps/jcrtest/install/some.config.pid
@@ -223,27 +179,17 @@ to check it. That page should now contai
 
-

And verify that the corresponding configuration is gone in the console page -(after 1-2 seconds, like for all other JCRInstall operations).

-

TODO: A node named like o.a.s.foo.bar-a uses o.a.s.foo.bar as its -factory PID creating a configuration with an automatically generated PID. -The value of a is stored as an alias property in the configuration to -correlate the configuration object with the repository node - demonstrate -that.

-

+

And verify that the corresponding configuration is gone in the console page (after 1-2 seconds, like for all other JCRInstall operations).

+

TODO: A node named like o.a.s.foo.bar-a uses o.a.s.foo.bar as its factory PID creating a configuration with an automatically generated PID. The value of a is stored as an alias property in the configuration to correlate the configuration object with the repository node - demonstrate that.

Automated Tests

-

The following modules contain lots of automated tests (under src/test, -as usual):

+

The following modules contain lots of automated tests (under src/test, as usual):

-

Many of these tests are fairly readable, and can be used to find out in -more detail how these modules work.

+

Many of these tests are fairly readable, and can be used to find out in more detail how these modules work.

- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Modified: websites/staging/sling/trunk/content/jspc.html ============================================================================== --- websites/staging/sling/trunk/content/jspc.html (original) +++ websites/staging/sling/trunk/content/jspc.html Tue May 22 08:25:32 2012 @@ -82,85 +82,80 @@ Home

JspC

-

-

Maven JspC Plugin

-

{excerpt:hidden=true}Compiles JSP scripts into class files and generates -Declarative Service Descriptors to register the compiled JSPs as -services{excerpt}

-

The Maven JspC Plugin provides a single goal jspc which is by default -executed in the compile phase of the Maven build process. This goal -takes all JSP source files from a configured location (src/main/scripts -by default) and compiles them into classes in a configurable location -(target/jspc-plugin-generated by default). In addition, for each -compiled JSP a Declarative Services descriptor is generated and written to -a descriptor file (OSGI-INF/jspServiceComponents.xml in the output -location). This descriptor will then be read by the Service Component -Runtime of the deployment OSGi framework to register all contained JSP as -javax.servlet.Servlet services.

-

+

Maven JspC Plugin

+

The Maven JspC Plugin provides a single goal jspc which is by default executed in the compile phase of the Maven build process. This goal takes all JSP source files from a configured location (src/main/scripts by default) and compiles them into classes in a configurable location (target/jspc-plugin-generated by default). In addition, for each compiled JSP a Declarative Services descriptor is generated and written to a descriptor file (OSGI-INF/jspServiceComponents.xml in the output location). This descriptor will then be read by the Service Component Runtime of the deployment OSGi framework to register all contained JSP as javax.servlet.Servlet services.

Use

-

To use the Maven JspC Plugin define the following elements in the - section of the POM:

+

To use the Maven JspC Plugin define the following elements in the <plugins> section of the POM:

<?xml version="1.0" encoding="ISO-8859-1"?>
 <project>
     ....
     <build>
-    ....
-    <plugins>
         ....
-        <plugin>
-        <groupId>org.apache.sling</groupId>
-        <artifactId>maven-jspc-plugin</artifactId>
-        <executions>
-            <execution>
-            <id>compile-jsp</id>
-            <goals>
-                <goal>jspc</goal>
-            </goals>
-            </execution>
-        </executions>
-        </plugin>
+        <plugins>
+            ....
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>maven-jspc-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>compile-jsp</id>
+                        <goals>
+                            <goal>jspc</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            ....
+        <plugins>
         ....
-    <plugins>
-    ....
     <build>
     ....
 <project>
 
-

Configuration

-

The Maven JspC Plugin may be configured in the element -using the following properties:

+

The Maven JspC Plugin may be configured in the <configuration> element using the following properties:

- - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameter Default Value Description
*sourceDirectory* *$\{project.build.scriptSourceDirectory*} -Location of the JSP source file; may be overwritten using the -*jspc.sourceDirectory* system property.
*outputDirectory* -*$\{project.build.directory}/jspc-plugin-generated* Target directory -for the compiled JSP classes; may be overwritten using the -*jspc.outputDirectory* system propertiy.
*compilerTargetVM* *1.5* The Target Virtual Machine Version to -generate class files for; may be overwritten using the -*jspc.compilerTargetVM* system property.
*compilerSourceVM* *1.5* The Compiler Source Version of the Java -source generated from the JSP files before compiling into classes; may be -overwritten using the *jspc.compilerSourceVM* system property.
*servletPackage* *org.apache.jsp* The root package name for the -generated class files; may be overwritten using the *jspc.servletPackage* -system property.
ParameterDefault ValueDescription
sourceDirectory$\{project.build.scriptSourceDirectory}Location of the JSP source file; may be overwritten using the jspc.sourceDirectory system property.
outputDirectory$\{project.build.directory}/jspc-plugin-generatedTarget directory for the compiled JSP classes; may be overwritten using the jspc.outputDirectory system propertiy.
compilerTargetVM1.5The Target Virtual Machine Version to generate class files for; may be overwritten using the jspc.compilerTargetVM system property.
compilerSourceVM1.5The Compiler Source Version of the Java source generated from the JSP files before compiling into classes; may be overwritten using the jspc.compilerSourceVM system property.
servletPackageorg.apache.jspThe root package name for the generated class files; may be overwritten using the jspc.servletPackage system property.
- -

Notes

-

The generated JSP classes as well as the Declarative Services descriptor -are automatically copied to the generated bundle jar file if the Maven -Bundle Plugin (from the Apache Felix) project is used to build the project -package.

+

The generated JSP classes as well as the Declarative Services descriptor are automatically copied to the generated bundle jar file if the Maven Bundle Plugin (from the Apache Felix) project is used to build the project package.

- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Modified: websites/staging/sling/trunk/content/launch-sling.html ============================================================================== --- websites/staging/sling/trunk/content/launch-sling.html (original) +++ websites/staging/sling/trunk/content/launch-sling.html Tue May 22 08:25:32 2012 @@ -82,10 +82,9 @@ Home

Launch Sling

-

Please refer to The Sling Launchpad - for up-to-date information on launching Sling.

+

Please refer to The Sling Launchpad for up-to-date information on launching Sling.

- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Modified: websites/staging/sling/trunk/content/links.html ============================================================================== --- websites/staging/sling/trunk/content/links.html (original) +++ websites/staging/sling/trunk/content/links.html Tue May 22 08:25:32 2012 @@ -82,86 +82,53 @@ Home

Links

-

-

Links

+

Links

Here are some links to other resources

-

Articles

-

About Sling

    -
  • Sling on dev.day.com
  • -
  • Day's developers blog, regularly includes articles on Sling and JCR. -Powered by Sling, of course.
  • -
  • Sling on Lars Trieloff's Blog
  • -
  • Lars regularly writes on his experiences with Sling. Most notably the -mini series of three entries introducing Sling and microsling.
  • -
  • Sling links at del.icio.us
  • -
  • If you're a del.icio.us user, please tag Sling-related posts with both -sling and jcr tags, so that they appear in that list.
  • -
  • Sling on Fisheye
  • -
  • code repository viewer, activity statistics, etc.
  • -
  • Sling on ohloh
  • -
  • activity and community statistics.
  • -
  • Sling on MarkMail
  • -
  • searchable mailing list archives.
  • +
  • Sling on dev.day.com - Day's developers blog, regularly includes articles on Sling and JCR. Powered by Sling, of course.
  • +
  • Sling on Lars Trieloff's Blog - Lars regularly writes on his experiences with Sling. Most notably the mini series of three entries introducing Sling and microsling.
  • +
  • Sling links at del.icio.us - If you're a del.icio.us user, please tag Sling-related posts with both sling and jcr tags, so that they appear in that list.
  • +
  • Sling on Fisheye - code repository viewer, activity statistics, etc.
  • +
  • Sling on ohloh - activity and community statistics.
  • +
  • Sling on MarkMail - searchable mailing list archives.
-

Projects using Sling

    -
  • Gert Vanthienen succeeded in installing Sling into the new Apache -ServiceMix kernel and documented his experience Sling On ServiceMix Kernel
  • +
  • Gert Vanthienen succeeded in installing Sling into the new Apache ServiceMix kernel and documented his experience Sling On ServiceMix Kernel
-

Sling Presentations and Screencasts

-

The following screencasts demonstrate Day Software's CRX quickstart -product, powered by Sling: - * First Steps with CRX Quickstart - * TheServerSide.com in 15 minutes

-

+

The following screencasts demonstrate Day Software's CRX quickstart product, powered by Sling: + * First Steps with CRX Quickstart + * TheServerSide.com in 15 minutes

From ApacheCon EU 08

-

From ApacheCon US 07

-

Technology used by Sling

    -
  • Apache Jackrabbit
  • -
  • The reference implementation of the Content Repository for Java (JCR) -Specification. This implementation is used in Sling as the primary -repository.
  • -
  • JSR 170: Content Repository for Java{tm} technology API
  • -
  • The specification of the repository API.
  • -
  • Apache Felix
  • -
  • The OSGi Framework implementation we use in Sling.
  • -
  • The OSGi Alliance
  • -
  • The OSGi Alliance is the specification body defining the OSGi Core and -Compendium Services. These specifications are at the center of making Sling -possible.
  • +
  • Apache Jackrabbit - The reference implementation of the Content Repository for Java (JCR) Specification. This implementation is used in Sling as the primary repository.
  • +
  • JSR 170: Content Repository for Java{tm} technology API - The specification of the repository API.
  • +
  • Apache Felix - The OSGi Framework implementation we use in Sling.
  • +
  • The OSGi Alliance - The OSGi Alliance is the specification body defining the OSGi Core and Compendium Services. These specifications are at the center of making Sling possible.
- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Modified: websites/staging/sling/trunk/content/logging.html ============================================================================== --- websites/staging/sling/trunk/content/logging.html (original) +++ websites/staging/sling/trunk/content/logging.html Tue May 22 08:25:32 2012 @@ -82,196 +82,190 @@ Home

Logging

-

-

Logging

-

+

Logging

Introduction

-

Logging in Sling is supported by the org.apache.sling.commons.log -bundle, which is one of the first bundles installed and started by the -Sling Launcher. The org.apache.sling.commons.log bundle has the -following tasks:

+

Logging in Sling is supported by the org.apache.sling.commons.log bundle, which is one of the first bundles installed and started by the Sling Launcher. The org.apache.sling.commons.log bundle has the following tasks:

-

Initial Configuration

-

The org.apache.sling.commons.log bundle gets the initial configuration -from the following BundleContext properties:

+

The org.apache.sling.commons.log bundle gets the initial configuration from the following BundleContext properties:

- - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property Default Description
*org.apache.sling.commons.log.level* *INFO* Sets the initial -logging level of the root logger. This may be any of the defined logging -levels *DEBUG*, *INFO*, *WARN*, *ERROR* and *FATAL*.
*org.apache.sling.commons.log.file* undefined Sets the log file to -which log messages are written. If this property is empty or missing, log -messages are written to *System.out*.
*org.apache.sling.commons.log.file.number* 5 The number of rotated -files to keep.
*org.apache.sling.commons.log.file.size* '.'yyyy-MM-dd Defines how -the log file is rotated (by schedule or by size) and when to rotate. See -the section _Log File Rotation_ below for full details on log file -rotation.
*org.apache.sling.commons.log.pattern* \{0,date,dd.MM.yyyy HH:mm:ss.SSS\} \*\{4\}\* \[\{2\}\](\{2\}\.html) - \{3\} \{5\} The *MessageFormat* pattern to use for formatting log -messages with the root logger.
*org.apache.sling.commons.log.julenabled* n/a Enables the -*java.util.logging* support.
PropertyDefaultDescription
org.apache.sling.commons.log.levelINFOSets the initial logging level of the root logger. This may be any of the defined logging levels DEBUG, INFO, WARN, ERROR and FATAL.
org.apache.sling.commons.log.fileundefinedSets the log file to which log messages are written. If this property is empty or missing, log messages are written to System.out.
org.apache.sling.commons.log.file.number5The number of rotated files to keep.
org.apache.sling.commons.log.file.size'.'yyyy-MM-ddDefines how the log file is rotated (by schedule or by size) and when to rotate. See the section Log File Rotation below for full details on log file rotation.
org.apache.sling.commons.log.pattern{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}]() {3} {5}The MessageFormat pattern to use for formatting log messages with the root logger.
org.apache.sling.commons.log.julenabledn/aEnables the java.util.logging support.
- -

User Configuration

-

User Configuration after initial configuration is provided by the -Configuration Admin Service. To this avail two -org.osgi.services.cm.ManagedServiceFactory services are registered -under the PIDs org.apache.sling.commons.log.LogManager.factory.writer -and org.apache.sling.commons.log.LogManager.factory.config which may -receive configuration.

-

+

User Configuration after initial configuration is provided by the Configuration Admin Service. To this avail two org.osgi.services.cm.ManagedServiceFactory services are registered under the PIDs org.apache.sling.commons.log.LogManager.factory.writer and org.apache.sling.commons.log.LogManager.factory.config which may receive configuration.

Logger Configuration

-

Loggers (or Categories) can be configured to log to specific files at -specific levels using configurable patterns. To this avail factory -configuration instances with factory PID -org.apache.sling.commons.log.LogManager.factory.config may be created -and configured with the Configuration Admin Service.

+

Loggers (or Categories) can be configured to log to specific files at specific levels using configurable patterns. To this avail factory configuration instances with factory PID org.apache.sling.commons.log.LogManager.factory.config may be created and configured with the Configuration Admin Service.

The following properties may be set:

- - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property Type Default Description
*org.apache.sling.commons.log.level* String *INFO* Sets the -logging level of the loggers. This may be any of the defined logging levels -*DEBUG*, *INFO*, *WARN*, *ERROR* and *FATAL*.
*org.apache.sling.commons.log.file* String undefined Sets the log -file to which log messages are written. If this property is empty or -missing, log messages are written to *System.out*. This property should -refer to the file name of a configured Log Writer (see below). If no Log -Writer is configured with the same file name an implicit Log Writer -configuration with default configuration is created.
*org.apache.sling.commons.log.pattern* String \{0,date,dd.MM.yyyy HH:mm:ss.SSS\} \*\{4\}\* \[\{2\}\](\{2\}\.html) - \{3\} \{5\} The *java.util.MessageFormat* pattern to use for -formatting log messages with the root logger. This is a -*java.util.MessageFormat* pattern supporting up to six arguments: \{0\} -The timestamp of type *java.util.Date*, \{1\} the log marker, \{2\} the -name of the current thread, \{3\} the name of the logger, \{4\} the debug -level and \{5\} the actual debug message. If the log call includes a -Throwable, the stacktrace is just appended to the message regardless of the -pattern.
*org.apache.sling.commons.log.names* String[](.html) - -- A list of logger names to which this configuration applies.
PropertyTypeDefaultDescription
org.apache.sling.commons.log.levelStringINFOSets the logging level of the loggers. This may be any of the defined logging levels DEBUG, INFO, WARN, ERROR and FATAL.
org.apache.sling.commons.log.fileStringundefinedSets the log file to which log messages are written. If this property is empty or missing, log messages are written to System.out. This property should refer to the file name of a configured Log Writer (see below). If no Log Writer is configured with the same file name an implicit Log Writer configuration with default configuration is created.
org.apache.sling.commons.log.patternString{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}]() {3} {5}The java.util.MessageFormat pattern to use for formatting log messages with the root logger. This is a java.util.MessageFormat pattern supporting up to six arguments: {0} The timestamp of type java.util.Date, {1} the log marker, {2} the name of the current thread, {3} the name of the logger, {4} the debug level and {5} the actual debug message. If the log call includes a Throwable, the stacktrace is just appended to the message regardless of the pattern.
org.apache.sling.commons.log.namesString--A list of logger names to which this configuration applies.
- -

Note that multiple Logger Configurations may refer to the same Log Writer -Configuration. If no Log Writer Configuration exists whose file name -matches the file name set on the Logger Configuration an implicit Log -Writer Configuration with default setup (daily log rotation) is internally -created.

-

+

Note that multiple Logger Configurations may refer to the same Log Writer Configuration. If no Log Writer Configuration exists whose file name matches the file name set on the Logger Configuration an implicit Log Writer Configuration with default setup (daily log rotation) is internally created.

Log Writer Configuration

-

Log Writer Configuration is used to setup file output and log file rotation -characteristics for log writers used by the Loggers.

+

Log Writer Configuration is used to setup file output and log file rotation characteristics for log writers used by the Loggers.

The following properties may be set:

- - - - + + + + + + + + + + + + + + + + + + + + + + + +
Property Default Description
*org.apache.sling.commons.log.file* undefined Sets the log file to -which log messages are written. If this property is empty or missing, log -messages are written to *System.out*.
*org.apache.sling.commons.log.file.number* 5 The number of rotated -files to keep.
*org.apache.sling.commons.log.file.size* '.'yyyy-MM-dd Defines how -the log file is rotated (by schedule or by size) and when to rotate. See -the section _Log File Rotation_ below for full details on log file -rotation.
PropertyDefaultDescription
org.apache.sling.commons.log.fileundefinedSets the log file to which log messages are written. If this property is empty or missing, log messages are written to System.out.
org.apache.sling.commons.log.file.number5The number of rotated files to keep.
org.apache.sling.commons.log.file.size'.'yyyy-MM-ddDefines how the log file is rotated (by schedule or by size) and when to rotate. See the section Log File Rotation below for full details on log file rotation.
- -

See the section Log File Rotation below for full details on the -org.apache.sling.commons.log.file.size and -org.apache.sling.commons.log.file.number properties.

-

+

See the section Log File Rotation below for full details on the org.apache.sling.commons.log.file.size and org.apache.sling.commons.log.file.number properties.

Log File Rotation

-

Log files can grow rather quickly and fill up available disk space. To cope -with this growth log files may be rotated in two ways: At specific times or -when the log file reaches a configurable size. The first method is called -Scheduled Rotation and is used by specifying a SimpleDateFormat -pattern as the log file "size". The second method is called Size Rotation -and is used by setting a maximum file size as the log file size.

-

As of version 2.0.6 of the Sling Commons Log bundle, the default value for -log file scheduling is '.'yyyy-MM-dd causing daily log rotation. -Previously log rotation defaulted to a 10MB file size limit.

-

+

Log files can grow rather quickly and fill up available disk space. To cope with this growth log files may be rotated in two ways: At specific times or when the log file reaches a configurable size. The first method is called Scheduled Rotation and is used by specifying a SimpleDateFormat pattern as the log file "size". The second method is called Size Rotation and is used by setting a maximum file size as the log file size.

+

As of version 2.0.6 of the Sling Commons Log bundle, the default value for log file scheduling is '.'yyyy-MM-dd causing daily log rotation. Previously log rotation defaulted to a 10MB file size limit.

Scheduled Rotation

-

The rolling schedule is specified by setting the -org.apache.sling.commons.log.file.size property to a -java.text.SimpleDateFormat pattern. Literal text (such as a leading -dot) to be included must be enclosed within a pair of single quotes. A -formatted version of the date pattern is used as the suffix for the rolled -file name.

-

For example, if the log file is configured as /foo/bar.log and the -pattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging -file /foo/bar.log will be renamed to /foo/bar.log.2001-02-16 and -logging for 2001-02-17 will continue in a new /foo/bar.log file until -it rolls over the next day.

-

It is possible to specify monthly, weekly, half-daily, daily, hourly, or -minutely rollover schedules.

+

The rolling schedule is specified by setting the org.apache.sling.commons.log.file.size property to a java.text.SimpleDateFormat pattern. Literal text (such as a leading dot) to be included must be enclosed within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name.

+

For example, if the log file is configured as /foo/bar.log and the pattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging file /foo/bar.log will be renamed to /foo/bar.log.2001-02-16 and logging for 2001-02-17 will continue in a new /foo/bar.log file until it rolls over the next day.

+

It is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.

- - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DatePattern Rollover schedule Example
*'.'yyyy-MM* Rollover at the beginning of each month At midnight of -May 31st, 2002 */foo/bar.log* will be copied to */foo/bar.log.2002-05*. -Logging for the month of June will be output to */foo/bar.log* until it -is also rolled over the next month.
*'.'yyyy-ww* Rollover at the first day of each week. The first day of -the week depends on the locale. Assuming the first day of the week is -Sunday, on Saturday midnight, June 9th 2002, the file */foo/bar.log* will -be copied to */foo/bar.log.2002-23*. Logging for the 24th week of 2002 -will be output to */foo/bar.log* until it is rolled over the next week.
*'.'yyyy-MM-dd* Rollover at midnight each day. At midnight, on March -8th, 2002, */foo/bar.log* will be copied to */foo/bar.log.2002-03-08*. -Logging for the 9th day of March will be output to */foo/bar.log* until -it is rolled over the next day.
*'.'yyyy-MM-dd-a* Rollover at midnight and midday of each day. at -noon, on March 9th, 2002, */foo/bar.log* will be copied to -*/foo/bar.log.2002-03-09-AM*. Logging for the afternoon of the 9th will -be output to */foo/bar.log* until it is rolled over at midnight.
*'.'yyyy-MM-dd-HH* Rollover at the top of every hour. At -approximately 11:00.000 o'clock on March 9th, 2002, */foo/bar.log* will -be copied to */foo/bar.log.2002-03-09-10*. Logging for the 11th hour of -the 9th of March will be output to */foo/bar.log* until it is rolled over -at the beginning of the next hour.
*'.'yyyy-MM-dd-HH-mm* Rollover at the beginning of every minute. At -approximately 11:23,000, on March 9th, 2001, */foo/bar.log* will be -copied to */foo/bar.log.2001-03-09-10-22*. Logging for the minute of -11:23 (9th of March) will be output to */foo/bar.log* until it is rolled -over the next minute.
DatePatternRollover scheduleExample
'.'yyyy-MMRollover at the beginning of each monthAt midnight of May 31st, 2002 /foo/bar.log will be copied to /foo/bar.log.2002-05. Logging for the month of June will be output to /foo/bar.log until it is also rolled over the next month.
'.'yyyy-wwRollover at the first day of each week. The first day of the week depends on the locale.Assuming the first day of the week is Sunday, on Saturday midnight, June 9th 2002, the file /foo/bar.log will be copied to /foo/bar.log.2002-23. Logging for the 24th week of 2002 will be output to /foo/bar.log until it is rolled over the next week.
'.'yyyy-MM-ddRollover at midnight each day.At midnight, on March 8th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-08. Logging for the 9th day of March will be output to /foo/bar.log until it is rolled over the next day.
'.'yyyy-MM-dd-aRollover at midnight and midday of each day.at noon, on March 9th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-09-AM. Logging for the afternoon of the 9th will be output to /foo/bar.log until it is rolled over at midnight.
'.'yyyy-MM-dd-HHRollover at the top of every hour.At approximately 11:00.000 o'clock on March 9th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-09-10. Logging for the 11th hour of the 9th of March will be output to /foo/bar.log until it is rolled over at the beginning of the next hour.
'.'yyyy-MM-dd-HH-mmRollover at the beginning of every minute.At approximately 11:23,000, on March 9th, 2001, /foo/bar.log will be copied to /foo/bar.log.2001-03-09-10-22. Logging for the minute of 11:23 (9th of March) will be output to /foo/bar.log until it is rolled over the next minute.
- -

Do not use the colon ":" character in anywhere in the pattern option. The -text before the colon is interpeted as the protocol specificaion of a URL -which is probably not what you want.

-

Note that Scheduled Rotation ignores the -org.apache.sling.commons.log.file.number property since the old log -files are not numbered but "dated".

-

+

Do not use the colon ":" character in anywhere in the pattern option. The text before the colon is interpeted as the protocol specificaion of a URL which is probably not what you want.

+

Note that Scheduled Rotation ignores the org.apache.sling.commons.log.file.number property since the old log files are not numbered but "dated".

Size Rotation

-

Log file rotation by size is specified by setting the -org.apache.sling.commons.log.file.size property to a plain number or a -number plus a size multiplier. The size multiplier may be any of K, -KB, M, MB, G, or GB where the case is ignored and the -meaning is probably obvious.

-

When using Size Rotation, the org.apache.sling.commons.log.file.number -defines the number of old log file generations to keep. For example to keep -5 old log files indexed by 0 through 4, set the -org.apache.sling.commons.log.file.number to 5 (which happens to be -the default).

+

Log file rotation by size is specified by setting the org.apache.sling.commons.log.file.size property to a plain number or a number plus a size multiplier. The size multiplier may be any of K, KB, M, MB, G, or GB where the case is ignored and the meaning is probably obvious.

+

When using Size Rotation, the org.apache.sling.commons.log.file.number defines the number of old log file generations to keep. For example to keep 5 old log files indexed by 0 through 4, set the org.apache.sling.commons.log.file.number to 5 (which happens to be the default).

- Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000 + Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project