sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject [13/53] sling-site git commit: asf-site branch created for published content
Date Mon, 19 Jun 2017 12:41:19 GMT
http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.md
----------------------------------------------------------------------
diff --git a/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.md b/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.md
deleted file mode 100644
index 2bdc080..0000000
--- a/content/documentation/tutorials-how-tos/how-to-manage-events-in-sling.md
+++ /dev/null
@@ -1,208 +0,0 @@
-title=How to Manage Job in Sling		
-type=page
-status=published
-~~~~~~
-
-Apache Sling supports the execution of jobs with the guarantee of processing the job at least
once. This can be seen as an extensions of the OSGi event admin, although jobs are not started
or processed by OSGi events leveraging the OSGi event admin.
-
-For more details please refer to the following resources:
-
-* [Eventing, Jobs and Scheduling section]({{ refs.eventing-and-jobs.path }}) to get detailed
information on the eventing mechanisms in Sling.
-* Package [org.osgi.service.event](http://www.osgi.org/javadoc/r4v42/org/osgi/service/event/package-summary.html)
of the OSGI API.
-* Package [org.apache.sling.event](/apidocs/sling6/org/apache/sling/event/package-summary.html)
of the Sling API.
-
-This page drives you through the implementation of two services that rely on the Sling job
mechanism. The services implement the following use case: whenever a file is uploaded to a
temporary location in your web application, the file is moved to a specific location according
to its MIME type.
-
-## Introduction
-
-You will now implement the logic to listen to files posted to */tmp/dropbox* and to move
them to the appropriate locations depending on the MIME type:
-
-* images (.png) are moved to **/dropbox/images/**
-* music (.mp3) are moved to **/dropbox/music/**
-* movies (.avi) are moved to **/dropbox/movies/**
-* otherwise the files are moved to **/dropbox/other/**
-
-To do that, you will implement two services. The first one, called **DropBoxService**:
-
-* Listens to specific OSGi events (Sling resource added events)
-* Starting a job event if a resource has been added to **/tmp/dropbox**.
-
-The second one, called **DropBoxEventHandler**:
-
-* Processes the former jobs
-* Moves the file according to its extension.
-
-## Listening to OSGI Events
-To listen to OSGi events in Sling you just need to register an **org.osgi.service.event.EventHandler**
service with
-an **event.topics** property that describes which event topics the handler is interested
in.
-
-To listen to a Sling **resource added** events, for example, you'll set the *event.topics*
property to
-**org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED** in the class annotations:
-
-:::java
-@Property(name=org.osgi.service.event.EventConstants.EVENT_TOPIC,
-value=org.apache.sling.api.SlingConstants.TOPIC_RESOURCE_ADDED)
-
-
-The javadocs of the TOPIC_ constants in the [org.apache.sling.api.SlingConstants](/apidocs/sling6/org/apache/sling/api/SlingConstants.html)
-class lists and explains the available event topics available in Sling.
-
-## Starting a job
-
-To start a job, the *JobManager* service can be used. It needs a job topic and a payload.
In our case we define our dropbox job topic and give the resource path as the payload:
-
-:::java
-final String resourcePath = ...; // path to the resource to handle
-final Map<String, Object> payload = new HashMap<String, Object>();
-payload.put("resourcePath", resourcePath);
-// start job
-this.jobManager.addJob(JOB_TOPIC, payload);
-
-To receive the resource event, the service needs to implement the **org.osgi.service.event.EventHandler**
interface and register it as an EventHandler service:
-
-:::java
-@Component(immediate=true) // immediate should only be used in rare cases (see below)
-@Service(value=EventHandler.class)
-public class DropBoxService implements EventHandler {
-...
-}
-
-Usually a service should be lazy and therefore not declare itself to be immediate (in the
Component annotation). However as this service is an event handler and might receive a lot
of events even concurrently, it is advised to set the immediate flag to true on the component.
Otherwise our event handler would be created and destroyed with every event coming in.
-
-To start the job we need a reference to the JobManager:
-
-:::java
-@Reference
-private JobManager jobManager;
-
-
-The job topic for dropbox job events needs to be defined:
-
-:::java
-/** The job topic for dropbox job events. */
-public static final String JOB_TOPIC = "com/sling/eventing/dropbox/job";
-
-
-The **org.osgi.service.event.EventHandler#handleEvent(Event event)** method needs to be implemented:
-
-Its logic is as follows:
-
-* The OSGI event is analyzed.
-* If the event is a file that has been added to */tmp/dropbox*:
-* An job is created with 1 property:
-* A property for the file path.
-* The job is started
-
-For example:
-
-:::java
-public void handleEvent(final Event event) {
-// get the resource event information
-final String propPath = (String) event.getProperty(SlingConstants.PROPERTY_PATH);
-final String propResType = (String) event.getProperty(SlingConstants.PROPERTY_RESOURCE_TYPE);
-
-// a job is started if a file is added to /tmp/dropbox
-if ( propPath.startsWith("/tmp/dropbox") && "nt:file".equals(propResType) ) {
-// create payload
-final Map<String, Object> payload = new HashMap<String, Object>();
-payload.put("resourcePath", propPath);
-// start job
-this.jobManager.addJob(JOB_TOPIC, payload);
-logger.info("the dropbox job has been started for: {}", propPath);
-}
-}
-
-The complete code for the **DropBoxService** service is available [here](DropBoxService.java).
-
-## Consuming Job Events
-
-Now that you have implemented a service that starts a job when a file is uploaded to **/tmp/dropbox**,
you will implement the service **DropBoxEventHandler** that processes those jobs and moves
the files to a location according to their MIME types.
-
-To process to the job that have been defined before the property **job.topics** needs to
be set to **DropBoxService.JOB_TOPIC** in the class annotations:
-
-:::java
-@Property(name="job.topics",
-value=DropBoxService.JOB_TOPIC)
-
-In addition the service needs to implement the **org.apache.sling.event.jobs.consumer.JobConsumer**
interface:
-
-
-:::java
-public class DropBoxEventHandler implements JobConsumer {
-
-
-Some class fields need to be defined:
-
-* The default logger.
-* The references to the ResourceResolverFactory services, which are used in the implementation.
-* The destination paths of the files.
-
-For example:
-
-:::java
-/** Default log. */
-protected final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-@Reference
-private ResourceResolverFactory resolverFactory;
-
-private final static String IMAGES_PATH = "/dropbox/images/";
-private final static String MUSIC_PATH = "/dropbox/music/";
-private final static String MOVIES_PATH = "/dropbox/movies/";
-private final static String OTHER_PATH = "/dropbox/other/";
-
-
-The **org.apache.sling.event.jobs.consumer.JobConsume#process(Job job)** method needs to
be implemented:
-
-
-Its logic is as follows:
-
-* The resource path is extracted from the job.
-* The resource is obtained from the resource path.
-* If the resource is a file, the destination path is defined based on the file MIME type.
-* The file is moved to the new location by using a JCR session (as the Sling Resource API
doesn't support move atm)
-
-or in Java Code:
-
-:::java
-public JobResult process(final Job job) {
-ResourceResolver adminResolver = null;
-try {
-adminResolver = resolverFactory.getAdministrativeResourceResolver(null);
-
-final String resourcePath = (String) job.getProperty("resourcePath");
-final String resourceName = resourcePath.substring(resourcePath.lastIndexOf("/") + 1);
-
-final Resource res = adminResolver.getResource(resourcePath);
-if ( res.isResourceType("nt:file") ) {
-final String mimeType = res.getResourceMetadata().getContentType();
-String destDir;
-if (mimeType.equals("image/png")) {
-destDir = IMAGES_PATH;
-}
-else if (mimeType.equals("audio/mpeg")) {
-destDir = MUSIC_PATH;
-}
-else if (mimeType.equals("video/x-msvideo")) {
-destDir = MOVIES_PATH;
-}
-else {
-destDir = OTHER_PATH;
-}
-final Session adminSession = adminResolver.adaptTo(Session.class);
-adminSession.move(resourcePath, destDir + resourceName);
-adminSession.save();
-logger.info("The file {} has been moved to {}", resourceName, destDir);
-}
-return JobResult.OK;
-} catch (final Exception e) {
-logger.error("Exception: " + e, e);
-return JobResult.FAILED;
-} finally {
-if (adminResolver != null) {
-adminResolver.close();
-}
-}
-}
-
-The complete code for the **DropBoxEventHandler** service is available [here](DropBoxEventHandler.java).

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/documentation/tutorials-how-tos/installing-and-upgrading-bundles.md
----------------------------------------------------------------------
diff --git a/content/documentation/tutorials-how-tos/installing-and-upgrading-bundles.md b/content/documentation/tutorials-how-tos/installing-and-upgrading-bundles.md
deleted file mode 100644
index eac473c..0000000
--- a/content/documentation/tutorials-how-tos/installing-and-upgrading-bundles.md
+++ /dev/null
@@ -1,76 +0,0 @@
-title=Installing and Upgrading Bundles		
-type=page
-status=published
-~~~~~~
-Excerpt: Explains how to install, upgrade and uninstall Bundles using the Sling Management
console.
-
-<div class="note">
-We recommend to use the Apache Felix Web Console. The documentation below describes the old
Sling Management Console, which isn't in use any more. Please refer to the documentation of
the <a href="http://felix.apache.org/site/apache-felix-web-console.html">Apache Felix
Web Console</a>.
-</div>
-
-OSGi bundles installed in the OSGi framework, which is provided by Sling, may be upgraded
or removed and new bundles may be installed by using the Sling Management Console. This page
is about using the Sling Management Console for those tasks.
-
-Basically, you have two choices to install and upgrade bundles: Upload the bundle files or
install them from a Bundle Repository.
-
-
-
-## Sling Management Console
-
-The Sling Management Console is installed by default when Sling is running and may be reached
at on the page `/system/console` in the Sling Context by default. For example if you installed
the Sling Web Application in the `/sample` context of the Servlet Container running at `http://somehost:4402`,
you would access the Sling Management Console at `http://somehost:4402/sample/system/console`.
-
-You will be prompted for a user name and password to access the Sling Management Console.
This password is preset to be *admin* for the user name and *admin* for the password.
-
-NB: Both the username and password and the location of the Sling Management Console inside
the Web Application Context is configurable in the *Sling Management Console* configuration
on the *Configuration* page.
-
-
-
-## Installing and upgrading bundles by Upload
-
-To install a new bundle or upgrade an already installed bundle, go to the *Bundles* page
in the Sling Management Console. At the top and the bottom of the page you have a form to
specify and upload a bundle as a file :
-
-* Select the bundle file to upload
-* Click the *Start* checkbox, if you want to start the bundle after installation. If the
bundle is upgraded, this checkbox is ignored.
-* Specify the start level of the bundle in the *Start Level* field. This must be a number
higher than 0 and is ignored for bundles, which are already installed. Most of the time, you
will use the default value.
-* Click the *Install or Update* button
-
-After clicking the button, the bundle file will be uploaded. If a bundle with the same bundle
symbolic name is already installed, the respective bundle will be updated with the new bundle
file. Otherwise the bundle file will be installed as a new bundle and its start level is set
as defined. Additionally the bundle will optionally be started.
-
-After having updated a bundle, you should also refresh the packages by clicking on the *Refresh
Packages* button. The reson for this is, that the old version of the bundle is still used
by other bundles even after upgrading to a new version. Only when the packages are refreshed
any users of the bundle will be relinked to use the new bundle version. As this might be a
somewhat lengthy operation, which also stops and restarts using bundles, this operation has
to be executed explicitly.
-
-Also, if you plan to upgrade multiple bundles, you may wish to upgrade all bundles before
repackaging the using bundles.
-
-
-
-## Installing and upgrading bundles from the Bundle Repository
-
-The OSGi Bundle Repository is a repository of bundles, from which Sling may download and
install or upgrade bundles very easily. Unlike the installation of bundles by file upload,
the OSGi Bundle Repository has the functionality to resolve and dependencies of bundles to
be installed.
-
-Say you wish to install bundle *X* which depends on packages provided by bundle *Y*. When
uploading bundle *X* as a file it will not resolve, that is Sling (the OSGi framework actually)
is not able to ensure proper operation of bundle *X* and thus prevents the bundle from being
started and used. You will have to manually upload bundle *Y* yourself. When using the OSGi
Bundle Repository, you just select bundle *X* for installation and the bundle repository will
find out, that bundle *Y* is also required and will automatically download and install it
along with bundle *X*.
-
-
-### The Bundle Repository page
-
-Installation or update of bundles may be done on the *Bundle Repository* page of the Sling
Management Console. In the upper part of the page, you will see a list (usually just a single
entry) of OSGi Bundle Repositories known to Sling. In the lower part of the list you see the
bundles available from these repositories. To install or update bundles, just check the respective
button and click on the *Deploy Selected* or *Deploy and Start Selected* button at the bottom
of the page depending on whether you want to start the bundle(s) after installation or not.
-
-See below for more information on OSGi Bundle Repository management.
-
-
-
-### The Bundles page
-
-You may also want to upgrade already installed bundles from the *Bundles* page of the Sling
Management Console. For each bundle listed in this page, there is an *Upgrade* button. If
there is an upgrade to the installed bundle available in the OSGi Bundle Repository, the button
is enabled and clicking on the button will upgrade the respective bundle. If no upgrade is
available from the OSGi Bundle Repository, this button is disabled.
-
-
-
-### Managing OSGi Bundle Repositories
-
-Currently management of known OSGi Bundle Repositories is very simple. If a configured bundle
repository is not available on startup, it will be marked as being inactive. If you know the
repository is now available, you may click on the *Refresh* button, to activate it. Similarly,
the contents of the repository may be modified by for example adding new bundles or updating
bundles in the repository, these changes will be made known to Sling by clicking the *Refresh*
button.
-
-There exists no GUI functionality yet to add a new repository to the list of known repositories.
Instead you may submit a request with parameters `action` whose value must be `refreshOBR`
and `repository` whose value must be the URL to the repository descriptor file generally called
`repository.xml`.
-
-For example, if you run Sling on `http://localhost:7402/sample` with default location of
the Sling Management Console, the following request would add a repository at `/tmp/repo/repository.xml`
in the filesystem:
-
-:::html
-http://localhost:7402/sample/system/console/bundlerepo?action=refreshOBR&repository=file:///tmp/repo/repository.xml
-
-Note: Only use `file:` URLs if you know Sling has access to the named file !

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/documentation/tutorials-how-tos/jackrabbit-persistence.md
----------------------------------------------------------------------
diff --git a/content/documentation/tutorials-how-tos/jackrabbit-persistence.md b/content/documentation/tutorials-how-tos/jackrabbit-persistence.md
deleted file mode 100644
index c9c5d84..0000000
--- a/content/documentation/tutorials-how-tos/jackrabbit-persistence.md
+++ /dev/null
@@ -1,112 +0,0 @@
-title=Jackrabbit Persistence		
-type=page
-status=published
-~~~~~~
-
-Out-of-the-box the embedded Jackrabbit repository used by Sling (the Embedded Jackrabbit
Repository bundle) uses Derby to persist the JCR nodes and properties. For some applications
or environments it may be required or required to replace Derby with another backing store
such as PostgreSQL or Oracle.
-
-This page is based on the journey of Tony Giaccone to get Sling running with a PostgreSQL
based Jackrabbit instance.
-
-
-## Management Summary
-
-To replace Derby as the persistence manager for Jackrabbit the following steps are required:
-
-1. Provide a JDBC driver for your database as an OSGi bundle
-1. Reconfigure Jackrabbit to use your database
-1. (Re-) Start the Embedded Jackrabbit bundle
-
-When you are not using the Derby persistence manager, you may safely remove the Derby bundle
from your Sling instance.
-
-
-## JDBC Driver
-
-The hardest thing to do is probably getting the JDBC driver for your database. One option
is to look at the bundles provided by Spring Source in their repository at <http://www.springsource.com/repository/>.
-
-Another option is to create the bundle on your own using Peter Kriens' [bnd Tool](http://bnd.bndtools.org/):
-
-1. Get the JDBC driver for your database from the driver provider
-1. Wrap the JDBC driver library into an OSGi bundle:
-
-:::sh
-# Example for PostgreSQL JDBC 3 driver 8.4-701
-$ java -jar bnd.jar wrap postgresql-8.4-701.jdbc3.jar
-$ mv postgresql-8.4-701.jdbc3.bar postgresql-8.4-701.jdbc3-bnd.jar
-
-1. Deploy the driver to your local Maven 2 Repository (Required if adding the JDBC driver
to a Maven build, e.g. using the Sling Launchpad Plugin)
-
-:::sh
-$ mvn install:install-file
--DgroupId=postgresql -DartifactId=postgresql -Dversion=8.4.701.jdbc3
--Dpackaging=jar -Dfile=postgresql-8.4-701.jdbc3-bnd.jar
-
-
-Tony reports no success with the Spring Source bundle, whily the bnd approach worked for
the PostgreSQL JDBC driver.
-
-
-## Replace Derby in a running Sling Instance
-
-To replace Derby in a running Sling instance follow these steps (e.g. through the Web Console
at `/system/console`):
-
-1. Uninstall the Apache Derby bundle
-1. Install the JDBC bundle prepared in the first step
-1. Stop the Jackrabbit Embedded Repository bundle
-This needs to be reconfigured and restarted anyway. So lets just stop it to prevent failures
in the next step.
-1. Refresh the packages (click the *Refresh Packages* button)
-
-Alternatively, you may wish to stop Sling after uninstalling Derby and installing the JDBC
bundle. Technically, this is not required, though.
-
-
-## Reconfiguring Jackrabbit
-
-To actually use a persistence manager other than the default (Derby) persistence manager,
you have to configure Jackrabbit to use it. Create a `repository.xml` file in the `sling/jackrabbit`
folder before starting Sling for the first time. If the repository was already started, you
can also modify the existing file.
-
-To prepare a repository.xml file before first startup, use the [`repository.xml`](http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml)
as a template and modify it by replacing the `<PersistenceManager>` elements to refer
to the selected persistence manager.
-
-If the file already exists, you can modifiy this existing file and there is no need to get
the original from the SVN repository.
-
-For example to use PostgreSQL instead of Derby modify the `<PersistenceManager>` elements
as follows:
-
-:::xml
-<Repository>
-...
-<Workspace name="${wsp.name}">
-...
-<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
-<param name="driver" value="org.postgresql.Driver"/>
-<param name="url" value="jdbc:postgresql://localhost:5432/YOUR_DB_NAME_HERE"/>
-<param name="schema" value="postgresql"/>
-<param name="user" value="YOUR_USER_HERE"/>
-<param name="password" value="YOUR_PASSWORD_HERE"/>
-<param name="schemaObjectPrefix" value="jcr_${wsp.name}_"/>
-<param name="externalBLOBs" value="false"/>
-</PersistenceManager>
-...
-</Workspace>
-
-<Versioning rootPath="${rep.home}/version">
-...
-<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
-<param name="driver" value="org.postgresql.Driver"/>
-<param name="url" value="jdbc:postgresql://localhost:5432/YOUR_DB_NAME_HERE"/>
-<param name="schema" value="postgresql"/>
-<param name="user" value="YOUR_USER_HERE"/>
-<param name="password" value="YOUR_PASSWORD_HERE"/>
-<param name="schemaObjectPrefix" value="version_"/>
-<param name="externalBLOBs" value="false"/>
-</PersistenceManager>
-</Versioning>
-...
-</Repository>
-
-
-Modify the `url`, `user`, and `password` parameters to match your database setup.
-
-If you reconfigure Jackrabbit to use the new persistence manager, the existing repository
data in the `sling/jackrabbit` directory, except the `repository.xml` file, of course, should
now be removed.
-
-Finally either start Sling or start the Jackrabbit Embedded Repository bundle.
-
-
-## Credits
-
-This description is based on Tony Giaccone's description [Swapping Postgres for Derby](http://markmail.org/message/wlbfrukmjjsl33hh)
sent to the Sling Users mailing list.

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/documentation/tutorials-how-tos/testing-sling-based-applications.md
----------------------------------------------------------------------
diff --git a/content/documentation/tutorials-how-tos/testing-sling-based-applications.md b/content/documentation/tutorials-how-tos/testing-sling-based-applications.md
deleted file mode 100644
index 5ec3106..0000000
--- a/content/documentation/tutorials-how-tos/testing-sling-based-applications.md
+++ /dev/null
@@ -1,119 +0,0 @@
-title=Testing Sling-based applications		
-type=page
-status=published
-~~~~~~
-
-Automated testing of OSGi components and services can be challenging, as many of them depend
on other services that must be present or simulated for testing.
-
-This page describes the various approaches that we use to test Sling itself, and introduces
a number of tools that can help testing OSGi and HTTP-based applications.
-
-[TOC]
-
-## Unit tests
-
-When possible, unit tests are obviously the fastest executing ones, and it's easy to keep
them close to the code that they're testing.
-
-We have quite a lot of those in Sling, the older use the JUnit3 TestCase base class, and
later ones use JUnit4 annotations. Mixing both approaches is possible, there's no need to
rewrite existing tests.
-
-## Tests that use a JCR repository
-
-Utility classes from our [commons/testing](https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/testing)
module make it easy to get a real JCR repository for testing. That's a bit slower than pure
unit tests, of course, but this only adds 1-2 seconds to the execution of a test suite.
-
-The `RepositoryProviderTest` in that module uses this technique to get a JCR repository.
-
-Note that our utilities do not cleanup the repository between tests, so you must be careful
about test isolation, for example by using unique paths for each test.
-
-## Mock classes and services
-
-The next step is to use mock classes and services to simulate components that are needed
for testing. This makes it possible to test OSGi service classes without an OSGi framework,
or classes accessing the Sling or JCR API without a running Sling instance or JCR repository.
-
-The [Development](/documentation/development.html) documentation page contains a section
"Testing Sling-based Applications" lising all mock implementations available as part of the
Apache Sling project.
-
-In other cases we use [jmock](http://www.jmock.org/) or [Mockito][1] to help create mock
objects without having to write much code - such mocking libraries take care of the plumbing
and allow you to write just the bits of code that matter (often with funny syntaxes). The
tests of the [org.apache.sling.event](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/event/)
bundle, for example, make extensive use of such mock services.
-
-The problem with mocks is that it can become hard to make sure you're actually testing something,
and not just "mocking mocks". At a certain level of complexity, it becomes quicker and clearer
to actually start an OSGi framework for automated tests.
-
-### Side note: injecting services in private fields
-
-To inject (real or fake) services in others for testing, without having to create getters
and setters just for this, you could use a reflection-based trick, as in the below example.
Utilities
-such as the [PrivateAccessor](http://junit-addons.sourceforge.net/junitx/util/PrivateAccessor.html)
from [junit-addons](http://junit-addons.sourceforge.net/) make that simpler.
-
-#!java
-// set resource resolver factory
-// in a ServletResolver object which has a private resourceResolverFactory field
-
-ServletResolver servletResolver = ....
-Class<?> resolverClass = servletResolver.getClass().getSuperclass();
-final java.lang.reflect.Field resolverField = resolverClass.getDeclaredField("resourceResolverFactory");
-resolverField.setAccessible(true);
-resolverField.set(servletResolver, factory);
-
-
-## Pax Exam
-
-[Pax Exam](http://team.ops4j.org/wiki/display/paxexam/Pax+Exam) allows you to easily start
an OSGi framework during execution of a JUnit test suite.
-
-We currently use it for our [Sling installer integration tests](https://svn.apache.org/repos/asf/sling/trunk/installer/it)
for example. As parts of the installer interact directly with the OSGi framework, it felt
safer to test it in a realistic situation rather than mock everything.
-
-Such tests are obviously slower than plain unit tests and tests that use mocks. Our installer
integration tests, using Pax Exam, take about a minute to execute on a 2010 macbook pro.
-
-## Server-side JUnit tests
-
-The tools described on the [JUnit server-side testing support](/documentation/bundles/org-apache-sling-junit-bundles.html)
page allow for
-running JUnit tests on an live Sling instance, as part of the normal integration testing
cycle.
-
-## HTTP-based integration tests
-The [Sling HTTP Testing Rules](https://svn.apache.org/repos/asf/sling/trunk/testing/junit/rules)
allow writing integration tests easily. They are primarily meant to be used for tests that
use http against
-a Sling instance and make use of the [org.apache.sling.testing.clients](https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients)
which offer a simple, immutable and extendable way of working
-with specialized testing clients.
-
-The JUnit rules incorporate boiler-plate logic that is shared in tests and take the modern
approach of using rules rather than
-inheritance. The `SlingRule` (for methods) or `SlingClassRule` (for test classes) are base
rules, chaining other rules like `TestTimeoutRule`,
-`TestDescriptionRule`, `FilterRule`. The `SlingInstanceRule` extends that and starts a Sling
instance if needed and also allows
-instantiating a `SlingClient` pointing to the instance and automatically configure the base
url, credentials, etc.
-
-
-### <a name="starting"></a> Starting an Integration Test
-Starting an integration is very simple out of the box, but is very extendable, both by combining
or configuring the junit rules and by
-using the versatile `SlingClient` (which can be extended or adapted by calling `adaptTo(MyClient.class)`
without losing the client
-configuration)
-
-The [README](https://svn.apache.org/repos/asf/sling/trunk/testing/junit/rules/README.md)
provides more detail, as do [the tests](https://svn.apache.org/repos/asf/sling/trunk/testing/junit/rules/src/test/java).
-The [Sling HTTP Testing Clients](https://svn.apache.org/repos/asf/sling/trunk/testing/http/clients)
provide simple explanations, and unit tests.
-
-#### Maven Dependency
-#!xml
-<dependency>
-<groupId>org.apache.sling</groupId>
-<artifactId>org.apache.sling.testing.rules</artifactId>
-<version>0.1.0-SNAPSHOT</version>
-</dependency>
-
-#### Simple Example using SlingInstanceRule
-
-
-#!java
-public class MySimpleIT {
-
-@ClassRule
-public static SlingInstanceRule instanceRule = new SlingInstanceRule();
-
-@Rule
-public SlingRule methodRule = new SlingRule(); // will configure test timeout, description,
etc.
-
-@Test
-public void testCreateNode() {
-SlingClient client = instanceRule.getAdminClient();
-client.createNode("/content/myNode", "nt:unstructured");
-Assert.assertTrue("Node should be there", client.exists("/content/myNode"));
-//client.adaptTo(OsgiConsoleClient.class).editConfigurationWithWait(10, "MYPID", null, myMap);
-}
-}
-
-
-## Summary
-
-Combining the above testing techniques has worked well for us in creating and testing Sling.
Being able to test things at different levels of integration has proved an efficient way to
get good test coverage without having to write too much boring test code.
-
-
-[1]: https://code.google.com/p/mockito/

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/downloads.cgi
----------------------------------------------------------------------
diff --git a/content/downloads.cgi b/content/downloads.cgi
deleted file mode 100755
index 435af12..0000000
--- a/content/downloads.cgi
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# Wrapper script around mirrors.cgi script (http://www.apache.org/dev/release-download-pages.html)
-# (we must change to that directory in order for python to pick up the
-#  python includes correctly)
-cd /www/www.apache.org/dyn/mirrors
-/www/www.apache.org/dyn/mirrors/mirrors.cgi $*

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/downloads.md
----------------------------------------------------------------------
diff --git a/content/downloads.md b/content/downloads.md
deleted file mode 100644
index c502cb6..0000000
--- a/content/downloads.md
+++ /dev/null
@@ -1,37 +0,0 @@
-title=Downloads
-type=downloads
-status=published
-comment=the download data (bundle version etc) is found in the downloads template
-~~~~~~
-
-To get the latest development release of Apache Sling, you can check out the Source Code
and Getting and Building Sling yourself. Otherwise, the releases below are available for download.
To install, just download and extract. The PGP keys at [[https://people.apache.org/keys/group/sling.asc]]
can be used to verify the integrity of the release archives.
-
-All Apache Sling products are distributed under the terms of The Apache Software License
(version 2.0). See our license, or the LICENSE file included in each distribution. 
-
-TODO ToC ??
-
-# Mirrors
-
-Use the links below to download binary or source distributions of Apache Sling from one of
our mirrors.
-
-You are currently using **[preferred]**. If you encounter a problem with
-this mirror, please select another mirror. If all mirrors are failing,
-there are backup mirrors (at the end of the mirrors list) that should be
-available. If the mirror displayed above is labeled *preferred*, then
-please reload this page by [downloads.cgi](clicking here)
-
-<form action="[location]" method="get" id="SelectMirror">
-<p>Other mirrors: </p>
-<select name="Preferred">
-[if-any http]
-[for http]<option value="[http]">[http]</option>[end]
-[end]
-[if-any ftp]
-[for ftp]<option value="[ftp]">[ftp]</option>[end]
-[end]
-[if-any backup]
-[for backup]<option value="[backup]">[backup] (backup)</option>[end]
-[end]
-</select>
-<input type="submit" value="Change"></input>
-</form>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/errors/403.md
----------------------------------------------------------------------
diff --git a/content/errors/403.md b/content/errors/403.md
deleted file mode 100644
index def2c05..0000000
--- a/content/errors/403.md
+++ /dev/null
@@ -1,27 +0,0 @@
-title=Forbidden (403)		
-type=page
-status=published
-~~~~~~
-Notice:    Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-.
-http://www.apache.org/licenses/LICENSE-2.0
-.
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-
-We're sorry, but the page you requested cannot be accessed. This may be because:
-
-* You typed the address incorrectly
-* You followed a link from another site that pointed to this page.
-
-If you came to this page by following a broken link on our site, you can report the [problem](https://issues.apache.org/jira/browse/SLING).

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/errors/404.md
----------------------------------------------------------------------
diff --git a/content/errors/404.md b/content/errors/404.md
deleted file mode 100644
index a35f228..0000000
--- a/content/errors/404.md
+++ /dev/null
@@ -1,28 +0,0 @@
-title=Page Not Found		
-type=page
-status=published
-~~~~~~
-Notice:    Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-.
-http://www.apache.org/licenses/LICENSE-2.0
-.
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-
-We're sorry, but the page you requested cannot be found. This may be because:
-
-* The page has moved, was outdated, or has not been created yet
-* You typed the address incorrectly
-* You followed a link from another site that pointed to this page.
-
-If you came to this page by following a broken link on our site, you can report the [problem](https://issues.apache.org/jira/browse/SLING).

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/favicon.ico
----------------------------------------------------------------------
diff --git a/content/favicon.ico b/content/favicon.ico
deleted file mode 100644
index a36e242..0000000
Binary files a/content/favicon.ico and /dev/null differ

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/guides.md
----------------------------------------------------------------------
diff --git a/content/guides.md b/content/guides.md
deleted file mode 100644
index 30a4d95..0000000
--- a/content/guides.md
+++ /dev/null
@@ -1,23 +0,0 @@
-title=Guides		
-type=page
-status=published
-~~~~~~
-translation_pending: true
-
-These pages contain further information in a more informal way.
-
-* [Discover Sling in 15 minutes ](/documentation/getting-started/discover-sling-in-15-minutes.html)
- title says it all
-
-* [Resources](/documentation/the-sling-engine/resources.html) -- Presents the Resource as
the object around which Sling is built
-* [Servlet Resolution]({{ refs.servlet-resolution.path }}) -- How Sling resolves the servlet
or script responsible for rendering a Resource.
-* [Request Parameters](/documentation/the-sling-engine/request-parameters.html) -- Explains
how Sling provides request parameters to servlets, scripts and filters.
-* [Repository Based Development](/documentation/development/repository-based-development.html)
-- Shows how WebDAV is supported by Sling.
-
-* [Bundle Management](/documentation/tutorials-how-tos/installing-and-upgrading-bundles.html)
-- Explains how to install, upgrade and uninstall Bundles using the Sling Management console.
-
-
-These pages refer to the old Component API and launcher, and remain referred to here until
more up to date documentation has been prepared:
-
-* [Getting and Building Sling](/documentation/development/getting-and-building-sling.html)
-- A short recount on the first step for getting a running Sling instance after checking out
the source from the SVN repository
-* [Default Mapping and Rendering](/documentation/the-sling-engine/default-mapping-and-rendering.html)
-- Explains default mapping of repository nodes to Content instances and selection of a default
Component.
-* [Dispatching Requests](/documentation/the-sling-engine/dispatching-requests.html) -- Explains
how a Component may dispatch requests to include further content renderings in the response
to the client's request

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/index.md
----------------------------------------------------------------------
diff --git a/content/index.md b/content/index.md
deleted file mode 100644
index 392a6cb..0000000
--- a/content/index.md
+++ /dev/null
@@ -1,148 +0,0 @@
-title=Apache Sling - Bringing Back the Fun!		
-type=page
-status=published
-~~~~~~
-
-**Apache Sling&trade;** is an innovative web framework that is intended to
-bring back the fun to web development.
-
-Discussions about Sling happen on our mailing lists, see the [Project Information](/project-information.html)
-page for more info.
-
-# Apache Sling in five bullets points
-
-* REST based web framework
-* Content-driven, using a JCR content repository
-* Powered by OSGi
-* Scripting inside, multiple languages (JSP, server-side javascript, Scala,
-etc.)
-* Apache Open Source project
-
-# Apache Sling in a hundred words
-
-Apache Sling is a web framework that uses a [Java Content Repository](http://en.wikipedia.org/wiki/JSR-170),
such as [Apache Jackrabbit](http://jackrabbit.apache.org/), to store and manage content.
-
-Sling applications use either scripts or Java servlets, selected based on
-simple name conventions, to process HTTP requests in a RESTful way.
-
-The embedded [Apache Felix](http://felix.apache.org/)
-OSGi framework and console provide a dynamic runtime environment, where
-code and content bundles can be loaded, unloaded and reconfigured at
-runtime.
-
-As the first web framework dedicated to [JSR-170](http://jcp.org/en/jsr/detail?id=170)
-Java Content Repositories, Sling makes it very simple to implement simple
-applications, while providing an enterprise-level framework for more
-complex applications.
-
-## News
-
-<ul id="newsExcerpt">
-</ul>
-
-
-Refer to the news [archive](/news.html) for all news.
-
-## History
-
-Sling started as an internal project at [Day Software](http://www.day.com)
-, and entered the Apache Incubator in September 2007. As of June, 17th,
-2009 Apache Sling is a top level project of the Apache Software Foundation.
-
-The name "Sling" has been proposed by Roy Fielding who explained it like
-this:
-
-> [The name is] Biblical in nature.  The story of David: the weapon he
-> uses to slay the giant Goliath is a sling.  Hence, our David's
-> [David Nuescheler, CTO of Day Software] favorite weapon.
-
-> It is also the simplest device for delivering content very fast.
-
-## Getting started
-
-If you prefer doing rather than reading, please proceed to [Discover Sling in 15 minutes](/documentation/getting-started/discover-sling-in-15-minutes.html)
-or read through the recommended links in the [Getting Started](/documentation/getting-started.html)
-section, where you can quickly get started on your own instance of Sling.
-
-## Use Cases for Sling
-
-#### Wiki
-
-Day built a Wiki system on Sling. Each Wiki page is a node (with optional
-child nodes) in the repository. As a page is requested, the respective node
-is accessed and through the applying Component is rendered.
-
-Thanks to the JCR Mapping and the resolution of the Component from the
-mapped Content, the system does not care for what actual node is addressed
-as long as there is a Content mapping and a Component capable of handling
-the Content.
-
-Thus in the tradition of REST, the attachement of a Wiki page, which
-happens to be in a node nested below the wiki page node is easily accessed
-using the URL of the wiki page attaching the relative path of the
-attachement  ode. The system resolves the URL to the attachement Content
-and just calls the attachement's Component to spool the attachement.
-
-
-
-#### Digital Asset Management
-
-Day has implemented a Digital Asset Management (DAM) Application based on
-Sling. Thanks to the flexibility of the Content/Component combo as well as
-the service registration/access functionality offered by OSGi, extending
-DAM for new content type is merely a matter of implementing one or two
-interfaces and registering the respective service(s).
-
-Again, the managed assets may be easily spooled by directly accessing them.
-
-
-#### Web Content Management
-
-Last but not least, Sling offers itself very well to implementing a Web
-Content Management system. Thanks to the flexibility of rendering the
-output - remember: the system does not care what to render, as long as the
-URL resolves to a Content object for which a Component exists, which is
-called to render the Content - providing support for Web Content authors
-(not PHP programmers but users out in the field) to build pages to their
-likings can easily be done.
-
-
-## References
-
-
-#### Apache Jackrabbit
-
-The main purpose of Sling is to develop a content-centric Web Application
-framework for Java Content Repository (JCR) based data stores. Sling is
-implemented - with the notable exception of JCR Node Type management -
-purely in terms of the JCR API and as such may use any JCR compliant
-repository. The default implementation for [Apache Jackrabbit](http://jackrabbit.apache.org)
-is provided out of the box.
-
-#### OSGi
-
-Sling is implemented as a series of [OSGi](http://www.osgi.org)
-Bundles and makes extensive use of the OSGi functionality, such as
-lifecycle management and the service layer. In addition, Sling requires
-several OSGi compendium services to be available, such as the Log Service,
-Http Service, Configuration Admin Service, Metatype Service, and
-Declarative Services.
-
-#### Apache Felix
-
-While Sling does not require a specific OSGi framework implementation to
-run in, Sling is being developed using [Apache Felix](http://felix.apache.org)
-as the OSGi framework implementation. It has not been tested yet, but it
-is expected that Sling also operates perfectly inside other OSGi frameworks
-such as [Equinox](http://www.eclipse.org/equinox) and [Knopflerfish](http://www.knopflerfish.org).
-
-
-<script src="/res/jquery.js" type="text/javascript"></script>
-<script type="text/javascript">
-$(document).ready(function() {
-$.get("/news.html", function(news) {
-var $newsExcerpt = $(news).find('li').slice(0,5);
-$('#newsExcerpt').append($newsExcerpt);
-});
-});
-</script>

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/javadoc-io.md
----------------------------------------------------------------------
diff --git a/content/javadoc-io.md b/content/javadoc-io.md
deleted file mode 100644
index 0626628..0000000
--- a/content/javadoc-io.md
+++ /dev/null
@@ -1,10 +0,0 @@
-title=Sling API docs at javadoc.io		
-type=page
-status=published
-~~~~~~
-
-[javadocs.io](http://www.javadoc.io/) provides archived javadocs for all Sling modules (and
actually
-for all open source software hosted at Maven Central).
-
-To get the javadocs of a particular module use an URL like `http://javadoc.io/doc/{org}/{artifact}/{version}`,
like
-for example [http://www.javadoc.io/doc/org.apache.sling/org.apache.sling.api/2.9.0](http://www.javadoc.io/doc/org.apache.sling/org.apache.sling.api/2.9.0)

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/links.md
----------------------------------------------------------------------
diff --git a/content/links.md b/content/links.md
deleted file mode 100644
index 444949d..0000000
--- a/content/links.md
+++ /dev/null
@@ -1,51 +0,0 @@
-title=Links		
-type=page
-status=published
-~~~~~~
-
-Here are some links to other resources
-
-## Articles
-* [Java Content Repository: The Best Of Both Worlds](http://java.dzone.com/articles/java-content-repository-best)
- by Bertrand Delacretaz on Javalobby - uses the Sling HTTP interface to demonstrate JCR features.
-* [Accessing Relational Data as SLING RESTful URLs](http://www.lucamasini.net/Home/sling-and-cq5/accessing-relational-data-as-sling-restful-urls)
- by Luca Masini
-* [Your First Day With Sakai Nakamura](http://confluence.sakaiproject.org/display/KERNDOC/Your+First+Day+With+Sakai+Nakamura)
- Sakai Nakamura is based on Sling, that introductory article has very good explanations of
REST and Sling basics, and on why hierarchies are useful on the Web.
-
-## About Sling
-
-* [Sling on dev.day.com](http://dev.day.com/microsling/content/blogs/main.html?category=sling)
- Day's developers blog, regularly includes articles on Sling and JCR. Powered by Sling, of
course.
-* [Sling on Lars Trieloff's Blog](http://weblogs.goshaky.com/weblogs/lars/tags/sling) - 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](http://del.icio.us/tag/sling+jcr) - 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](http://fisheye6.atlassian.com/browse/sling) - code repository viewer,
activity statistics, etc.
-* [Sling on ohloh](https://www.ohloh.net/p/sling) - activity and community statistics.
-* [Sling on MarkMail](http://sling.markmail.org/) - 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](http://servicemix.apache.org/SMX4KNL/running-apache-sling-on-servicemix-kernel.html)
-
-## Sling Presentations and Screencasts
-
-* [Presentations tagged with "sling" at slideshare](http://www.slideshare.net/tag/sling)
-
-The following screencasts demonstrate Day Software's CRX quickstart product, powered by Sling:
-
-* [First Steps with CRX Quickstart](http://dev.day.com/microsling/content/blogs/main/firststeps1.html)
-* [TheServerSide.com in 15 minutes](http://dev.day.com/microsling/content/blogs/main/firststeps2.html)
-
-## From ApacheCon EU 08
-
-* [ApacheCon EU 08 Fast Feather Track Presentation on Sling](/res/docs/ApacheConEU08_FFT_Sling.pdf)
-* [JCR Meetup Presentation on Sling Architecture](/res/docs/ApacheConEU08_JCR_Meetup_Sling_Architecture.pdf)
-
-## From ApacheCon US 07
-
-* [ApacheCon US 07 Fast Feather Track Presentation on Sling](/res/docs/ApacheConUS07_FFT_Sling.pdf)
-* [Feathercast On Day 4 with an interview on Sling with Felix](http://feathercast.org/?p=59)
-
-## Technology used by Sling
-
-* [Apache Jackrabbit](http://jackrabbit.apache.org) - 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](http://www.jcp.org/en/jsr/detail?id=170)
- The specification of the repository API.
-* [Apache Felix](http://felix.apache.org) - The OSGi Framework implementation we use in Sling.
-* [The OSGi Alliance](http://www.osgi.org) - The OSGi Alliance is the specification body
defining the OSGi Core and Compendium Services. These specifications are at the center of
making Sling possible.

http://git-wip-us.apache.org/repos/asf/sling-site/blob/7b703652/content/media.md
----------------------------------------------------------------------
diff --git a/content/media.md b/content/media.md
deleted file mode 100644
index 424c423..0000000
--- a/content/media.md
+++ /dev/null
@@ -1,11 +0,0 @@
-title=Media		
-type=page
-status=published
-~~~~~~
-translation_pending: true
-
-This page holds all media required for the Apache Sling website. The media are attachments
and can be addressed using the following URL: http://cwiki.apache.org/SLINGxSITE/media.data/
(followed by the actual name of the attachment).
-
-Currently, some of these attachments are used by the overall site template (only visible/editable
by Confluence administrators).
-
-{attachments}


Mime
View raw message