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 2006/06/08 15:01:00 UTC

svn commit: r412741 - in /lenya/trunk/src: modules/cforms/config/menu.xsp modules/links/config/menu.xsp modules/opendocument/config/menus/opendocument.xsp modules/xhtml/config/menu.xsp pubs/default/modules/homepage/config/menus/homepage.xsp

Author: andreas
Date: Thu Jun  8 06:01:00 2006
New Revision: 412741

URL: http://svn.apache.org/viewvc?rev=412741&view=rev
Log:
Menus: check if the current document object as returned from the page envelope is really a document, because the input module logicsheet returns an empty string instead of null values.

Modified:
    lenya/trunk/src/modules/cforms/config/menu.xsp
    lenya/trunk/src/modules/links/config/menu.xsp
    lenya/trunk/src/modules/opendocument/config/menus/opendocument.xsp
    lenya/trunk/src/modules/xhtml/config/menu.xsp
    lenya/trunk/src/pubs/default/modules/homepage/config/menus/homepage.xsp

Modified: lenya/trunk/src/modules/cforms/config/menu.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/cforms/config/menu.xsp?rev=412741&r1=412740&r2=412741&view=diff
==============================================================================
--- lenya/trunk/src/modules/cforms/config/menu.xsp (original)
+++ lenya/trunk/src/modules/cforms/config/menu.xsp Thu Jun  8 06:01:00 2006
@@ -45,8 +45,8 @@
       <menu i18n:attr="name" name="Edit">
           <xsp:logic>
             try {
-                Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc != null &amp;&amp; doc.exists()) {
+                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 info="false">

Modified: lenya/trunk/src/modules/links/config/menu.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/links/config/menu.xsp?rev=412741&r1=412740&r2=412741&view=diff
==============================================================================
--- lenya/trunk/src/modules/links/config/menu.xsp (original)
+++ lenya/trunk/src/modules/links/config/menu.xsp Thu Jun  8 06:01:00 2006
@@ -45,8 +45,8 @@
       <menu i18n:attr="name" name="Edit">
           <xsp:logic>
             try {
-                Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc != null &amp;&amp; doc.exists()) {
+                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 ("links".equals(doctype)) {
                         <block info="false">

Modified: lenya/trunk/src/modules/opendocument/config/menus/opendocument.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/opendocument/config/menus/opendocument.xsp?rev=412741&r1=412740&r2=412741&view=diff
==============================================================================
--- lenya/trunk/src/modules/opendocument/config/menus/opendocument.xsp (original)
+++ lenya/trunk/src/modules/opendocument/config/menus/opendocument.xsp Thu Jun  8 06:01:00 2006
@@ -44,8 +44,8 @@
       <menu i18n:attr="name" name="Edit">
           <xsp:logic>
             try {
-                Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc != null &amp;&amp; doc.exists()) {
+                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"/>;
                     String requestURI = <input:get-attribute module="request" as="string" name="requestURI"/>;
                     String moduleURI = requestURI.substring(0,requestURI.lastIndexOf(".html")).concat(".odt?lenya.module=opendocument");

Modified: lenya/trunk/src/modules/xhtml/config/menu.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/xhtml/config/menu.xsp?rev=412741&r1=412740&r2=412741&view=diff
==============================================================================
--- lenya/trunk/src/modules/xhtml/config/menu.xsp (original)
+++ lenya/trunk/src/modules/xhtml/config/menu.xsp Thu Jun  8 06:01:00 2006
@@ -45,8 +45,8 @@
       <menu i18n:attr="name" name="Edit">
           <xsp:logic>
             try {
-                Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc != null &amp;&amp; doc.exists()) {
+                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 ("xhtml".equals(doctype)) {
                         <block info="false">

Modified: lenya/trunk/src/pubs/default/modules/homepage/config/menus/homepage.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/modules/homepage/config/menus/homepage.xsp?rev=412741&r1=412740&r2=412741&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/modules/homepage/config/menus/homepage.xsp (original)
+++ lenya/trunk/src/pubs/default/modules/homepage/config/menus/homepage.xsp Thu Jun  8 06:01:00 2006
@@ -39,8 +39,8 @@
       <menu i18n:attr="name" name="Edit">
           <xsp:logic>
             try {
-                Document doc = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
-                if (doc != null &amp;&amp; doc.exists()) {
+                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 ("homepage".equals(doctype)) {
                         <block info="false">



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