You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/04/12 23:22:38 UTC

svn commit: r161123 - in lenya/trunk/src/webapp/lenya/pubs/blog: config/menus/feed.xsp lenya/usecases/edit/ lenya/usecases/edit/forms/ lenya/usecases/edit/forms/entry.xsl lenya/usecases/edit/forms/sidebar.xsl lenya/xslt/formeditor/

Author: andreas
Date: Tue Apr 12 14:22:37 2005
New Revision: 161123

URL: http://svn.apache.org/viewcvs?view=rev&rev=161123
Log:
usecase framework for blog form editor

Added:
    lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/
    lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/
    lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/entry.xsl
    lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/sidebar.xsl
Removed:
    lenya/trunk/src/webapp/lenya/pubs/blog/lenya/xslt/formeditor/
Modified:
    lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp

Modified: lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp?view=diff&r1=161122&r2=161123
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/config/menus/feed.xsp Tue Apr 12 14:22:37 2005
@@ -40,7 +40,7 @@
         <item uc:usecase="site.create" href="?">Add&#160;new&#160;Entry</item>
       </block>
       <block>
-        <item wf:event="edit" uc:usecase="edit" uc:step="open" href="../../sidebar.html?form=sidebar">Edit&#160;Sidebar&#160;with&#160;Forms</item>
+        <item wf:event="edit" uc:usecase="edit.forms" href="../../sidebar.html?form=sidebar">Edit&#160;Sidebar&#160;with&#160;Forms</item>
         <item wf:event="publish" uc:usecase="publish" uc:step="showscreen" href="../../sidebar.html?sources=sidebar.xml&amp;uris=feeds/all/index.html"><i18n:text>Publish Sidebar</i18n:text></item>
       </block>
       <block>

Added: lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/entry.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/entry.xsl?view=auto&rev=161123
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/entry.xsl (added)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/entry.xsl Tue Apr 12 14:22:37 2005
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed 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.
+-->
+
+<!-- $Id: entry.xsl 42702 2004-03-13 12:34:18Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:echo="http://purl.org/atom/ns#"
+  xmlns:ent="http://www.purl.org/NET/ENT/1.0/"
+>
+
+<xsl:import href="../../../../../../usecases/edit/forms/form.xsl"/>
+
+<xsl:template match="echo:entry">
+<node name="Title" select="/echo:entry/echo:title[@tagID='{echo:title/@tagID}']">
+<!-- FIXME: In the case of text input field, < and > need to be replaced by &lt; and &gt;
+  <content><input type="text" name="&lt;xupdate:update select=&quot;/echo:entry/echo:title[@tagID='{echo:title/@tagID}']&quot;&gt;" size="40"><xsl:attribute name="value"><xsl:apply-templates select="echo:title/node()" mode="mixed"/></xsl:attribute></input></content>
+-->
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/echo:entry/echo:title[@tagID='{echo:title/@tagID}']&quot;&gt;" cols="40" rows="1">
+      <xsl:copy-of select="echo:title/node()"/>
+<!--
+      <xsl:apply-templates select="echo:title/node()" mode="mixedcontent"/>
+-->
+    </textarea>
+  </content>
+</node>
+
+<xsl:if test="not(echo:summary)">
+<node name="Summary">
+  <action><insert name="&lt;xupdate:insert-after select=&quot;/echo:entry/echo:title[@tagID='{echo:title/@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;echo:summary&quot; namespace=&quot;http://purl.org/atom/ns#&quot;&gt;New summary&lt;/xupdate:element&gt;&lt;/xupdate:insert-after&gt;"/></action>
+</node>
+</xsl:if>
+
+<xsl:apply-templates select="echo:summary"/>
+<xsl:apply-templates select="echo:content"/>
+
+<node name="Content Block (application/xhtml+xml)">
+  <action><insert name="&lt;xupdate:append select=&quot;/echo:entry&quot;&gt;&lt;xupdate:element name=&quot;echo:content&quot; namespace=&quot;http://purl.org/atom/ns#&quot;&gt;&lt;xupdate:attribute name=&quot;type&quot;&gt;application/xhtml+xml&lt;/xupdate:attribute&gt;&lt;p&gt;Append new content&lt;/p&gt;&lt;/xupdate:element&gt;&lt;/xupdate:append&gt;"/></action>
+</node>
+<!--
+<node name="Content (text/plain as CDATA)">
+  <action><insert name="&lt;xupdate:append select=&quot;/echo:entry&quot;&gt;&lt;xupdate:element name=&quot;echo:content&quot; namespace=&quot;http://purl.org/atom/ns#&quot;&gt;&lt;xupdate:attribute name=&quot;type&quot;&gt;text/plain&lt;/xupdate:attribute&gt;New CDATA content&lt;/xupdate:element&gt;&lt;/xupdate:append&gt;"/></action>
+</node>
+-->
+</xsl:template>
+
+<xsl:template match="echo:summary">
+<node name="Summary" select="/echo:entry/echo:summary[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/echo:entry/echo:summary[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/echo:entry/echo:summary[@tagID='{@tagID}']&quot;&gt;" cols="40" rows="5">
+      <xsl:copy-of select="node()"/>
+<!--
+      <xsl:apply-templates mode="mixedcontent"/>
+-->
+    </textarea>
+  </content>
+</node>
+</xsl:template>
+
+
+<xsl:template match="echo:content[@type='text/plain']">
+<node name="Content (text/plain as CDATA)">
+  <action><insert name="&lt;xupdate:insert-before select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;echo:content&quot; namespace=&quot;http://purl.org/atom/ns#&quot;&gt;&lt;xupdate:attribute name=&quot;type&quot;&gt;text/plain&lt;/xupdate:attribute&gt;New content&lt;/xupdate:element&gt;&lt;/xupdate:insert-before&gt;"/></action>
+</node>
+<node name="Content (text/plain as CDATA)">
+  <action><delete name="&lt;xupdate:remove select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content><textarea name="&lt;xupdate:update select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;&gt;&lt;![CDATA[" cols="40" rows="5"><xsl:value-of select="."/></textarea></content>
+</node>
+</xsl:template>
+
+
+<xsl:template match="echo:content[@type='application/xhtml+xml']">
+<node name="Content Block (application/xhtml+xml)">
+  <action><insert name="&lt;xupdate:insert-before select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;echo:content&quot; namespace=&quot;http://purl.org/atom/ns#&quot;&gt;&lt;xupdate:attribute name=&quot;type&quot;&gt;application/xhtml+xml&lt;/xupdate:attribute&gt;&lt;p&gt;Insert before new content&lt;/p&gt;&lt;/xupdate:element&gt;&lt;/xupdate:insert-before&gt;"/></action>
+</node>
+<node name="Content Block (application/xhtml+xml)" select="/echo:entry/echo:content[@tagID='{@tagID}']">
+  <action><delete name="&lt;xupdate:remove select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  <content>
+    <textarea name="&lt;xupdate:update select=&quot;/echo:entry/echo:content[@tagID='{@tagID}']&quot;&gt;" cols="40" rows="5">
+      <xsl:copy-of select="node()"/>
+<!--
+      <xsl:apply-templates mode="mixedcontent"/>
+-->
+    </textarea>
+  </content>
+</node>
+</xsl:template>
+
+
+<xsl:template match="echo:content">
+<node name="Content (Either no @type attribute or no xsl:template with such a @type attribute!)">
+<content><xsl:apply-templates/></content>
+</node>
+</xsl:template>
+ 
+</xsl:stylesheet>  

Added: lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/sidebar.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/sidebar.xsl?view=auto&rev=161123
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/sidebar.xsl (added)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/lenya/usecases/edit/forms/sidebar.xsl Tue Apr 12 14:22:37 2005
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed 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.
+-->
+
+<!-- $Id: sidebar.xsl 42702 2004-03-13 12:34:18Z gregor $ -->
+                                                                
+<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="../../../../../../usecases/edit/forms/form.xsl"/>
+
+<xsl:template match="sidebar">
+ <xsl:apply-templates select="block"/>
+
+  <node name="Add Block">
+    <action><insert name="&lt;xupdate:append select=&quot;/sidebar&quot;&gt;&lt;xupdate:element name=&quot;block&quot;&gt;&lt;title&gt;New title&lt;/title&gt;&lt;content&gt;New content&lt;/content&gt;&lt;/xupdate:element&gt;&lt;/xupdate:append&gt;"/></action>
+  </node>
+</xsl:template>
+
+<xsl:template match="block">
+  <node name="Add Block">
+    <action><insert name="&lt;xupdate:insert-before select=&quot;/sidebar/block[@tagID='{@tagID}']&quot;&gt;&lt;xupdate:element name=&quot;block&quot;&gt;&lt;title&gt;New title&lt;/title&gt;&lt;content&gt;New content&lt;/content&gt;&lt;/xupdate:element&gt;&lt;/xupdate:insert-before&gt;"/></action>
+  </node>
+  <node name="Delete Block">
+    <action><delete name="&lt;xupdate:remove select=&quot;/sidebar/block[@tagID='{@tagID}']&quot;/&gt;"/></action>
+  </node>
+  <node name="Title" select="/sidebar/block/title[@tagID='{title/@tagID}']">
+    <content type="plain"><input type="text" name="&lt;xupdate:update select=&quot;/sidebar/block/title[@tagID='{title/@tagID}']&quot;&gt;" size="40"><xsl:attribute name="value"><xsl:value-of select="title"/></xsl:attribute></input></content>
+  </node>
+  <node name="Content" select="/sidebar/block/content[@tagID='{content/@tagID}']">
+    <content type="mixed">
+      <textarea name="&lt;xupdate:update select=&quot;/sidebar/block/content[@tagID='{content/@tagID}']&quot;&gt;" cols="40" rows="3">
+        <xsl:copy-of select="content/node()"/>
+      </textarea>
+    </content>
+ </node> 
+</xsl:template>
+ 
+</xsl:stylesheet>



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