You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2017/02/24 08:00:34 UTC
svn commit: r1784234 -
/sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext
Author: kwin
Date: Fri Feb 24 08:00:34 2017
New Revision: 1784234
URL: http://svn.apache.org/viewvc?rev=1784234&view=rev
Log:
clean up links, several typos fixed
Modified:
sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext
Modified: sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext?rev=1784234&r1=1784233&r2=1784234&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext (original)
+++ sling/site/trunk/content/documentation/the-sling-engine/resources.mdtext Fri Feb 24 08:00:34 2017
@@ -75,7 +75,7 @@ More details on mappings can be found at
Sometimes it is required to resolve relative paths to Resources. An example of such a use case is Script and Servlet resolution which starts with a relative path consisting of the Resource type, optional selectors and the request extension or method name. By scanning a search path for these relative paths a system provided Resource may be overwritten with some user defined implementation.
-Consider for example, the system would provide a Servlet to render Resources of type `nt:file`. This Servlet would be registered under the path `/libs/nt/file/html`. For a certain web application, this default HTML rendering might not be appropriate, so a Script is created as `/apps/nt/file/html.jsp` with a customized HTML rendering. By defining the search path to be *\[* `*/apps{*}{`}*,* `*/libs{*`} *\]({{ refs.--apps----libs-.path }})* the Servlet resolver would call the `ResourceResolver.getResource(String)` method with the relative path `nt/file/html` and be provided with the first matching resource - `/apps/nt/file/html.jsp` in this example.
+Consider for example, the system would provide a Servlet to render Resources of type `nt:file`. This Servlet would be registered under the path `/libs/nt/file/html`. For a certain web application, this default HTML rendering might not be appropriate, so a Script is created as `/apps/nt/file/html.jsp` with a customized HTML rendering. By defining the search path to be `[/apps,/libs]` the Servlet resolver would call the `ResourceResolver.getResource(String)` method with the relative path `nt/file/html` and be provided with the first matching resource - `/apps/nt/file/html.jsp` in this example.
Of course the search path is not used for absolute path arguments.
@@ -154,20 +154,24 @@ To be notified whenever certain resource
### Resource Observation API (ResourceChangeListener)
*This API is only available since Sling API 2.11.0 ([SLING-4751](https://issues.apache.org/jira/browse/SLING-4751)).*
-Register an OSGi service for [`org.apache.sling.api.resource.observation.ResourceChangeListener`](https://svn.apache.org/repos/asf/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java) or `org.apache.sling.api.resource.observation.ExternalResourceChangeListener` to be notified about changes. Certain properties can be used to
-restrict subscription to only a subset of events.
+
+Register an OSGi service for [`org.apache.sling.api.resource.observation.ResourceChangeListener`][6] or [`org.apache.sling.api.resource.observation.ExternalResourceChangeListener`][7] to be notified about changes. Certain properties can be used to restrict subscription to only a subset of events.
### OSGi Event Admin
-Event are send out via the OSGi Event Admin. You can subscribe to those event by registering an OSGi service for [`org.osgi.service.event.EventHandler`](https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventHandler.html)). Several properties should be used to restrict the subscription to only the relevant event. The event topics which are used for resources are listed as constants in [`org.apache.sling.api.SlingConstants`](http://sling.apache.org/apidocs/sling8/org/apache/sling/api/SlingConstants.html) starting with the prefix `TOPIC_`.
+Resource events are sent out via the OSGi Event Admin. You can subscribe to those event by registering an OSGi service for [`org.osgi.service.event.EventHandler`][8]. Several properties should be used to restrict the subscription to only the relevant event. The event topics which are used for resources are listed as constants in [`org.apache.sling.api.SlingConstants`][9] starting with the prefix `TOPIC_`.
## Wrap/Decorate Resources
The Sling API provides an easy way to wrap or decorate a resource before returning. Details see [Wrap or Decorate Resources]({{ refs.wrap-or-decorate-resources.path }}).
- [1]: http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceMetadata.html "ResourceMetadata"
- [2]: http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/Resource.html "Resource"
- [3]: http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/AbstractResource.html "AbstractResource"
- [4]: http://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/resourceprovider/
- [5]: https://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/WriteableResourcesTest.java
\ No newline at end of file
+ [1]: http://sling.apache.org/apidocs/sling8/org/apache/sling/api/resource/ResourceMetadata.html "ResourceMetadata"
+ [2]: http://sling.apache.org/apidocs/sling8/org/apache/sling/api/resource/Resource.html "Resource"
+ [3]: http://sling.apache.org/apidocs/sling8/org/apache/sling/api/resource/AbstractResource.html "AbstractResource"
+ [4]: https://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/resourceprovider/
+ [5]: https://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/WriteableResourcesTest.java
+ [6]: https://svn.apache.org/repos/asf/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ResourceChangeListener.java
+ [7]: https://svn.apache.org/repos/asf/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/observation/ExternalResourceChangeListener.java
+ [8]: https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/EventHandler.html
+ [9]: http://sling.apache.org/apidocs/sling8/org/apache/sling/api/SlingConstants.html
\ No newline at end of file