Replace MimeTypeService (commons/mime) by [Sling]ServletContext registered as a 
Service
---------------------------------------------------------------------------------------

                 Key: SLING-103
                 URL: https://issues.apache.org/jira/browse/SLING-103
             Project: Sling
          Issue Type: New Feature
          Components: Core
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: 2.0.0


The commons/mime project with the MimeTypeService has been introduced to be 
able to provide MIME type mapping to the Content Loader in the former 
sling-content-jcr bundle and a ServletContext to access the MIME type mapping 
was not available. Extensibility has been reached by defining a 
MimeTypeProvider service, which might be implemented by other bundles to 
enhance MIME type mapping in the MimeTypeService.

With the new Sling API we defined a new ServletResolver interface, which in 
real Sling resolves resource types to servlets registered as OSGi service. 
These servlets have to be initialized with a ServletConfig and a 
ServletContext. If we want to provide ServletResolver implementations outside 
the core project (which I strive to), we have to have a way to provide the 
ServletContext from the main Sling servlet to the ServletResolver.

So I propose ...

* to have the main sling servlet (SlingMainServlet) register the ServletContext 
as a javax.servlet.ServletContext service which would be available to all 
intersted parties.

* to remove the commons/mime project as MIME type mapping may be used by 
accessing the ServletContext service

* drop the MimeTypeResovler interface functionality completely. To extend the 
registered ServletContext service with new mappings, the ServletContext service 
will be a ManagedService, whose configuration will be able to configure MIME 
type mappings.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to