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/09/08 17:14:33 UTC

svn commit: r441527 - /lenya/trunk/src/webapp/lenya/content/rc/view.xsp

Author: andreas
Date: Fri Sep  8 08:14:32 2006
New Revision: 441527

URL: http://svn.apache.org/viewvc?view=rev&rev=441527
Log:
Added workaround to view.xsp: don't use page-envelope:document-path, but build the path using UUID and language. I hope this can be replaced with decent revision control code soon.

Modified:
    lenya/trunk/src/webapp/lenya/content/rc/view.xsp

Modified: lenya/trunk/src/webapp/lenya/content/rc/view.xsp
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/content/rc/view.xsp?view=diff&rev=441527&r1=441526&r2=441527
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/rc/view.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/rc/view.xsp Fri Sep  8 08:14:32 2006
@@ -27,6 +27,7 @@
     <xsp:include>java.io.File</xsp:include>
     <xsp:include>org.apache.lenya.cms.rc.RevisionController</xsp:include>
     <xsp:include>org.apache.lenya.cms.rc.RCEnvironment</xsp:include>
+    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
     <xsp:include>org.apache.lenya.xml.DocumentHelper</xsp:include>
   </xsp:structure>                                                                                                                          
@@ -37,7 +38,7 @@
 
       String rollbackTime=request.getParameter("rollbackTime");
 
-      Publication publication = (Publication)<input:get-attribute module="page-envelope" as="object" name="publication"/>;
+      Publication publication = (Publication) <input:get-attribute module="page-envelope" as="object" name="publication"/>;
       String publicationPath = publication.getDirectory().getCanonicalPath();
       RCEnvironment rcEnvironment = RCEnvironment.getInstance(publication.getServletContext().getCanonicalPath());
       String rcmlDirectory = rcEnvironment.getRCMLDirectory(); 
@@ -46,13 +47,13 @@
       backupDirectory = publicationPath + File.separator + backupDirectory;
       String contextPath = "content";
       String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
-      String documentPath = <input:get-attribute module="page-envelope" as="string" name="document-path"/>;
-      String filename = "/" + contextPath + "/" + area + "/" + documentPath;    
+      Document document = (Document) <input:get-attribute module="page-envelope" as="object" name="document"/>;
+      String filename = "/" + contextPath + "/" + area + "/" + document.getUUID() + "/" + document.getLanguage();    
 
       RevisionController rc = new RevisionController(rcmlDirectory, backupDirectory, publicationPath);
       String backupFilename = rc.getBackupFilename(new Long(rollbackTime).longValue(), filename);
 
-      org.w3c.dom.Document doc=null;
+      org.w3c.dom.Document doc = null;
       try {
         doc = DocumentHelper.readDocument(backupFilename);
       } catch (Exception e) {



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