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 2008/02/06 23:05:51 UTC

svn commit: r619176 - in /lenya/trunk/src/modules: cforms/ cforms/config/ fckeditor/config/ news/config/ opendocument/ opendocument/config/ opendocument/config/menus/

Author: andreas
Date: Wed Feb  6 14:05:50 2008
New Revision: 619176

URL: http://svn.apache.org/viewvc?rev=619176&view=rev
Log:
Converting some module menus to plain XML.

Added:
    lenya/trunk/src/modules/cforms/config/menu.xml
      - copied, changed from r618794, lenya/trunk/src/modules/cforms/config/menu.xsp
    lenya/trunk/src/modules/fckeditor/config/menu.xml
      - copied, changed from r618794, lenya/trunk/src/modules/fckeditor/config/menu.xsp
    lenya/trunk/src/modules/news/config/menu.xml
      - copied, changed from r618794, lenya/trunk/src/modules/news/config/menu.xsp
    lenya/trunk/src/modules/opendocument/config/menu.xml
      - copied, changed from r619066, lenya/trunk/src/modules/opendocument/config/menu.xsp
Removed:
    lenya/trunk/src/modules/cforms/config/menu.xsp
    lenya/trunk/src/modules/cforms/menus.xmap
    lenya/trunk/src/modules/fckeditor/config/menu.xsp
    lenya/trunk/src/modules/news/config/menu.xsp
    lenya/trunk/src/modules/opendocument/config/menu.xsp
    lenya/trunk/src/modules/opendocument/config/menus/
Modified:
    lenya/trunk/src/modules/opendocument/sitemap.xmap

Copied: lenya/trunk/src/modules/cforms/config/menu.xml (from r618794, lenya/trunk/src/modules/cforms/config/menu.xsp)
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/cforms/config/menu.xml?p2=lenya/trunk/src/modules/cforms/config/menu.xml&p1=lenya/trunk/src/modules/cforms/config/menu.xsp&r1=618794&r2=619176&rev=619176&view=diff
==============================================================================
--- lenya/trunk/src/modules/cforms/config/menu.xsp (original)
+++ lenya/trunk/src/modules/cforms/config/menu.xml Wed Feb  6 14:05:50 2008
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
+  
+  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.
@@ -16,62 +16,33 @@
   limitations under the License.
 -->
 
-<!-- $Id: generic.xsp 155806 2005-03-01 17:55:42Z andreas $ -->
-
-<xsp:page 
-    language="java" 
-    xmlns:xsp="http://apache.org/xsp"
-    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
-    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
-    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
-    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
-    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
-    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
->
-
-  <xsp:structure>
-    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
-    <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
-  </xsp:structure>
+<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
   
-  <menu>
-
-    <menus>
-      <menu i18n:attr="name" name="File">
-        <block areas="site authoring" id="create">
-          <item uc:usecase="sitemanagement.create" href="?doctype=cforms">
-            <i18n:translate>
-              <i18n:text>New ... Document</i18n:text>
-              <i18n:param><i18n:text>resourceType-cforms</i18n:text></i18n:param>
-            </i18n:translate>
-          </item>
-        </block>
-      </menu>
-      
-      <menu i18n:attr="name" name="Edit">
-          <xsp:logic>
-            try {
-                Object doc = <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc instanceof Document &amp;&amp; ((Document) doc).exists()) {
-                    String doctype = <input:get-attribute module="page-envelope" as="string" name="document-type"/>;
-                    if ("cforms".equals(doctype)) {
-                        <block areas="authoring">
-                          <item wf:event="edit" uc:usecase="cforms.edit" href="?"><i18n:text>With CForms</i18n:text></item>
-                          <!-- TODO: add RelaxNG schemas for cforms doctype.
-                          <item wf:event="edit" uc:usecase="editors.forms"><xsp:attribute name="href"><xsp:expr>"?form=" + doctype</xsp:expr></xsp:attribute><i18n:text>With Forms</i18n:text></item>
-                          <item wf:event="edit" uc:usecase="editors.oneform" href="?"><i18n:text>With one Form</i18n:text></item>
-                          -->
-                        </block>
-                    }
-                }
-            }
-            catch (Exception e) {
-                throw new ProcessingException("Error during menu generation: ", e);
-            }
-          </xsp:logic>
-      </menu>
-      
-    </menus>
+  <menus>
+    <menu i18n:attr="name" name="File">
+      <block areas="site authoring" id="create">
+        <item uc:usecase="sitemanagement.create" href="?doctype=cforms">
+          <i18n:translate>
+            <i18n:text>New ... Document</i18n:text>
+            <i18n:param><i18n:text>resourceType-cforms</i18n:text></i18n:param>
+          </i18n:translate>
+        </item>
+      </block>
+    </menu>
     
-  </menu>
-</xsp:page>
+    <menu i18n:attr="name" name="Edit">
+      <block areas="authoring" resourceTypes="cforms">
+        <item wf:event="edit" uc:usecase="cforms.edit" href="?"><i18n:text>With CForms</i18n:text></item>
+        <!-- TODO: add RelaxNG schemas for cforms doctype.
+          <item wf:event="edit" uc:usecase="editors.forms"><xsp:attribute name="href"><xsp:expr>"?form=" + doctype</xsp:expr></xsp:attribute><i18n:text>With Forms</i18n:text></item>
+          <item wf:event="edit" uc:usecase="editors.oneform" href="?"><i18n:text>With one Form</i18n:text></item>
+        -->
+      </block>
+    </menu>
+    
+  </menus>
+  
+</menu>

Copied: lenya/trunk/src/modules/fckeditor/config/menu.xml (from r618794, lenya/trunk/src/modules/fckeditor/config/menu.xsp)
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/config/menu.xml?p2=lenya/trunk/src/modules/fckeditor/config/menu.xml&p1=lenya/trunk/src/modules/fckeditor/config/menu.xsp&r1=618794&r2=619176&rev=619176&view=diff
==============================================================================
--- lenya/trunk/src/modules/fckeditor/config/menu.xsp (original)
+++ lenya/trunk/src/modules/fckeditor/config/menu.xml Wed Feb  6 14:05:50 2008
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
+  
+  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.
@@ -16,31 +16,14 @@
   limitations under the License.
 -->
 
-<xsp:page 
-    language="java" 
-    xmlns:xsp="http://apache.org/xsp"
-    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
-    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
-    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
-    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
-    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
-    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
->
-
-  <menu>
-    <menus>
-      <menu i18n:attr="name" name="Edit">
-          <xsp:logic>
-            String doctype = <input:get-attribute module="page-envelope" as="string" name="document-type"/>;
-            if ("xhtml".equals(doctype) || "homepage".equals(doctype)) {
-                <block info="false">
-                  <item wf:event="edit" uc:usecase="fckeditor.edit" href="?"><i18n:text>With FCKEditor</i18n:text></item>
-                </block>
-            }
-          </xsp:logic>
-      </menu>
-      
-    </menus>
-    
-  </menu>
-</xsp:page>
\ No newline at end of file
+<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
+  <menus>
+    <menu i18n:attr="name" name="Edit">
+      <block info="false" resourceTypes="xhtml homepage">
+        <item uc:usecase="fckeditor.edit" href="?"><i18n:text>With FCKEditor</i18n:text></item>
+      </block>
+    </menu>
+  </menus>
+</menu>

Copied: lenya/trunk/src/modules/news/config/menu.xml (from r618794, lenya/trunk/src/modules/news/config/menu.xsp)
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/news/config/menu.xml?p2=lenya/trunk/src/modules/news/config/menu.xml&p1=lenya/trunk/src/modules/news/config/menu.xsp&r1=618794&r2=619176&rev=619176&view=diff
==============================================================================
--- lenya/trunk/src/modules/news/config/menu.xsp (original)
+++ lenya/trunk/src/modules/news/config/menu.xml Wed Feb  6 14:05:50 2008
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
+  
+  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.
@@ -16,56 +16,28 @@
   limitations under the License.
 -->
 
-<!-- $Id: generic.xsp 155806 2005-03-01 17:55:42Z andreas $ -->
-
-<xsp:page 
-    language="java" 
-    xmlns:xsp="http://apache.org/xsp"
-    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
-    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
-    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
-    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
-    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
-    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
->
-
-  <xsp:structure>
-    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
-  </xsp:structure>
+<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
   
-  <menu>
-    <menus>
-      <menu i18n:attr="name" name="File">
-        <block areas="site authoring" id="create">
-          <item uc:usecase="sitemanagement.create" href="?doctype=news">
-            <i18n:translate>
-              <i18n:text>New ... Document</i18n:text>
-              <i18n:param><i18n:text>resourceType-news</i18n:text></i18n:param>
-            </i18n:translate>
-          </item>
-        </block>
-      </menu>
-      
-      <menu i18n:attr="name" name="Edit">
-        <xsp:logic>
-          try {
-              Object doc = <input:get-attribute module="page-envelope" as="object" name="document"/>;
-              if (doc instanceof Document &amp;&amp; ((Document) doc).exists()) {
-                  String doctype = <input:get-attribute module="page-envelope" as="string" name="document-type"/>;
-                  if ("news".equals(doctype)) {
-                      <block areas="authoring">
-                        <item uc:usecase="news.edit" href="?"><i18n:text>news-settings</i18n:text></item>
-                      </block>
-                  }
-              }
-          }
-          catch (Exception e) {
-              throw new ProcessingException("Error during menu generation: ", e);
-          }
-        </xsp:logic>
-      </menu>
-      
-    </menus>
-  </menu>
-  
-</xsp:page>
+  <menus>
+    <menu i18n:attr="name" name="File">
+      <block areas="site authoring" id="create">
+        <item uc:usecase="sitemanagement.create" href="?doctype=news">
+          <i18n:translate>
+            <i18n:text>New ... Document</i18n:text>
+            <i18n:param><i18n:text>resourceType-news</i18n:text></i18n:param>
+          </i18n:translate>
+        </item>
+      </block>
+    </menu>
+    
+    <menu i18n:attr="name" name="Edit">
+      <block areas="authoring" resourceTypes="news">
+        <item uc:usecase="news.edit" href="?"><i18n:text>news-settings</i18n:text></item>
+      </block>
+    </menu>
+    
+  </menus>
+</menu>
+

Copied: lenya/trunk/src/modules/opendocument/config/menu.xml (from r619066, lenya/trunk/src/modules/opendocument/config/menu.xsp)
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/opendocument/config/menu.xml?p2=lenya/trunk/src/modules/opendocument/config/menu.xml&p1=lenya/trunk/src/modules/opendocument/config/menu.xsp&r1=619066&r2=619176&rev=619176&view=diff
==============================================================================
--- lenya/trunk/src/modules/opendocument/config/menu.xsp (original)
+++ lenya/trunk/src/modules/opendocument/config/menu.xml Wed Feb  6 14:05:50 2008
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
+  
+  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.
@@ -18,64 +18,27 @@
 
 <!-- $Id:$ -->
 
-<xsp:page 
-    language="java" 
-    xmlns:xsp="http://apache.org/xsp"
-    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
-    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
-    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
-    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
-    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
-    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
->
-
-  <xsp:structure>
-    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
-    <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
-  </xsp:structure>
+<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
+  xmlns="http://apache.org/cocoon/lenya/menubar/1.0">
   
-  <menu>
-
-    <menus>
-      <menu i18n:attr="name" name="File">
-        <block areas="site authoring" id="create">
-          <item uc:usecase="opendocument.create" href="?doctype=opendocument">
-            <i18n:translate>
-              <i18n:text>New ... Document</i18n:text>
-              <i18n:param><i18n:text>resourceType-opendocument</i18n:text></i18n:param>
-            </i18n:translate>
-          </item>
-        </block>
-      </menu>
-      <menu i18n:attr="name" name="Edit">
-          <xsp:logic>
-            try {
-                Object doc = <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc instanceof Document &amp;&amp; ((Document) doc).exists()) {
-                    String doctype = <input:get-attribute module="page-envelope" as="string" name="document-type"/>;
-                    if ("opendocument".equals(doctype)) {
-                        String requestURI = <input:get-attribute module="request" as="string" name="requestURI"/>;
-                        String moduleURI = requestURI.substring(0,requestURI.lastIndexOf(".html")).concat(".odt?lenya.module=opendocument");
-                        <block areas="authoring">
-                          <item>
-                            <xsp:attribute name="href">
-                              <xsp:expr>moduleURI</xsp:expr>
-                            </xsp:attribute>
-                            <i18n:text>Download ODT</i18n:text></item>
-                        </block>
-                        <block areas="authoring">
-                          <item uc:usecase="opendocument.upload" href="?"><i18n:text>Upload ODT</i18n:text></item>
-                        </block>
-                    }
-                }
-            }
-            catch (Exception e) {
-                throw new ProcessingException("Error during menu generation: ", e);
-            }
-          </xsp:logic>
-      </menu>
-    </menus>
-
-    
-  </menu>
-</xsp:page>
+  <menus>
+    <menu i18n:attr="name" name="File">
+      <block areas="site authoring" id="create">
+        <item uc:usecase="opendocument.create" href="?doctype=opendocument">
+          <i18n:translate>
+            <i18n:text>New ... Document</i18n:text>
+            <i18n:param><i18n:text>resourceType-opendocument</i18n:text></i18n:param>
+          </i18n:translate>
+        </item>
+      </block>
+    </menu>
+    <menu i18n:attr="name" name="Edit">
+      <block areas="authoring" resourceTypes="opendocument">
+        <item href="?lenya.module=opendocument&amp;download"><i18n:text>Download ODT</i18n:text></item>
+        <item uc:usecase="opendocument.upload" href="?"><i18n:text>Upload ODT</i18n:text></item>
+      </block>
+    </menu>
+  </menus>
+  
+</menu>

Modified: lenya/trunk/src/modules/opendocument/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/opendocument/sitemap.xmap?rev=619176&r1=619175&r2=619176&view=diff
==============================================================================
--- lenya/trunk/src/modules/opendocument/sitemap.xmap (original)
+++ lenya/trunk/src/modules/opendocument/sitemap.xmap Wed Feb  6 14:05:50 2008
@@ -48,6 +48,12 @@
         </map:transform>
         <map:serialize type="xml"/>
       </map:match>
+      
+      <map:match type="request-parameter" pattern="download">
+        <map:match pattern="**/*.html">
+          <map:redirect-to uri="{2}.odt?lenya.module=opendocument"/>
+        </map:match>
+      </map:match>
 
       <map:match pattern="**.odt">
         <map:read src="lenya-document:{page-envelope:document-uuid},lang={page-envelope:document-language}" mime-type="application/vnd.oasis.opendocument.text"/>



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