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 [1/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/...

Author: solprovider
Date: Tue Sep  9 17:30:20 2008
New Revision: 693670

URL: http://svn.apache.org/viewvc?rev=693670&view=rev
Log:
Design Resources!  Any Module file can be overridden in the repository.  Structures save as special Design Resources.  Indexes are configured in Modules and stored as temporary files.

Added:
    lenya/branches/revolution/1.3.x/13Install.txt
    lenya/branches/revolution/1.3.x/13Navigation.txt
    lenya/branches/revolution/1.3.x/eclipseformat.xml
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/AbstractContentSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/DesignSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/StructureSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatDesign.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/PublicationInputModule.java
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/clean.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/finish.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/save.xsl
Modified:
    lenya/branches/revolution/1.3.x/13ABOUT.txt
    lenya/branches/revolution/1.3.x/13DONE.txt
    lenya/branches/revolution/1.3.x/13Eclipse.txt
    lenya/branches/revolution/1.3.x/13TODO.txt
    lenya/branches/revolution/1.3.x/INSTALL-SRC.txt
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/usecase/UsecaseAuthorizer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/workflow/WorkflowAuthorizer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ant/PublicationTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/DefaultCreatorAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/acting/ParentChildCreatorAction.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DublinCoreModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/FallbackModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationContentDirModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PublicationModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/components/modules/input/Usecase2ModuleModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/generation/SiteTreeGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/task/CocoonTaskWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/cocoon/transformation/UsecaseMenuTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/Content.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ContentInputModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ContentSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/Location.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/Resource.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/ResourceTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/CreateResourceTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/CreateRevisionTransformer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatContent.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndex.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexPart.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatIndexer.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatRelations.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatResource.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatRevision.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/FlatTranslation.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/content/flat/SitetreeGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/Module.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleInputModule.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/ModuleSourceFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/PublicationModules.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/modules/PublicationModulesGenerator.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PageEnvelope.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Publication.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/PublicationFactory.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/task/TaskParameters.java
    lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/util/Globals.java
    lenya/branches/revolution/1.3.x/src/webapp/WEB-INF/cocoon-xconf.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/code.js
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/code.js
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/code.js
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/module.xmap
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/relate/structure.xsl
    lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js
    lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/relation/live.xml
    lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/1190179730703.xml
    lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/en/translation.xml
    lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0005/resource.xml
    lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/content/resource/0007/resource.xml
    lenya/branches/revolution/1.3.x/src/webapp/sitemap.xmap

Modified: lenya/branches/revolution/1.3.x/13ABOUT.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13ABOUT.txt?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13ABOUT.txt (original)
+++ lenya/branches/revolution/1.3.x/13ABOUT.txt Tue Sep  9 17:30:20 2008
@@ -1,5 +1,7 @@
 About Lenya 1.3
 
+Lenya 1.3.0-dev is developed for Java 1.4 and Cocoon 2.1.11.
+
 === History
 February 2006: Started a private fork of Lenya 1.2.2.  
 June 2006: The other Committers expressed interest in (or demanded) the code.  I stopped new development and integrated my code with Lenya 1.2.x (between the 1.2.4 and 1.2.5 releases.)

Modified: lenya/branches/revolution/1.3.x/13DONE.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13DONE.txt?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13DONE.txt (original)
+++ lenya/branches/revolution/1.3.x/13DONE.txt Tue Sep  9 17:30:20 2008
@@ -1,28 +1,59 @@
 This file contains completed entries from the TODO file with the most recent entries at the top.  Separate Commits with "---".
 ======
 
---- 
-DONE 20080319
+
+--- 20080909
+Fixed setting revisions to none (to unpublish.)  
+Fixed getting PageEnvelope when outside the Module system (for 1.2 Kupu's global usecase.) 
+- 20080615
+Major library issues.  Reverted to 20080320 commit rev 639174 and copied all Java, Module, and unrelated files from current development version. Committed 20080908.  
+The lack of serializer.jar may again cause problems on Macs.  
+- 200804??
+Structure and design resource transformers handle naming of UNIDs.
+Structure = publicationId + "+" + StructureName
+Design Resource = publicationId + "." + moduleId + "." + safe(filename)
+Design Resources retrieved by ModuleSourceFactory.  Editors retrieve with structure: and design: protocols.
+Documented navigation system as 13Navigation.txt.
+Added serializer.jar.  Upgraded XalanJ to 2.7.1.  Changed Installation Instructions to upgrade Cocoon before building to avoid WrappedRuntimeException caused by incompatible versions of Transformer objects.
+Created FlatDesign class to separate Design Resources from Content Resources.  Design Resources are needed during Modules Initialization needed before Content Initialization.
+- 20080401
+"relate" Module: Change Editor to retrieve Structure as Design Resource.  Revisions, choose "live".
+Update Resource editor to use Named Revisions from Content.
+Deprecated PublicationFactory (to solve bugs.)
+Move Structures to Design Resources. Use publication '+' structure
+Set Index files to delete on exit.
+Fix Migration to convert Live Sitetree to Live Structure Resource. SOLUTION: Create Design Resource and copy relation/live.xml as first revision.
+"relate" Module - Added "Save" Action.
+- 20080327
+Added "live" index configuration to nav Module's module.xml.
+Modules read index configuration from module.xml and {module}/*.index; passes to FlatContent's Indexer.  
+Moved language control from FlatIndexer to FlatIndex.
+FlatIndex: Use temp files.  (Defaults to content directory if cannot create temp files.)
+FlatIndex reports Named Revisions and Structures to FlatIndexer.  List is exposed by FlatContent and was added to PublicationGenerator.  Note that "live" is hardcoded in many places.  Named Revisions always include "live" and "edit".  No predefined Structures exist.
+Created Design Resources.  Used separate directory "design" to distinguish from Content Resources.
+ModuleSourceFactory: Check for Design Resource before file system.
+Design resources: Module protocol can check datastore for design elements such as XSLT and CSS.  This is the reason for named resources; use UNID = publication '$' module '$' safe(filepath).  Also useful for structures.
+
+--- 20080319
 Structure editor/"relate" Module - Add Resources and move branches to new parent or root independent of translations.  Collapse/Expand tree.  Undo abilities.  Added link from Edit screen.
 
----
--- DONE 20080308
+-- 20080308
 1.2 Authoring: Uses {pub}/xslt/page2xhtml.xsl.  lenya-body aggregate returns xhtml:html/xhtml:body rather than expected xhtml:html/xhtml:div[@id='body'].  Added former match to page2xhtml.xsl.
 Indexer: creating or updating Resources runs Indexer. Added system so only one thread handles updates while other threads may request that the first thread run update again. IMPLEMENTATION: Queue background indexing. Thread check next index. Send changes to indexes with return of needsIndexing so add to queue. If exists and does not need updating, return
 Patched xhtml module.xmap during testing.
 Replace all ResourceExists Actions with the ResourceExists Selector in Modules.
 New Module requires and passes successful requests to Edit Module.
--- DONE 20080225
+-- 20080225
 Fixed setting live revision when currently empty string.
 Migration: Changed doctype of homepage from "homepage" to "home".
 Changed "live" Index removing doctype.
--- DONE 20080221
+-- 20080221
 Restructured Modules to remove XML processing from Live.  
 Added live.xmap.  Separates Module inheritance of display from other pipelines.
 Made File, Link, and XML work for create, edit, and display. 
 Fixed ContentSourceFactory to send SourceNotFoundException correctly.
 Fixed FlatResource to use ID.  Also removes extension.  Simplifies XMAPs as ContentSourceFactory and ContentInputModule can receive UNID, ID, or Structure/ID.
--- DONE 20080219
+-- 20080219
 New File Resource did not allow new Revisions without uploads=true.  Changed default.
 Merge {module}/resource.xml with current revision to add fields (especially important for new Resources containing no fields.)
 flat.SitetreeGenerator used for "edit" Module must return all Resources diregarding language and including Resources without any languages.
@@ -33,8 +64,7 @@
 IMPLEMENTATION: Resources only know "type".  Doctype is removed.  Type is the module for the Resource.  "Home" type's Resource Module is "/xml/xhtml/home" but the Resource type is "home".
 Create New Resource: Publication has Resource Types.  Use Generator. Choose Type.  Create required languages. Use Transformer. Pass to Edit Module. [Done except open in edit.]
 
----
-DONE 20080127: Fix Publication Module loading and inheritance.  Each Publication should build structure once per restart.  
+-- 20080127: Fix Publication Module loading and inheritance.  Each Publication should build structure once per restart.  
 [Modules.java]
 synchronize setting of static variables.
 Move inherit to static (publication.module.name=publication.module.name).
@@ -49,8 +79,7 @@
 
 ---
 FIXED?: CreateRevisionTransformer: Set creator and when properly.
-DONE 20080120: Xinha adds extra fields. Dialog1 - Dialog6 fields added to new revisions.
-
+20080120: Xinha adds extra fields. Dialog1 - Dialog6 fields added to new revisions.
 
 === Older completed entries ===
 Admin screens: Revision chooser

Modified: lenya/branches/revolution/1.3.x/13Eclipse.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13Eclipse.txt?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13Eclipse.txt (original)
+++ lenya/branches/revolution/1.3.x/13Eclipse.txt Tue Sep  9 17:30:20 2008
@@ -7,43 +7,71 @@
 http://svn.apache.org/repos/asf/lenya/branches/revolution/1.3.x 
 (Committers should use https:.)
 Next
-Click top choice matching the reposityory string.
+Click top choice matching the repository string.
 Next
 Finish
 (New Project Wizard)
 Java/Java Project - Next
-Project name: Lenya13x
+Project name: lenya-1.3
 JRE - Use an execution environment JRE: J2SE-1.4
 Project layout - Create separate folders for source and class files - Configure defuault - Source folder name: src/java
 OK
 Next
 Finish
 
+-- Cocoon-2.1.11
+Lenya 1.3 uses Cocoon-2.1.11.  A major bug from before Cocoon-2.1.6 survived through Cocoon-2.1.10 making those releases undesirable.
 
-Add lib Libraries to build path.
-Add tools/jetty/lib/servlet-2.3.jar to build path
+Repeat for Cocoon:
+Download the Cocoon-2.1.11 release.
 
-Lenya 1.3 will use Cocoon-2.1.11 when it is released.  A major bug from before Cocoon-2.1.6 survived through Cocoon-2.1.10 making those releases undesirable.
+-- Cocoon in Eclipse
+These instructions attempt to make an Eclipse project for Cocoon.  The instructions are incomplete because I could not discover the proper libraries to prevent errors.  The code may just be incompatible with Eclipse's convention of all classes resolving without errors.
 
-Repeat for Cocoon:
-http://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X
-Project name: Cocoon21x
+Project name: Cocoon-2.1.11
+
+Cocoon is missing several libraries.  Download and add to Cocoon's build path:
+  commons-httpclient-3.1.jar - 
+  commons-lang-2.3.jar - 
+  htmlunit-1.14.jar - 
+  jaxen-1.1.1.jar  - http://jaxen.codehaus.org/releases.html
+  jcr-1.0.jar - http://www.day.com/maven/jsr170/jars/jcr-1.0.jar (This jar is also found buried in a download from Sun with a misleading name.)
+Remove source from the build path.
+  src/jdk1.3/java
+  src/blocks/slop
+
+These may not be the correct libraries as Eclipse still finds errors.
 
+---  Java version error
 JRE: Must be above 1.4 or will error:
 Access restriction: the method ___ from the type ___ is not accessible due to restriction on required library rt.jar
 
-Add to build path
-lib/core 
-lib/endorsed
-tools/lib/ant.jar
+Install and configure j2sdk1.4.2_15
+
+--- Finish Lenya in Eclipse
 
 Copy Lenya13x/src/cocoon/
    local.blocks.properties
    local.build.properties
-To Cocoon21x/
+To Cocoon-2.1.11/
 
-Run Cocoon21x/build.bat
+Run cocoon-2.1.11/build.bat
 
-Open Lenya13x/build.properties
-Verify cocoon.src.dir.
+Add libraries to build path from:
+lib/core 
+lib/endorsed
+tools/jetty/lib/servlet-2.3.jar
+tools/lib/ant.jar
+cocoon-2.1.11/build/webapp/WEB-INF/lib/*
+
+Remove duplicate libraries keeping latest versions (higher numbers.)
+
+Open Lenya13x/build.properties and verify cocoon.src.dir
 Run Lenya13x/build.bat
+Run Lenya13x/lenya.bat
+
+Change the Problems filter to "description" "doesn't contain" "deprecated" (unless you are fixing these warnings.)
+
+To use a consistent code format (designed for maximum code in minimum vertical distance proven to reduce bugs):
+Preferences - Java Code Style/Formatter - Import eclipseformat.xml
+

Added: lenya/branches/revolution/1.3.x/13Install.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13Install.txt?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/13Install.txt (added)
+++ lenya/branches/revolution/1.3.x/13Install.txt Tue Sep  9 17:30:20 2008
@@ -0,0 +1,27 @@
+=== Installing Lenya 1.3 ===
+
+Create "cocoon-2.1.11" and "lenya-1.3" directories inside the same directory for the easiest configuration.
+
+1. Download Cocoon-2.1.11 from:
+http://cocoon.apache.org/mirror.cgi
+
+2. Use svn to checkout from:
+svn co http://svn.apache.org/repos/asf/lenya/branches/revolution/1.3.x
+(Committers should use https.)
+
+3. Copy lenya-1.3/src/cocoon/
+   local.blocks.properties
+   local.build.properties
+To cocoon-2.1.11/
+
+4. Run cocoon-2.1.11/build.bat (or build.sh)
+
+5. Open lenya-1.3/build.properties and verify cocoon.src.dir matches your directory.
+
+6. Run lenya-1.3/build.bat (or build.sh)
+
+7. Run lenya-1.3/lenya.bat (or lenya.sh)
+
+Macs may need to add serializer.jar (from XalanJ) to the endorsed libraries.
+
+

Added: lenya/branches/revolution/1.3.x/13Navigation.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13Navigation.txt?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/13Navigation.txt (added)
+++ lenya/branches/revolution/1.3.x/13Navigation.txt Tue Sep  9 17:30:20 2008
@@ -0,0 +1,34 @@
+=== Lenya 1.3's Navigation System ===
+
+== Administration ==
+
+1. A Navigation Module defines Index configurations.  Configuration includes the Revision name (currently "live" or "edit", but will allow the Module developer to create more) and filters (e.g.limit to certain Types).  Hierarchical Indexes also require a Structure.  
+
+Index Configurations in module.xml must have id attribute.  Indexes configured as files named "{indexname}.index" default to using the indexname part of the filename.
+
+Most Indexes will use the "live" Structure, but Module developers have the freedom to request a new Structure, and administrators can have as many Structures as they are willing to maintain.  With Module Inheritance, a new Module could use all the code from an existing Module while specifying a different Structure.
+
+NOTE: A large Publication could have several local Modules inheriting from the global "nav" Module with each using a different Index/Structure. That might require only one file in one new directory for each new Module. Then teach the aggregation to use different Modules based on the current page (again implemented by overriding only one file.)
+
+2. Lenya-1.3 notices Module Indexes that need Structures and adds the Structure names to an administration menu.
+
+3. Administrators edit the Structure Resources.  
+Default Relations are stored in {pub}/content/relation.  Relations become Design Resources when edited using the GUI.   The Relations editor is completely DHTML. The data sent to the browser includes the UNID, ID, and Type of each Resource, the language of each Translation, and the Title of "live" Translations. The browser submits a String of UNIDs with <> characters marking parent-child relationships.  Current actions are "Add Resource", "Move Resource and all descendants", and "Remove Resource and all descendants".  "Copy Resource and all descendants" is easy to program, but needs an easy interface distinguishing between move and copy actions.
+
+Relation Resources contain the UNID, ID, and FullPath of each Resource.  (The data could be optimized to contain only the UNID and let the Indexers do more work.  Wasting drive space saves processing by the frequently run Indexers.)  
+
+Selecting the "live" Relations from all Revisions is a future enhancement.
+
+
+4. The Indexer creates/updates the Index using the specified Structure.  The result is similar to a Sitetree file.  Indexes are language-specific and add the Title from the specified Translation/Revision to the information in the Structure.  Indexes are stored as temporary delete-on-exit files because they are completely and frequently generated so permanent storage is unnecessary and unwise.
+
+== Browser Responses ==
+
+5. Something (usually a Type Module which received the user request from the Live Module) requests a menu from the Navigation Module. (The "nav" Module handles menus for Flat datastores.)
+
+6. The Module calls the SitetreeGenerator with the name of the Index. The SitetreeGenerator sends the correct file and will filter based on security (so people cannot see what they cannot get.) 
+
+7. The Module transforms the Index into XHTML and returns the information to the requesting Module.
+
+
+

Modified: lenya/branches/revolution/1.3.x/13TODO.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13TODO.txt?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13TODO.txt (original)
+++ lenya/branches/revolution/1.3.x/13TODO.txt Tue Sep  9 17:30:20 2008
@@ -1,31 +1,37 @@
-====================
-==== Structures ====
-====================
-NOTE: Goal is to add "Save" action to Structure Editor.  [I will be implementing this next. - solprovider]
+=====================
+==== Underscores ====
+=====================
+IDs cannot contain underscores.  
+
+Fix migration to convert underscores to dashes.  (Default publication includes an ID with an underscore.)
+
+Add validation to Create Resource forms.
+ID Validation - No duplicate IDs, spaces, periods, exclamation marks, or underscores.
+UNID Validation - No < and >. Must be valid directory name (deny .:!,?*_"&+#/\| and leading ~).
 
-- Move Index Configuration to Modules.  Allow both module.xml and separate files.  (module.xml requires work when inherited.  Separate files are automatically inherited.)
-- Read index configuration for names of Structures.  IndexConfiguration includes Structure and Revision names.  Load during initialization for use in adminstration.
-- Generator for names of Structures.
-- Create Design Resources.  Exclude Design Resources from "all" Index.
-- ModuleSourceFactory: Check for Design Resource before file system.
-Design resources: Module protocol can check datastore for design elements such as XSLT and CSS.  This is the reason for named resources; use UNID = publication + module + filepath.  Also useful for structures.
-- Move Structures to Design Resources.
-- "relate" Module: Change Editor to retrieve Structure as Design Resource.  Revisions, choose "live".
-- Implement "Save Resource" with run Indexer.
+Can fix Location for easier parsing on underscores.  Currently only allows 2-character languages.
 
 ==================
 ==== Security ====
 ==================
 
-Resource-level Security.
+Implement in SitetreeGenerator and ContentSourceFactory.
+
+Resource-level Security.  
 Access Control List in Resource.xml
-"admin" Group bypasses security and is allowed to do anything.
 <acl><read default="yes"><person|group|role id="name" access="yes|no"></read><edit default="yes">same as read</edit></acl>
-Implement in SitetreeGenerator and ContentSourceFactory.
-"Not allowed" returns Sorry page (rather than error).
+Inherit from Resource using Structure.  Multiple inheritance: default allow or deny.
+Authors field?
+
+Publication: 
+Master group: "admin" Group bypasses security and is allowed to do anything.
+Revision-level security.
+Action-level security.
+"Not allowed" returns Sorry page (rather than error). Specify sorry page: module://lenya/sorry.xml
 "Does not exist" returns same Sorry page.
-Sorry: This resource is not available, either it does not exist or you do not have access to it.  (Link to Login page if not logged in.)
-DESIGN: How to handle inheritance?  Multiple parents?  Assume "live" structure?
+
+Sorry page: Add link to login if not logged in.
+
 Workflow: Reproduce Lenya-1.2's approve/publish system.
 
 ==============================================
@@ -54,23 +60,33 @@
 === CreateRevisionTransformer
 Replace all A and IMG tags with appropriate RESOURCE tags, creating new Resources as necessary.
 
+====================
+==== Known Bugs ====
+====================
+
+Saving xhtml Resource did not change "edit" version as specified. Workaround: Select old version before new Revision.  Do we still need "edit" named revision?  Alternate: Add links to "edit" Module for opening and editing each revision.  Add "edit" button to live pages?
+
+File Resource: Create Translation does not save upload.  Create Revision works.
+
+Edit File: Setting Default Language does not save.  (Fixed for XML earlier, probably also affects Links.)
+
 ==============================
 ==== Other Critical Tasks ====
 ==============================
 
-BUG: Saving xhtml Resource did not change edit version as specified.  Selecting old version before new Revision.
-BUG: File Resource: Create Translation does not save upload.  Create Revision works.
-Edit File: Setting Default Language does not save.  (Fixed for XML earlier, probably also affects Links.)
-Edit Resource: Add description for Revisions, edited separately.  Add return to edit and live.  Add show version.
-Edit: Add return to live.
+Edit: Add link for return to live. Need Administration navigation.  Like 1.2 or 2.x?
 
+Test: Module Index Files (module.xml works, but did not test /modules/moduleid/myindex.index
+
+Include Cocoon in Lenya-1.3 so installing Cocoon separately is not required.  (Or downgrade Xalan and SourceResolver to the versions included in Cocoon so replacing files before building Cocoon is not required.)
+
+Edit Screens: Use NamedRevisions.
 
 Only explicitly included Modules should appear on New Resource list.  Inherited Modules should not appear.  Configure default pub to exclude "text" (until working), "xml", and "homepage".
 
 Edit-Save must clear Cache. (Or "cache" Module must check if Resource is still valid.)
 
-New: ID Validation - No duplicates, periods, exclamation marks, or underscores.
-New: UNID Validation - No < and >. Must be valid directory name (deny :!,?*_"&+#/\| and leading .~).
+Flat Migration: Test.  Creates "live" structure?  Needs mkdirs()?
 
 flat Module: content3.xsl sets doctype.  Need to use rules in {pub}/parameter-doctype.xmap
 Migration: Copy XSLTs to proper modules and patch as needed.
@@ -80,10 +96,15 @@
 modules
 config/???
 
+Add default option for Live Module to use old "xslt" directory when handling hierarchical content.
+
 ==============================
 ==== Non-critical Updates ====
 ==============================
-Add default option for Live Module to use old "xslt" directory when handling hierarchical content.
+
+FlatIndex: Need to synchronize so filename is created once.  Currently creates each index twice.
+
+Administration navigation - Create Resource, return from edit resource.
 
 Modules are only added to Publications when server is started.  Should ModuleSourceFactory check for changes before erroring?
 
@@ -92,23 +113,17 @@
 DESIGN: Does Module differentiation by ContentType cause confusion with inheritance?  A module overriding one type will intercept calls to all types.
 Remove Module Types.  Let Module devs handle.
 
-Administration navigation - Create Resource, return from edit resource.
-
 Replace uses of post.xsp with RequestGenerator.
 
 Resource @defaultlanguage is used to return one Translation for all requests.  Does it work?
 
 Xinha adds xmlns:xhtml="http://www.w3.org/1999/xhtml to some elements (P H1).
 
-Check synchronization of HashMaps.
+Replace <map:generate src="module://lenya/empty.xml"/> with <map:generate src="empty:empty"/>
 
-"relate" Module/Structure Editor: 
-- Add Categories (placeholder for menu entries with no document) using quotes to distinguish from UNIDs.  
-- Search other Revisions for Title when no "live" Revision or "live" Title is blank.  
-- Add "Copy Resource and all descendants" action.
-- Add export/import to assist copying amongst Structures.
-- Filter Resources on Types.
+Move page.css from {pub}\resources\shared\css\page.css to Module (xml?).  Fix xml/live.xmap, page2html.xsl in home and xml, and Lenya global XMAPs.  Add to migration?
 
+Check synchronization of HashMaps.
 
 =============================
 ==== ToDo List from 2006 ====
@@ -124,10 +139,6 @@
 Since all code is based on current language, may need method to have Admin menus in different language than Resource displayed.  Probably add langauge as parameter:
 http:server/pub/admin/en/docid_xx.html
 
-=== File Resource
-New XML should reference old file?  Need another file to register all uses of revision binary
-Or make copy? (waste space, but safer when deleting revisions)
-
 === Search
 Doctype Configuration should define Body.
 Title is assumed from Revision Title?  Or allow override?
@@ -140,11 +151,42 @@
 =======================
 [This section lists new abilities not required to complete 1.2 functionality.]
 
+Make a publication based on pubs/{publication-id}.xml.   Content, Modules, and security can be placed outside Lenya removing the need for a publication directory,
+
+"relate" Module/Structure Editor:
+- Add Categories (placeholder for menu entries with no document) using quotes to distinguish from UNIDs.  
+- Search other Revisions for Title when no "live" Revision or "live" Title is blank.  
+- Add "Copy Resource and all descendants" action.
+- Add export/import to assist copying amongst Structures.
+- Filter Resources on Types.
+
+Replace System.out messages with logger.
+
+Saving Structure should only update indexes dependent on that Structure.
+
+Revisions: Remember base revision for each edit to enhance with branching history for diff viewer.
+Diff viewer showing progress and compare any two revisions.
+
+Edit Resource: Add description for Revisions, edited separately.  Add return to edit and live.  Add show version.
+
+Allow configuration of Named Revisions other than needed for Indexes.  Currently only Indexes can specify Revision Names.  Workflow should also configure new Revision Names and allow limiting to a specific Resource type.
+
+Many Modules were created before 1.3's SourceFactories and Transformers.  Revise xml,file,link Modules to use Create Transformers directly without JS Flow.
+
+Try adding final slash to request before sending error.
+
+"relate" Module - Allow selection of "live" revision for Structures.
+
+Transactions - All changes saved to content/transactions filename formatted when(revision).unid.lang:
+1207025524250.{uuid}.en.xml = Revision
+1207025524250.{uuid}.en.ext = Revision Files
+1207025524250.{uuid}.en.translation.xml = Translation
+1207025524250.{uuid}.xml = Resource
+Create transaction during change, not when deleting.
+Future functions include scheduled zipping of transactions, monthly and annually.
+
 cocoon: protocol does not follow Module inheritance for missing files. Example: /pub/home/parameters should use /pub/xhtml/parameters if modules/home/module.xmap is missing.  Needing module.xmap defeats purpose of inheritance.  (module: protocol follows inheritance so resource-exists works as test for Module.)
 
-Identifier must not contain period, underscore, or exclamation mark.  Allow spaces? Caps?
-Default publication includes an ID with an underscore.  Remove during migration?  
-Current code allows for underscores in ID as long as portion after underscore is not two characters.
 
 New Translation: Warn if no language chosen but other fields changed for new translation.
 

Modified: lenya/branches/revolution/1.3.x/INSTALL-SRC.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/INSTALL-SRC.txt?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/INSTALL-SRC.txt (original)
+++ lenya/branches/revolution/1.3.x/INSTALL-SRC.txt Tue Sep  9 17:30:20 2008
@@ -15,15 +15,14 @@
   You will need
 
 	* Java 2 Platform, Standard Edition
-	  version 1.4.2 or newer, 1.5.x works with some limitations
-	  (see http://issues.apache.org/bugzilla/show_bug.cgi?id=32923)
-          Lenya 1.3 was developed with j2sdk1.4.2_07
+	  version 1.4.2 or newer.
+          Lenya 1.3 was developed with j2sdk1.4.2_15
 
-	* Apache Cocoon, version 2.1.9
+	* Apache Cocoon, version 2.1.11
 	  Available from http://cocoon.apache.org/mirror.cgi
 
 	* Apache Tomcat, version 5
-	  (optional, only if you don't want to use the built-in Jetty)
+	  Optional and untested replacement for Jetty (included with Lenya.)
 
   Don't install Tomcat in a location with spaces in the path!
   On Windows, put it directly in C:\tomcat rather than
@@ -33,44 +32,42 @@
 
 	1.	Create a directory src/ in a location with no spaces in the path
 
-	2.	Unpack Cocoon in src/, thereby creating src/cocoon-2.1.9
+	2.	Unpack Cocoon in src/, thereby creating src/cocoon-2.1.11
 
-	3.	Unpack Lenya in src/, thereby creating src/lenya-1.3.x
+	3.	Unpack Lenya in src/, thereby creating src/lenya-1.3
 
   Build Cocoon
 
 	1.	Copy
+			src/lenya-1.3/src/cocoon/local.build.properties
+			src/lenya-1.3/src/cocoon/local.blocks.properties
+		to	src/cocoon-2.1.11/
 
-			src/lenya-1.3.x/src/cocoon/local.build.properties
-			src/lenya-1.3.x/src/cocoon/local.blocks.properties
 
-		to	src/cocoon-2.1.9/
+	2.	Go to src/cocoon-2.1.11 and type
+			./build.sh on Unix
+			build.bat  on Windows
 
-        2.      If Windows, fix the 4 batch files.
-                    src\cocoon-2.1.9\tools\bin
+        	If errors on Windows, fix the 4 batch files.
+                    src\cocoon-2.1.11\tools\bin
                     ant.bat  antRun.bat  appendcp.bat  lcp.bat
                 Convert to DOS format.  
                 Copy from src\lenya-1.3\tools\bin
                 OR Open each in Wordpad and save it.)
 
-	3.	Go to src/cocoon-2.1.9 and type
-
-			./build.sh on Unix
-			build.bat  on Windows
 
   Standalone Installation (using the built-in Jetty)
 
 	1.	Configure Lenya
 
-		In lenya-1.3.x, copy
-
+		In lenya-1.3, copy
 			build.properties
 
 		to	local.build.properties
  
 		Edit local.build.properties and make sure that
 
-			cocoon.src.dir=../cocoon-2.1.9
+			cocoon.src.dir=../cocoon-2.1.11
 			web.app.server=Jetty
 
 		If you want to upload files to your Lenya website
@@ -80,28 +77,24 @@
 
 	2.	Build Lenya 
 
-		In lenya-1.3.x, execute
-
+		In lenya-1.3, execute
 			./build.sh on Unix
 			build.bat  on Windows
 
 		If you need to re-build Lenya, issue
-
 			./build.sh clean on Unix
 			build.bat clean  on Windows
-
 		to clear the build directory prior to your next build.
 
 	3.	Start Lenya/Jetty
 
-		In lenya-1.3.x, type
-
+		In lenya-1.3, type
 			./lenya.sh servlet on Unix
 			lenya.bat servlet  on Windows
 
 	4.	Test the Installation
 
-		Point your browser to http://localhost:8888
+		Open your browser to http://localhost:8888
 
   End of standalone installation using the built-in Jetty
   ----
@@ -110,7 +103,7 @@
 
 	1.	Configure Lenya
 
-		In lenya-1.3.x, copy
+		In lenya-1.3, copy
 
 			build.properties
 
@@ -118,7 +111,7 @@
 
 		Edit local.build.properties and make sure that
 
-			cocoon.src.dir=../cocoon-2.1.9
+			cocoon.src.dir=../cocoon-2.1.11
 			web.app.server=Tomcat
 			tomcat.home.dir=[path_to_tomcat]
 
@@ -135,7 +128,7 @@
 
 	2.	Build Lenya
 
-		In lenya-1.3.x, execute
+		In lenya-1.3, execute
 
 			./build.sh on Unix
 			build.bat  on Windows

Added: lenya/branches/revolution/1.3.x/eclipseformat.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/eclipseformat.xml?rev=693670&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/eclipseformat.xml (added)
+++ lenya/branches/revolution/1.3.x/eclipseformat.xml Tue Sep  9 17:30:20 2008
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="solprovider" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="999"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="3"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="64"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="64"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="999"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="64"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="52"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/>
+</profile>
+</profiles>

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java?rev=693670&r1=693669&r2=693670&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java Tue Sep  9 17:30:20 2008
@@ -14,11 +14,8 @@
  *  limitations under the License.
  *
  */
-
 /* $Id$  */
-
 package org.apache.lenya.cms.ac;
-
 import java.io.File;
 import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.configuration.Configurable;
@@ -43,253 +40,206 @@
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentBuilder;
 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.util.Globals;
 /**
- * A PolicyManager which is capable of mapping all URLs of a document to the appropriate canonical
- * URL, e.g. <code>/foo/bar_de.print.html</code> is mapped to <code>/foo/bar</code>.
+ * A PolicyManager which is capable of mapping all URLs of a document to the appropriate canonical URL, e.g. <code>/foo/bar_de.print.html</code> is mapped to <code>/foo/bar</code>.
  */
-public class DocumentPolicyManagerWrapper
-    extends AbstractLogEnabled
-    implements InheritingPolicyManager, Serviceable, Configurable, Disposable {
-
-    /**
-	 * Ctor.
-	 */
-    public DocumentPolicyManagerWrapper() {
-    }
-
-    private InheritingPolicyManager policyManager;
-    private ServiceSelector policyManagerSelector;
-
-    /**
-	 * Returns the URI which is used to obtain the policy for a webapp URL.
-	 * 
-	 * @param webappUrl The webapp URL.
-	 * @return A string.
-	 * @throws AccessControlException when something went wrong.
-	 */
-    protected String getPolicyURL(String webappUrl) throws AccessControlException {
-
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Resolving policy for webapp URL [" + webappUrl + "]");
-        }
-
-        Publication publication = getPublication(webappUrl);
-        DocumentBuilder builder = publication.getDocumentBuilder();
-        String url = null;
-        try {
-            if (builder.isDocument(publication, webappUrl)) {
-                Document document = builder.buildDocument(publication, webappUrl);
-                if (document.existsInAnyLanguage()) {
-                    url = "/" + document.getArea() + document.getId();
-                    if (getLogger().isDebugEnabled()) {
-                        getLogger().debug("    Document exists");
-                        getLogger().debug("    Document ID: [" + document.getId() + "]");
-                    }
-                }
+public class DocumentPolicyManagerWrapper extends AbstractLogEnabled implements InheritingPolicyManager, Serviceable, Configurable, Disposable {
+   /**
+    * Ctor.
+    */
+   public DocumentPolicyManagerWrapper() {
+   }
+   private InheritingPolicyManager policyManager;
+   private ServiceSelector policyManagerSelector;
+   /**
+    * Returns the URI which is used to obtain the policy for a webapp URL.
+    * 
+    * @param webappUrl
+    *           The webapp URL.
+    * @return A string.
+    * @throws AccessControlException
+    *            when something went wrong.
+    */
+   protected String getPolicyURL(String webappUrl) throws AccessControlException {
+      if(getLogger().isDebugEnabled()){
+         getLogger().debug("Resolving policy for webapp URL [" + webappUrl + "]");
+      }
+      Publication publication = getPublication(webappUrl);
+      DocumentBuilder builder = publication.getDocumentBuilder();
+      String url = null;
+      try{
+         if(builder.isDocument(publication, webappUrl)){
+            Document document = builder.buildDocument(publication, webappUrl);
+            if(document.existsInAnyLanguage()){
+               url = "/" + document.getArea() + document.getId();
+               if(getLogger().isDebugEnabled()){
+                  getLogger().debug("    Document exists");
+                  getLogger().debug("    Document ID: [" + document.getId() + "]");
+               }
             }
-        } catch (Exception e) {
-            throw new AccessControlException(e);
-        }
-
-        if (url == null) {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("    Document does not exist.");
+         }
+      }catch(Exception e){
+         throw new AccessControlException(e);
+      }
+      if(url == null){
+         if(getLogger().isDebugEnabled()){
+            getLogger().debug("    Document does not exist.");
+         }
+         url = webappUrl.substring(("/" + publication.getId()).length());
+      }
+      if(getLogger().isDebugEnabled()){
+         getLogger().debug("    Using URL: [" + url + "]");
+      }
+      return url;
+   }
+   /**
+    * Returns the publication for a certain URL.
+    * 
+    * @param url
+    *           The webapp url.
+    * @return A publication.
+    * @throws AccessControlException
+    *            when the publication could not be created.
+    */
+   protected Publication getPublication(String url) throws AccessControlException {
+      getLogger().debug("Building publication");
+      Publication publication;
+      Source source = null;
+      SourceResolver resolver = null;
+      try{
+         resolver = (SourceResolver) serviceManager.lookup(SourceResolver.ROLE);
+         source = resolver.resolveURI("context:///");
+         File servletContext = SourceUtil.getFile(source);
+         getLogger().debug("    Webapp URL:      [" + url + "]");
+         getLogger().debug("    Serlvet context: [" + servletContext.getAbsolutePath() + "]");
+         publication = Globals.getPublication();
+         if(null == publication){
+            throw new PublicationException("DocumentPolicyWrapper.getPublication: No Publication.");
+         }
+      }catch(Exception e){
+         throw new AccessControlException(e);
+      }finally{
+         if(resolver != null){
+            if(source != null){
+               resolver.release(source);
             }
-            url = webappUrl.substring(("/" + publication.getId()).length());
-        }
-
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("    Using URL: [" + url + "]");
-        }
-        return url;
-    }
-
-    /**
-	 * Returns the publication for a certain URL.
-	 * 
-	 * @param url The webapp url.
-	 * @return A publication.
-	 * @throws AccessControlException when the publication could not be created.
-	 */
-    protected Publication getPublication(String url) throws AccessControlException {
-        getLogger().debug("Building publication");
-
-        Publication publication;
-        Source source = null;
-        SourceResolver resolver = null;
-
-        try {
-            resolver = (SourceResolver) serviceManager.lookup(SourceResolver.ROLE);
-            source = resolver.resolveURI("context:///");
-            File servletContext = SourceUtil.getFile(source);
-            getLogger().debug("    Webapp URL:      [" + url + "]");
-            getLogger().debug("    Serlvet context: [" + servletContext.getAbsolutePath() + "]");
-            publication = PublicationFactory.getPublication(url, servletContext);
-        } catch (Exception e) {
-            throw new AccessControlException(e);
-        } finally {
-            if (resolver != null) {
-                if (source != null) {
-                    resolver.release(source);
-                }
-                serviceManager.release(resolver);
+            serviceManager.release(resolver);
+         }
+      }
+      return publication;
+   }
+   private ServiceManager serviceManager;
+   /**
+    * Returns the service manager.
+    * 
+    * @return A service manager.
+    */
+   protected ServiceManager getServiceManager() {
+      return serviceManager;
+   }
+   /**
+    * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+    */
+   public void service(ServiceManager manager) throws ServiceException {
+      this.serviceManager = manager;
+   }
+   /**
+    * @return Returns the policyManager.
+    */
+   public InheritingPolicyManager getPolicyManager() {
+      return policyManager;
+   }
+   /**
+    * @param policyManager
+    *           The policyManager to set.
+    */
+   public void setPolicyManager(InheritingPolicyManager policyManager) {
+      this.policyManager = policyManager;
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.InheritingPolicyManager#buildURLPolicy(org.apache.lenya.ac.AccreditableManager, java.lang.String)
+    */
+   public DefaultPolicy buildURLPolicy(AccreditableManager controller, String url) throws AccessControlException {
+      return getPolicyManager().buildURLPolicy(controller, getPolicyURL(url));
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.InheritingPolicyManager#buildSubtreePolicy(org.apache.lenya.ac.AccreditableManager, java.lang.String)
+    */
+   public DefaultPolicy buildSubtreePolicy(AccreditableManager controller, String url) throws AccessControlException {
+      return getPolicyManager().buildSubtreePolicy(controller, getPolicyURL(url));
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.InheritingPolicyManager#getPolicies(org.apache.lenya.ac.AccreditableManager, java.lang.String)
+    */
+   public DefaultPolicy[] getPolicies(AccreditableManager controller, String url) throws AccessControlException {
+      return getPolicyManager().getPolicies(controller, getPolicyURL(url));
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.InheritingPolicyManager#saveURLPolicy(java.lang.String, org.apache.lenya.ac.impl.DefaultPolicy)
+    */
+   public void saveURLPolicy(String url, DefaultPolicy policy) throws AccessControlException {
+      getPolicyManager().saveURLPolicy(getPolicyURL(url), policy);
+   }
+   /**
+    * @see org.apache.lenya.ac.impl.InheritingPolicyManager#saveSubtreePolicy(java.lang.String, org.apache.lenya.ac.impl.DefaultPolicy)
+    */
+   public void saveSubtreePolicy(String url, DefaultPolicy policy) throws AccessControlException {
+      getPolicyManager().saveSubtreePolicy(getPolicyURL(url), policy);
+   }
+   /**
+    * @see org.apache.lenya.ac.PolicyManager#getPolicy(org.apache.lenya.ac.AccreditableManager, java.lang.String)
+    */
+   public Policy getPolicy(AccreditableManager controller, String url) throws AccessControlException {
+      return getPolicyManager().getPolicy(controller, getPolicyURL(url));
+   }
+   /**
+    * @see org.apache.lenya.ac.PolicyManager#accreditableRemoved(org.apache.lenya.ac.AccreditableManager, org.apache.lenya.ac.Accreditable)
+    */
+   public void accreditableRemoved(AccreditableManager manager, Accreditable accreditable) throws AccessControlException {
+      getPolicyManager().accreditableRemoved(manager, accreditable);
+   }
+   String ELEMENT_POLICY_MANAGER = "policy-manager";
+   String ATTRIBUTE_TYPE = "type";
+   /**
+    * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+    */
+   public void configure(Configuration configuration) throws ConfigurationException {
+      Configuration policyManagerConfiguration = configuration.getChild(ELEMENT_POLICY_MANAGER, false);
+      if(policyManagerConfiguration != null){
+         String type = policyManagerConfiguration.getAttribute(ATTRIBUTE_TYPE);
+         try{
+            policyManagerSelector = (ServiceSelector) getServiceManager().lookup(PolicyManager.ROLE + "Selector");
+            PolicyManager policyManager = (PolicyManager) policyManagerSelector.select(type);
+            if(!(policyManager instanceof InheritingPolicyManager)){
+               throw new AccessControlException("The " + getClass().getName() + " can only be used with an " + InheritingPolicyManager.class.getName() + ".");
             }
-        }
-        return publication;
-    }
-
-    private ServiceManager serviceManager;
-
-    /**
-	 * Returns the service manager.
-	 * 
-	 * @return A service manager.
-	 */
-    protected ServiceManager getServiceManager() {
-        return serviceManager;
-    }
-
-    /**
-	 * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
-	 */
-    public void service(ServiceManager manager) throws ServiceException {
-        this.serviceManager = manager;
-    }
-
-    /**
-	 * @return Returns the policyManager.
-	 */
-    public InheritingPolicyManager getPolicyManager() {
-        return policyManager;
-    }
-
-    /**
-	 * @param policyManager The policyManager to set.
-	 */
-    public void setPolicyManager(InheritingPolicyManager policyManager) {
-        this.policyManager = policyManager;
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.impl.InheritingPolicyManager#buildURLPolicy(org.apache.lenya.ac.AccreditableManager,
-	 *      java.lang.String)
-	 */
-    public DefaultPolicy buildURLPolicy(AccreditableManager controller, String url)
-        throws AccessControlException {
-        return getPolicyManager().buildURLPolicy(controller, getPolicyURL(url));
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.impl.InheritingPolicyManager#buildSubtreePolicy(org.apache.lenya.ac.AccreditableManager,
-	 *      java.lang.String)
-	 */
-    public DefaultPolicy buildSubtreePolicy(AccreditableManager controller, String url)
-        throws AccessControlException {
-        return getPolicyManager().buildSubtreePolicy(controller, getPolicyURL(url));
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.impl.InheritingPolicyManager#getPolicies(org.apache.lenya.ac.AccreditableManager,
-	 *      java.lang.String)
-	 */
-    public DefaultPolicy[] getPolicies(AccreditableManager controller, String url)
-        throws AccessControlException {
-        return getPolicyManager().getPolicies(controller, getPolicyURL(url));
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.impl.InheritingPolicyManager#saveURLPolicy(java.lang.String,
-	 *      org.apache.lenya.ac.impl.DefaultPolicy)
-	 */
-    public void saveURLPolicy(String url, DefaultPolicy policy) throws AccessControlException {
-        getPolicyManager().saveURLPolicy(getPolicyURL(url), policy);
-
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.impl.InheritingPolicyManager#saveSubtreePolicy(java.lang.String,
-	 *      org.apache.lenya.ac.impl.DefaultPolicy)
-	 */
-    public void saveSubtreePolicy(String url, DefaultPolicy policy) throws AccessControlException {
-        getPolicyManager().saveSubtreePolicy(getPolicyURL(url), policy);
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.PolicyManager#getPolicy(org.apache.lenya.ac.AccreditableManager,
-	 *      java.lang.String)
-	 */
-    public Policy getPolicy(AccreditableManager controller, String url)
-        throws AccessControlException {
-        return getPolicyManager().getPolicy(controller, getPolicyURL(url));
-    }
-
-    /**
-	 * @see org.apache.lenya.ac.PolicyManager#accreditableRemoved(org.apache.lenya.ac.AccreditableManager,
-	 *      org.apache.lenya.ac.Accreditable)
-	 */
-    public void accreditableRemoved(AccreditableManager manager, Accreditable accreditable)
-        throws AccessControlException {
-        getPolicyManager().accreditableRemoved(manager, accreditable);
-
-    }
-
-    String ELEMENT_POLICY_MANAGER = "policy-manager";
-    String ATTRIBUTE_TYPE = "type";
-
-    /**
-	 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
-	 */
-    public void configure(Configuration configuration) throws ConfigurationException {
-        Configuration policyManagerConfiguration =
-            configuration.getChild(ELEMENT_POLICY_MANAGER, false);
-        if (policyManagerConfiguration != null) {
-            String type = policyManagerConfiguration.getAttribute(ATTRIBUTE_TYPE);
-            try {
-                policyManagerSelector =
-                    (ServiceSelector) getServiceManager().lookup(PolicyManager.ROLE + "Selector");
-
-                PolicyManager policyManager = (PolicyManager) policyManagerSelector.select(type);
-
-                if (!(policyManager instanceof InheritingPolicyManager)) {
-                    throw new AccessControlException(
-                        "The "
-                            + getClass().getName()
-                            + " can only be used with an "
-                            + InheritingPolicyManager.class.getName()
-                            + ".");
-                }
-
-                DefaultAccessController.configureOrParameterize(policyManager, policyManagerConfiguration);
-                setPolicyManager((InheritingPolicyManager) policyManager);
-            } catch (Exception e) {
-                throw new ConfigurationException(
-                    "Obtaining policy manager for type [" + type + "] failed: ",
-                    e);
-            }
-        }
-    } /**
-	   * @see org.apache.avalon.framework.activity.Disposable#dispose()
-	   */
-    public void dispose() {
-        if (policyManagerSelector != null) {
-            if (getPolicyManager() != null) {
-                policyManagerSelector.release(getPolicyManager());
-            }
-            getServiceManager().release(policyManagerSelector);
-        }
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Disposing [" + this +"]");
-        }
-
-    }
-
-    /**
-     * @see org.apache.lenya.ac.PolicyManager#accreditableAdded(org.apache.lenya.ac.AccreditableManager, org.apache.lenya.ac.Accreditable)
-     */
-    public void accreditableAdded(AccreditableManager manager, Accreditable accreditable) throws AccessControlException {
-        getPolicyManager().accreditableAdded(manager, accreditable);
-    }
-
+            DefaultAccessController.configureOrParameterize(policyManager, policyManagerConfiguration);
+            setPolicyManager((InheritingPolicyManager) policyManager);
+         }catch(Exception e){
+            throw new ConfigurationException("Obtaining policy manager for type [" + type + "] failed: ", e);
+         }
+      }
+   }
+   /**
+    * @see org.apache.avalon.framework.activity.Disposable#dispose()
+    */
+   public void dispose() {
+      if(policyManagerSelector != null){
+         if(getPolicyManager() != null){
+            policyManagerSelector.release(getPolicyManager());
+         }
+         getServiceManager().release(policyManagerSelector);
+      }
+      if(getLogger().isDebugEnabled()){
+         getLogger().debug("Disposing [" + this + "]");
+      }
+   }
+   /**
+    * @see org.apache.lenya.ac.PolicyManager#accreditableAdded(org.apache.lenya.ac.AccreditableManager, org.apache.lenya.ac.Accreditable)
+    */
+   public void accreditableAdded(AccreditableManager manager, Accreditable accreditable) throws AccessControlException {
+      getPolicyManager().accreditableAdded(manager, accreditable);
+   }
 }



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