You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2006/06/14 10:41:06 UTC

svn commit: r414149 - in /lenya/branches/revolution/1.3.x/src: java/org/apache/lenya/cms/content/flat/FlatResource.java webapp/lenya/modules/flat/code.js webapp/lenya/modules/flat/content3.xsl webapp/lenya/modules/flat/resources3.xsl

Author: solprovider
Date: Wed Jun 14 01:41:06 2006
New Revision: 414149

URL: http://svn.apache.org/viewvc?rev=414149&view=rev
Log:
FlatRevision: Fixed bug with getTitle() not using current revision.
Migrate: Restored edit and live revisions default to "1".
Migrate: Removed extension from id and fullid.  This changes the content datastore, so please migrate again.

Modified:
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/resources3.xsl

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java?rev=414149&r1=414148&r2=414149&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java Wed Jun 14 01:41:06 2006
@@ -96,13 +96,13 @@
  * Get Navigation Title from live revision of current language.
  */
    public String getTitle(){
-      return getTitle(defaultLanguage, "live");
+      return getTitle(defaultLanguage, defaultRevision);
    }
 /**
  * Get Navigation Title from live revision of specified language.
  */
    public String getTitle(String language){
-      return getTitle(language, "live");
+      return getTitle(language, defaultRevision);
    }
 /**
  * Get Navigation Title from specified revision of specified language.
@@ -183,11 +183,4 @@
          return false;
       }
    }
-/*
-   public Source getSource(String translation, String revision) throws SourceNotFoundException {
-      throw new SourceNotFoundException("FlatResource.getSource is not implemented yet");
-   }
-
-*/
-
 }

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js?rev=414149&r1=414148&r2=414149&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js Wed Jun 14 01:41:06 2006
@@ -52,6 +52,7 @@
    var resourcetableentry;
    var type;
    var extension;
+   var hasExtension;
    var id2unid = new Packages.java.util.HashMap();
    var homeunid = "0001";
    var nextunid = 1;
@@ -118,9 +119,14 @@
       // Extension - BEGIN
       extension = "";
       pos = id.lastIndexOf(".");
-      if(pos > 0) extension = id.substring(pos + 1);
-// WORKAROUND: BUG with JS String.length.  If length > 0 returns function code rather than number.
-      var hasExtension = (extension.length == 0 ? false : true);
+      hasExtension = false;
+      if(pos > 0){
+         extension = id.substring(pos + 1);
+         id = id.substring(0, pos);
+         pos = fullid.lastIndexOf(id);
+         fullid = fullid.substring(0, pos) + id;
+         hasExtension = true;
+      }
       // Extension - END
       pos = fullid.lastIndexOf("/" + id);
       parentid = fullid.substring(0, pos);

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl?rev=414149&r1=414148&r2=414149&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl Wed Jun 14 01:41:06 2006
@@ -46,7 +46,7 @@
 <xsl:variable name="editf"><xsl:value-of select="file[@area='authoring']/@time"/></xsl:variable>
 <xsl:variable name="edit"><xsl:choose>
    <xsl:when test="string-length($editf) &gt; 0"><xsl:value-of select="$editf"/></xsl:when>
-   <xsl:otherwise></xsl:otherwise>
+   <xsl:otherwise>1</xsl:otherwise>
 </xsl:choose></xsl:variable>
 
 <xsl:variable name="livef"><xsl:value-of select="file[@area='live']/@time"/></xsl:variable>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/resources3.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/resources3.xsl?rev=414149&r1=414148&r2=414149&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/resources3.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/resources3.xsl Wed Jun 14 01:41:06 2006
@@ -45,7 +45,7 @@
 <xsl:variable name="livef"><xsl:value-of select="file[@area='live']/@time"/></xsl:variable>
 <xsl:variable name="live"><xsl:choose>
    <xsl:when test="string-length($livef) &gt; 0"><xsl:value-of select="$livef"/></xsl:when>
-   <xsl:otherwise></xsl:otherwise>
+   <xsl:otherwise>1</xsl:otherwise>
 </xsl:choose></xsl:variable>
 
   <xsl:copy><xsl:apply-templates select="@*"/>



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