You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/03/29 00:51:22 UTC

svn commit: r928508 - /myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/

Author: lu4242
Date: Sun Mar 28 22:51:22 2010
New Revision: 928508

URL: http://svn.apache.org/viewvc?rev=928508&view=rev
Log:
TOMAHAWK-1498 Update t:inputHtml and kupu to 1.4.16

Added:
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/libraries.rng
Modified:
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/.objects
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/allimages.xml
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl.metadata
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/imagelibrary.xml
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/kupubuttons.xml
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/linklibrary.xml
    myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/logos.xml

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/.objects
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/.objects?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/.objects (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/.objects Sun Mar 28 22:51:22 2010
@@ -1,2 +1,2 @@
-drawer.xsl:Page Template
-drawer.xsl.metadata:
+drawer.xsl:Page Template
+drawer.xsl.metadata:

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/allimages.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/allimages.xml?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/allimages.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/allimages.xml Sun Mar 28 22:51:22 2010
@@ -1,9 +1,11 @@
 <?xml version="1.0" ?>
-<collection>
+<?oxygen RNGSchema="file:libraries.rng" type="xml"?>
+<collection id="collection-allimages.xml">
     <uri>kupudrawers/allimages.xml</uri>
     <icon>kupuimages/kupulibrary.png</icon>
     <title>All images</title>
     <src>kupudrawers/allimages.xml</src>
+    <breadcrumbs><crumb href="top">top</crumb><crumb href="sub">Kupubuttons</crumb></breadcrumbs>
     <items>
         <collection id="logos">
             <uri>kupudrawers/logos.xml</uri>
@@ -11,11 +13,12 @@
             <src>kupudrawers/logos.xml</src>
             <icon>kupuimages/kupulibrary.png</icon>
         </collection>
-        <collection id="kupubuttons">
+        <resource id="kupubuttons">
             <uri>kupudrawers/kupubuttons.xml</uri>
             <title>Kupu buttons</title>
             <src>kupudrawers/kupubuttons.xml</src>
             <icon>kupuimages/kupulibrary.png</icon>
-        </collection>
+            <description>Button collection</description>
+        </resource>
     </items>
 </collection>

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl Sun Mar 28 22:51:22 2010
@@ -10,152 +10,241 @@
 #
 ##############################################################################
 
-XSL transformation from Kupu Library XML to HTML for the image library
-drawer.
+XSL transformation from Kupu Library XML to HTML for the library drawers.
 
-$Id$
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
     xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:i18n="http://xml.zope.org/namespaces/i18n"
-    i18n:domain="kupu">
- <tal:block define="x python:request.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=UTF-8')" />
-    <xsl:param name="drawertype">image</xsl:param>
-    <xsl:param name="drawertitle">Image Drawer</xsl:param>
-    <xsl:param name="showupload"></xsl:param>
-    <xsl:param name="usecaptions"></xsl:param>
-    <xsl:variable name="titlelength" select="60"/>
-        <xsl:variable name="i18n_drawertitle"> 
+    xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="kupu">
+    <tal:block define="x python:request.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=UTF-8')" />
+    <xsl:param name="drawertype">
+        <xsl:variable name="v" select="/libraries/param[@name='drawertype']"></xsl:variable>
+        <xsl:choose>
+            <xsl:when test="count($v)"><xsl:value-of select="$v"/></xsl:when>
+            <xsl:otherwise>image</xsl:otherwise>
+        </xsl:choose>
+    </xsl:param>
+    <xsl:param name="drawertitle">
+        <xsl:variable name="v" select="/libraries/param[@name='drawertitle']"></xsl:variable>
+        <xsl:choose>
+          <xsl:when test="count($v)"><xsl:value-of select="$v"/></xsl:when>
+          <xsl:otherwise i18n:translate="default_drawer_title">Drawer</xsl:otherwise>
+        </xsl:choose>
+    </xsl:param>
+    <xsl:param name="showupload">
+      <!-- does this default value actually make any sense? -->
+      <xsl:variable name="v" select="/libraries/param[@name='showupload']"></xsl:variable>
+      <xsl:choose>
+        <xsl:when test="count($v)"><xsl:value-of select="$v"/></xsl:when>
+      </xsl:choose>
+    </xsl:param>
+    <xsl:param name="usecaptions">
+        <xsl:variable name="v" select="/libraries/param[@name='usecaptions']"></xsl:variable>
+        <xsl:choose>
+            <xsl:when test="count($v)"><xsl:value-of select="$v"/></xsl:when>
+        </xsl:choose>
+    </xsl:param>
+    <xsl:param name="multiple"><xsl:variable name="v" select="/libraries/param[@name='multiple']"></xsl:variable>
+        <xsl:choose>
+            <xsl:when test="count($v)"><xsl:value-of select="$v"/></xsl:when>
+        </xsl:choose>
+    </xsl:param>
+    <xsl:param name="showanchors">yes</xsl:param>
+    <xsl:param name="image-align">inline</xsl:param>
+    <xsl:param name="image-caption">true</xsl:param>
+    <xsl:param name="image-class"></xsl:param>
+    <xsl:param name="link_target"></xsl:param>
+    <xsl:param name="link_name"></xsl:param>
+    <xsl:param name="ie"></xsl:param>
+    <xsl:variable name="titlelength" select="255"/>
+    <xsl:variable name="i18n_drawertitle">
         <xsl:choose>
             <xsl:when i18n:translate="imagedrawer_title" test="$drawertype='image'">Insert Image</xsl:when>
             <xsl:when i18n:translate="linkdrawer_title"
-test="$drawertype='link'">Insert Link</xsl:when>
+                test="$drawertype='link'">Insert Link</xsl:when>
+            <xsl:otherwise><xsl:value-of select="$drawertitle"/></xsl:otherwise>
         </xsl:choose>
-</xsl:variable>
-    <xsl:template match="/">
-        <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
+    </xsl:variable>
+    <xsl:template name="drawer-title" i18n:translate="default_drawer_title">Drawer</xsl:template>
+    <xsl:output indent="yes" method="xml" />
+    <xsl:preserve-space elements="form div strong br input textarea"/>
+    <xsl:template match="/"><!-- root is always 'libraries'? -->
+        <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="kupu" >
             <head>
                 <title>
                     <xsl:value-of select="$i18n_drawertitle"/>
                 </title>
-                <link type="text/css" rel="stylesheet">
-                    <xsl:attribute name="href">kupudrawerstyles.css </xsl:attribute>
-                </link>
+                <xsl:call-template name="mystyle" />
             </head>
             <body>
-                <div style="width: 500px; border: solid black 1px; width: 100px">
+                <div class="kupu-drawer">
                     <div id="kupu-librarydrawer">
-                        <h1 style="padding: 0;float: left;">
-                            <xsl:value-of select="$i18n_drawertitle"/>
-                        </h1>
-                        <div id="kupu-searchbox" style="text-align: right">
-                            <form onsubmit="return false;">
-                                <xsl:variable name="search_value" 
-                                              i18n:translate="kupudrawer_search">search</xsl:variable>
+                        <div id="kupu-searchbox">
+                            <!--<form onsubmit="return false;">-->
+                                <xsl:variable name="search_value" i18n:translate="kupudrawer_search"
+                                    >Search</xsl:variable>
                                 <input id="kupu-searchbox-input"
-                                    class="kupu-searchbox-input nofocus"
-                                    name="searchbox"
-                                    style="font-style: italic;"
-                                    onkeyup="if (event.keyCode == 13 ) drawertool.current_drawer.search();">
-                                   <xsl:attribute name="value">
-                                      <xsl:value-of select="$search_value" />
-                                   </xsl:attribute>
-                                   <xsl:attribute name="onclick">
-                                      if (this.value == '<xsl:value-of select="$search_value" />') this.value = ''; this.style.fontStyle='normal';</xsl:attribute>
+                                    class="kupu-searchbox-input nofocus">
+                                  <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                                    <xsl:attribute name="onkeyup">if(event.keyCode == 13){drawertool.current_drawer.search();return false;}</xsl:attribute>
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="$search_value"/>
+                                    </xsl:attribute>
+                                    <xsl:attribute name="onclick">
+                                        if (this.value == '<xsl:value-of
+                                            select="$search_value"/>') this.value = ''; this.style.fontStyle='normal';</xsl:attribute>
                                 </input>
-                            </form>
+                            <!--</form>-->
+                        </div>
+                        <h1 class="kupu-drawer-title">
+                            <xsl:value-of select="$i18n_drawertitle"/>
+                        </h1>
+                        <div id="kupu-breadcrumbs">
+                          <xsl:if test="//*[@selected]/breadcrumbs">
+                              <xsl:apply-templates select="//*[@selected]/breadcrumbs"/>
+                          </xsl:if>
                         </div>
                         <div class="kupu-panels">
-                            <table>
+                          <table>
                                 <tr class="kupu-panelsrow">
                                     <td id="kupu-librariespanel" class="panel">
                                         <div id="kupu-librariesitems" class="overflow">
-                                        <xsl:apply-templates select="/libraries/library"/>
+                                            <xsl:apply-templates select="/libraries/library"/>
                                         </div>
                                     </td>
                                     <td id="kupu-resourcespanel" class="panel">
+                                       <xsl:if test="/libraries/*[@selected]//uploadbutton">
+                                          <xsl:attribute name="class">panel upload-allowed</xsl:attribute>
+                                       </xsl:if>
                                         <div id="kupu-resourceitems" class="overflow">
-                                        <xsl:apply-templates select="/libraries/*[@selected]/items"/>
+                                            <xsl:apply-templates
+                                                select="/libraries/*[@selected]/items"/>
                                         </div>
+                                        <xsl:apply-templates select="/libraries/*[@selected]//uploadbutton"
+                                                                mode="currentpanel"/>
                                     </td>
                                     <td id="kupu-propertiespanel" class="panel">
                                         <div id="kupu-properties" class="overflow">
-                                        <xsl:choose>
-                                        <xsl:when test="$drawertype='image'">
-                                            <xsl:if test="//resource[@selected]">
-                                                <xsl:apply-templates
-                                                select="/libraries/*[@selected]//resource[@selected]" mode="image-properties"/>
-                                            </xsl:if>
-                                            <!-- use image upload template -->
-                                            <xsl:if test="$showupload='yes'">
-                                                <xsl:apply-templates select="/libraries/*[@selected]//uploadbutton" mode="image-upload"/>
-                                            </xsl:if>
-                                        </xsl:when>
-                                        <xsl:when test="$drawertype='link'">
-                                        <xsl:apply-templates
-                                        select="/libraries/*[@selected]//resource[@selected]" mode="link-properties"/>
-                                        </xsl:when>
-                                        <xsl:otherwise>
-                                            <xsl:apply-templates
-                                            select="/libraries/*[@selected]//resource[@selected]" mode="properties"/>
-                                        </xsl:otherwise>
-                                        </xsl:choose>
+                                          <xsl:apply-templates select="." mode="panel" />
                                         </div>
                                     </td>
                                 </tr>
                             </table>
                         </div>
-                        <div class="kupu-dialogbuttons">                            
-                            <button type="button" 
+                        <div class="kupu-dialogbuttons">
+                            <button type="button"
                                     class="kupu-dialog-button"
-                                    i18n:translate="" 
-                                    onclick="drawertool.current_drawer.save();">Ok</button>
+                                    i18n:translate="button_ok"
+                                onclick="drawertool.current_drawer.save();">Ok</button>
                             <button type="button"
-                                    class="kupu-dialog-button" 
-                                    i18n:translate="" 
-                                    onclick="drawertool.closeDrawer();">Cancel</button>
+                                    class="kupu-dialog-button"
+                                    i18n:translate="button_cancel"
+                                onclick="drawertool.closeDrawer();">Cancel</button>
+                            <button type="button"
+                                    class="kupu-dialog-button"
+                                    i18n:translate="button_reload"
+                                onclick="drawertool.current_drawer.reloadCurrent();">Reload</button>
                         </div>
                     </div>
                 </div>
             </body>
         </html>
     </xsl:template>
+
+    <!-- The panel template can be overridden, if something else must happen on the right panel of the drawer. -->
+    <xsl:template match="*" mode="panel">
+      <xsl:choose>
+        <xsl:when test="$drawertype='image'">
+          <xsl:if test="//resource[@selected]">
+            <xsl:apply-templates
+                select="/libraries/*[@selected]//resource[@selected]"
+                mode="image-properties"/>
+          </xsl:if>
+          <!-- use image upload template -->
+          <xsl:if test="$showupload='yes'">
+            <xsl:apply-templates
+                select="/libraries/*[@selected]//uploadbutton"
+                mode="image-upload"/>
+          </xsl:if>
+        </xsl:when>
+        <xsl:when test="$drawertype='link'">
+          <xsl:apply-templates
+              select="/libraries/*[@selected]//resource[@selected]"
+              mode="link-properties"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates
+              select="/libraries/*[@selected]//resource[@selected]"
+              mode="properties"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+
+    <xsl:template name="mystyle" />
+
     <xsl:template match="library">
-        <div onclick="drawertool.current_drawer.selectLibrary('{@id}');"
-            class="kupu-libsource" title="{title}" style="">
+        <div onclick="drawertool.current_drawer.selectLibrary('{@id}');" class="kupu-libsource"
+            title="{title}" style="">
             <xsl:attribute name="id">
                 <xsl:value-of select="@id"/>
             </xsl:attribute>
+            <xsl:if test="@selected=1">
+               <xsl:attribute name="class">kupu-libsource-selected</xsl:attribute>
+            </xsl:if>
             <xsl:apply-templates select="icon"/>
-            <span class="drawer-item-title"><xsl:value-of select="title"/></span>
+            <span class="drawer-item-title">
+               <xsl:call-template name="lf2br">
+                  <xsl:with-param name="StringToTransform" select="title/text()"/>
+               </xsl:call-template>
+            </span>
         </div>
     </xsl:template>
     <xsl:template match="items">
-        <xsl:apply-templates select="collection|resource|uploadbutton" mode="currentpanel"/>
+        <xsl:apply-templates select="collection|resource" mode="currentpanel"/>
     </xsl:template>
     <xsl:template match="resource|collection" mode="currentpanel">
-        <div id="{@id}" class="kupu-{local-name()}" title="{description}">
+        <div id="{@id}" title="{description}">
+           <xsl:attribute name="class">
+              <xsl:value-of select="@class"/>
+              kupu-<xsl:value-of select="local-name()"/>
+              <xsl:if test="@selected">
+                 selected-item
+              </xsl:if>
+           </xsl:attribute>
             <xsl:attribute name="onclick">
                 <xsl:choose>
-                    <xsl:when
-                            test="local-name()='collection'">drawertool.current_drawer.selectCollection('<xsl:value-of select="@id"/>');</xsl:when>
-
-                    <xsl:otherwise>drawertool.current_drawer.selectItem(this, '<xsl:value-of select="@id"/>')</xsl:otherwise>
+                    <xsl:when test="local-name()='collection'">drawertool.current_drawer.selectCollection(this);</xsl:when>
+                    <xsl:otherwise>drawertool.current_drawer.selectItem(this, event)</xsl:otherwise>
                 </xsl:choose>
             </xsl:attribute>
-            <xsl:apply-templates select="icon"/>
-            <xsl:apply-templates select="(label|title)[1]"/>
+            <span>
+               <input name="drawer-item-radio">
+                  <xsl:attribute name="type">
+                     <xsl:choose>
+                        <xsl:when test="$multiple='yes'">checkbox</xsl:when>
+                        <xsl:otherwise>radio</xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:attribute>
+                  <xsl:if test="@checked">
+                     <xsl:attribute name="checked">checked</xsl:attribute>
+                  </xsl:if>
+                  <xsl:if test="not(local-name()='resource')">
+                     <xsl:attribute name="style">visibility:hidden;</xsl:attribute>
+                  </xsl:if>
+               </input>
+               <xsl:apply-templates select="icon"/>
+               <xsl:apply-templates select="(label|title)[1]"/>
+            </span>
         </div>
     </xsl:template>
+
     <xsl:template match="uploadbutton" mode="currentpanel">
-        <div class="kupu-upload">
-            <xsl:attribute name="onclick">
-                drawertool.current_drawer.selectUpload();
-            </xsl:attribute>
-            <span class="drawer-item-title" 
-                  i18n:translate="imagedrawer_upload_link">Upload ...</span>
-        </div>
+        <button class="kupu-dialog-button kupu-upload">
+            <xsl:attribute name="onclick"> drawertool.current_drawer.selectUpload(); </xsl:attribute>
+            <span tal:omit-tag="" i18n:translate="imagedrawer_upload_link">Upload&#xa0;image&#xa0;here...</span>
+        </button>
     </xsl:template>
+
     <xsl:template match="icon">
         <img src="{.}" alt="{../title}">
             <xsl:attribute name="class">library-icon-<xsl:value-of select="local-name(..)"/>
@@ -164,9 +253,6 @@ test="$drawertype='link'">Insert Link</x
     </xsl:template>
     <xsl:template match="label|title">
         <span class="drawer-item-title">
-            <xsl:if test="../@selected">
-                <xsl:attribute name="class">drawer-item-title selected-item</xsl:attribute>
-            </xsl:if>
             <xsl:choose>
                 <xsl:when test="string-length() &gt; $titlelength">
                     <xsl:value-of select="substring(., 0, $titlelength)"/>... </xsl:when>
@@ -174,134 +260,368 @@ test="$drawertype='link'">Insert Link</x
                     <xsl:value-of select="."/>
                 </xsl:otherwise>
             </xsl:choose>
-        </span>
+            </span>
     </xsl:template>
-    <xsl:template match="resource|collection" mode="image-properties">
-        <div>
+    <!-- resource template with no mode can be used to generate a quick preview -->
+    <xsl:template match="resource">
+      <div>
+        <h1 class="kupu-title-row">
             <xsl:value-of select="title"/>
+        </h1>
+        <div class="kupu-preview-row">
+          <xsl:apply-templates select="." mode="image-view" />
         </div>
-        <xsl:choose>
-            <xsl:when test="width">
-                <div>
-                    <xsl:variable name="h" select="number(height) div 120"/>
-                    <xsl:variable name="w" select="number(width) div 100"/>
-                    <xsl:choose>
-                        <xsl:when test="($h&gt;$w) and $h&gt;1">
-                            <img src="{uri}" title="{title}" height="120"
-                                width="{width div $h}" alt="{title}"/>
-                        </xsl:when>
-                        <xsl:when test="($w&gt;$h) and $w&gt;1">
-                            <img src="{uri}" title="{title}"
-                                height="{height div $w}" width="100" alt="{title}"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <img src="{uri}" title="{title}" height="{height}"
-                                width="{width}" alt="{title}"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
-                </div>
-            </xsl:when>
-            <xsl:when test="preview">
-                <tr>
-                    <td>
-                        <strong i18n:translate="imagedrawer_upload_preview_label">Preview</strong>
-                        <br/>
-                        <img src="{preview}" title="{title}" height="{height}"
-                            width="{width}" alt="{title}"/>
-                    </td>
-                </tr>
-            </xsl:when>
-            <xsl:otherwise>
-                <img src="{uri}" title="{title}" height="120" alt="{title}" />
-            </xsl:otherwise>
-        </xsl:choose>
-        <div>
-            <xsl:value-of select="size"/>
-            <xsl:if test="width" i18n:translate="imagedrawer_size">(<span i18n:name="width"><xsl:value-of select="width" /></span> by <span i18n:name="height"><xsl:value-of select="height" /></span>)</xsl:if>
-        </div>
-        <div>
-            <xsl:value-of select="description"/>
+        <xsl:if test="description != ''">
+            <div class="kupu-description-row documentDescription">
+                <p><xsl:copy-of
+                select="description/*|description/text()"/></p>
+            </div>
+        </xsl:if>
+        <div style="clear:both;line-height:1px;">&#xA0;</div>
+      </div>
+    </xsl:template>
+    <xsl:template match="resource|collection" mode="base-properties">
+        <h1 class="kupu-title-row">
+            <xsl:value-of select="title"/>
+        </h1>
+        <div class="kupu-preview-row">
+            <xsl:apply-templates select="status"/>
+            <xsl:apply-templates select="." mode="image-view" />
+            <div class="preview-size">
+                <xsl:if test="width" i18n:translate="imagedrawer_size"> (<span i18n:name="width">
+                <xsl:value-of select="width"/>
+                    </span> by <span i18n:name="height">
+                        <xsl:value-of select="height"/>
+                    </span>)</xsl:if>
+            </div>
         </div>
-        <div>
-            <form onsubmit="return false;">
-                <strong i18n:translate="imagedrawer_upload_alt_text">ALT-text</strong>
-                <br/>
-                <input type="text" id="image_alt" size="20" value="{title}"/>
-                <br/>
-                <input type="radio" name="image-align" id="image-align-left"
-                    checked="checked" value="image-left"/>
-                <label for="image-align-left" i18n:translate="imagedrawer_left">Left</label>
-                <input type="radio" name="image-align" id="image-align-inline" value="image-inline"/>
-                <label for="image-align-inline" i18n:translate="imagedrawer_inline">Inline</label>
-                <input type="radio" name="image-align" id="image-align-right" value="image-right"/>
-                <label for="image-align-right" i18n:translate="imagedrawer_right">Right</label>
-                <xsl:if test="$usecaptions='yes'">
-                    <br/>
-                    <input type="checkbox" name="image-caption"
-                        id="image-caption" checked="checked"/>
-                    <label for="image-caption" i18n:translate="imagedrawer_caption_label">Caption</label>
+        <xsl:if test="description != ''">
+            <div class="kupu-description-row documentDescription">
+               <p><xsl:copy-of
+               select="description/*|description/text()"/></p>
+            </div>
+        </xsl:if>
+        <div style="clear:both;"/>
+    </xsl:template>
+
+    <!--
+     This template shows one image.
+     If a 'preview' tag is available then that one is used, otherwise 'uri'.
+    -->
+    <xsl:template match="resource|collection" mode="image-view">
+       <xsl:variable name="p" select="preview"></xsl:variable>
+       <xsl:choose>
+          <xsl:when test="media='flash'">
+             <object src="{$p}" data="{$p}" type="application/x-shockwave-flash"
+                     width="100" height="100">
+                <param name="movie" value="{$p}" />
+             </object>
+          </xsl:when>
+          <xsl:when test="$p!=''">
+             <img src="{$p}" title="{title}" width="{width}" height="{height}" id="kupu-preview-image">
+                <xsl:choose>
+                   <xsl:when test="height > width">
+                      <xsl:if test="height > 128">
+                         <xsl:attribute name="width"><xsl:value-of select="width*128 div height" /></xsl:attribute>
+                         <xsl:attribute name="height">128</xsl:attribute>
+                      </xsl:if>
+                   </xsl:when>
+                   <xsl:when test="width >= height">
+                      <xsl:if test="width > 128">
+                         <xsl:attribute name="height"><xsl:value-of select="height*128 div width" /></xsl:attribute>
+                         <xsl:attribute name="width">128</xsl:attribute>
+                      </xsl:if>
+                   </xsl:when>
+                   <xsl:otherwise>
+                      <xsl:attribute name="height">1</xsl:attribute>
+                      <xsl:attribute name="width">1</xsl:attribute>
+                      <xsl:attribute name="onload">kupuFixImage(this);</xsl:attribute>
+                   </xsl:otherwise>
+                </xsl:choose>
+             </img>
+          </xsl:when>
+          <xsl:otherwise/>
+       </xsl:choose>
+    </xsl:template>
+
+    <!--
+        Used in image-upload template.
+    -->
+    <xsl:template match="resource|collection|uploadbutton" mode="image-extra-properties">
+       <div class="kupu-image-fields">
+          <input id="kupu-media" type="hidden" value="{media}" />
+          <input id="kupu-width" type="hidden" value="{width}" />
+          <input id="kupu-height" type="hidden" value="{height}" />
+          <label class="kupu-detail" i18n:translate="image_alignment">Alignment</label>
+          <span class="kupu-detail">
+             <input type="radio" name="image-align" id="image-align-left" value="image-left">
+                <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                <xsl:if test="$image-align='left'">
+                   <xsl:attribute name="checked">checked</xsl:attribute>
                 </xsl:if>
-            </form>
-        </div>
+             </input>
+             <label for="image-align-left" i18n:translate="imagedrawer_left">Left</label>
+             <input type="radio" name="image-align" id="image-align-inline" value="image-inline">
+                <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                <xsl:if test="$image-align='inline'">
+                   <xsl:attribute name="checked">checked</xsl:attribute>
+                </xsl:if>
+             </input>
+             <label for="image-align-inline" i18n:translate="imagedrawer_inline">Inline</label>
+             <input type="radio" name="image-align" id="image-align-right" value="image-right">
+                <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                <xsl:if test="$image-align='right'">
+                   <xsl:attribute name="checked">checked</xsl:attribute>
+                </xsl:if>
+             </input>
+             <label for="image-align-right" i18n:translate="imagedrawer_right">Right</label>
+          </span>
+          <xsl:if test="$usecaptions='yes'">
+             <xsl:choose>
+                <xsl:when test="media='flash'" />
+                <xsl:otherwise>
+                   <label class="kupu-detail"
+                          for="image-caption" i18n:translate="imagedrawer_caption_label">Caption</label>
+                   <span class="kupu-detail">
+                      <input type="checkbox" name="image-caption" id="image-caption">
+                         <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                         <xsl:if test="$image-caption='true'">
+                            <xsl:attribute name="checked">checked</xsl:attribute>
+                         </xsl:if>
+                         <xsl:attribute name="onclick">toggleAltFieldVisibility(this);</xsl:attribute>
+                      </input>
+                   </span>
+                </xsl:otherwise>
+             </xsl:choose>
+          </xsl:if>
+          <xsl:if test="sizes">
+             <label class="kupu-detail"
+                    for="image-size-selector"><span
+                    i18n:translate="imagedrawer_size_2">Size</span>
+                <span class="image-dimensions" i18n:translate="imagedrawer_size">
+                   (<span i18n:name="width"><xsl:value-of select="width"/></span>
+                   by
+                   <span i18n:name="height"><xsl:value-of select="height"/></span>)
+                </span>
+             </label>
+             <span class="kupu-detail">
+                <select name="image-size-selector">
+                   <xsl:apply-templates select="sizes/size" />
+                </select>
+             </span>
+          </xsl:if>
+          <xsl:if test="class">
+             <label class="kupu-detail" i18n:translate="imagedrawer_style"
+                    for="kupu-image-class-selector">Style</label>
+             <span class="kupu-detail">
+                <select name="kupu-image-class-selector" id="kupu-image-class">
+                   <xsl:apply-templates select="class"/>
+                </select>
+             </span>
+          </xsl:if>
+          <xsl:apply-templates select="." mode="image-extra-properties-alt" />
+       </div>
+    </xsl:template>
+
+    <!--
+        Used in image-extra-properties. Produces a form entry for the 'alt' attribute.
+    -->
+    <xsl:template match="resource|collection|uploadbutton" mode="image-extra-properties-alt">
+      <label class="kupu-detail" id="image-alt-label"
+             for="image-alt">
+        <xsl:if test="$usecaptions='yes' and $image-caption='true'">
+          <xsl:attribute name="style">display:none;</xsl:attribute>
+        </xsl:if>
+        <span tal:omit-tag="" i18n:translate="imagedrawer_upload_alt_text">Text equivalent</span>
+      </label>
+      <textarea class="kupu-detail" type="text" id="image-alt" rows="4">
+        <xsl:if test="$usecaptions='yes' and $image-caption='true'">
+          <xsl:attribute name="style">display:none;</xsl:attribute>
+        </xsl:if>
+        <xsl:value-of select="title"/>
+      </textarea>
+    </xsl:template>
+
+
+    <xsl:template match="resource|collection" mode="image-properties">
+       <xsl:apply-templates select="." mode="base-properties"/>
+       <xsl:apply-templates select="." mode="image-extra-properties"/>
+    </xsl:template>
+
+    <xsl:template match="class">
+       <option value="{@name}">
+          <xsl:if test="$image-class=@name">
+             <xsl:attribute name="selected">selected</xsl:attribute>
+          </xsl:if>
+          <xsl:value-of select="@title" /></option>
+    </xsl:template>
+
+    <xsl:template match="size">
+       <option value="{uri}">
+          <xsl:if test="selected">
+             <xsl:attribute name="selected">selected</xsl:attribute>
+          </xsl:if>
+          <xsl:value-of select="label" />
+       </option>
     </xsl:template>
+
     <xsl:template match="resource|collection" mode="link-properties">
-        <form onsubmit="return false;">
-            <table>
-                <tr class="kupu-linkdrawer-title-row">
-                    <td>
-                        <strong i18n:translate="linkdrawer_title_label">Title</strong>
-                        <br/>
-                        <xsl:value-of select="title"/>
-                    </td>
-                </tr>
-                <tr class="kupu-linkdrawer-description-row">
-                    <td>
-                        <strong i18n:translate="linkdrawer_description_label">Description</strong>
-                        <br/>
-                        <xsl:value-of select="description"/>
-                    </td>
-                </tr>
-                <tr class="kupu-linkdrawer-name-row">
-                    <td>
-                        <strong i18n:translate="linkdrawer_name_label">Name</strong>
-                        <br/>
-                        <input type="text" id="link_name" size="10"/>
-                    </td>
-                </tr>
-                <tr class="kupu-linkdrawer-target-row">
-                    <td>
-                        <strong i18n:translate="linkdrawer_target_label">Target</strong>
-                        <br/>
-                        <input type="text" id="link_target" value="_self" 
-                               size="10"/>
-                    </td>
-                </tr>
-            </table>
-        </form>
+        <xsl:apply-templates select="." mode="base-properties"/>
+
+        <!-- <form onsubmit="return false;"> -->
+        <div class="kupu-linkdrawer-name-row">
+                <div><label i18n:translate="linkdrawer_name_label">Name</label></div>
+                <input type="text" id="link_name" size="10">
+                   <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                   <xsl:attribute name="value"><xsl:value-of select="$link_name"/></xsl:attribute>
+                </input>
+            </div>
+            <div class="kupu-linkdrawer-target-row">
+                <div><label i18n:translate="linkdrawer_target_label">Target</label></div>
+                <input type="text" id="link_target" size="10">
+                   <xsl:attribute name="onkeypress">if(event.keyCode==13)return false;</xsl:attribute>
+                   <xsl:attribute name="value"><xsl:value-of select="$link_target"/></xsl:attribute>
+                </input>
+            </div>
+            <xsl:if test="$showanchors='yes'">
+                <xsl:apply-templates select="anchor"></xsl:apply-templates>
+            </xsl:if>
+        <!-- </form> -->
     </xsl:template>
-    
-    <!-- image upload form -->
-    <xsl:template match="uploadbutton" mode="image-upload">
-     <div>
-        <div id="kupu-upload-instructions" i18n:translate="imagedrawer_upload_instructions">
-            Select an image from your computer and click ok to have it
-            automatically uploaded to selected folder and inserted into the
-            editor.
+
+    <xsl:template match="resource|collection" mode="properties">
+        <xsl:apply-templates select="." mode="base-properties"/>
+    </xsl:template>
+
+    <xsl:template match="anchor">
+       <div class="kupu-linkdrawer-anchors">
+          <input type="hidden" value="{../uri}"/>
+          <label for="kupu-anchor-select" i18n:translate="linkdrawer_anchor">Link to anchor</label>
+          <xsl:if test="$ie='true'">
+             <input type="checkbox">
+                <xsl:attribute name="onclick">drawertool.current_drawer.initAnchors();</xsl:attribute>
+             </input>
+          </xsl:if>
+          <select onmousedown="drawertool.current_drawer.initAnchors();">
+             <xsl:if test="$ie='true'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+             </xsl:if>
+             <option i18n:translate="top_of_page" value="">top of page (default)</option>
+             <option i18n:translate="fetching_anchors" value=""><em>...fetching anchors...</em></option>
+          </select>
+       </div>
+    </xsl:template>
+
+    <xsl:template match="status">
+        <div>
+            <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
+            <xsl:value-of select="text()"/>
         </div>
-        <form name="kupu_upload_form" method="POST" action="" scrolling="off" target="kupu_upload_form_target"
-              enctype="multipart/form-data" style="margin: 0; border: 0;">
+    </xsl:template>
 
-            <label for="kupu-upload-file" i18n:translate="imagedrawer_upload_to_label">Upload to: <span i18n:name="folder"><xsl:value-of select='/libraries/*[@selected]/title' /></span></label>
-            <input id="kupu-upload-file" type="file" name="node_prop_image" size="20"/><br/>
-            <label for="kupu-upload-title"
-i18n:translate="imagedrawer_upload_title_label">Title:</label>
-            <input id="kupu-upload-title" type="text" name="node_prop_caption" size="23" value=""/><br/>
-        </form>
-
-        <iframe id="kupu-upload-form-target" name="kupu_upload_form_target"
-                src="kupublank.html" scrolling="off" frameborder="0" width="0px" height="0px" display="None">
-        </iframe>
-      </div>
+    <xsl:template match="uploadfield">
+      <label>
+        <span><xsl:value-of select="name" /></span>
+        <xsl:copy-of select="input/*" />
+      </label>
+    </xsl:template>
+
+
+    <!--
+        Used in the 'image-upload' template.
+        Produces all non-file input entries (i.e. in this default version 'title' and 'description').
+
+        Can be overriden if you need other fields.
+    -->
+    <xsl:template match="uploadbutton" mode="upload-fields">
+      <xsl:choose>
+        <xsl:when test="../uploadfield">
+          <xsl:apply-templates select="../uploadfield" />
+        </xsl:when>
+        <xsl:otherwise>
+          <label>
+            <span tal:omit-tag="" i18n:translate="imagedrawer_upload_title_label">Title</span>
+            <input id="kupu-upload-title" type="text" name="node_prop_title" size="23" value=""/>
+          </label>
+          <label>
+            <span tal:omit-tag=""
+                  i18n:translate="imagedrawer_upload_desc_label">Description</span>
+            <textarea rows="5" cols="40" name="node_prop_desc">&#160;</textarea>
+          </label>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+
+    <!--
+        Used in the 'image-upload' template.
+        Shows a message about where the image is uploaded to, and creates a file input entry.
+    -->
+    <xsl:template match="uploadbutton" mode="upload-to">
+      <label>
+        <tal:block i18n:translate="imagedrawer_upload_to_label">Upload to: <span tal:omit-tag="" i18n:name="folder"> <xsl:value-of select="/libraries/*[@selected]/title"/> </span> </tal:block>
+        <input id="kupu-upload-file" type="file" name="node_prop_image" size="20"/>
+      </label>
+    </xsl:template>
+
+
+    <!--
+         Image upload form
+    -->
+    <xsl:template match="uploadbutton" mode="image-upload">
+            <div id="kupu-upload-instructions" i18n:translate="imagedrawer_upload_instructions">
+                Select an image from your computer and click ok to have it automatically uploaded to
+                selected folder and inserted into the editor. </div>
+            <form name="kupu_upload_form" id="kupu_upload_form" method="POST"
+                scrolling="off"
+                target="kupu_upload_form_target" enctype="multipart/form-data" style="margin: 0;
+                border: 0;">
+              <xsl:attribute name="action"><xsl:value-of select="uri"/></xsl:attribute>
+              <xsl:apply-templates select="." mode="upload-to" />
+              <xsl:apply-templates select="." mode="upload-fields" />
+            </form>
+            <iframe id="kupu_upload_form_target" name="kupu_upload_form_target" src="javascript:''"
+                scrolling="off" frameborder="0" width="0px" height="0px" display="None">&#160;</iframe>
+            <xsl:apply-templates select="." mode="image-extra-properties"/>
+    </xsl:template>
+
+    <xsl:template match="breadcrumbs">
+        <span>
+          <xsl:attribute name="class">
+              <xsl:value-of select="@class"/>
+          </xsl:attribute>
+        <xsl:apply-templates select="crumb"></xsl:apply-templates>
+        </span>
+    </xsl:template>
+    <xsl:template match="crumb[@href]">
+        <a>
+            <xsl:attribute name="href">
+              <xsl:value-of select="@href"/>
+            </xsl:attribute>
+            <xsl:attribute name="onclick">drawertool.current_drawer.selectBreadcrumb(this);return false;</xsl:attribute>
+            <xsl:value-of select="node()"/>
+        </a>
+        <xsl:if test="not(position()=last())">
+            <span class="kupu-breadcrumbSeparator"> &#8594; </span>
+        </xsl:if>
+    </xsl:template>
+    <xsl:template match="crumb">
+        <xsl:value-of select="node()"/>
+    </xsl:template>
+    <xsl:template name="lf2br">
+       <xsl:param name="StringToTransform"/>
+       <xsl:choose>
+          <xsl:when test="contains($StringToTransform,'&lt;br&gt;')">
+             <xsl:value-of select="substring-before($StringToTransform,'&lt;br&gt;')"/>
+             <br/>
+             <xsl:call-template name="lf2br">
+                <xsl:with-param name="StringToTransform">
+                   <xsl:value-of select="substring-after($StringToTransform,'&lt;br&gt;')"/>
+                </xsl:with-param>
+             </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+             <xsl:value-of select="$StringToTransform"/>
+          </xsl:otherwise>
+       </xsl:choose>
     </xsl:template>
-    
 </xsl:stylesheet>

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl.metadata
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl.metadata?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl.metadata (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/drawer.xsl.metadata Sun Mar 28 22:51:22 2010
@@ -1,2 +1,2 @@
-[default]
-keep_extension=1
+[default]
+keep_extension=1

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/imagelibrary.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/imagelibrary.xml?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/imagelibrary.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/imagelibrary.xml Sun Mar 28 22:51:22 2010
@@ -1,4 +1,6 @@
 <?xml version="1.0" ?>
+<?xml-stylesheet href="test-drawer.xsl" ?>
+<?oxygen RNGSchema="file:libraries.rng" type="xml"?>
 <libraries>
   <library id="logos">
     <uri>kupudrawers/logos.xml</uri>
@@ -18,5 +20,4 @@
     <src>kupudrawers/allimages.xml</src>
     <icon>kupuimages/kupulibrary.png</icon>
   </library>
-
 </libraries>

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/kupubuttons.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/kupubuttons.xml?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/kupubuttons.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/kupubuttons.xml Sun Mar 28 22:51:22 2010
@@ -1,14 +1,15 @@
 <?xml version="1.0" ?>
-<collection>
-   <uri>kupudrawers/kupubuttons.xml</uri>
-   <icon>kupuimages/kupulibrary.png</icon>
-   <title>Kupu buttons</title>
-   <src>kupudrawers/kupubuttons.xml</src>
-   <items>
+<?oxygen RNGSchema="file:libraries.rng" type="xml"?>
+<collection id="collection-kupubuttons.xml">
+    <uri>kupudrawers/kupubuttons.xml</uri>
+    <icon>kupuimages/kupulibrary.png</icon>
+    <title>Kupu buttons</title>
+    <src>kupudrawers/kupubuttons.xml</src>
+    <items>
         <resource id="smaller-text.png">
             <uri>kupuimages/smaller-text.png</uri>
             <title>smaller-text</title>
-            <description></description>
+            <description/>
             <size>961</size>
             <height>20</height>
             <width>20</width>
@@ -16,7 +17,7 @@
         <resource id="undo.png">
             <uri>kupuimages/undo.png</uri>
             <title>undo</title>
-            <description></description>
+            <description/>
             <size>959</size>
             <height>20</height>
             <width>20</width>
@@ -24,7 +25,7 @@
         <resource id="superscript.png">
             <uri>kupuimages/superscript.png</uri>
             <title>superscript</title>
-            <description></description>
+            <description/>
             <size>961</size>
             <height>20</height>
             <width>19</width>
@@ -32,7 +33,7 @@
         <resource id="fonts.png">
             <uri>kupuimages/fonts.png</uri>
             <title>fonts</title>
-            <description></description>
+            <description/>
             <size>953</size>
             <height>20</height>
             <width>20</width>
@@ -40,7 +41,7 @@
         <resource id="cut.png">
             <uri>kupuimages/cut.png</uri>
             <title>cut</title>
-            <description></description>
+            <description/>
             <size>975</size>
             <height>20</height>
             <width>20</width>
@@ -48,7 +49,7 @@
         <resource id="save.png">
             <uri>kupuimages/save.png</uri>
             <title>save</title>
-            <description></description>
+            <description/>
             <size>966</size>
             <height>20</height>
             <width>20</width>
@@ -56,7 +57,7 @@
         <resource id="paste.png">
             <uri>kupuimages/paste.png</uri>
             <title>paste</title>
-            <description></description>
+            <description/>
             <size>1004</size>
             <height>20</height>
             <width>20</width>
@@ -64,7 +65,7 @@
         <resource id="justify-center.png">
             <uri>kupuimages/justify-center.png</uri>
             <title>justify-center</title>
-            <description></description>
+            <description/>
             <size>934</size>
             <height>20</height>
             <width>20</width>
@@ -72,7 +73,7 @@
         <resource id="larger-text.png">
             <uri>kupuimages/larger-text.png</uri>
             <title>larger-text</title>
-            <description></description>
+            <description/>
             <size>959</size>
             <height>20</height>
             <width>20</width>
@@ -80,7 +81,7 @@
         <resource id="view-source.png">
             <uri>kupuimages/view-source.png</uri>
             <title>view-source</title>
-            <description></description>
+            <description/>
             <size>1045</size>
             <height>20</height>
             <width>20</width>
@@ -88,7 +89,7 @@
         <resource id="definitionlist.png">
             <uri>kupuimages/definitionlist.png</uri>
             <title>definitionlist</title>
-            <description></description>
+            <description/>
             <size>212</size>
             <height>20</height>
             <width>20</width>
@@ -96,7 +97,7 @@
         <resource id="indent.png">
             <uri>kupuimages/indent.png</uri>
             <title>indent</title>
-            <description></description>
+            <description/>
             <size>963</size>
             <height>20</height>
             <width>20</width>
@@ -104,7 +105,7 @@
         <resource id="document.png">
             <uri>kupuimages/document.png</uri>
             <title>document</title>
-            <description></description>
+            <description/>
             <size>390</size>
             <height>16</height>
             <width>16</width>
@@ -112,7 +113,7 @@
         <resource id="exthyperlink.png">
             <uri>kupuimages/exthyperlink.png</uri>
             <title>exthyperlink</title>
-            <description></description>
+            <description/>
             <size>314</size>
             <height>22</height>
             <width>23</width>
@@ -120,7 +121,7 @@
         <resource id="background-color.png">
             <uri>kupuimages/background-color.png</uri>
             <title>background-color</title>
-            <description></description>
+            <description/>
             <size>1005</size>
             <height>20</height>
             <width>20</width>
@@ -128,7 +129,7 @@
         <resource id="size.png">
             <uri>kupuimages/size.png</uri>
             <title>size</title>
-            <description></description>
+            <description/>
             <size>955</size>
             <height>20</height>
             <width>20</width>
@@ -136,7 +137,7 @@
         <resource id="justify-right.png">
             <uri>kupuimages/justify-right.png</uri>
             <title>justify-right</title>
-            <description></description>
+            <description/>
             <size>934</size>
             <height>20</height>
             <width>20</width>
@@ -144,7 +145,7 @@
         <resource id="buttons.png">
             <uri>kupuimages/buttons.png</uri>
             <title>buttons</title>
-            <description></description>
+            <description/>
             <size>3253</size>
             <height>140</height>
             <width>120</width>
@@ -152,7 +153,7 @@
         <resource id="subscript.png">
             <uri>kupuimages/subscript.png</uri>
             <title>subscript</title>
-            <description></description>
+            <description/>
             <size>961</size>
             <height>20</height>
             <width>20</width>
@@ -160,7 +161,7 @@
         <resource id="remove.png">
             <uri>kupuimages/remove.png</uri>
             <title>remove</title>
-            <description></description>
+            <description/>
             <size>1298</size>
             <height>22</height>
             <width>23</width>
@@ -168,7 +169,7 @@
         <resource id="caret.png">
             <uri>kupuimages/caret.png</uri>
             <title>caret</title>
-            <description></description>
+            <description/>
             <size>948</size>
             <height>20</height>
             <width>20</width>
@@ -176,7 +177,7 @@
         <resource id="underline.png">
             <uri>kupuimages/underline.png</uri>
             <title>underline</title>
-            <description></description>
+            <description/>
             <size>953</size>
             <height>20</height>
             <width>20</width>
@@ -184,7 +185,7 @@
         <resource id="copy.png">
             <uri>kupuimages/copy.png</uri>
             <title>copy</title>
-            <description></description>
+            <description/>
             <size>984</size>
             <height>20</height>
             <width>20</width>
@@ -192,7 +193,7 @@
         <resource id="hr.png">
             <uri>kupuimages/hr.png</uri>
             <title>hr</title>
-            <description></description>
+            <description/>
             <size>937</size>
             <height>20</height>
             <width>20</width>
@@ -200,7 +201,7 @@
         <resource id="image.png">
             <uri>kupuimages/image.png</uri>
             <title>image</title>
-            <description></description>
+            <description/>
             <size>1002</size>
             <height>20</height>
             <width>20</width>
@@ -208,7 +209,7 @@
         <resource id="strikethrough.png">
             <uri>kupuimages/strikethrough.png</uri>
             <title>strikethrough</title>
-            <description></description>
+            <description/>
             <size>963</size>
             <height>20</height>
             <width>20</width>
@@ -216,7 +217,7 @@
         <resource id="format.png">
             <uri>kupuimages/format.png</uri>
             <title>format</title>
-            <description></description>
+            <description/>
             <size>965</size>
             <height>20</height>
             <width>20</width>
@@ -224,7 +225,7 @@
         <resource id="undo-disabled.png">
             <uri>kupuimages/undo-disabled.png</uri>
             <title>undo-disabled</title>
-            <description></description>
+            <description/>
             <size>959</size>
             <height>20</height>
             <width>20</width>
@@ -232,7 +233,7 @@
         <resource id="folder.png">
             <uri>kupuimages/folder.png</uri>
             <title>folder</title>
-            <description></description>
+            <description/>
             <size>1126</size>
             <height>16</height>
             <width>16</width>
@@ -240,7 +241,7 @@
         <resource id="create-new.png">
             <uri>kupuimages/create-new.png</uri>
             <title>create-new</title>
-            <description></description>
+            <description/>
             <size>951</size>
             <height>20</height>
             <width>20</width>
@@ -248,7 +249,7 @@
         <resource id="unlink.png">
             <uri>kupuimages/unlink.png</uri>
             <title>unlink</title>
-            <description></description>
+            <description/>
             <size>983</size>
             <height>20</height>
             <width>20</width>
@@ -256,7 +257,7 @@
         <resource id="justify-full.png">
             <uri>kupuimages/justify-full.png</uri>
             <title>justify-full</title>
-            <description></description>
+            <description/>
             <size>929</size>
             <height>20</height>
             <width>20</width>
@@ -264,7 +265,7 @@
         <resource id="kupulibrary.png">
             <uri>kupuimages/kupulibrary.png</uri>
             <title>kupulibrary</title>
-            <description></description>
+            <description/>
             <size>2094</size>
             <height>32</height>
             <width>32</width>
@@ -272,7 +273,7 @@
         <resource id="bold.png">
             <uri>kupuimages/bold.png</uri>
             <title>bold</title>
-            <description></description>
+            <description/>
             <size>945</size>
             <height>20</height>
             <width>20</width>
@@ -280,7 +281,7 @@
         <resource id="text-color.png">
             <uri>kupuimages/text-color.png</uri>
             <title>text-color</title>
-            <description></description>
+            <description/>
             <size>988</size>
             <height>20</height>
             <width>20</width>
@@ -288,7 +289,7 @@
         <resource id="unordered-list.png">
             <uri>kupuimages/unordered-list.png</uri>
             <title>unordered-list</title>
-            <description></description>
+            <description/>
             <size>937</size>
             <height>20</height>
             <width>20</width>
@@ -296,7 +297,7 @@
         <resource id="ordered-list.png">
             <uri>kupuimages/ordered-list.png</uri>
             <title>ordered-list</title>
-            <description></description>
+            <description/>
             <size>957</size>
             <height>20</height>
             <width>20</width>
@@ -304,7 +305,7 @@
         <resource id="redo-disabled.png">
             <uri>kupuimages/redo-disabled.png</uri>
             <title>redo-disabled</title>
-            <description></description>
+            <description/>
             <size>959</size>
             <height>20</height>
             <width>20</width>
@@ -312,7 +313,7 @@
         <resource id="outdent.png">
             <uri>kupuimages/outdent.png</uri>
             <title>outdent</title>
-            <description></description>
+            <description/>
             <size>962</size>
             <height>20</height>
             <width>20</width>
@@ -320,7 +321,7 @@
         <resource id="table.png">
             <uri>kupuimages/table.png</uri>
             <title>table</title>
-            <description></description>
+            <description/>
             <size>952</size>
             <height>20</height>
             <width>20</width>
@@ -328,7 +329,7 @@
         <resource id="justify-left.png">
             <uri>kupuimages/justify-left.png</uri>
             <title>justify-left</title>
-            <description></description>
+            <description/>
             <size>932</size>
             <height>20</height>
             <width>20</width>
@@ -336,7 +337,7 @@
         <resource id="redo.png">
             <uri>kupuimages/redo.png</uri>
             <title>redo</title>
-            <description></description>
+            <description/>
             <size>959</size>
             <height>20</height>
             <width>20</width>
@@ -344,7 +345,7 @@
         <resource id="italic.png">
             <uri>kupuimages/italic.png</uri>
             <title>italic</title>
-            <description></description>
+            <description/>
             <size>965</size>
             <height>20</height>
             <width>20</width>
@@ -352,7 +353,7 @@
         <resource id="link.png">
             <uri>kupuimages/link.png</uri>
             <title>link</title>
-            <description></description>
+            <description/>
             <size>1030</size>
             <height>20</height>
             <width>20</width>
@@ -360,7 +361,7 @@
         <resource id="inthyperlink.png">
             <uri>kupuimages/inthyperlink.png</uri>
             <title>inthyperlink</title>
-            <description></description>
+            <description/>
             <size>296</size>
             <height>22</height>
             <width>23</width>

Added: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/libraries.rng
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/libraries.rng?rev=928508&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/libraries.rng (added)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/libraries.rng Sun Mar 28 22:51:22 2010
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
+    <start>
+        <choice>
+            <ref name="libraries"/>
+            <ref name="library"/>
+            <ref name="collection"/>
+        </choice>
+    </start>
+    <define name="libraries">
+        <a:documentation>
+            The libraries element is the top level for the XML used in Kupu.
+            library elements which it contains are listed in the first column of the drawer.
+        </a:documentation>
+        <element name="libraries">
+            <zeroOrMore>
+                <ref name="library"/>
+            </zeroOrMore>
+        </element>
+    </define>
+    <define name="library">
+        <a:documentation> 
+            A library is static or dynamic collection of resources and collections defined at a top level.
+            Libraries have no parents from a UI perspective, where as the collection they represent might have a parent collection.
+            A library may be returned as a top-level element from a search or canned query.
+        </a:documentation>
+        <element name="library">
+            <interleave>
+                <ref name="commonToAllItems"/>
+                <choice>
+                    <ref name="collectionItems"/>
+                    <ref name="itemsSource"/>
+                </choice>
+            </interleave>
+        </element>
+    </define>
+    <define name="commonToAllItems">
+        <attribute name="id">
+            <!-- Must be unique among all libraries, resources and collections. -->
+            <data type="ID"/>
+        </attribute>
+        <optional>
+            <attribute name="class">
+                <data type="NMTOKENS"/>
+            </attribute>
+        </optional>
+        <optional>
+            <attribute name="selected">
+                <value>selected</value>
+            </attribute>
+        </optional>
+        <interleave>
+            <element name="uri">
+                <a:documentation>The url to use when linking to this object</a:documentation>
+                <data type="anyURI"/>
+            </element>
+            <element name="title">
+                <a:documentation>Title to display in properties pane</a:documentation>
+                <text/>
+            </element>
+            <optional>
+                <element name="label">
+                    <text/>
+                </element>
+            </optional>
+            <optional>
+                <element name="icon">
+                    <a:documentation>Icon to use in resource pane</a:documentation>
+                    <data type="anyURI"/>
+                </element>
+            </optional>
+        </interleave>
+    </define>
+    <define name="collectionItems">
+        <a:documentation>A list of collections and resources with an optional upload button at the end.</a:documentation>
+        <element name="items">
+            <zeroOrMore>
+                <ref name="collectionItem"/>
+            </zeroOrMore>
+            <optional>
+                <element name="uploadbutton">
+                    <element name="uri">
+                        <data type="anyURI"/>
+                    </element>
+                </element>
+            </optional>
+        </element>
+    </define>
+    <define name="itemsSource">
+        <a:documentation>URI to retrieve the contents of the collection.</a:documentation>
+        <element name="src">
+            <text/>
+        </element>
+    </define>
+    <define name="collectionItem">
+        <choice>
+            <ref name="resource"/>
+            <ref name="collection"/>
+        </choice>
+    </define>
+    <define name="resource">
+        <a:documentation>A named and URI-locatable object with associated metadata, such as title, description, preview, size, etc.</a:documentation>
+        <element name="resource">
+            <interleave>
+                <ref name="commonToAllItems"/>
+                <ref name="extraResourceInfo"/>
+                <optional><a:documentation>src element only if the resource is also a collection</a:documentation><ref name="itemsSource"></ref></optional>
+            </interleave>
+        </element>
+    </define>
+    <define name="collection">
+        <a:documentation>
+            A static or dynamic collection of resources and collections, modelled after WebDAV collections.
+        </a:documentation>
+        <element name="collection">
+            <interleave>
+                <ref name="commonToAllItems"/>
+                <ref name="itemsSource"/>
+                <optional><ref name="breadcrumbs"></ref></optional>
+                <zeroOrMore>
+                    <ref name="collectionItems"/>
+                </zeroOrMore>
+            </interleave>
+        </element>
+    </define>
+    <define name="extraResourceInfo">
+        <interleave>
+            <optional>
+                <element name="preview">
+                    <data type="anyURI"/>
+                </element>
+            </optional>
+            <zeroOrMore>
+                <ref name="status"/>
+            </zeroOrMore>
+            <optional>
+                <element name="size">
+                    <ref name="sizeType"/>
+                </element>
+            </optional>
+            <optional>
+                <element name="type">
+                    <text/>
+                </element>
+            </optional>
+            <optional>
+                <element name="description">
+                    <text/>
+                </element>
+            </optional>
+            <optional>
+                <element name="height">
+                    <data type="positiveInteger"/>
+                </element>
+            </optional>
+            <optional>
+                <element name="width">
+                    <data type="positiveInteger"/>
+                </element>
+            </optional>
+            <optional>
+                <a:documentation>Set if this resource could contain anchors</a:documentation>
+                <element name="anchor">
+                    <empty/>
+                </element>
+            </optional>
+        </interleave>
+    </define>
+    <define name="sizeType">
+        <data type="string">
+            <param name="pattern">[0-9]+([KkMmGgTt]?b)?</param>
+        </data>
+    </define>
+    <define name="status">
+        <element name="status">
+            <a:documentation>Additional text to display in drawer</a:documentation>
+            <attribute name="class">
+                <data type="NMTOKENS"></data>
+            </attribute>
+            <text/>
+        </element>
+    </define>
+    <define name="breadcrumbs">
+        <a:documentation>
+            The optional breadcrumbs element may be used to provide a breadcrumb bar at the top of the drawer.
+        </a:documentation>
+        <element name="breadcrumbs">
+            <optional>
+              <attribute name="class">
+                  <data type="NMTOKENS"></data>
+              </attribute>
+            </optional>
+            <zeroOrMore>
+                <element name="crumb">
+                    <attribute name="href">
+                        <data type="anyURI"/>
+                    </attribute>
+                </element>
+            </zeroOrMore>
+            <text/>
+        </element>
+    </define>
+</grammar>

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/linklibrary.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/linklibrary.xml?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/linklibrary.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/linklibrary.xml Sun Mar 28 22:51:22 2010
@@ -1,4 +1,5 @@
 <?xml version="1.0" ?>
+<?oxygen RNGSchema="file:libraries.rng" type="xml"?>
 <libraries>
   <library id="logos">
     <uri>kupudrawers/logos.xml</uri>
@@ -18,5 +19,4 @@
     <src>kupudrawers/allimages.xml</src>
     <icon>kupuimages/kupulibrary.png</icon>
   </library>
-
 </libraries>

Modified: myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/logos.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/logos.xml?rev=928508&r1=928507&r2=928508&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/logos.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/custom/inputHtml/resource/kupudrawers/logos.xml Sun Mar 28 22:51:22 2010
@@ -1,5 +1,6 @@
 <?xml version="1.0" ?>
-<collection>
+<?oxygen RNGSchema="file:libraries.rng" type="xml"?>
+<collection id="collection-logos.xml">
     <uri>kupudrawers/logos.xml</uri>
     <icon>kupuimages/kupulibrary.png</icon>
     <title>Logo's</title>