[
https://issues.apache.org/jira/browse/SLING-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger closed SLING-103.
-----------------------------------
Resolution: Fixed
Working on the implementation showed, that removing the MimeTypeService (and
hence the commons/mime project) is not a viable solution: The
SlingServletContext will only be available when the Sling Core bundle is
started, while the mime type mapping is required by the JCR Resource bundle to
be able to load initial content, which may be well before this.
In addition, configurability of the SlingServletContext for MIME type mapping
would be too complicated to be done.
So we keep the MimeTypeService and use it from the SlingServletContext.
Nevertheless the SlingServletContext is registered as a ServletContext service
for servlets and scripts running inside Sling.
> 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.