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 new Entry</item>
</block>
<block>
- <item wf:event="edit" uc:usecase="edit" uc:step="open" href="../../sidebar.html?form=sidebar">Edit Sidebar with Forms</item>
+ <item wf:event="edit" uc:usecase="edit.forms" href="../../sidebar.html?form=sidebar">Edit Sidebar with Forms</item>
<item wf:event="publish" uc:usecase="publish" uc:step="showscreen" href="../../sidebar.html?sources=sidebar.xml&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 < and >
+ <content><input type="text" name="<xupdate:update select="/echo:entry/echo:title[@tagID='{echo:title/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:apply-templates select="echo:title/node()" mode="mixed"/></xsl:attribute></input></content>
+-->
+ <content>
+ <textarea name="<xupdate:update select="/echo:entry/echo:title[@tagID='{echo:title/@tagID}']">" 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="<xupdate:insert-after select="/echo:entry/echo:title[@tagID='{echo:title/@tagID}']"><xupdate:element name="echo:summary" namespace="http://purl.org/atom/ns#">New summary</xupdate:element></xupdate:insert-after>"/></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="<xupdate:append select="/echo:entry"><xupdate:element name="echo:content" namespace="http://purl.org/atom/ns#"><xupdate:attribute name="type">application/xhtml+xml</xupdate:attribute><p>Append new content</p></xupdate:element></xupdate:append>"/></action>
+</node>
+<!--
+<node name="Content (text/plain as CDATA)">
+ <action><insert name="<xupdate:append select="/echo:entry"><xupdate:element name="echo:content" namespace="http://purl.org/atom/ns#"><xupdate:attribute name="type">text/plain</xupdate:attribute>New CDATA content</xupdate:element></xupdate:append>"/></action>
+</node>
+-->
+</xsl:template>
+
+<xsl:template match="echo:summary">
+<node name="Summary" select="/echo:entry/echo:summary[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/echo:entry/echo:summary[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/echo:entry/echo:summary[@tagID='{@tagID}']">" 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="<xupdate:insert-before select="/echo:entry/echo:content[@tagID='{@tagID}']"><xupdate:element name="echo:content" namespace="http://purl.org/atom/ns#"><xupdate:attribute name="type">text/plain</xupdate:attribute>New content</xupdate:element></xupdate:insert-before>"/></action>
+</node>
+<node name="Content (text/plain as CDATA)">
+ <action><delete name="<xupdate:remove select="/echo:entry/echo:content[@tagID='{@tagID}']"/>"/></action>
+ <content><textarea name="<xupdate:update select="/echo:entry/echo:content[@tagID='{@tagID}']"><![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="<xupdate:insert-before select="/echo:entry/echo:content[@tagID='{@tagID}']"><xupdate:element name="echo:content" namespace="http://purl.org/atom/ns#"><xupdate:attribute name="type">application/xhtml+xml</xupdate:attribute><p>Insert before new content</p></xupdate:element></xupdate:insert-before>"/></action>
+</node>
+<node name="Content Block (application/xhtml+xml)" select="/echo:entry/echo:content[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/echo:entry/echo:content[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/echo:entry/echo:content[@tagID='{@tagID}']">" 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="<xupdate:append select="/sidebar"><xupdate:element name="block"><title>New title</title><content>New content</content></xupdate:element></xupdate:append>"/></action>
+ </node>
+</xsl:template>
+
+<xsl:template match="block">
+ <node name="Add Block">
+ <action><insert name="<xupdate:insert-before select="/sidebar/block[@tagID='{@tagID}']"><xupdate:element name="block"><title>New title</title><content>New content</content></xupdate:element></xupdate:insert-before>"/></action>
+ </node>
+ <node name="Delete Block">
+ <action><delete name="<xupdate:remove select="/sidebar/block[@tagID='{@tagID}']"/>"/></action>
+ </node>
+ <node name="Title" select="/sidebar/block/title[@tagID='{title/@tagID}']">
+ <content type="plain"><input type="text" name="<xupdate:update select="/sidebar/block/title[@tagID='{title/@tagID}']">" 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="<xupdate:update select="/sidebar/block/content[@tagID='{content/@tagID}']">" 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