You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/04/06 18:01:42 UTC

svn commit: r526211 [1/2] - in /lenya/branches/trunk-rework-pubconf: ./ src/impl/java/org/apache/lenya/cms/publication/ src/java/org/apache/lenya/cms/cocoon/components/modules/input/ src/java/org/apache/lenya/cms/cocoon/source/ src/java/org/apache/leny...

Author: nettings
Date: Fri Apr  6 09:01:39 2007
New Revision: 526211

URL: http://svn.apache.org/viewvc?view=rev&rev=526211
Log:
resync with trunk.
additional changes:
remove <templates/> from publication.xconf, allow only single
<template/>.
updated publication.rng
updated global readme.xml
TODO: rip out the multi-templates, array-based code entirely.

Added:
    lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java
      - copied unchanged from r526161, lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java
    lenya/branches/trunk-rework-pubconf/src/modules/collection/samples/children.xml
      - copied unchanged from r526161, lenya/trunk/src/modules/collection/samples/children.xml
    lenya/branches/trunk-rework-pubconf/src/modules/collection/sitemap.xmap
      - copied unchanged from r526161, lenya/trunk/src/modules/collection/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/collection/xslt/
      - copied from r526161, lenya/trunk/src/modules/collection/xslt/
    lenya/branches/trunk-rework-pubconf/src/modules/collection/xslt/collection2cinclude.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/collection/xslt/sitetree2children.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/kupu/config/cocoon-xconf/usecase-kupu.xconf
      - copied unchanged from r526161, lenya/trunk/src/modules/kupu/config/cocoon-xconf/usecase-kupu.xconf
    lenya/branches/trunk-rework-pubconf/src/modules/news/
      - copied from r526161, lenya/trunk/src/modules/news/
    lenya/branches/trunk-rework-pubconf/src/modules/news/config/
      - copied from r526161, lenya/trunk/src/modules/news/config/
    lenya/branches/trunk-rework-pubconf/src/modules/news/config/cocoon-xconf/
      - copied from r526161, lenya/trunk/src/modules/news/config/cocoon-xconf/
    lenya/branches/trunk-rework-pubconf/src/modules/news/config/cocoon-xconf/resourcetype-news.xconf
      - copied unchanged from r526161, lenya/trunk/src/modules/news/config/cocoon-xconf/resourcetype-news.xconf
    lenya/branches/trunk-rework-pubconf/src/modules/news/config/menu.xsp
      - copied unchanged from r526161, lenya/trunk/src/modules/news/config/menu.xsp
    lenya/branches/trunk-rework-pubconf/src/modules/news/menus.xmap
      - copied unchanged from r526161, lenya/trunk/src/modules/news/menus.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/news/module.xml
      - copied unchanged from r526161, lenya/trunk/src/modules/news/module.xml
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/
      - copied from r526161, lenya/trunk/src/modules/news/resources/
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/i18n/
      - copied from r526161, lenya/trunk/src/modules/news/resources/i18n/
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/i18n/cmsui.xml
      - copied unchanged from r526161, lenya/trunk/src/modules/news/resources/i18n/cmsui.xml
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/i18n/cmsui_de.xml
      - copied unchanged from r526161, lenya/trunk/src/modules/news/resources/i18n/cmsui_de.xml
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/icons/
      - copied from r526161, lenya/trunk/src/modules/news/resources/icons/
    lenya/branches/trunk-rework-pubconf/src/modules/news/resources/icons/news.gif
      - copied unchanged from r526161, lenya/trunk/src/modules/news/resources/icons/news.gif
    lenya/branches/trunk-rework-pubconf/src/modules/news/sitemap.xmap
      - copied unchanged from r526161, lenya/trunk/src/modules/news/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/
      - copied from r526161, lenya/trunk/src/modules/news/xslt/
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/collection2header.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/news/xslt/collection2header.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/collection2include.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/news/xslt/collection2include.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/collection2rss.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/news/xslt/collection2rss.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/collection2xhtml.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/rss/
      - copied from r526161, lenya/trunk/src/modules/news/xslt/rss/
    lenya/branches/trunk-rework-pubconf/src/modules/news/xslt/rss/xhtmllink2rsslink.xsl
      - copied unchanged from r526161, lenya/trunk/src/modules/news/xslt/rss/xhtmllink2rsslink.xsl
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/
      - copied from r526161, lenya/trunk/src/pubs/default/example-content/news/
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/index_de
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/index_de
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/index_de.meta
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/index_de.meta
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/index_en
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/index_en
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/index_en.meta
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/index_en.meta
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/installed/
      - copied from r526161, lenya/trunk/src/pubs/default/example-content/news/installed/
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/installed/index_de
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/installed/index_de
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/installed/index_de.meta
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/installed/index_de.meta
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/installed/index_en
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/installed/index_en
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/news/installed/index_en.meta
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/example-content/news/installed/index_en.meta
    lenya/branches/trunk-rework-pubconf/src/pubs/default/resources/shared/css/news.css
      - copied unchanged from r526161, lenya/trunk/src/pubs/default/resources/shared/css/news.css
    lenya/branches/trunk-rework-pubconf/src/webapp/lenya/xslt/util/identity.xsl
      - copied unchanged from r526161, lenya/trunk/src/webapp/lenya/xslt/util/identity.xsl
Modified:
    lenya/branches/trunk-rework-pubconf/INSTALL-BIN.txt
    lenya/branches/trunk-rework-pubconf/INSTALL-SRC.txt
    lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
    lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java
    lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
    lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSourceFactory.java
    lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/util/Query.java
    lenya/branches/trunk-rework-pubconf/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java
    lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java
    lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Paste.java
    lenya/branches/trunk-rework-pubconf/src/modules-core/workflow/test/canoo/test.xml
    lenya/branches/trunk-rework-pubconf/src/modules/bxe/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/bxe/xslt/link.xsl
    lenya/branches/trunk-rework-pubconf/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/README.txt
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckconfig.js
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckloader.js
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/insertLink.js
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/usecases/fckeditor.jx
    lenya/branches/trunk-rework-pubconf/src/modules/kupu/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/modules/resource/java/src/org/apache/lenya/cms/site/usecases/CreateResource.java
    lenya/branches/trunk-rework-pubconf/src/modules/sitetree/resources/i18n/cmsui_de.xml
    lenya/branches/trunk-rework-pubconf/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java
    lenya/branches/trunk-rework-pubconf/src/modules/xhtml/config/menu.xsp
    lenya/branches/trunk-rework-pubconf/src/modules/xhtml/xslt/clean-xhtml.xsl
    lenya/branches/trunk-rework-pubconf/src/pubs/blog/config/ac/usecase-policies.xml
    lenya/branches/trunk-rework-pubconf/src/pubs/blog/config/menus/entry.xsp
    lenya/branches/trunk-rework-pubconf/src/pubs/blog/webdav.xmap
    lenya/branches/trunk-rework-pubconf/src/pubs/default/config/ac/usecase-policies.xml
    lenya/branches/trunk-rework-pubconf/src/pubs/default/config/publication.xconf
    lenya/branches/trunk-rework-pubconf/src/pubs/default/example-content/sitetree.xml
    lenya/branches/trunk-rework-pubconf/src/pubs/default/modules/homepage/config/menus/homepage.xsp
    lenya/branches/trunk-rework-pubconf/src/pubs/default/modules/homepage/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/pubs/default/modules/homepage/xslt/homepage2xhtml.xsl
    lenya/branches/trunk-rework-pubconf/src/pubs/default/resources/shared/css/page.xml
    lenya/branches/trunk-rework-pubconf/src/pubs/default/sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/webapp/global-sitemap.xmap
    lenya/branches/trunk-rework-pubconf/src/webapp/lenya/resources/schemas/publication.rng
    lenya/branches/trunk-rework-pubconf/src/webapp/lenya/xslt/menu/menu2xhtml.xsl
    lenya/branches/trunk-rework-pubconf/src/webapp/lenya/xslt/menu/menu2xslt.xsl
    lenya/branches/trunk-rework-pubconf/src/webapp/readme.xml

Modified: lenya/branches/trunk-rework-pubconf/INSTALL-BIN.txt
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/INSTALL-BIN.txt?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/INSTALL-BIN.txt (original)
+++ lenya/branches/trunk-rework-pubconf/INSTALL-BIN.txt Fri Apr  6 09:01:39 2007
@@ -1,34 +1,2 @@
-
-   +----------------------+
-   |    INSTALL BINARY    |
-   +----------------------+
-
-Jetty
------
-
-
-1) Start up Lenya by executing lenya.bat on Windows or lenya.sh on Unix, e.g.
-
-   sh lenya.sh servlet
-
-
-2) Open http://localhost:8888/ with your browser
-
-
-
-Tomcat
-------
-
-
-1) Copy lenya.war into .../TOMCAT_PREFIX/webapps directory
-
-2) Copy endorsed libraries into .../TOMCAT_PREFIX/common/endorsed directory
-
-3) Startup Tomcat
-
-
-
-Known issues
-------------
-Please read the "Known issues" section in the README.txt file
-to find out more about known bugs/issues in Lenya.
\ No newline at end of file
+There is no binary release of Lenya 1.4 at this point.
+We recommend checking out the SVN repository instead (see INSTALL-SRC.txt).

Modified: lenya/branches/trunk-rework-pubconf/INSTALL-SRC.txt
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/INSTALL-SRC.txt?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/INSTALL-SRC.txt (original)
+++ lenya/branches/trunk-rework-pubconf/INSTALL-SRC.txt Fri Apr  6 09:01:39 2007
@@ -4,149 +4,107 @@
     * Standalone Installation (using the built-in Jetty)
     * Installation with Apache Tomcat
 
-Prerequisites
-
-The following list describes the setup that is tested and recommended. 
-Please note that you can use other servlet containers as well, but Jetty and Tomcat are the tested ones.
 
+Prerequisites
 
-    *
 
-      Java 2 Platform, Standard Edition
-      version: 1.4.2 or newer (1.5.x NOT properly tested).
-      source: http://java.sun.com/j2se/1.4.2/download.html
-    *
+    The following list describes the setup that is tested and recommended. 
+    Please note that you can use other servlet containers as well, but Jetty and Tomcat are the tested ones.
 
-      Apache Cocoon
-      version: BRANCH_2_1_X (https://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X)
-      source: http://cocoon.apache.org/mirror.cgi
 
+    * Java 2 Platform, Standard Edition
+      Recommended version: JDK 1.5 (used by most developers, 1.4.2 or later should also work).
+      JDK 6 has not been tested yet, feedback is welcome.
+      Get the JDK at http://java.sun.com/javase/downloads/index_jdk5.jsp
+
+    * Apache Cocoon
+      Recommended version: BRANCH_2_1_X (https://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X)
+      When you check out Lenya 1.4 from svn, Cocoon will be included as an svn external 
+      and you don't need to download it separately.
       Note that Cocoon is needed when building the source version of Lenya, but the 
       resulting Lenya webapp is completely self contained and therefore it does not need 
       the Cocoon webapp to be installed. See the FAQ for details of configuration changes 
       required when running multiple Cocoon based applications.
-    *
 
-      (optional) Apache Tomcat for JDK 1.4
+    * A SVN client
+      SVN (or subversion) is a software revision control system that is used by the Lenya community to 
+      manage the development tree. You will need to install a client in order to check out your local
+      copy of Lenya.
+      All Linux distributions come with svn (or subversion) packages. Under Windows, you can either use 
+      TortoiseSVN (see http://tortoisesvn.tigris.org) or the svn package included in Cygwin (http://cygwin.com).
+
+    * (optional) Apache Tomcat for JDK 1.4
       version: 5.0.28 or newer, 5.5.x not tested.
       source: http://jakarta.apache.org/site/binindex.cgi
-
       Note that Lenya ships with Jetty and therefore does not need a servlet container to be installed.
 
-Standalone Installation (using the built-in Jetty)
-
-   1.
-
-      Get the Java SDK (see Prerequisites): e.g. J2SDK_1.4.2_10
-      and set JAVA_HOME
-      (Windows: start -> Control Panel -> System -> Advanced -> Environment Variables -> User variables ...
-   2. 
 
-      Get Apache Cocoon (see Prerequisites)
-   3.
+Standalone Installation (using the built-in Jetty)
 
-      Get Apache Lenya (see Download Lenya)
-   4.
 
-      Extract the downloaded Lenya archive to the lenya-trunk directory as described below. 
-      If you use Subversion, create your Lenya checkout inside the src directory as described below. 
-      It is recommended to use the following directory structure for an easier build experience.
-
-            your_home/ (or c:\ on Windows, NOT My Documents)
-              `-- src/
-                   |-- lenya-trunk/            $LENYA_HOME
-                   `-- cocoon/                 $COCOON_HOME
-                        `-- build/
-                             `-- webapp/       $COCOON_WEBAPP
-          
-   5.
+   This is the recommended mode of installation that is used by most
+   developers.
 
-      Configure Lenya
+   1. Get the Java SDK (see Prerequisites): e.g. J2SDK_1.5.0-11
+      and set JAVA_HOME
+      (Windows: start -> Control Panel -> System -> Advanced -> Environment Variables -> User variables
+      ...)
 
-      If your Cocoon source tree is set up as described above, you can skip this step. 
-      If your Cocoon source tree is not at ../cocoon relative to Lenya, you need to edit 
-      your build properties. To do this, copy $LENYA_HOME/build.properties to 
-      $LENYA_HOME/local.build.properties.
+   2. Check out Apache Lenya from SVN:
+      Change into the directory where you want your Lenya sources to be, and do
+  
+        svn checkout http://svn.apache.org/repos/asf/lenya/trunk lenya-1.4.x
 
-      Edit local.build.properties. For the described configuration the following settings 
-      will work (MS Windows: Don't use backslashes "\" for directory separation.)
-          * cocoon.src.dir=$COCOON_HOME
-          * tomcat.home.dir=$TOMCAT_HOME
+   3. Configure Lenya:
 
-      or use
+      In the newly created lenya-1.4.x directory, copy build.properties to local.build.properties
+      and edit it to taste or use the configure script:
 
-          * Linux: configure.sh
+          * Linux: configure.sh (works also on Windows with Cygwin)
           * Windows: configure.bat
 
 
-   6.  Build Lenya
-   ---------------
+   4. Build Lenya:
 
       Make sure that you have the environment variable JAVA_HOME defined to point 
       to the location of the Java SDK you installed (see Prerequisites).
 
       MS Windows: http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&sd=tech
-      Linux/Unix: export JAVA_HOME=/usr/local/jdk-1.4.2
-
-      Execute build.bat or build.sh in your Lenya source directory, depending on your platform.
+      Linux/Unix: export JAVA_HOME=/usr/local/jdk-1.5.0 (or wherever your JDK is)
 
-      MS Windows
+      Start the build process:
 
-            $LENYA_HOME > build.bat
-
-      Unix
-
-            $LENYA_HOME > ./build.sh
-          
-
-
-   7.  Start Lenya
-   ---------------
-
-      Execute lenya.bat or lenya.sh servlet in your Lenya source directory, depending on your 
-      platform. Make sure that you have the environment variable JAVA_HOME defined to point 
-      to the location of the Java SDK you installed (see Prerequisites).
-
-      MS Windows
-
-            $LENYA_HOME > lenya.bat
+          * Linux: ./build.sh (works also on Windows with Cygwin)
+          * Windows:  build.bat
           
+   5. Start Lenya:
 
-      Unix
-
-            $LENYA_HOME > ./lenya.sh servlet
-          
+          * Linux: ./lenya.sh
+          * Windows: lenya.bat
 
-  8.
+   6. Test the installation by pointing your browser to
+          http://localhost:8888/
 
-      Test the installation
 
-      http://localhost:8888/
 
 Installation with Apache Tomcat
 
-Installing Lenya with Tomcat is mostly the same procedure. Follow Steps 1-4, then do the steps below.
-
-   1.
 
-      get Apache Tomcat (see Prerequisites)
-   2.
+   Watch out: Tomcat integration has not been tested much yet. You are welcome
+   to direct questions at or point out problems to the lenya developer mailing
+   list.
 
-      Install Apache Tomcat
+   Installing Lenya with Tomcat is similar to stand-alone mode. Follow Steps 1-3
+   above, then do the steps below.
 
-      See Tomcat 5.0 Setup
+   1. Get Apache Tomcat (see Prerequisites)
 
-      MS Windows:
-      Basically this is setting the JAVA_HOME environment variable and running the Tomcat installer. 
-      Decide to run Tomcat as a Windows NT/2000/XP-Service.
-      Warning
-      Make sure you do not install at a location with spaces in the path.
-   3.
+   2. Install Apache Tomcat as per the Tomcat docs.
 
-      Configure Lenya
+      Important: Make sure you do not install at a location with spaces in the path, such as
+      C:\Tomcat Webapps\Lenya - some components in Lenya/Cocoon don't play well with such paths.
 
-      To install Lenya with Tomcat, you need to edit your build properties. To do this, 
-      copy $LENYA_HOME/build.properties to $LENYA_HOME/local.build.properties.
+   3. Configure Lenya for Tomcat
 
       Edit local.build.properties. For the described configuration the following settings 
       will work (MS Windows: Don't use backslashes "\" for directory separation.) It is 
@@ -155,14 +113,10 @@
       relative to Lenya, then change the cocoon.webapp.dir and cocoon.src.dir properties.
           * cocoon.src.dir=$COCOON_HOME
           * tomcat.home.dir=$TOMCAT_HOME
-   4.
+  
+   4. Build Lenya (see "Standalone Installation" above)
 
-      Build Lenya
-
-      Execute build install in your Lenya source directory.
-   5.
-
-      Checked versions of endorsed libraries
+   5. Check versions of endorsed libraries
 
       Lenya and Tomcat will inter-operate correctly only if the proper versions of the Xalan 
       and Xerces libraries are used consistently throughout the deployment. Unfortunately 
@@ -190,13 +144,9 @@
       References:
           * Tomcat Class Loader HOWTO (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html)
           * Java 2 Endorsed Standards Override Mechanism (http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html)
-   6.
-
-      Restart Tomcat
-
-      Restart Tomcat to load the Lenya webapp.
-   7.
+ 
+   6. Restart Tomcat
 
-      Test the installation
+   7. Test the installation by pointing your browser to
+          http://localhost:8080/lenya/
 
-      http://localhost:8080/lenya/

Modified: lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java Fri Apr  6 09:01:39 2007
@@ -81,37 +81,27 @@
     }
 
     /**
-     * Copies meta data from one document to another.
+     * Copies meta data from one document to another. If the destination
+     * document is a different area version, the meta data are duplicated (i.e.,
+     * onCopy = delete is neglected).
      * @param source
      * @param destination
      * @throws PublicationException
      */
     protected void copyMetaData(Document source, Document destination) throws PublicationException {
-        try {
-            String[] uris = source.getMetaDataNamespaceUris();
-            for (int i = 0; i < uris.length; i++) {
-                destination.getMetaData(uris[i]).replaceBy(source.getMetaData(uris[i]));
-            }
-        } catch (MetaDataException e) {
-            throw new PublicationException(e);
-        }
-    }
 
-    /**
-     * Copies meta data from one document to another, whereas both documents
-     * will have completely identical meta data afterwards (including workflow
-     * etc.). This is only useful if the source document will be deleted
-     * afterwards.
-     * @param source
-     * @param destination
-     * @throws PublicationException
-     */
-    protected void duplicateMetaData(Document source, Document destination)
-            throws PublicationException {
+        boolean duplicate = source.getUUID().equals(destination.getUUID())
+                && source.getLanguage().equals(destination.getLanguage())
+                && !source.getArea().equals(destination.getArea());
+
         try {
             String[] uris = source.getMetaDataNamespaceUris();
             for (int i = 0; i < uris.length; i++) {
-                destination.getMetaData(uris[i]).forcedReplaceBy(source.getMetaData(uris[i]));
+                if (duplicate) {
+                    destination.getMetaData(uris[i]).forcedReplaceBy(source.getMetaData(uris[i]));
+                } else {
+                    destination.getMetaData(uris[i]).replaceBy(source.getMetaData(uris[i]));
+                }
             }
         } catch (MetaDataException e) {
             throw new PublicationException(e);
@@ -322,18 +312,83 @@
      * @see org.apache.lenya.cms.publication.DocumentManager#copy(org.apache.lenya.cms.publication.Document,
      *      org.apache.lenya.cms.publication.DocumentLocator)
      */
-    public void copy(Document sourceDocument, DocumentLocator destination)
-            throws PublicationException {
-        SiteStructure destSite = sourceDocument.getPublication().getArea(destination.getArea())
+    public void copy(Document sourceDoc, DocumentLocator destination) throws PublicationException {
+
+        if (!destination.getPublicationId().equals(sourceDoc.getPublication().getId())) {
+            throw new PublicationException("Can't copy to a different publication!");
+        }
+
+        SiteStructure destSite = sourceDoc.getPublication().getArea(destination.getArea())
                 .getSite();
+        String destPath = destination.getPath();
         if (destSite.contains(destination.getPath(), destination.getLanguage())) {
-            Document destDoc = destSite.getNode(destination.getPath()).getLink(
-                    destination.getLanguage()).getDocument();
-            copyDocumentSource(sourceDocument, destDoc);
+            Document destDoc = destSite.getNode(destPath).getLink(destination.getLanguage())
+                    .getDocument();
+            copyDocumentSource(sourceDoc, destDoc);
+            copyInSiteStructure(sourceDoc, destDoc, destPath);
         } else {
-            add(sourceDocument, destination.getArea(), destination.getPath(), destination
-                    .getLanguage(), sourceDocument.getExtension(), sourceDocument.getLink()
-                    .getLabel(), sourceDocument.getLink().getNode().isVisible());
+            add(sourceDoc, destination.getArea(), destPath, destination.getLanguage(), sourceDoc
+                    .getExtension(), sourceDoc.getLink().getLabel(), sourceDoc.getLink().getNode()
+                    .isVisible());
+        }
+
+    }
+
+    protected void copyInSiteStructure(Document sourceDoc, Document destDoc, String destPath)
+            throws PublicationException, DocumentException, SiteException {
+
+        String destArea = destDoc.getArea();
+
+        SiteStructure destSite = sourceDoc.getPublication().getArea(destArea).getSite();
+
+        if (sourceDoc.hasLink()) {
+            if (destDoc.hasLink()) {
+                Link srcLink = sourceDoc.getLink();
+                Link destLink = destDoc.getLink();
+                destLink.setLabel(srcLink.getLabel());
+                destLink.getNode().setVisible(srcLink.getNode().isVisible());
+            } else {
+                String label = sourceDoc.getLink().getLabel();
+                boolean visible = sourceDoc.getLink().getNode().isVisible();
+                if (destSite.contains(sourceDoc.getLink().getNode().getPath())) {
+                    addToSiteManager(destPath, destDoc, label, visible);
+                } else {
+
+                    String followingSiblingPath = null;
+
+                    if (sourceDoc.getPath().equals(destPath)) {
+                        SiteStructure sourceSite = sourceDoc.area().getSite();
+
+                        SiteNode[] sourceSiblings;
+                        SiteNode sourceNode = sourceDoc.getLink().getNode();
+                        if (sourceNode.isTopLevel()) {
+                            sourceSiblings = sourceSite.getTopLevelNodes();
+                        } else if (sourceNode.getParent() != null) {
+                            sourceSiblings = sourceNode.getParent().getChildren();
+                        } else {
+                            sourceSiblings = new SiteNode[1];
+                            sourceSiblings[0] = sourceNode;
+                        }
+
+                        final int sourcePos = Arrays.asList(sourceSiblings).indexOf(sourceNode);
+
+                        int pos = sourcePos;
+                        while (followingSiblingPath == null && pos < sourceSiblings.length) {
+                            String siblingPath = sourceSiblings[pos].getPath();
+                            if (destSite.contains(siblingPath)) {
+                                followingSiblingPath = siblingPath;
+                            }
+                            pos++;
+                        }
+                    }
+
+                    if (followingSiblingPath == null) {
+                        addToSiteManager(destPath, destDoc, label, visible);
+                    } else {
+                        addToSiteManager(destPath, destDoc, label, visible, followingSiblingPath);
+                    }
+                }
+            }
         }
     }
 
@@ -359,37 +414,24 @@
     public void move(Document sourceDocument, DocumentLocator destination)
             throws PublicationException {
 
-        Publication publication = sourceDocument.getPublication();
-        SiteManager siteManager = null;
-        ServiceSelector selector = null;
-        try {
-            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
-            siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());
-            if (siteManager.getSiteStructure(sourceDocument.getFactory(),
-                    sourceDocument.getPublication(), destination.getArea()).contains(
-                    destination.getPath())) {
-                throw new PublicationException("The path [" + destination
-                        + "] is already contained in this publication!");
-            }
-
-            String label = sourceDocument.getLink().getLabel();
-            boolean visible = sourceDocument.getLink().getNode().isVisible();
-            sourceDocument.getLink().delete();
+        if (!destination.getArea().equals(sourceDocument.getArea())) {
+            throw new PublicationException("Can't move to a different area!");
+        }
 
-            siteManager.add(destination.getPath(), sourceDocument);
-            sourceDocument.getLink().setLabel(label);
-            siteManager.setVisibleInNav(sourceDocument, visible);
-        } catch (final ServiceException e) {
-            throw new PublicationException(e);
-        } finally {
-            if (selector != null) {
-                if (siteManager != null) {
-                    selector.release(siteManager);
-                }
-                this.manager.release(selector);
-            }
+        SiteStructure site = sourceDocument.area().getSite();
+        if (site.contains(destination.getPath())) {
+            throw new PublicationException("The path [" + destination
+                    + "] is already contained in this publication!");
         }
 
+        String label = sourceDocument.getLink().getLabel();
+        boolean visible = sourceDocument.getLink().getNode().isVisible();
+        sourceDocument.getLink().delete();
+
+        site.add(destination.getPath(), sourceDocument);
+        sourceDocument.getLink().setLabel(label);
+        sourceDocument.getLink().getNode().setVisible(visible);
+
     }
 
     /**
@@ -403,62 +445,18 @@
 
     protected void copyToVersion(Document sourceDoc, String destinationArea, String language)
             throws DocumentException, DocumentBuildException, PublicationException, SiteException {
-        Document destinationDoc;
+
+        Document destDoc;
         if (sourceDoc.existsAreaVersion(destinationArea)) {
-            destinationDoc = sourceDoc.getAreaVersion(destinationArea);
-            copyDocumentSource(sourceDoc, destinationDoc);
+            destDoc = sourceDoc.getAreaVersion(destinationArea);
+            copyDocumentSource(sourceDoc, destDoc);
         } else {
-            destinationDoc = addVersion(sourceDoc, destinationArea, language);
+            destDoc = addVersion(sourceDoc, destinationArea, language);
         }
 
-        SiteStructure destSite = sourceDoc.getPublication().getArea(destinationArea).getSite();
-
         if (sourceDoc.hasLink()) {
-            if (destinationDoc.hasLink()) {
-                boolean visible = sourceDoc.getLink().getNode().isVisible();
-                destinationDoc.getLink().getNode().setVisible(visible);
-            } else {
-                String path = sourceDoc.getPath();
-                String label = sourceDoc.getLink().getLabel();
-                boolean visible = sourceDoc.getLink().getNode().isVisible();
-                if (destSite.contains(sourceDoc.getLink().getNode().getPath())) {
-                    addToSiteManager(path, destinationDoc, label, visible);
-                } else {
-
-                    SiteStructure sourceSite = sourceDoc.area().getSite();
-
-                    SiteNode[] sourceSiblings;
-                    SiteNode sourceNode = sourceDoc.getLink().getNode();
-                    if (sourceNode.isTopLevel()) {
-                        sourceSiblings = sourceSite.getTopLevelNodes();
-                    } else if (sourceNode.getParent() != null) {
-                        sourceSiblings = sourceNode.getParent().getChildren();
-                    } else {
-                        sourceSiblings = new SiteNode[1];
-                        sourceSiblings[0] = sourceNode;
-                    }
-
-                    final int sourcePos = Arrays.asList(sourceSiblings).indexOf(sourceNode);
-
-                    String followingSiblingPath = null;
-                    int pos = sourcePos;
-                    while (followingSiblingPath == null && pos < sourceSiblings.length) {
-                        String siblingPath = sourceSiblings[pos].getPath();
-                        if (destSite.contains(siblingPath)) {
-                            followingSiblingPath = siblingPath;
-                        }
-                        pos++;
-                    }
-
-                    if (followingSiblingPath == null) {
-                        addToSiteManager(path, destinationDoc, label, visible);
-                    } else {
-                        addToSiteManager(path, destinationDoc, label, visible, followingSiblingPath);
-                    }
-                }
-            }
+            copyInSiteStructure(sourceDoc, destDoc, sourceDoc.getPath());
         }
-
     }
 
     /**
@@ -532,8 +530,7 @@
             if (sourceArea.getName().equals(targetArea.getName())) {
                 targetDoc = sourceDoc;
             } else {
-                targetDoc = duplicateVersion(sourceDoc, targetArea.getName(), sourceDoc
-                        .getLanguage());
+                targetDoc = addVersion(sourceDoc, targetArea.getName(), sourceDoc.getLanguage());
                 sourceDoc.delete();
             }
 
@@ -596,7 +593,12 @@
      */
     public void copyDocumentSource(Document sourceDocument, Document destinationDocument)
             throws PublicationException {
+        copyContent(sourceDocument, destinationDocument);
+        copyMetaData(sourceDocument, destinationDocument);
+    }
 
+    protected void copyContent(Document sourceDocument, Document destinationDocument)
+            throws PublicationException {
         boolean useBuffer = true;
 
         OutputStream destOutputStream = null;
@@ -625,9 +627,6 @@
         } catch (Exception e) {
             throw new PublicationException(e);
         }
-
-        copyMetaData(sourceDocument, destinationDocument);
-
     }
 
     /**
@@ -925,15 +924,6 @@
                         .getPublication(), area, language, sourceDocument.getSourceExtension());
         copyMetaData(sourceDocument, document);
 
-        return document;
-    }
-
-    protected Document duplicateVersion(Document sourceDocument, String area, String language)
-            throws DocumentBuildException, DocumentException, PublicationException {
-        Document document = add(sourceDocument.getFactory(), sourceDocument.getResourceType(),
-                sourceDocument.getUUID(), sourceDocument.getInputStream(), sourceDocument
-                        .getPublication(), area, language, sourceDocument.getSourceExtension());
-        duplicateMetaData(sourceDocument, document);
         return document;
     }
 

Modified: lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/impl/java/org/apache/lenya/cms/publication/PublicationConfiguration.java Fri Apr  6 09:01:39 2007
@@ -67,7 +67,6 @@
     private static final String ELEMENT_LANGUAGES = "languages";
     private static final String ELEMENT_LANGUAGE = "language";
     private static final String ATTRIBUTE_DEFAULT_LANGUAGE = "default";
-    private static final String ELEMENT_TEMPLATES = "templates";
     private static final String ELEMENT_TEMPLATE = "template";
     private static final String ATTRIBUTE_ID = "id";
     private static final String ELEMENT_TEMPLATE_INSTANTIATOR = "template-instantiator";
@@ -82,7 +81,7 @@
     private static final String ELEMENT_MODULE = "module";//*
     private static final String ELEMENT_BREADCRUMB_PREFIX = "breadcrumb-prefix";
     private static final String ELEMENT_CONTENT_DIR = "content-dir";
-    private static final String ELEMENT_LINK_ATTRIBUTE = "link-attribute";
+    private static final String ATTRIBUTE_SRC = "src";
     private static final String ELEMENT_PROXIES = "proxies";
     private static final String ELEMENT_PROXY = "proxy";
     private static final String ATTRIBUTE_AREA = "area";
@@ -197,16 +196,20 @@
                 }
             }
 
-            Configuration templatesConfig = config.getChild(ELEMENT_TEMPLATES);
-            if (templatesConfig != null) {
-                Configuration[] templateConfigs = templatesConfig.getChildren(ELEMENT_TEMPLATE);
-                this.templates = new String[templateConfigs.length];
-                for (int i = 0; i < templateConfigs.length; i++) {
-                    String templateId = templateConfigs[i].getAttribute(ATTRIBUTE_ID);
-                    this.templates[i] = templateId;
-                }
+            Configuration templateConfig = config.getChild(ELEMENT_TEMPLATE, false);
+            //FIXME: this is a hack. For some reason, the old code seems to imply that a publication
+            // can have multiple templates. This is not the case. All this code should use a simple string
+            // rather than arrays at some point. For now, the old array is kept, to avoid having to deal
+            // with all kinds of NPEs that keep cropping up...
+            if (templateConfig == null) {
+                this.templates = new String[0]; // ugh. empty array to keep the legacy code from breaking.
+            }
+            else {
+                 this.templates = new String[1];
+                 this.templates[0] = templateConfig.getAttribute(ATTRIBUTE_ID);
             }
 
+
             Configuration templateInstantiatorConfig = config.getChild(
                     ELEMENT_TEMPLATE_INSTANTIATOR, false);
             if (templateInstantiatorConfig != null) {
@@ -216,7 +219,7 @@
 
             Configuration contentDirConfig = config.getChild(ELEMENT_CONTENT_DIR, false);
             if (contentDirConfig != null) {
-                this.contentDir = contentDirConfig.getAttribute("src");
+                this.contentDir = contentDirConfig.getAttribute(ATTRIBUTE_SRC);
                 getLogger().info(
                         "Content directory loaded from pub configuration: " + this.contentDir);
             } else {

Modified: lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java Fri Apr  6 09:01:39 2007
@@ -33,7 +33,7 @@
  * </p>
  * <p>
  * Example:
- * <code>{document-url:{page-envelope:area}:{page-envelope:document-id}:{page-envelope:document-language}}</code>
+ * <code>{document-url:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}}</code>
  * </p>
  * @version $Id$
  */

Modified: lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSourceFactory.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSourceFactory.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSourceFactory.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/cms/cocoon/source/SiteSourceFactory.java Fri Apr  6 09:01:39 2007
@@ -30,7 +30,6 @@
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.ContextHelper;
@@ -39,18 +38,6 @@
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
 import org.apache.excalibur.source.SourceFactory;
-import org.apache.excalibur.source.SourceResolver;
-import org.apache.lenya.cms.publication.Document;
-import org.apache.lenya.cms.publication.DocumentException;
-import org.apache.lenya.cms.publication.DocumentFactory;
-import org.apache.lenya.cms.publication.DocumentUtil;
-import org.apache.lenya.cms.publication.Publication;
-import org.apache.lenya.cms.publication.URLInformation;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
-import org.apache.lenya.cms.site.SiteManager;
-import org.apache.lenya.cms.site.SiteStructure;
-import org.apache.lenya.util.ServletHelper;
 
 /**
  * <p>
@@ -108,107 +95,9 @@
      */
     public Source getSource(String location, Map parameters) throws MalformedURLException,
             IOException, SourceException {
-        String area = null;
-        String pubId;
-
         Map objectModel = ContextHelper.getObjectModel(this.context);
         Request request = ObjectModelHelper.getRequest(objectModel);
-
-        String completePath = location.split("\\?")[0];
-        String queryString = null;
-        if (location.indexOf("?") > -1) {
-            queryString = location.split("\\?")[1];
-        }
-
-        String relativePath;
-        try {
-
-            final String scheme = completePath.split(":")[0] + ":";
-            final String absolutePath = completePath.substring(scheme.length());
-            if (absolutePath.startsWith("//")) {
-                final String fullPath = absolutePath.substring(2);
-                String[] steps = fullPath.split("/");
-                pubId = steps[0];
-                area = steps[1];
-                String prefix = pubId + "/" + area;
-                relativePath = fullPath.substring(prefix.length());
-            } else if (absolutePath.startsWith("/")) {
-                String webappUrl = ServletHelper.getWebappURI(request);
-                URLInformation info = new URLInformation(webappUrl);
-                pubId = info.getPublicationId();
-                area = info.getArea();
-                relativePath = absolutePath;
-            } else {
-                throw new MalformedURLException("The path [" + absolutePath
-                        + "] must start with at least one slash.");
-            }
-
-            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
-            Publication pub = factory.getPublication(pubId);
-            String[] steps = relativePath.substring(1).split("/");
-
-            String language = steps[0];
-            String prefix = "/" + language;
-            String path = relativePath.substring(prefix.length());
-
-            ServiceSelector selector = null;
-            SiteManager siteManager = null;
-
-            Document doc;
-
-            try {
-                selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
-                siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());
-                SiteStructure structure = siteManager.getSiteStructure(factory, pub, area);
-                doc = structure.getNode(path).getLink(language).getDocument();
-            } finally {
-                if (selector != null) {
-                    if (siteManager != null) {
-                        selector.release(siteManager);
-                    }
-                    this.manager.release(selector);
-                }
-            }
-
-            if (queryString != null && queryString.length() > 0) {
-                return getFormatSource(doc, queryString);
-            } else {
-                String lenyaURL = doc.getSourceURI();
-                Session session = RepositoryUtil.getSession(this.manager, request);
-                return new RepositorySource(manager, lenyaURL, session, getLogger());
-            }
-
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-
-    protected Source getFormatSource(Document doc, String queryString) throws DocumentException, ServiceException, MalformedURLException, IOException {
-        String name = queryString.split("=")[0];
-        String value = queryString.split("=")[1];
-
-        if (name.equals("format")) {
-            String format = value;
-            String formatBaseUri = doc.getResourceType().getFormatURI(format);
-            String formatUri = formatBaseUri + "/" + doc.getPublication().getId() + "/"
-                    + doc.getArea() + "/" + doc.getUUID() + "/" + doc.getLanguage();
-            
-            SourceResolver resolver = null;
-            try {
-                resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-                return resolver.resolveURI(formatUri);
-            }
-            finally {
-                if (resolver != null) {
-                    this.manager.release(resolver);
-                }
-            }
-            
-        } else {
-            throw new MalformedURLException("The parameter [" + name
-                    + "] is not supported.");
-        }
+        return new SiteSource(this.manager, request, location, getLogger());
     }
 
     /**

Modified: lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/util/Query.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/util/Query.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/util/Query.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/java/org/apache/lenya/util/Query.java Fri Apr  6 09:01:39 2007
@@ -18,12 +18,14 @@
 package org.apache.lenya.util;
 
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 
 /**
  * <p>
  * Utility class to analyze a query string of the form
  * <code>key1=value1&key2=value2&...</code>.
+ * Access is not thread-safe.
  * </p>
  * <p>
  * Invalid parts (not a valid key-value-pair) are omitted.
@@ -96,6 +98,25 @@
 
     public String getPairDelimiter() {
         return pairDelimiter;
+    }
+    
+    public void removeValue(String key) {
+        this.key2value.remove(key);
+    }
+    
+    public String toString() {
+        StringBuffer buf = new StringBuffer();
+        for (Iterator i = this.key2value.keySet().iterator(); i.hasNext(); ) {
+            String key = (String) i.next();
+            String value = (String) this.key2value.get(key);
+            buf.append(key);
+            buf.append(this.keyValueDelimiter);
+            buf.append(value);
+            if (i.hasNext()) {
+                buf.append(this.pairDelimiter);
+            }
+        }
+        return buf.toString();
     }
 
 }

Modified: lenya/branches/trunk-rework-pubconf/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java Fri Apr  6 09:01:39 2007
@@ -45,6 +45,7 @@
 import org.apache.lenya.cms.publication.Publication;
 import org.apache.lenya.cms.repository.RepositoryUtil;
 import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.util.Query;
 import org.apache.lenya.util.ServletHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -74,12 +75,18 @@
  * <code>&lt;a/&gt;</code> element is removed to disable the link.</li>
  * </ul>
  * 
+ * <p>
+ * You can add the query parameter <code>uuid2url.extension</code> to <code>lenya-document:</code>
+ * URLs to set a specific link extension.
+ * </p>
+ * 
  * $Id: LinkRewritingTransformer.java,v 1.7 2004/03/16 11:12:16 gregor
  */
 public class UuidToUrlTransformer extends AbstractSAXTransformer implements Disposable {
 
     protected static final String BROKEN_ATTRIB = "class";
     protected static final String BROKEN_VALUE = "brokenlink";
+    protected static final String EXTENSION_PARAM = "uuid2url.extension";
 
     private boolean ignoreLinkElement = false;
     private ServiceSelector serviceSelector;
@@ -159,7 +166,7 @@
 
     private String indent = "";
 
-    protected static final String[] elementNames = { "a", "object", "img" };
+    protected static final String[] elementNames = { "a", "object", "img", "link" };
     protected static final String[] attributeNames = { "href", "src", "data" };
 
     /**
@@ -208,16 +215,20 @@
                             String[] linkUriAndQuery = url.split("\\?");
                             String linkUri = linkUriAndQuery[0];
                             String queryString = null;
+                            String requiredExtension = null;
                             if (linkUriAndQuery.length > 1) {
                                 queryString = linkUriAndQuery[1];
+                                Query query = new Query(queryString);
+                                requiredExtension = query.getValue(EXTENSION_PARAM);
+                                query.removeValue(EXTENSION_PARAM);
+                                queryString = query.toString();
                             }
                             LinkTarget target = this.linkResolver.resolve(doc, linkUri);
                             if (target.exists() && target.getDocument().hasLink()) {
                                 Document targetDocument = target.getDocument();
-                                String extension = targetDocument.getExtension();
-                                if (extension.length() > 0) {
-                                    extension = "." + extension;
-                                }
+                                
+                                String extension = getExtension(targetDocument, requiredExtension);
+                                
                                 rewriteLink(newAttrs, attributeNames[i], targetDocument, anchor,
                                         queryString, extension);
                             } else if (doc.getArea().equals(Publication.AUTHORING_AREA)) {
@@ -268,6 +279,15 @@
         }
     }
 
+    protected String getExtension(Document targetDocument, String requiredExtension) {
+        String docExtension = targetDocument.getExtension();
+        String extension = requiredExtension != null ? requiredExtension : docExtension;
+        if (extension.length() > 0) {
+            extension = "." + extension;
+        }
+        return extension;
+    }
+
     /**
      * Marks a <code>&lt;a/&gt;</code> element as broken and removes href
      * attribute.
@@ -327,7 +347,7 @@
             rewrittenURL += "#" + anchor;
         }
 
-        if (queryString != null) {
+        if (queryString != null && queryString.length() > 0) {
             rewrittenURL += "?" + queryString;
         }
 

Modified: lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java Fri Apr  6 09:01:39 2007
@@ -21,6 +21,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.GregorianCalendar;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.avalon.framework.service.ServiceSelector;
@@ -309,7 +310,17 @@
                         + "] doesn't provide any samples!");
             }
             setParameter(SAMPLES, samples);
-            setParameter(SAMPLE, samples[0]);
+            String presetSample = getParameterAsString(SAMPLE);
+            if (presetSample == null) {
+                setParameter(SAMPLE, samples[0]);
+            }
+            else {
+                List sampleList = Arrays.asList(samples);
+                if (!sampleList.contains(presetSample)) {
+                    getLogger().warn("Sample [" + presetSample + "] not defined, using default sample.");
+                    setParameter(SAMPLE, samples[0]);
+                }
+            }
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {

Modified: lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Paste.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Paste.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Paste.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Paste.java Fri Apr  6 09:01:39 2007
@@ -69,6 +69,10 @@
 
         Clipboard clipboard = new ClipboardHelper().getClipboard(getContext());
         if (clipboard != null) {
+            if(getSourceDocument() == null) {
+                addErrorMessage("No source document");
+                return;
+            }
             String label;
             try {
                 Publication pub = getSourceDocument().getPublication();
@@ -162,4 +166,4 @@
         return SiteUtil.getAvailableLocator(this.manager, getDocumentFactory(), potentialLoc)
                 .getPath();
     }
-}
\ No newline at end of file
+}

Modified: lenya/branches/trunk-rework-pubconf/src/modules-core/workflow/test/canoo/test.xml
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules-core/workflow/test/canoo/test.xml?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules-core/workflow/test/canoo/test.xml (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules-core/workflow/test/canoo/test.xml Fri Apr  6 09:01:39 2007
@@ -20,11 +20,11 @@
   
   <import file="${webtest.home}/lib/taskdef.xml"/>
   
-  <target name="main" depends="sequence, overview"/>
+  <target name="main" depends="sequence, published-footer, overview"/>
   
     
   <target name="sequence">
-    <webtest name="myTest">
+    <webtest name="Workflow sequence">
       <config host="localhost" port="8888" protocol="http" basepath="default/authoring" />
       <steps>
         <!-- login as lenya -->
@@ -94,10 +94,11 @@
         <verifyElementText type="span" name="workflow-state" text="review"/>
         
         <!-- publish -->
+        
         <invoke url="index.html?lenya.usecase=workflow.publish"/>
         <clickButton name="submit"/>
         <verifyElementText type="span" name="workflow-state" text="live"/>
-
+        
         <!-- deactivate -->
         <invoke url="index.html?lenya.usecase=workflow.deactivate"/>
         <clickButton name="submit"/>
@@ -112,6 +113,50 @@
   </target>
   
   
+  <target name="published-footer">
+    <webtest name="Workflow sequence">
+      <config host="localhost" port="8888" protocol="http" basepath="default">
+        <option name="ThrowExceptionOnFailingStatusCode" value="false"/>
+      </config>
+      <steps>
+        <!-- login as alice -->
+        <invoke url="authoring/tutorial.html" />
+        <setInputField name="username" value="alice"/>
+        <setInputField name="password" value="levi"/>
+        <clickButton name="submit"/>
+        <verifyElementText type="span" name="workflow-state" text="authoring"/>
+        
+        <!-- submit -->
+        <invoke url="authoring/tutorial.html?lenya.usecase=workflow.submit"/>
+        <clickButton name="submit"/>
+        <verifyElementText type="span" name="workflow-state" text="review"/>
+        
+        <!-- live version should not exist -->
+        <invoke url="live/tutorial.html"/>
+        <storeResponseCode property="status" />
+        <verifyProperty name="status" text="404"/>
+        
+        <!-- publish -->
+        <invoke url="authoring/tutorial.html"/>
+        <verifyText text="This page has not been published yet."/>
+        <invoke url="authoring/tutorial.html?lenya.usecase=workflow.publish"/>
+        <clickButton name="submit"/>
+        <verifyElementText type="span" name="workflow-state" text="live"/>
+        <verifyText text="This page was last published at"/>
+        <verifyText text="by Alice."/>
+        
+        <invoke url="live/tutorial.html"/>
+        <verifyText text="This page was last published at"/>
+        
+        <!-- logout -->
+        <invoke url="authoring/tutorial.html?lenya.usecase=ac.logout"/>
+        <clickButton name="submit"/>
+        
+      </steps>
+    </webtest>
+  </target>
+  
+  
   <target name="overview">
     <webtest name="myTest">
       <config host="localhost" port="8888" protocol="http" basepath="default/authoring">
@@ -127,7 +172,6 @@
         
         <invoke url="index.html?lenya.usecase=workflow.multiWorkflow"/>
         <verifyElementText type="h1" text="Workflow Overview"/>
-        
       </steps>
     </webtest>
   </target>

Modified: lenya/branches/trunk-rework-pubconf/src/modules/bxe/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/bxe/sitemap.xmap?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/bxe/sitemap.xmap (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/bxe/sitemap.xmap Fri Apr  6 09:01:39 2007
@@ -111,7 +111,7 @@
           <map:parameter name="area" value="authoring"/>
           <map:parameter name="tab" value="en"/>
           <map:parameter name="chosenlanguage" value="{page-envelope:document-language}"/>
-          <map:parameter name="documentid" value="{page-envelope:document-id}"/>
+          <map:parameter name="path" value="{page-envelope:document-path}"/>
           <map:parameter name="documenturl" value="/{page-envelope:document-url}"/>
           <map:parameter name="documentextension" value="{page-envelope:document-extension}"/>
           <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>

Modified: lenya/branches/trunk-rework-pubconf/src/modules/bxe/xslt/link.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/bxe/xslt/link.xsl?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/bxe/xslt/link.xsl (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/bxe/xslt/link.xsl Fri Apr  6 09:01:39 2007
@@ -33,7 +33,7 @@
   <xsl:param name="publicationid"/>
   <xsl:param name="area"/>
   <xsl:param name="tab"/>
-  <xsl:param name="documentid"/>
+  <xsl:param name="path"/>
   <xsl:param name="documentextension"/>
   <xsl:param name="documenturl"/>
   <xsl:param name="languages"/>
@@ -52,7 +52,7 @@
         <script type="text/javascript" src="{$contextprefix}/modules/bxe/javascript/insertLink.js">&#160;</script>
         <script type="text/javascript" >
           AREA = "<xsl:value-of select="$area"/>";
-          DOCUMENT_ID = "<xsl:value-of select="$documentid"/>";
+          DOCUMENT_ID = "<xsl:value-of select="$path"/>";
           CONTEXT_PREFIX = "<xsl:value-of select="$contextprefix"/>";
           PUBLICATION_ID = "<xsl:value-of select="$publicationid"/>";
           CHOSEN_LANGUAGE = "<xsl:value-of select="$chosenlanguage"/>";
@@ -62,72 +62,62 @@
           ALL_AREAS = "authoring"
           PIPELINE_PATH = '/authoring/sitetree-fragment.xml'
         </script>
-        <table border="0" cellpadding="0" cellspacing="0" width="100%">
-          <tr>
-            <td valign="top" width="20%">
-              <div id="lenya-info-treecanvas">
-                <!-- Build the tree. -->
-                <table border="0" cellpadding="0" cellspacing="0">
-                  <tr>
-                    <xsl:call-template name="languagetabs">
-                      <xsl:with-param name="tablanguages">
-                        <xsl:value-of select="$languages"/>
-                      </xsl:with-param>
-                    </xsl:call-template>
-                  </tr>
-                </table>
-                
-                <div id="lenya-info-tree">
-                  <div id="tree">
-                    <script type="text/javascript">
-                      buildTree();
-                    </script>
-                  </div>
-                </div>
-              </div>
-            </td>
-            <td>
-              <form action="" name="link" id="link" onsubmit="insertLink()">
-                <table class="lenya-table-noborder">
-                  <tr>
-                    <td colspan="2" class="lenya-form-caption">You can either click on a node in the tree for an internal link or enter a link in the URL field. </td>
-                  </tr>
-                  <tr>
-                    <td colspan="2">&#160;</td>
-                  </tr>
-                  <tr>
-                    <td class="lenya-form-caption"><i18n:text>URL</i18n:text>:</td>
-                    <td>
-                      <input class="lenya-form-element" type="text" name="url"/>
-                    </td>
-                  </tr>
-                  <tr>
-                    <td class="lenya-form-caption"><i18n:text>Title</i18n:text>:</td>
-                    <td>
-                      <input class="lenya-form-element" type="text" name="title"/>
-                    </td>
-                  </tr>
-                  <tr>
-                    <td class="lenya-form-caption">Link text:</td>
-                    <td>
-                      <input class="lenya-form-element" 
-                        type="text" 
-                        name="text"/>
-                    </td>
-                  </tr>
-                  <tr>
-                    <td colspan="2">&#160;</td>
-                  </tr>
-                  <tr>
-                    <td/>
-                    <td> <input type="submit" 
-                      value="Insert" name="input-insert"/>
-                    </td>
-                  </tr>
-                </table>
-              </form>   
-            </td>
-          </tr></table>
+        
+        <div id="lenya-info-treecanvas" style="width: 30%">
+          <div class="lenya-tabs">
+            <xsl:call-template name="languagetabs">
+              <xsl:with-param name="tablanguages" select="$languages"/>
+            </xsl:call-template>
+          </div>
+          <div id="lenya-info-tree">
+            <div id="tree">
+              <script type="text/javascript">
+                buildTree();
+              </script>
+            </div>
+          </div>
+        </div>
+        
+        <form action="" name="link" id="link" onsubmit="insertLink()">
+          <table class="lenya-table-noborder">
+            <tr>
+              <td colspan="2" class="lenya-form-caption">You can either click on a node in the tree for an internal link or enter a link in the URL field. </td>
+            </tr>
+            <tr>
+              <td colspan="2">&#160;</td>
+            </tr>
+            <tr>
+              <td class="lenya-form-caption"><i18n:text>URL</i18n:text>:</td>
+              <td>
+                <input class="lenya-form-element" type="text" name="url"/>
+              </td>
+            </tr>
+            <tr>
+              <td class="lenya-form-caption"><i18n:text>Title</i18n:text>:</td>
+              <td>
+                <input class="lenya-form-element" type="text" name="title"/>
+              </td>
+            </tr>
+            <tr>
+              <td class="lenya-form-caption">Link text:</td>
+              <td>
+                <input class="lenya-form-element" 
+                  type="text" 
+                  name="text"/>
+              </td>
+            </tr>
+            <tr>
+              <td colspan="2">&#160;</td>
+            </tr>
+            <tr>
+              <td/>
+              <td> <input type="submit" 
+                value="Insert" name="input-insert"/>
+              </td>
+            </tr>
+          </table>
+        </form>
+              
       </page:body>
     </page:page>
   </xsl:template>
@@ -169,19 +159,17 @@
   
   <xsl:template name="languagetab">
     <xsl:param name="tablanguage"/>
-    <td>
       <a id="{$tablanguage}">
         <xsl:call-template name="activate">
           <xsl:with-param name="tablanguage" select="$tablanguage"/>
         </xsl:call-template>
       </a>
-    </td>
   </xsl:template>
   
   
   <xsl:template name="activate">
     <xsl:param name="tablanguage"/>
-    <xsl:attribute name="href"><xsl:value-of select="$contextprefix"/>/<xsl:value-of select="$publicationid"/>/<xsl:value-of select="$area"/><xsl:value-of select="$documentid"/>_<xsl:value-of select="$tablanguage"/><xsl:value-of select="$extension"/>?lenya.module=bxe&amp;lenya.step=link-show</xsl:attribute>
+    <xsl:attribute name="href"><xsl:value-of select="$contextprefix"/>/<xsl:value-of select="$publicationid"/>/<xsl:value-of select="$area"/><xsl:value-of select="$path"/>_<xsl:value-of select="$tablanguage"/><xsl:value-of select="$extension"/>?lenya.module=bxe&amp;lenya.step=link-show</xsl:attribute>
     <xsl:attribute name="class">lenya-tablink<xsl:choose><xsl:when test="$chosenlanguage = $tablanguage">-active</xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute><xsl:value-of select="$tablanguage"/>
   </xsl:template>
   

Modified: lenya/branches/trunk-rework-pubconf/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf Fri Apr  6 09:01:39 2007
@@ -23,7 +23,8 @@
   <component-instance name="collection"
                       logger="lenya.resourcetypes.collectoin"
                       class="org.apache.lenya.cms.publication.ResourceTypeImpl">
-    <sample-name>fallback://lenya/modules/collection/samples/collection.xml</sample-name>
+    <sample-name name="Manual">fallback://lenya/modules/collection/samples/collection.xml</sample-name>
+    <sample-name name="Children">fallback://lenya/modules/collection/samples/children.xml</sample-name>
   </component-instance>
 
 </xconf>

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/README.txt
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/README.txt?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/README.txt (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/README.txt Fri Apr  6 09:01:39 2007
@@ -2,7 +2,7 @@
 1. download the latest release of fckeditor from http://www.fckeditor.net/
 
 2. unzip it into the src/modules/fckeditor/resources directory
-   (resources directory should now contain a directory named FCKeditor)
+   (resources directory should now contain a directory named fckeditor)
    
 3. register the module with your publication, so that the appropriate menu
    item can be displayed: in <yourpub>/config/publication.xconf, add the line
@@ -16,8 +16,10 @@
      <role id="admin"/>
      <role id="edit"/>
    </usecase>
+
+   or use the usecases option under the admin tab in lenya. 
     
 5. build lenya
 
 6. try to edit your document by clicking on "With FCKEditor" in the edit menu
-    
\ No newline at end of file
+    

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java Fri Apr  6 09:01:39 2007
@@ -41,6 +41,7 @@
 import org.apache.excalibur.source.ModifiableSource;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
+import org.apache.lenya.cms.linking.LinkConverter;
 import org.apache.lenya.cms.publication.ResourceType;
 import org.apache.lenya.cms.usecase.DocumentUsecase;
 import org.apache.lenya.cms.usecase.UsecaseException;
@@ -195,6 +196,8 @@
                 }
             }
 
+
+
             // Try to clean the xml using xslt
             ResourceType resType = getSourceDocument().getResourceType();
             String[] formats = resType.getFormats();
@@ -221,6 +224,9 @@
 
                 saveXMLFile(encoding, content, getSourceDocument().getOutputStream());
             }
+            // Convert URLs back to UUIDs. convert() does a save
+            LinkConverter converter = new LinkConverter(this.manager, getLogger());
+            converter.convertUrlsToUuids(getSourceDocument(),false);
 
             xmlDoc = DocumentHelper.readDocument(getSourceDocument().getInputStream());
 

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckconfig.js
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckconfig.js?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckconfig.js (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckconfig.js Fri Apr  6 09:01:39 2007
@@ -28,7 +28,7 @@
 	['OrderedList','UnorderedList','-','Outdent','Indent'],
 	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 	['Link','Unlink','Anchor'],
-	['Image','Table','Rule','Smiley','SpecialChar','PageBreak','UniversalKey'],
+	['Image','Table','Rule','Smiley','SpecialChar','PageBreak'],
 	['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
 	'/',
 	['Style','FontFormat','FontName','FontSize'],

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckloader.js
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckloader.js?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckloader.js (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/fckloader.js Fri Apr  6 09:01:39 2007
@@ -18,7 +18,7 @@
 function fckloader(host, requesturi, contextPath)
 {
   var oFCKeditor = new FCKeditor( 'content' ) ;
-  oFCKeditor.BasePath	= contextPath + '/modules/fckeditor/FCKeditor/' ;
+  oFCKeditor.BasePath	= contextPath + '/modules/fckeditor/fckeditor/' ;
   oFCKeditor.Width="800";
   oFCKeditor.Height="700";
   oFCKeditor.Config[ "FullPage" ] = true ;

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/insertLink.js
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/insertLink.js?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/insertLink.js (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/resources/javascript/insertLink.js Fri Apr  6 09:01:39 2007
@@ -24,13 +24,16 @@
      url = prefix + url;
     }
     window.opener.SetUrl(url); 
-    window.opener.document.getElementById('txtAttTitle').value = title ; 
+    window.opener.document.getElementById('txtAttTitle').value = title ;
+    // set protocol to other so FCK won't append anything
+    window.opener.document.getElementById('cmbLinkProtocol').selectedIndex = 4;
     window.close();
 }
 
-function setLink(src) { 
-    url = src;
-    document.forms["link"].url.value = url;
+function setLink(uuid) { 
+    var language = CHOSEN_LANGUAGE;
+    url = uuid;
+    document.forms["link"].url.value = "lenya-document:" + url + ",lang=" + language;
 }
 
 function LinkTree(doc, treeElement) {
@@ -42,7 +45,7 @@
 LinkTree.prototype = new NavTree;
 
 LinkTree.prototype.handleItemClick = function(item, event) {
-    setLink(item.href);
+    setLink(item.uuid);
 }
 
 function buildTree() {

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/sitemap.xmap?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/sitemap.xmap (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/sitemap.xmap Fri Apr  6 09:01:39 2007
@@ -45,17 +45,6 @@
   <map:pipelines>
     <map:pipeline>
       <map:match pattern="fckeditor.open" >
-        <map:act type="reserved-checkout">
-          <map:generate type="serverpages" src="fallback://lenya/content/rc/{exception}.xsp">
-            <map:parameter name="user" value="{user}"/>
-            <map:parameter name="filename" value="{filename}"/>
-            <map:parameter name="date" value="{date}"/>
-            <map:parameter name="message" value="{message}"/>
-          </map:generate>
-          <map:transform src="fallback://lenya/xslt/rc/rco-exception.xsl"/>
-          <map:call resource="style-cms-page"/>
-          <map:serialize />
-        </map:act>    
         <map:generate type="jx" src="fallback://lenya/modules/fckeditor/usecases/fckeditor.jx"/>
         <map:transform type="i18n">
           <map:parameter name="locale" value="{request:locale}"/>
@@ -87,6 +76,7 @@
 
       <map:match pattern="content">
         <map:generate src="lenyadoc:/{page-envelope:document-language}/{page-envelope:document-id}"/>
+        <map:transform type="uuid2url"/>
         <map:serialize type="xml-get"/>
       </map:match>
 

Modified: lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/usecases/fckeditor.jx
URL: http://svn.apache.org/viewvc/lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/usecases/fckeditor.jx?view=diff&rev=526211&r1=526210&r2=526211
==============================================================================
--- lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/usecases/fckeditor.jx (original)
+++ lenya/branches/trunk-rework-pubconf/src/modules/fckeditor/usecases/fckeditor.jx Fri Apr  6 09:01:39 2007
@@ -1,40 +1,40 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  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
-
-  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.
--->
-
-<page:page
-  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
-  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
-  xmlns:cinclude="http://apache.org/cocoon/include/1.0"
-  >
-  
-  <script type="text/javascript" src="${request.getContextPath()}/modules/fckeditor/FCKeditor/fckeditor.js">&#160;</script>
-  <script type="text/javascript" src="${request.getContextPath()}/modules/fckeditor/javascript/fckloader.js">&#160;</script>
-  <script type="text/javascript">
-    window.onload = function()
-    {
-      fckloader('${usecase.getParameter('host')}', '${usecase.getParameter('requesturi')}', '${request.getContextPath()}');
-    }
-  </script>
-  
-	<page:title>FCKeditor - Sample</page:title>
-
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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
+
+  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.
+-->
+
+<page:page
+  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+  xmlns:cinclude="http://apache.org/cocoon/include/1.0"
+  >
+  
+  <script type="text/javascript" src="${request.getContextPath()}/modules/fckeditor/fckeditor/fckeditor.js">&#160;</script>
+  <script type="text/javascript" src="${request.getContextPath()}/modules/fckeditor/javascript/fckloader.js">&#160;</script>
+  <script type="text/javascript">
+    window.onload = function()
+    {
+      fckloader('${usecase.getParameter('host')}', '${usecase.getParameter('requesturi')}', '${request.getContextPath()}');
+    }
+  </script>
+  
+	<page:title>FCKeditor - Sample</page:title>
+
         <jx:choose>
           <jx:when test="${usecase.hasErrors()}">
             <page:body>
@@ -42,49 +42,49 @@
             </page:body>
           </jx:when>
           <jx:otherwise>
-	    <page:body>
-	  
-                <div class="lenya-box">
-                  <div class="lenya-box-title">Information</div>
-                  <div class="lenya-box-body">
-                    <table class="lenya-table-noborder">
-                      <tr>
-                        <td class="lenya-entry-caption">Document:</td>
-                        <td><jx:out value="${usecase.getParameter('document').getId()}"/></td>
-                      </tr>
-                      <tr>
-                        <td class="lenya-entry-caption">Workflow Event:</td>
-                        <jx:set var="event" value="${request.getParameter('lenya.event')}"/>
-                        <jx:choose>
-                          <jx:when test="${event.equals('') || event.equals('null')}">
-                            <td>No workflow event specified</td>
-                          </jx:when>
-                          <jx:otherwise>
-                            <td><jx:out value="${event}"/></td>
-                          </jx:otherwise>
-                        </jx:choose>
-                      </tr>
-                    </table>
-                  </div>
-                </div>
-          
-              <form method="post" name="fckeditor" id="fckeditor">
-            <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
-            <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>		
-            <input name="namespaces" type="hidden" value=" xmlns=&quot;http://www.w3.org/1999/xhtml&quot;" />
-			    <div>
-				    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 200px">
-                      <cinclude:includexml>
-                        <cinclude:src>cocoon://modules/fckeditor/content</cinclude:src>
-                      </cinclude:includexml>		
-				    </textarea>
-			    </div>
-			    <br />
-			    <input name="submit" type="submit" value="Save" />
-          <input type="submit" name="cancel" value="Cancel"/>
-		      </form>
-            			
-	    </page:body>
+	    <page:body>
+	  
+                <div class="lenya-box">
+                  <div class="lenya-box-title">Information</div>
+                  <div class="lenya-box-body">
+                    <table class="lenya-table-noborder">
+                      <tr>
+                        <td class="lenya-entry-caption">Document:</td>
+                        <td><jx:out value="${usecase.getParameter('document').getId()}"/></td>
+                      </tr>
+                      <tr>
+                        <td class="lenya-entry-caption">Workflow Event:</td>
+                        <jx:set var="event" value="${request.getParameter('lenya.event')}"/>
+                        <jx:choose>
+                          <jx:when test="${event.equals('') || event.equals('null')}">
+                            <td>No workflow event specified</td>
+                          </jx:when>
+                          <jx:otherwise>
+                            <td><jx:out value="${event}"/></td>
+                          </jx:otherwise>
+                        </jx:choose>
+                      </tr>
+                    </table>
+                  </div>
+                </div>
+          
+              <form method="post" name="fckeditor" id="fckeditor">
+            <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
+            <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>		
+            <input name="namespaces" type="hidden" value=" xmlns=&quot;http://www.w3.org/1999/xhtml&quot;" />
+			    <div>
+				    <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 200px">
+                      <cinclude:includexml>
+                        <cinclude:src>cocoon://modules/fckeditor/content</cinclude:src>
+                      </cinclude:includexml>		
+				    </textarea>
+			    </div>
+			    <br />
+			    <input name="submit" type="submit" value="Save" />
+          <input type="submit" name="cancel" value="Cancel"/>
+		      </form>
+            			
+	    </page:body>
           </jx:otherwise>
         </jx:choose>
-</page:page>
+</page:page>



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