You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2007/06/01 17:54:12 UTC

svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Author: rfrovarp
Date: Fri Jun  1 08:54:11 2007
New Revision: 543517

URL: http://svn.apache.org/viewvc?view=rev&rev=543517
Log:
Transforms object tags into img tags so that FCKEditor can correctly identify images for modification. XSL modified from Kupu.

Added:
    lenya/trunk/src/modules/fckeditor/resources/xslt/
    lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl
Modified:
    lenya/trunk/src/modules/fckeditor/sitemap.xmap

Added: lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl?view=auto&rev=543517
==============================================================================
--- lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl (added)
+++ lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl Fri Jun  1 08:54:11 2007
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+  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.
+-->
+
+<!--
+  Transforms page to be edited by FCKEditor wysiwyg xhtml editor.
+-->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns="http://www.w3.org/1999/xhtml"
+ >
+
+   <!-- this template converts the object tag to img (for compatiblity with older browsers 
+    for more, see http://www.xml.com/pub/a/2003/07/02/dive.html -->
+   <xsl:template name="object2img">
+      <img border="0">
+        <xsl:attribute name="src">
+          <xsl:value-of select="@data"/>
+        </xsl:attribute>
+        <!-- use the rarely-used ismap to roundtrip the type attribute for the object element -->
+        <xsl:attribute name="ismap">
+          <xsl:value-of select="@type"/>
+        </xsl:attribute>
+        <xsl:attribute name="alt">
+          <!-- the overwritten title (stored in @name) has precedence over dc:title -->
+          <xsl:choose>
+            <xsl:when test="@name != ''">
+              <xsl:value-of select="@name"/>
+            </xsl:when>
+            <xsl:when test="@title != ''">
+              <xsl:value-of select="@title"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="dc:metadata/dc:title"/>                    
+            </xsl:otherwise>
+            </xsl:choose>
+        </xsl:attribute>
+         <xsl:if test="string(@height)">
+          <xsl:attribute name="height">
+            <xsl:value-of select="@height"/>
+          </xsl:attribute>
+        </xsl:if> 
+        <xsl:if test="string(@width)">
+          <xsl:attribute name="width">
+            <xsl:value-of select="@width"/>
+          </xsl:attribute>
+        </xsl:if>         
+      </img>
+   </xsl:template>
+  
+  <xsl:template match="xhtml:object" priority="3">
+    <xsl:choose>
+      <xsl:when test="@href != ''">
+        <a href="{@href}">
+          <xsl:call-template name="object2img"/>
+        </a>
+      </xsl:when>
+      <xsl:when test="@type = 'application/x-shockwave-flash'">
+        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
+            <param name="movie" value="{@data}"/>
+        </object>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="object2img"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>  
+
+<xsl:template match="@*|node()">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template> 
+
+</xsl:stylesheet>

Modified: lenya/trunk/src/modules/fckeditor/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/sitemap.xmap?view=diff&rev=543517&r1=543516&r2=543517
==============================================================================
--- lenya/trunk/src/modules/fckeditor/sitemap.xmap (original)
+++ lenya/trunk/src/modules/fckeditor/sitemap.xmap Fri Jun  1 08:54:11 2007
@@ -79,6 +79,8 @@
         <map:transform type="uuid2url">
           <map:parameter name="urls" value="absolute"/>
         </map:transform>
+        <map:transform
+          src="fallback://lenya/modules/fckeditor/resources/xslt/content2edit.xsl"/>
         <map:serialize type="xml-get"/>
       </map:match>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Re: License guidance: Re: svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Posted by Michael Wechner <mi...@wyona.com>.
Richard Frovarp wrote:

> Michael Wechner wrote:
>
>> Richard Frovarp wrote:
>>
>>>
>>>>
>>>> +</xsl:template> +
>>>> +</xsl:stylesheet>
>>>>   
>>>
>>>
>>>
>>> This file is basically a slightly modified version of the one from 
>>> Kupu. It was missing the ASF header, so I slapped it on. I just 
>>> realized that the Kupu file isn't under our SVN (when I tried to svn 
>>> commit a modified version of that file). You can find the original 
>>> Kupu file at src/modules/kupu/apache-lenya/lenya/content2edit.xsl. 
>>> What needs to be done to make everything okay with respect to 
>>> licensing?
>>
>>
>>
>> you could ask the Kupu people if it's ok to use this file and 
>> dual-license it.
>>
>> Otherwise I am afraid we need to remove it or rewrite it, such that 
>> it cannot be considered a copy anymore.
>> Sounds silly, but I guess it's legally correct.
>>
>> Cheers
>>
>> Michael
>
>
> Okay. I kind of figured as much. Since it was a Lenya specific file, I 
> didn't know if this project originally contributed the file or not. 
> I'll remove it until this gets figured out. I need to talk to them 
> anyway, since their file isn't correct at the moment.


this might help to convince them to dual-license ;-)

Cheers

Michael

>
>
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: License guidance: Re: svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Posted by Richard Frovarp <Ri...@sendit.nodak.edu>.
Michael Wechner wrote:
> Richard Frovarp wrote:
>
>>
>>>
>>> +</xsl:template> +
>>> +</xsl:stylesheet>
>>>   
>>
>>
>> This file is basically a slightly modified version of the one from 
>> Kupu. It was missing the ASF header, so I slapped it on. I just 
>> realized that the Kupu file isn't under our SVN (when I tried to svn 
>> commit a modified version of that file). You can find the original 
>> Kupu file at src/modules/kupu/apache-lenya/lenya/content2edit.xsl. 
>> What needs to be done to make everything okay with respect to licensing?
>
>
> you could ask the Kupu people if it's ok to use this file and 
> dual-license it.
>
> Otherwise I am afraid we need to remove it or rewrite it, such that it 
> cannot be considered a copy anymore.
> Sounds silly, but I guess it's legally correct.
>
> Cheers
>
> Michael

Okay. I kind of figured as much. Since it was a Lenya specific file, I 
didn't know if this project originally contributed the file or not. I'll 
remove it until this gets figured out. I need to talk to them anyway, 
since their file isn't correct at the moment.

Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: License guidance: Re: svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Michael Wechner wrote:
> Richard Frovarp wrote:
> 
>>
>>>
>>> +</xsl:template> +
>>> +</xsl:stylesheet>
>>>   
>>
>>
>> This file is basically a slightly modified version of the one from 
>> Kupu. It was missing the ASF header, so I slapped it on. I just 
>> realized that the Kupu file isn't under our SVN (when I tried to svn 
>> commit a modified version of that file). You can find the original 
>> Kupu file at src/modules/kupu/apache-lenya/lenya/content2edit.xsl. 
>> What needs to be done to make everything okay with respect to licensing?
> 
> 
> you could ask the Kupu people if it's ok to use this file and 
> dual-license it.
> 
> Otherwise I am afraid we need to remove it or rewrite it, such that it 
> cannot be considered a copy anymore.
> Sounds silly, but I guess it's legally correct.

nonsense.

http://codespeak.net/svn/kupu/trunk/kupu/doc/LICENSE.txt is clearly a 
BSD license, so you are in the clear.

for comparison: http://opensource.org/licenses/bsd-license.php


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: License guidance: Re: svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Posted by Michael Wechner <mi...@wyona.com>.
Richard Frovarp wrote:

>
>>
>> +</xsl:template> +
>> +</xsl:stylesheet>
>>   
>
>
> This file is basically a slightly modified version of the one from 
> Kupu. It was missing the ASF header, so I slapped it on. I just 
> realized that the Kupu file isn't under our SVN (when I tried to svn 
> commit a modified version of that file). You can find the original 
> Kupu file at src/modules/kupu/apache-lenya/lenya/content2edit.xsl. 
> What needs to be done to make everything okay with respect to licensing?


you could ask the Kupu people if it's ok to use this file and 
dual-license it.

Otherwise I am afraid we need to remove it or rewrite it, such that it 
cannot be considered a copy anymore.
Sounds silly, but I guess it's legally correct.

Cheers

Michael

>
> Thanks,
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


License guidance: Re: svn commit: r543517 - in /lenya/trunk/src/modules/fckeditor: resources/xslt/ resources/xslt/content2edit.xsl sitemap.xmap

Posted by Richard Frovarp <Ri...@sendit.nodak.edu>.
rfrovarp@apache.org wrote:
> Author: rfrovarp
> Date: Fri Jun  1 08:54:11 2007
> New Revision: 543517
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=543517
> Log:
> Transforms object tags into img tags so that FCKEditor can correctly identify images for modification. XSL modified from Kupu.
>
> Added:
>     lenya/trunk/src/modules/fckeditor/resources/xslt/
>     lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl
> Modified:
>     lenya/trunk/src/modules/fckeditor/sitemap.xmap
>
> Added: lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl
> URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl?view=auto&rev=543517
> ==============================================================================
> --- lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl (added)
> +++ lenya/trunk/src/modules/fckeditor/resources/xslt/content2edit.xsl Fri Jun  1 08:54:11 2007
> @@ -0,0 +1,94 @@
> +<?xml version="1.0" encoding="UTF-8" ?>
> +
> +<!--
> +  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.
> +-->
> +
> +<!--
> +  Transforms page to be edited by FCKEditor wysiwyg xhtml editor.
> +-->
> +
> +<xsl:stylesheet version="1.0"
> +  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> +  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
> +  xmlns:xhtml="http://www.w3.org/1999/xhtml"
> +    xmlns:dc="http://purl.org/dc/elements/1.1/"
> +  xmlns="http://www.w3.org/1999/xhtml"
> + >
> +
> +   <!-- this template converts the object tag to img (for compatiblity with older browsers 
> +    for more, see http://www.xml.com/pub/a/2003/07/02/dive.html -->
> +   <xsl:template name="object2img">
> +      <img border="0">
> +        <xsl:attribute name="src">
> +          <xsl:value-of select="@data"/>
> +        </xsl:attribute>
> +        <!-- use the rarely-used ismap to roundtrip the type attribute for the object element -->
> +        <xsl:attribute name="ismap">
> +          <xsl:value-of select="@type"/>
> +        </xsl:attribute>
> +        <xsl:attribute name="alt">
> +          <!-- the overwritten title (stored in @name) has precedence over dc:title -->
> +          <xsl:choose>
> +            <xsl:when test="@name != ''">
> +              <xsl:value-of select="@name"/>
> +            </xsl:when>
> +            <xsl:when test="@title != ''">
> +              <xsl:value-of select="@title"/>
> +            </xsl:when>
> +            <xsl:otherwise>
> +              <xsl:value-of select="dc:metadata/dc:title"/>                    
> +            </xsl:otherwise>
> +            </xsl:choose>
> +        </xsl:attribute>
> +         <xsl:if test="string(@height)">
> +          <xsl:attribute name="height">
> +            <xsl:value-of select="@height"/>
> +          </xsl:attribute>
> +        </xsl:if> 
> +        <xsl:if test="string(@width)">
> +          <xsl:attribute name="width">
> +            <xsl:value-of select="@width"/>
> +          </xsl:attribute>
> +        </xsl:if>         
> +      </img>
> +   </xsl:template>
> +  
> +  <xsl:template match="xhtml:object" priority="3">
> +    <xsl:choose>
> +      <xsl:when test="@href != ''">
> +        <a href="{@href}">
> +          <xsl:call-template name="object2img"/>
> +        </a>
> +      </xsl:when>
> +      <xsl:when test="@type = 'application/x-shockwave-flash'">
> +        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
> +            <param name="movie" value="{@data}"/>
> +        </object>
> +      </xsl:when>
> +      <xsl:otherwise>
> +        <xsl:call-template name="object2img"/>
> +      </xsl:otherwise>
> +    </xsl:choose>
> +  </xsl:template>  
> +
> +<xsl:template match="@*|node()">
> +  <xsl:copy>
> +    <xsl:apply-templates select="@*|node()"/>
> +  </xsl:copy>
> +</xsl:template> 
> +
> +</xsl:stylesheet>
>   

This file is basically a slightly modified version of the one from Kupu. 
It was missing the ASF header, so I slapped it on. I just realized that 
the Kupu file isn't under our SVN (when I tried to svn commit a modified 
version of that file). You can find the original Kupu file at 
src/modules/kupu/apache-lenya/lenya/content2edit.xsl. What needs to be 
done to make everything okay with respect to licensing?

Thanks,
Richard

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org