Ok. Here we are, I've followed all procedures on the page pointed me
to by Bruno (thanks!) and are submitting (attached to this message,
discard the former attachment on this thread) the hopefully correct
patch for review.

Thanks, and sorry for all my former questions about things that were
stated in some restlet.org web page.

2009/8/14 Fabián Mandelbaum <[email protected]>:
> Hello Bruno,
>
> Thanks for pointing my lazy ... to the right resource answering my question.
>
> I'll study this and contact Jerome or Thierry afterwards.
>
> On Fri, Aug 14, 2009 at 11:49 AM, Bruno
> Harbulot<[email protected]> wrote:
>> Hi Fabian,
>>
>> The procedure to contribute to Restlet is described here:
>> http://www.restlet.org/community/contribute
>>
>> In short, for a patch to be included, you would have to sign the JCA and
>> get in touch with Jerome or Thierry.
>>
>> Best wishes,
>>
>> Bruno.
>>
>>
>> Fabian Mandelbaum wrote:
>>> Hello,
>>>
>>> I've asked on this busy ML about the procedure to submit a (small)
>>> patch to MetadataService and got no answer so far. I suppose everyone
>>> is as busy as I am. So, I'm taking the liberty to post this message
>>> with the (small) patch attached.
>>>
>>> This patch was generated on MetadataService.java from Restlet 2.0M4's
>>> JEE distribution, with "diff -u". It adds out-of-the-box support for
>>> XSL files using the (more common than .xslt) .xsl extension. Please,
>>> consider including this small contribution into the next iteration of
>>> Restlet 2.0, thank you!
>>>
>>>
>>>
>>>
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2383638
>>
>
>
>
> --
> Fabián Mandelbaum
> IS Engineer
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2384072
Index: modules/org.restlet/src/org/restlet/service/MetadataService.java
===================================================================
--- modules/org.restlet/src/org/restlet/service/MetadataService.java	(revision 5310)
+++ modules/org.restlet/src/org/restlet/service/MetadataService.java	(working copy)
@@ -199,6 +199,7 @@
      * <li>xltx: Office Excel 2007 template</li>
      * <li>xml: XML document</li>
      * <li>xsd: W3C XML Schema document</li>
+     * <li>xsl: XSL Transform file</li>
      * <li>xslt: XSL Transform file</li>
      * <li>xul: XML User Interface Language file</li>
      * <li>z: UNIX compressed archive file</li>
@@ -339,6 +340,7 @@
         ext(dm, "xml", MediaType.TEXT_XML);
         ext(dm, "xml", MediaType.APPLICATION_XML);
         ext(dm, "xsd", MediaType.APPLICATION_W3C_SCHEMA);
+        ext(dm, "xsl", MediaType.APPLICATION_W3C_XSLT);
         ext(dm, "xslt", MediaType.APPLICATION_W3C_XSLT);
         ext(dm, "xul", MediaType.APPLICATION_XUL);
         ext(dm, "z", MediaType.APPLICATION_COMPRESS);
@@ -676,7 +678,7 @@
             Class<T> metadataType) {
         Metadata metadata = getMetadata(extension);
 
-        if (metadataType.isAssignableFrom(metadata.getClass())) {
+        if (metadata != null && metadataType.isAssignableFrom(metadata.getClass())) {
             return metadataType.cast(metadata);
         } else {
             return null;

Reply via email to