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 2008/09/10 02:30:22 UTC

svn commit: r693670 [6/6] - in /lenya/branches/revolution/1.3.x: ./ src/java/org/apache/lenya/cms/ac/ src/java/org/apache/lenya/cms/ac/usecase/ src/java/org/apache/lenya/cms/ac/workflow/ src/java/org/apache/lenya/cms/ant/ src/java/org/apache/lenya/cms/...

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java Tue Sep  9 17:30:20 2008
@@ -1,6 +1,8 @@
 package org.apache.lenya.util;
+import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.util.HashMap;
 import java.util.Map;
 import org.apache.axis.components.uuid.UUIDGen;
 import org.apache.axis.components.uuid.UUIDGenFactory;
@@ -15,10 +17,10 @@
 import org.apache.excalibur.source.SourceException;
 import org.apache.lenya.ac.Identity;
 import org.apache.lenya.ac.User;
-import org.apache.lenya.cms.publication.PageEnvelope;
-import org.apache.lenya.cms.publication.PageEnvelopeException;
 import org.apache.lenya.cms.publication.Publication;
-import org.apache.lenya.cms.publication.PublicationFactory;
+import org.apache.lenya.cms.publication.PublicationException;
+import org.apache.lenya.cms.publication.URLInformation;
+import org.apache.lenya.cms.publication.file.FilePublication;
 import org.apache.log.ContextMap;
 /**
  * Static functions for accessing global and thread-based constants.
@@ -34,52 +36,54 @@
    private Globals() {
    }
    // UUID Generation (from Lenya 2)
-   static private UUIDGen delegate;
-   static private UUIDGen getDelegate() {
+   private static UUIDGen delegate;
+   private static UUIDGen getDelegate() {
       if(delegate == null){
          delegate = UUIDGenFactory.getUUIDGen();
       }
       return delegate;
    }
-   static public String createUUID() {
+   public static String createUUID() {
       return getDelegate().nextUUID();
    }
    // Lenya Functions
-   static public String getAction() {
+   public static String getAction() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getAction();
    }
    // null
-   static public String getContentType() {
+   public static String getContentType() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getContentType();
    }
-   static public final Context getContext() {
-      return (Context) getObjectModel().get(ObjectModelHelper.CONTEXT_OBJECT);
+   public static final Context getContext() {
+      Map objectModel = getObjectModel();
+      if(null == objectModel) return (Context) null;
+      return (Context) objectModel.get(ObjectModelHelper.CONTEXT_OBJECT);
    }
    /**
     * Use for modification times e.g. revision filenames.
     * 
     * @return current datetime (Date.getTime()) as String (Long.toString()).
     */
-   static public String getDateString() {
+   public static String getDateString() {
       return Long.toString(new java.util.Date().getTime());
    }
    // file:///F:/eclipseWS/Lenya13x/build/lenya/webapp/lenya/modules/authoring/
    // file:///F:/eclipseWS/Lenya13x/build/lenya/webapp/lenya/modules/cache/module.xmap
    // file:///F:/eclipseWS/Lenya13x/build/lenya/webapp/lenya/modules/edit/
    // ?? Last use of map:mount
-   static public String getEnvironmentContext() {
+   public static String getEnvironmentContext() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getContext();
    }
-   static public final Long getExpires() {
+   public static final Long getExpires() {
       return (Long) getObjectModel().get(ObjectModelHelper.EXPIRES_OBJECT);
    }
-   static public String getModuleId() {
+   public static String getModuleId() {
+      // System.out.println("Globals.getModuleId");
       Source source = getSource();
-      if(null == source)
-         return "";
+      if(null == source) return "";
       return getModuleId(source.getURI());
    }
    /**
@@ -88,10 +92,8 @@
     * @param filepath
     * @return
     */
-   static public String getModuleId(String filepath) {
-      if(filepath.length() < 1){
-         return "";
-      }
+   public static String getModuleId(String filepath) {
+      if(filepath.length() < 1){ return ""; }
       String ret = "";
       String[] strings = filepath.split("^(.*)modules");
       if(1 < strings.length){
@@ -108,10 +110,8 @@
     * @param filepath
     * @return
     */
-   static public String getPublicationId(String filepath) {
-      if(filepath.length() < 1){
-         return "";
-      }
+   public static String getPublicationId(String filepath) {
+      if(filepath.length() < 1){ return ""; }
       String ret = "";
       String[] strings = filepath.split("^(.*)pubs");
       if(1 < strings.length){
@@ -123,49 +123,50 @@
       return ret;
    }
    // null
-   static public Map getObjectModel() {
+   public static Map getObjectModel() {
       ContextMap contextMap = ContextMap.getCurrentContext();
       return (Map) contextMap.get("objectModel");
    }
-   static public Publication getPublication() {
-      try{
-         return PageEnvelope.getCurrent().getPublication();
-      }catch(PageEnvelopeException e){
-         // getPublication may be called without a request. Return null.
-      }
-      return null;
-   }
-   static public Publication getPublication(String publicationId) {
-      try{
-         return PublicationFactory.getPublication(publicationId, getServletContextPath());
-      }catch(org.apache.lenya.cms.publication.PublicationException pe){
-         return (Publication) null;
-      }
-   }
-   static public final Request getRequest() {
+   // public static Publication getPublication() {
+   // try{
+   // return PageEnvelope.getCurrent().getPublication();
+   // }catch(PageEnvelopeException e){
+   // // getPublication may be called without a request. Return null.
+   // System.out.println("Globals.getPublication PageEnvelopeException: " + e.getLocalizedMessage());
+   // }
+   // return null;
+   // }
+   // public static Publication getPublication(String publicationId) {
+   // try{
+   // return PublicationFactory.getPublication(publicationId, getServletContextPath());
+   // }catch(org.apache.lenya.cms.publication.PublicationException pe){
+   // return (Publication) null;
+   // }
+   // }
+   public static final Request getRequest() {
       try{
          return (Request) getObjectModel().get(ObjectModelHelper.REQUEST_OBJECT);
       }catch(NullPointerException npe){
       }
       return null;
    }
-   static public final Response getResponse() {
+   public static final Response getResponse() {
       return (Response) getObjectModel().get(ObjectModelHelper.RESPONSE_OBJECT);
    }
    // file:///F:/eclipseWS/Lenya13x/build/lenya/webapp/
    // ??? servletContextPath with protocol
-   static public String getRootContext() {
+   public static String getRootContext() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getRootContext();
    }
    // Jetty/4.2
-   static public String getServerName() {
+   public static String getServerName() {
       HttpContext hc = (HttpContext) getObjectModel().get("context");
       return hc.getServerInfo();
    }
    // F:\eclipseWS\Lenya13x\build\lenya\webapp
    // servletContextPath in OS' native format
-   static public String getServletContextPath() {
+   public static String getServletContextPath() {
       HttpContext hc = (HttpContext) getObjectModel().get("context");
       return hc.getRealPath("");
    }
@@ -181,7 +182,8 @@
    /**
     * FileSource
     */
-   static public Source getSource() {
+   public static Source getSource() {
+      // System.out.println("Globals.getSource");
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       try{
          return he.resolveURI("");
@@ -195,14 +197,14 @@
       return null;
    }
    // C:\DOCUME~1\solprovider\LOCALS~1\Temp\Jetty__8888__
-   static public String getTempDir() {
+   public static String getTempDir() {
       HttpContext hc = (HttpContext) getObjectModel().get("context");
       return (String) hc.getAttribute("javax.servlet.context.tempdir");
    }
-   static public final Throwable getThrowable() {
+   public static final Throwable getThrowable() {
       return (Throwable) getObjectModel().get(ObjectModelHelper.THROWABLE_OBJECT);
    }
-   static public String getUser() {
+   public static String getUser() {
       String userid = "anonymous";
       Request request = getRequest();
       if(null != request){
@@ -211,8 +213,7 @@
             Identity identity = (Identity) session.getAttribute(Identity.class.getName());
             if(identity != null){
                User user = identity.getUser();
-               if(user != null)
-                  userid = user.getId();
+               if(user != null) userid = user.getId();
             }
          }
       }
@@ -223,18 +224,84 @@
    // live/features_en.html
    // live/index.html
    // ??? The current match string for the XMAP.
-   static public String getURI() {
+   public static String getURI() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getURI();
    }
    // default13/
-   static public String getURIPrefix() {
+   public static String getURIPrefix() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getURIPrefix();
    }
    // null
-   static public String getView() {
+   public static String getView() {
       HttpEnvironment he = (HttpEnvironment) getObjectModel().get("source-resolver");
       return he.getView();
    }
+   // ###########################
+   // ## Publication Functions ##
+   // ###########################
+   private static volatile Map keyToPublication = new HashMap();
+   public static Publication getPublication() {
+      // Creating publication from webapp URL and servlet context Webapp URL: [" + webappUrl + "]"
+      Request request = getRequest();
+      if(null == request){
+         // This is acceptable as getPublication may be called without a request.
+         return (Publication) null;
+      }
+      String publicationId = new URLInformation(ServletHelper.getWebappURI(request)).getPublicationId();
+      Publication publication = getPublication(publicationId);
+      return publication;
+   }
+   public static synchronized Publication getPublication(String publicationId) {
+      File servletContext = new File(getContext().getRealPath(""));
+      String servletContextPath = servletContext.getAbsolutePath();
+      // String key = generatePublicationKey(id);
+      // File servletContext = new File(getContext().getRealPath(""));
+      // String key;
+      String canonicalPath;
+      try{
+         canonicalPath = servletContext.getCanonicalPath();
+      }catch(IOException e){
+         System.out.println("Globals.generatePublicationKey: Publication ID='" + publicationId + "' IOException " + e.getLocalizedMessage());
+         return (Publication) null;
+      }
+      String key = canonicalPath + "_" + publicationId;
+      Publication publication = null;
+      if(keyToPublication.containsKey(key)){
+         publication = (Publication) keyToPublication.get(key);
+         // System.out.println("Globals.getPublication ID='" + publicationId + "' Found");
+      }else{
+         if(existsPublication(publicationId)){
+            try{
+               publication = new FilePublication(publicationId, servletContextPath);
+               // System.out.println("Globals.getPublication ID='" + publicationId + "' Created");
+            }catch(PublicationException e){
+               // This is acceptable as getPublication may be called without a request.
+               System.out.println("Globals.getPublication ID='" + publicationId + "' PublicationException " + e.getLocalizedMessage());
+               return (Publication) null;
+            }
+            keyToPublication.put(key, publication);
+         }
+      }
+      if(publication == null){
+         // This is acceptable as getPublication may be called without a request.
+         System.out.println("Globals.getPublication: Publication ID='" + publicationId + "' could not be created.");
+      }
+      return publication;
+   }
+   public static boolean existsPublication(String id) {
+      Context context = getContext();
+      if(null == context) return false;
+      File servletContext = new File(getContext().getRealPath(""));
+      String servletContextPath = servletContext.getAbsolutePath();
+      if(servletContextPath.endsWith("/")){
+         servletContextPath = servletContextPath.substring(0, servletContextPath.length() - 1);
+      }
+      File publicationDirectory = new File(servletContextPath + File.separator + Publication.PUBLICATION_PREFIX + File.separator + id);
+      boolean exists = true;
+      exists = exists && publicationDirectory.isDirectory();
+      exists = exists && new File(publicationDirectory, Publication.CONFIGURATION_FILE).exists();
+      return exists;
+   }
 }

Modified: lenya/branches/revolution/1.3.x/src/webapp/WEB-INF/cocoon-xconf.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/WEB-INF/cocoon-xconf.xsl?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/WEB-INF/cocoon-xconf.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/WEB-INF/cocoon-xconf.xsl Tue Sep  9 17:30:20 2008
@@ -114,7 +114,7 @@
 <!-- Lenya1.3 BEGIN -->
 <component-instance class="org.apache.lenya.cms.content.ContentInputModule" name="content" logger="core.modules.input.module"/>
 <component-instance class="org.apache.lenya.cms.modules.ModuleInputModule" name="module" logger="core.modules.input.module"/>
-<component-instance class="org.apache.lenya.cms.cocoon.components.modules.input.PublicationModule" name="publication" logger="core.modules.input.module"/>
+<component-instance class="org.apache.lenya.cms.modules.PublicationInputModule" name="publication" logger="core.modules.input.module"/>
 <component-instance class="org.apache.lenya.cms.cocoon.components.modules.input.Usecase2ModuleModule" name="u2m" logger="core.modules.input.usecase2module"/>
 <component-instance class="org.apache.lenya.cms.cocoon.components.modules.input.VirtualModule" name="virtual" logger="core.modules.input.module"/>
 <!-- Lenya1.3 END -->
@@ -129,6 +129,8 @@
     <xsl:apply-templates/>
     <component-instance class="org.apache.lenya.cms.modules.ModuleSourceFactory" name="module"/>
     <component-instance class="org.apache.lenya.cms.content.ContentSourceFactory" name="content"/>
+    <component-instance class="org.apache.lenya.cms.content.DesignSourceFactory" name="design"/>
+    <component-instance class="org.apache.lenya.cms.content.StructureSourceFactory" name="structure"/>
     <component-instance class="org.apache.lenya.cms.cocoon.components.source.impl.VirtualSourceFactory" name="virtual"/>
   </xsl:copy>
 </xsl:template>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/code.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/code.js?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/code.js (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/code.js Tue Sep  9 17:30:20 2008
@@ -17,21 +17,22 @@
    var root = dom.getDocumentElement();
 print("ROOT=" + root.getTagName());
    var child = root.getFirstChild();
+   var type = "content";
    while(child != null){
       var childtag = child.getNodeName();
       if(childtag.equalsIgnoreCase("resource")){
          var doc = convertNodeToDocument(child);
-         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc);
+         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc, type);
       }
       if(childtag.equalsIgnoreCase("revision")){
          var language = child.getAttribute("language");
-         var setLive = false;
+          var setLive = false;
          if(child.hasAttribute("live")){
             if(child.getAttribute("live").equalsIgnoreCase("true")) setLive = true;
          }
          var revision = child.getFirstChild();
          var doc = convertNodeToDocument(revision);
-         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, setLive);
+         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, type, setLive);
       }
       child = child.getNextSibling();
    }

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=693670&r1=693669&r2=693670&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 Tue Sep  9 17:30:20 2008
@@ -2,6 +2,7 @@
 var ContentDirectoryNew;
 var ResourcesDirectory;
 var RelationsDirectory;
+var DesignDirectory;
 
 function init(){
 //Inconsistent directories.
@@ -15,6 +16,7 @@
    ContentDirectoryNew = PublicationDirectory + "content/";
    ResourcesDirectory = ContentDirectoryNew + "resource/";
    RelationsDirectory = ContentDirectoryNew + "relation/";
+   DesignDirectory = ContentDirectoryNew + "design/";
 }
 
 var incremental = false;
@@ -176,8 +178,7 @@
             if(oldfilename.length() > 0){
                filedoc = loadDocument(PublicationDirectory + oldfilename);
             }else{
-                filedoc = createDocument(resource.getAttribute("type"), 
-                      ResourcesDirectory + unid + file.getAttribute("filename"));
+                filedoc = createDocument(resource.getAttribute("type"), ResourcesDirectory + unid + file.getAttribute("filename"));
             }
             fileroot = filedoc.getDocumentElement();
             if(file.hasAttribute("navtitle")){
@@ -248,7 +249,26 @@
       var result = new Packages.javax.xml.transform.stream.StreamResult(resultFile);
       transformer.transform(source, result);
    }
-   //### Copy Indexes
+   //### Copy "live" structure to Design Resource - Added 20080331
+   unid = publication + "+live"   
+   if(!incremental){
+      resourcedoc = createDocument("resource", DesignDirectory + unid + "/resource.xml");
+      resourceroot = resourcedoc.getDocumentElement();
+      resourceroot.setAttribute("unid", unid);
+      resourceroot.setAttribute("id", "live");
+      resourceroot.setAttribute("defaultlanguage", "xx");
+      resourceroot.setAttribute("type", "relate");
+      writeDocument(resourcedoc, DesignDirectory + unid + "/resource.xml");
+      translationdoc = createDocument("translation", designDirectory + unid + "/xx/translation.xml");
+      translationroot = translationdoc.getDocumentElement();
+      translationroot.setAttribute("language", "xx");
+      translationroot.setAttribute("edit", "1");
+      translationroot.setAttribute("live", "1");
+      writeDocument(translationdoc, DesignDirectory + unid + "/xx/translation.xml");
+      copyfile(RelationsDirectory + "live.xml", DesignDirectory + unid + "/xx/1.xml");
+   }
+   // TODO: Add a revision and update translation.xml for "live" structure if not incremental?
+   //### Copy Indexes - Obsolete because indexes are configured in Modules (20080331)
    var isource = resolver.resolveURI("module:///index");
    var oldindexdirectoryURI = new Packages.java.net.URI(isource.getURI());
    var oldindexdirectory = new Packages.java.io.File(oldindexdirectoryURI);

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap Tue Sep  9 17:30:20 2008
@@ -11,6 +11,10 @@
    <map:pipelines>
       <map:pipeline type="noncaching">
          <map:match pattern="**">
+<!-- CSS bypass -->
+            <map:match pattern="**/*.css">
+               <map:read src="module:///{2}.css" mime-type="text/css"/>
+            </map:match>
             <map:match pattern="**/">
                <map:redirect-to uri="index.html"  session="false"/>
             </map:match>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/code.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/code.js?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/code.js (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/code.js Tue Sep  9 17:30:20 2008
@@ -38,9 +38,10 @@
 
    while(child != null){
       var childtag = child.getNodeName();
+      var type = "content";
       if(childtag.equalsIgnoreCase("resource")){
          var doc = convertNodeToDocument(child);
-         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc);
+         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc, type);
       }
       if(childtag.equalsIgnoreCase("revision")){
          var language = child.getAttribute("language");
@@ -50,7 +51,7 @@
          }
          var revision = child.getFirstChild();
          var doc = convertNodeToDocument(revision);
-         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, setLive);
+         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, type, setLive);
       }
       child = child.getNextSibling();
    }

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml Tue Sep  9 17:30:20 2008
@@ -1,4 +1,7 @@
 <module id="nav" name="Navigation" minimum="1.3" created="1.3" content="flat">
+<index id="live" structure="live">
+   <filter property="type">xml|xhtml|link</filter>
+</index>
 <description>Handles navigation framework for flat storage using SitetreeGenerator.</description>
 <usage>
 See README.txt for example code.

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap Tue Sep  9 17:30:20 2008
@@ -22,7 +22,7 @@
             <map:match pattern="{module:module}/save*">
                <map:generate type="request"/>
                <map:transform src="module::///create.xsl"/> 
-               <map:transform type="new-resource">
+               <map:transform type="new">
                </map:transform>
                <!-- Open new resource or display failure message-->
                <map:transform src="module:///edit.xsl">

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/clean.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/clean.xsl?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/clean.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/clean.xsl Tue Sep  9 17:30:20 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    
+<xsl:template match="/">
+   <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="newresource"/>
+
+<xsl:template match="@*|node()" priority="-1">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+  </xsl:copy>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/finish.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/finish.xsl?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/finish.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/finish.xsl Tue Sep  9 17:30:20 2008
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:h="http://apache.org/cocoon/request/2.0"
+    exclude-result-prefixes="h"
+
+>
+<xsl:param name="publication"/>
+<xsl:param name="module"/>
+<xsl:param name="structure"/>
+
+<xsl:template match="/">
+<xsl:apply-templates select="resources/newresource"/>
+</xsl:template>
+
+<xsl:template match="newresource">
+<xsl:variable name="status"><xsl:value-of select="@status"/></xsl:variable>
+<html><head><title><xsl:value-of select="$structure"/></title></head>
+<body><h1>
+<xsl:value-of select="$publication"/>&#160;<xsl:value-of select="$structure"/>&#160;
+<xsl:choose>
+<xsl:when test="string-length($status) = 0">saved.
+</xsl:when>
+<xsl:when test="$status = 'SUCCESS'">
+saved as new Relations Design Resource.
+</xsl:when>
+<xsl:otherwise>
+failed because <xsl:value-of select="."/>
+</xsl:otherwise>
+</xsl:choose>
+</h1>
+<br/><xsl:element name="a">
+<xsl:attribute name="href">/<xsl:value-of select="$publication"/>/<xsl:value-of select="$module"/>/<xsl:value-of select="$structure"/></xsl:attribute>
+Return to editing <xsl:value-of select="$structure"/> Relations.
+</xsl:element>
+<br/><xsl:element name="a">
+<xsl:attribute name="href">/<xsl:value-of select="$publication"/>/edit</xsl:attribute>
+Return to main edit screen.
+</xsl:element>
+</body>
+</html>
+</xsl:template>
+
+</xsl:stylesheet> 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/module.xmap?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/module.xmap Tue Sep  9 17:30:20 2008
@@ -32,20 +32,75 @@
                   <map:serialize type="html"/>
                </map:otherwise>
             </map:select>
+<!-- Because Cocoon's Aggregator does not understand Generators -->
             <map:match pattern="all">
                <map:generate type="sitetree"/>
                <map:serialize type="xml"/>
             </map:match>
+            <map:match pattern="request">
+               <map:generate type="request"/>
+               <map:serialize type="xml"/>
+            </map:match>
 <!-- Edit Structure. -->
             <map:match pattern="{module:module}/">
                <map:call resource="default"/>
             </map:match>
+<!-- Retrieve Structure -->
+            <map:match pattern="structure/*">
+               <map:select type="resource-exists">
+   <!-- Get Structure as Design Resource if exists. -->
+                  <map:when test="structure:/{1}">
+                     <map:generate src="structure:/{1}!edit"/>
+                  </map:when>
+   <!-- From development of Lenya 1.3.  Structures were stored in content/relation before becoming Design Resources. -->
+                  <map:when test="module:///../../pubs/{publication:publication}/content/relation/{1}.xml">
+                     <map:generate src="module:///../../pubs/{publication:publication}/content/relation/{1}.xml"/>
+                  </map:when>
+   <!-- Defaults to create new Structure -->
+                  <map:otherwise>
+                     <map:generate src="empty:resources"/>
+                  </map:otherwise>
+               </map:select>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- Save -->
+            <map:match pattern="{module:module}/save/*">
+               <map:aggregate element="data">
+                  <map:part src="cocoon:/request"/>
+                  <map:part src="cocoon:/all"/>
+               </map:aggregate>
+               <map:transform src="module:///save.xsl">
+                  <map:parameter name="module" value="{module:module}"/>
+                  <map:parameter name="name" value="{1}"/>
+                  <map:parameter name="publication" value="{publication:publication}"/>
+                  <map:parameter name="publicationname" value="{publication:name}"/>
+               </map:transform>
+               <map:select type="resource-exists">
+                  <map:when test="structure:/{1}">
+                  </map:when>
+                  <map:otherwise>
+                     <!-- If no Design Resource, create it. -->
+                     <map:transform type="new-structure"/>
+                  </map:otherwise>
+               </map:select>
+               <!-- Create revision -->
+<!--               <map:transform src="module:///clean.xsl"/>
+-->
+               <map:transform type="revise-structure" src="{1}"/>
+              <!-- Sensible return after save -->
+               <map:transform src="module:///finish.xsl">
+                  <map:parameter name="module" value="{module:module}"/>
+                  <map:parameter name="structure" value="{1}"/>
+                  <map:parameter name="publication" value="{publication:publication}"/>
+               </map:transform>
+               <map:serialize type="html"/>
+            </map:match>
+<!-- Edit -->
             <!-- module/structure -->
             <map:match pattern="{module:module}/*">
                <map:aggregate element="content">
                   <map:part src="cocoon:/all"/>
-<!-- TODO: Move structures to content -->
-                  <map:part src="module:///../../pubs/{publication:publication}/content/relation/{1}.xml"/>
+                  <map:part src="cocoon:/structure/{1}"/>
                </map:aggregate>
                <map:transform src="module:///structure.xsl">
                   <map:parameter name="module" value="{module:module}"/>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/save.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/save.xsl?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/save.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/save.xsl Tue Sep  9 17:30:20 2008
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:h="http://apache.org/cocoon/request/2.0"
+    exclude-result-prefixes="h"
+
+>
+<xsl:param name="publication"/>
+
+<xsl:key name="resources" match="resource" use="@unid"/>
+
+<xsl:template match="/">
+<xsl:apply-templates select="data/h:request/h:requestParameters"/>
+</xsl:template>
+
+<xsl:template match="h:requestParameters">
+<xsl:variable name="name"><xsl:value-of select="h:parameter[@name='id']/h:value"/></xsl:variable>
+<xsl:variable name="data"><xsl:value-of select="h:parameter[@name='relations']/h:value"/></xsl:variable>
+<xsl:element name="resources">
+<xsl:attribute name="structure"><xsl:value-of select="$name"/></xsl:attribute>
+<xsl:element name="newresource">
+<xsl:attribute name="unid"><xsl:value-of select="$publication"/>+<xsl:value-of select="$name"/></xsl:attribute>
+<xsl:attribute name="type">relate</xsl:attribute>
+<xsl:attribute name="id"><xsl:value-of select="$name"/></xsl:attribute>
+</xsl:element>
+
+<xsl:call-template name="resource">
+   <xsl:with-param name="data" select="$data"/>
+</xsl:call-template>
+</xsl:element>
+</xsl:template>
+
+<xsl:template name="resource">
+<xsl:param name="data"/>
+<xsl:param name="parent"/>
+<xsl:variable name="d1b1"><xsl:value-of select="substring-before($data, '&lt;')"/></xsl:variable>
+<xsl:variable name="d1a1"><xsl:value-of select="substring-after($data, '&lt;')"/></xsl:variable>
+<xsl:variable name="d2b1"><xsl:value-of select="substring-before($data, '>')"/></xsl:variable>
+<xsl:variable name="d2a1"><xsl:value-of select="substring-after($data, '>')"/></xsl:variable>
+<xsl:variable name="id"><xsl:value-of select="key('resources', $d1b1)[1]/@id"/></xsl:variable>
+<xsl:variable name="fullid"><xsl:value-of select="$parent"/>/<xsl:value-of select="$id"/></xsl:variable>
+<xsl:variable name="grandparent"><xsl:call-template name="beforelastslash">
+   <xsl:with-param name="string" select="$parent"/>
+</xsl:call-template></xsl:variable>
+<xsl:choose>
+   <xsl:when test="string-length($d2b1) = 0">
+      <xsl:text disable-output-escaping="yes">&lt;/resource&gt;</xsl:text>
+      <xsl:if test="string-length($d2a1) &gt; 0">
+         <xsl:call-template name="resource">
+            <xsl:with-param name="data" select="$d2a1"/>
+            <xsl:with-param name="parent" select="$grandparent"/>
+         </xsl:call-template>
+      </xsl:if>
+   </xsl:when>
+   <xsl:otherwise>
+      <xsl:text disable-output-escaping="yes">&lt;resource unid="</xsl:text><xsl:value-of select="$d1b1"/>" id="<xsl:value-of select="$id"/>" full="<xsl:value-of select="$fullid"/>"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+      <xsl:call-template name="resource">
+         <xsl:with-param name="data" select="$d1a1"/>
+         <xsl:with-param name="parent" select="$fullid"/>
+      </xsl:call-template>
+   </xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template name="beforelastslash">
+<xsl:param name="string"/>
+<xsl:variable name="after"><xsl:value-of select="substring-after($string, '/')"/></xsl:variable>
+<xsl:value-of select="substring-before($string, '/')"/><xsl:if test="contains($after, '/')">/<xsl:call-template name="beforelastslash">
+   <xsl:with-param name="string" select="$after"/>
+</xsl:call-template></xsl:if></xsl:template>
+
+
+</xsl:stylesheet> 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/structure.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/structure.xsl?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/structure.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/structure.xsl Tue Sep  9 17:30:20 2008
@@ -20,7 +20,7 @@
 <xsl:template match="/content">
   <html>
     <head>
-      <title><xsl:value-of select="$publication"/>&#160;<xsl:value-of select="$name"/>&#160;<i18n:text>Structure</i18n:text></title>
+      <title><xsl:value-of select="$publication"/>&#160;<xsl:value-of select="$name"/>&#160;<i18n:text>Relations</i18n:text></title>
 <style type="text/css">
 h1{
    margin: 0 0 5px 0;
@@ -531,6 +531,11 @@
       structure = beforeTarget.toString() + selection.toString() + afterTarget.toString();
    }
    undos.add(selected + '!' + selectedInstance + '!' + structure);
+
+   structureField = getElementForId("relations");
+   structureField.value = structure;
+
+   
    // Collapses are saved by position which may not be accurate after changing the structure
    // if a Resource is moved before or after an entry for the same Resource and only one is collapsed 
    // expandAllFunction(); // Prevents issue but annoys user.
@@ -608,6 +613,13 @@
 </div>
 <div id="structure">&#160;</div>
 <div id="information">&#160;</div>
+<div id="save">
+<form method="post" action="/{$publication}/{$module}/save/{$name}">
+<input type="hidden" name="id" value="{$name}"/>
+<input type="hidden" name="relations" id="relations"/>
+<input type="submit" value="Save Structure"/>
+</form>
+</div>
 <div id="instructions">
 <h2>Instructions</h2>
 This editor has 7 areas. <ol>
@@ -637,7 +649,9 @@
 Note that Sibling and Child actions depend on where the selected Resource was clicked.  If the Resource was chosen from the All Resources list, the Resource will be ADDED.  If the Resource was chosen from the Structure list, the Resource and its descendants will be MOVED.  Copying a portion of the structure has not been implemented.
 </div>
 <script language="JavaScript">
-redraw();
+   redraw();
+   structureField = getElementForId("relations");
+   structureField.value = structure;
 </script>
 </body></html>
 </xsl:template>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js Tue Sep  9 17:30:20 2008
@@ -31,11 +31,12 @@
    var root = dom.getDocumentElement();
 //print("ROOT=" + root.getTagName());
    var child = root.getFirstChild();
+   var isDesign = "content";
    while(child != null){
       var childtag = child.getNodeName();
       if(childtag.equalsIgnoreCase("resource")){
          var doc = convertNodeToDocument(child);
-         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc);
+         Packages.org.apache.lenya.cms.content.ResourceTransformer.transformDocument(cocoon.request, unid, doc, isDesign);
       }
       if(childtag.equalsIgnoreCase("revision")){
          var language = child.getAttribute("language");
@@ -45,7 +46,7 @@
          }
          var revision = child.getFirstChild();
          var doc = convertNodeToDocument(revision);
-         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, setLive);
+         Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid + "_" + language, doc, isDesign, setLive);
       }
       child = child.getNextSibling();
    }
@@ -57,8 +58,9 @@
    var module = cocoon.parameters.module;
    var unid = cocoon.parameters.unid;
    var dom = loadDocument("cocoon:/" + module + "/saverevisiondata/" + unid);
+   var isDesign = "content";
    var setLive = false;
-Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid, dom, setLive);
+Packages.org.apache.lenya.cms.content.flat.CreateRevisionTransformer.transformDocument(cocoon.request, unid, dom, isDesign, setLive);
    cocoon.sendPage("edit/" + unid);
 }
 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/relation/live.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/relation/live.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/relation/live.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/relation/live.xml Tue Sep  9 17:30:20 2008
@@ -1 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><resources structure="live"><resource full="/index" id="index" unid="0005"/><resource full="/tutorial" id="tutorial" unid="0006"><resource full="/tutorial/new_doctype" id="new_doctype" unid="0007"/></resource><resource full="/concepts" id="concepts" unid="0001"/><resource full="/features" id="features" unid="0004"/><resource full="/doctypes" id="doctypes" unid="0002"><resource full="/doctypes/xhtml-document" id="xhtml-document" unid="0003"/></resource></resources>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<resources structure="live">
+<resource full="/index" id="index" unid="0005"/>
+<resource full="/tutorial" id="tutorial" unid="0006">
+<resource full="/tutorial/new-doctype" id="new-doctype" unid="0007"/></resource><resource full="/concepts" id="concepts" unid="0001"/><resource full="/features" id="features" unid="0004"/><resource full="/doctypes" id="doctypes" unid="0002"><resource full="/doctypes/xhtml-document" id="xhtml-document" unid="0003"/></resource></resources>
\ No newline at end of file

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/1190179730703.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/1190179730703.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/1190179730703.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/1190179730703.xml Tue Sep  9 17:30:20 2008
@@ -1,23 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" dc:dummy="FIXME:keepNamespace" dcterms:dummy="FIXME:keepNamespace" lenya:dummy="FIXME:keepNamespace" title="Home" xhtml:dummy="FIXME:keepNamespace">
-
-<!--
-  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: index_en.xml 149362 2005-02-01 03:33:00Z gregor $ -->
     <lenya:meta>
         <dc:title>Welcome to the Lenya default publication</dc:title>
         <dc:creator>Lenya Development Team</dc:creator>
@@ -47,13 +29,13 @@
     Cocoon.</p>
 
     <p>For an overview of the concepts and the terminology used in
-    Apache Lenya please see the <a href="/default/authoring/concepts.html">Concepts
+    Apache Lenya please see the <a href="/default13/live/concepts.html">Concepts
     section</a>. To see what you can do with Apache Lenya please
-    refer to the <a href="/default/authoring/features.html">Features
+    refer to the <a href="/default13/live/features.html">Features
     section</a>.</p>
 
     <p>If you'd like to get a quick introduction on how to use Apache
-    Lenya CMS please go through the <a href="/default/authoring/tutorial.html">tutorial</a>.</p>
+    Lenya CMS please go through the <a href="/default13/live/tutorial.html">tutorial</a>.</p>
 
     <p>The purpose of this publication is</p>
 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/translation.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/translation.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/translation.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/translation.xml Tue Sep  9 17:30:20 2008
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<translation edit="1189740862937" language="en" live="1190179730703" xmlns=""/>
+<translation edit="1190179730703" language="en" live="1190179730703" xmlns=""/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/resource.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/resource.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/resource.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/resource.xml Tue Sep  9 17:30:20 2008
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<resource defaultlanguage="en" doctype="homepage" id="index" type="xml" unid="0005" xmlns=""/>
+<resource defaultlanguage="en" doctype="home" id="index" type="xml" unid="0005" xmlns=""/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0007/resource.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0007/resource.xml?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0007/resource.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0007/resource.xml Tue Sep  9 17:30:20 2008
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<resource defaultlanguage="en" doctype="xhtml" id="new_doctype" type="xml" unid="0007" xmlns=""/>
+<resource defaultlanguage="en" doctype="xhtml" id="new-doctype" type="xml" unid="0007" xmlns=""/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/sitemap.xmap?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/sitemap.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/sitemap.xmap Tue Sep  9 17:30:20 2008
@@ -44,7 +44,7 @@
     <map:generator name="stream" label="content,data" logger="sitemap.generator.stream" pool-grow="2" pool-max="16" pool-min="1" src="org.apache.cocoon.generation.StreamGenerator"/>
     <map:generator name="xpathdirectory" label="content" logger="sitemap.generator.xpathdirectory" src="org.apache.cocoon.generation.XPathDirectoryGenerator"/>
     <!--
-    <map:generator label="content,data" logger="sitemap.generator.profiler" name="profiler" src="org.apache.cocoon.generation.ProfilerGenerator"/>
+    <map:generator name="profiler" label="content,data" logger="sitemap.generator.profiler" src="org.apache.cocoon.generation.ProfilerGenerator"/>
     -->
 <!-- LENYA1.3 BEGIN -->
     <map:generator name="sitetree" label="content,data" logger="sitemap.generator.sitetree" src="org.apache.lenya.cms.content.flat.SitetreeGenerator"/>
@@ -135,10 +135,28 @@
     </map:transformer>
 
 <!-- Lenya 1.3 BEGIN -->
-   <!-- TODO: Create Transformers should be implementation-agnostic. -->
-    <map:transformer name="new-resource" logger="sitemap.transformer.create-resource" src="org.apache.lenya.cms.content.flat.CreateResourceTransformer"/>
-    <map:transformer name="create-revision" logger="sitemap.transformer.create-revision" src="org.apache.lenya.cms.content.flat.CreateRevisionTransformer"/>
+   <!-- TODO: Create Transformers should be implementation-agnostic. Move from flat package.-->
+    <map:transformer name="new" logger="sitemap.transformer.create-resource" src="org.apache.lenya.cms.content.flat.CreateResourceTransformer"/>
+    <map:transformer name="new-design" logger="sitemap.transformer.create-resource" src="org.apache.lenya.cms.content.flat.CreateResourceTransformer">
+      <type>design</type>
+    </map:transformer>
+    <map:transformer name="new-structure" logger="sitemap.transformer.create-resource" src="org.apache.lenya.cms.content.flat.CreateResourceTransformer">
+      <type>structure</type>
+    </map:transformer>
+    <map:transformer name="revise" logger="sitemap.transformer.create-revision" src="org.apache.lenya.cms.content.flat.CreateRevisionTransformer"/>
+    <map:transformer name="revise-design" logger="sitemap.transformer.create-revision" src="org.apache.lenya.cms.content.flat.CreateRevisionTransformer">
+      <type>design</type>
+    </map:transformer>
+    <map:transformer name="revise-structure" logger="sitemap.transformer.create-revision" src="org.apache.lenya.cms.content.flat.CreateRevisionTransformer">
+      <type>structure</type>
+    </map:transformer>
     <map:transformer name="resource" logger="sitemap.transformer.resource" src="org.apache.lenya.cms.content.ResourceTransformer"/>
+    <map:transformer name="design-resource" logger="sitemap.transformer.resource" src="org.apache.lenya.cms.content.ResourceTransformer">
+      <type>design</type>
+    </map:transformer>
+    <map:transformer name="structure-resource" logger="sitemap.transformer.resource" src="org.apache.lenya.cms.content.ResourceTransformer">
+      <type>structure</type>
+    </map:transformer>
     <!-- VirtualTransformer is not used in Lemya 1.3 -->
     <map:transformer name="virtual" logger="sitemap.transformer.virtual" src="org.apache.lenya.cms.cocoon.transformation.VirtualTransformer"/>
 <!-- Lenya 1.3 END -->
@@ -163,7 +181,6 @@
       <encoding>UTF-8</encoding>
     </map:serializer>
 -->
-
     <map:serializer name="html-no-dtd" logger="sitemap.serializer.html-no-dtd" mime-type="text/html; charset=utf-8" pool-grow="4" pool-max="32" pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
       <buffer-size>1024</buffer-size>
     </map:serializer>



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