Author: solprovider
Date: Fri Jan 25 00:04:53 2008
New Revision: 615137
URL: http://svn.apache.org/viewvc?rev=615137&view=rev
Log:
New Modules code. Not activated.
Added:
lenya/branches/revolution/1.3.x/13Eclipse.txt
lenya/branches/revolution/1.3.x/13ModuleXML.txt
lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Modules.java
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/page2xhtml.xsl
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/text/
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/text/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/module.xml
Modified:
lenya/branches/revolution/1.3.x/13ABOUT.txt
lenya/branches/revolution/1.3.x/13ModuleFiles.txt
lenya/branches/revolution/1.3.x/13TODO.txt
lenya/branches/revolution/1.3.x/13UPGRADE.txt
lenya/branches/revolution/1.3.x/build.properties
lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
lenya/branches/revolution/1.3.x/src/targets/properties-build.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xml
lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/form2xhtml.xsl
Modified: lenya/branches/revolution/1.3.x/13ABOUT.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13ABOUT.txt?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13ABOUT.txt (original)
+++ lenya/branches/revolution/1.3.x/13ABOUT.txt Fri Jan 25 00:04:53 2008
@@ -15,7 +15,9 @@
=== Versions
1.3.0.x
Fully compatible with Lenya 1.2.2, 1.2.3, and 1.2.4 Publications.
-Uses Java 1.4. Upgrade should only require changing Lenya (and maybe Cocoon.)
+Uses Java 1.4.
+Upgrade should only require changing Lenya and Cocoon.
+Cocoon should be upgraded to Cocoon-2.1.11 to include bug fix for http status codes.
Includes "flat" module to upgrade 1.2 Publications to 1.3's flat storage.
1.3.1+ (Exact features to be determined before release.)
Added: lenya/branches/revolution/1.3.x/13Eclipse.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13Eclipse.txt?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/13Eclipse.txt (added)
+++ lenya/branches/revolution/1.3.x/13Eclipse.txt Fri Jan 25 00:04:53 2008
@@ -0,0 +1,49 @@
+Download latest Eclipse 3.2
+
+Install Subclipse
+File - New - Project - SVN/Checkout Projects From SVN - Next
+
+Create a new repository location:
+http://svn.apache.org/repos/asf/lenya/branches/revolution/1.3.x
+(Committers should use https:.)
+Next
+Click top choice matching the reposityory string.
+Next
+Finish
+(New Project Wizard)
+Java/Java Project - Next
+Project name: Lenya13x
+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
+
+
+Add lib Libraries to build path.
+Add tools/jetty/lib/servlet-2.3.jar to build path
+
+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.
+
+Repeat for Cocoon:
+http://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X
+Project name: Cocoon21x
+
+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
+
+Copy Lenya13x/src/cocoon/
+ local.blocks.properties
+ local.build.properties
+To Cocoon21x/
+
+Run Cocoon21x/build.bat
+
+Open Lenya13x/build.properties
+Verify cocoon.src.dir.
+Run Lenya13x/build.bat
Modified: lenya/branches/revolution/1.3.x/13ModuleFiles.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13ModuleFiles.txt?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13ModuleFiles.txt (original)
+++ lenya/branches/revolution/1.3.x/13ModuleFiles.txt Fri Jan 25 00:04:53 2008
@@ -7,17 +7,17 @@
=== Specific Module Files ===
-navigation.xmap - Overrides Navigation Module.
+navigation.xmap - Overrides Navigation Module (used for hierarchical content.)
navigation.xsl - Overrides XSL in Navigation Module.
-nav.xmap - Overrides Nav Module.
+nav.xmap - Overrides Nav Module (used for flat content.)
nav.xsl - Overrides XSL in Nav Module.
edit.xmap - For additional fields in Edit Module. (Still in development)
=== Common Naming Standards ===
-code.js - JavaScript Flow functions.
+code.js - JavaScript Flow functions. Modules descending from a module that contains a code.js file should either copy the ancestor's code.js file or use a different name such as "code1.js" with the number indicating the depth of inheritance.
page2xhtml.xsl - Transforms aggregated DIVs to HTML.
Added: lenya/branches/revolution/1.3.x/13ModuleXML.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13ModuleXML.txt?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/13ModuleXML.txt (added)
+++ lenya/branches/revolution/1.3.x/13ModuleXML.txt Fri Jan 25 00:04:53 2008
@@ -0,0 +1,23 @@
+<module
+ id="moduleId"
+ name="EnglishName" rem="id and name default to directory name"
+ internal="true|false"
+ minimum="1.3" rem="Filter to not use below certain version of Lenya."
+ maximum="" rem="Filter to not use above certain version of Lenya."
+ created="1.3" rem="Unused. Comment."
+ content="hierarchical|flat|all" <!-- Filter for content type if multiple modules with same id. Default=all"
+ modified="1.3" rem="Filter for latest if multiple modules with same id and content type."
+ resource="/xml/xhtml" rem="Empty for non-resource modules. / for top-level resources: xml, file, link. /xml or /xml/xhtml for most custom resources. All modules on resource path are automatically inherited and required. Current id is not needed but is obviously needed in resource type."
+>
+ <inherit priority="1" publication="parentPublicationId" id="parentId"/>
+ <inherit priority="2" publication="parentPublicationId2" id="parentId2"/>
+ <required id="parentModuleId">Note why</required> <!-- All required modules will be loaded. Modules on resource path should not specified. -->
+ <required id="parentModuleId2"/>
+ <recommended id="recommendedModuleId">Suggestion to publication configurators.</recommended> <!-- Modules not required but increase functionality. -->
+ <optional id="otherModuleID">Explanation for other developers about when other module may be used.</optional> <!-- Any modules not listed in another category that may be used by this module. -->
+ <parameter name="parametername">parametervalue</parameter>
+ <description>Short description of the module. This is an element to allow XHTML in future.</description>
+ <usage>
+ XHTML help documentation
+ </usage>
+</module>
\ No newline at end of file
Modified: lenya/branches/revolution/1.3.x/13TODO.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13TODO.txt?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13TODO.txt (original)
+++ lenya/branches/revolution/1.3.x/13TODO.txt Fri Jan 25 00:04:53 2008
@@ -1,3 +1,6 @@
+Fix Publication Module loading and inheritance. Each Publication should build structure once per restart. See Modules.java below.
+Add reloadModules to publication.
+
Administration navigation - Create Resource, return from edit resource.
Add "Choose Lenya doc link" dialog to Xinha.
Add "Create file resource" to Xinha.
@@ -5,10 +8,10 @@
Link rewriting (CreateRevisionTransformer and HTMLSeriralizer)
Structure editor.
-CreateRevisionTransformer: Set creator and when properly.
-Dialog1 - Dialog6 fields added to new revisions. From Xinha?
Xinha adds xmlns:xhtml="http://www.w3.org/1999/xhtml to some elements (P H1).
+FIXED?: CreateRevisionTransformer: Set creator and when properly.
+FIXED 20080120: Xinha adds extra fields. Dialog1 - Dialog6 fields added to new revisions.
==== ToDo List from 2006
=== 1.2.x Conversion
@@ -26,7 +29,7 @@
=== CreateRevisionTransformer
-Create new Resource if none specified or does not exist. Allow a Title parameter, and default to "NEW" + datetime.
+Create new Resource if none specified or does not exist. Allow a Title parameter, and default to "NEW " + datetime.
TEST If request has file upload, save uploaded file with newrevision.
Save upload Part. Do not depend on field name.
@@ -201,3 +204,7 @@
Match identical indexconfs, same filters. ?superset include unless different value for same name. Could cause issues if poor code copies extra attributes.
+=== 1.3.1
+build/lenya directory should be self-contained runnable.
+Separate Cocoon building from Lenya build process so Cocoon download and build is optional.
+Correct ant target files. (Eclipse dislikes undeclared dependencies.)
\ No newline at end of file
Modified: lenya/branches/revolution/1.3.x/13UPGRADE.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/13UPGRADE.txt?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/13UPGRADE.txt (original)
+++ lenya/branches/revolution/1.3.x/13UPGRADE.txt Fri Jan 25 00:04:53 2008
@@ -1,10 +1,14 @@
How to Upgrade to Lenya 1.3
-You must have a Lenya1.2 Publication. Lenya1.3 knows nothing about Lenya1.4/2.0. Until Lenya1.3 can edit documents in the flat datastore, you must use Lenya1.2's edit capabilities with Lenya1.2's hierarchical content.
+Lenya 1.3 is usable as an intial install or an upgrade from Lenya 1.2. Lenya 1.3 knows nothing about Lenya 1.4 or 2.0 so upgrading publications from those releases may be difficult.
First, install Lenya1.3. Follow the instructions from the Release Notes for Lenya1.2, except download the code from Lenya1.3's SVN.
-=== Converting Publications
+NOTE: If you encounter any errors running Lenya 1.3, check for duplicate libraries in directory:
+ build/lenya/webapp/WEB-INF/lib
+Keep the latest version of each duplicate.
+
+=== Converting Publications from Lenya 1.2
The only required conversion is to change XSL references in page2xhtml.xsl and similar files:
CHANGE:
select="xhtml:div[@id = 'body']"
@@ -42,7 +46,9 @@
</map:transform
-=== Converting Usecases to Modules
+=== Converting Lenya 1.2 Usecases to Lenya 1.3 Modules
+This is optional. Lenya 1.3 understands Lenya 1.2 Usecases. Once the Modules are created, Lenya1.3 will automatically use them, even when the request uses the "?lenya.usecase=" format.
+
In your {pub} directory, create a directory names "modules".
In the {pub}/modules directory, create one directory for each Usecase. The Usecase directories should have the name from the Usecase XMAPs. So if you have {pub}/usecase-search.xmap, create a directory {pub}/modules/search.
@@ -52,16 +58,15 @@
RENAME the copied files (in {pub}/modules/{moduleID} to "module.xmap".
Open each of those files and fix the filepaths. No changes are necessary for "cocoon:", "fallback:" and "http:", but every "file:" src parameter must be fixed, including entries without a protocol. For now, just add "module:///../../" to the beginning of each src parameter.
-EXAMPLE:
+EXAMPLES:
src="xxx"
-src="file:/xxx
-BECOMES:
+src="file:/xxx"
+BECOME:
src="module:///../../xxx"
When accessing the content directory, use the content: protocol.
-Once the Modules are created, Lenya1.3 will automatically use them, even when the request uses the "?lenya.usecase=" format.
-
+--
If you may revert the Publication to Lenya1.2, make the following changes. Otherwise, delete all the {pub}/usecase-{usecaseID}.xmap files.
MODIFY FILES: {pub}/usecase-{usecaseID}.xmap
Modified: lenya/branches/revolution/1.3.x/build.properties
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/build.properties?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/build.properties (original)
+++ lenya/branches/revolution/1.3.x/build.properties Fri Jan 25 00:04:53 2008
@@ -21,13 +21,13 @@
# NOTE for Devs: Update this number if this file is being updated.
# Also update the version number within src/targets/properties-build.xml
-build.properties.version=157866
+build.properties.version=157867
#------------------------------------------------------------------------------------
# The root of the Cocoon source tree
-cocoon.src.dir=../cocoon-2.1.10
+cocoon.src.dir=../cocoon-2.1.11
#cocoon.src.dir=../cocoon/branches/BRANCH_2_1_X
#------------------------------------------------------------------------------------
Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/AbstractPublication.java Fri Jan 25 00:04:53 2008
@@ -16,7 +16,6 @@
*/
/* $Id$ */
package org.apache.lenya.cms.publication;
-
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -30,511 +29,595 @@
import org.apache.lenya.cms.content.hierarchical.HierarchicalContent;
import org.apache.lenya.cms.publishing.PublishingEnvironment;
import org.apache.log4j.Logger;
-
// Lenya1.3 - END
/**
* A publication.
*/
public abstract class AbstractPublication implements Publication {
- private static Logger log = Logger.getLogger(AbstractPublication.class);
- private static final String[] areas = {AUTHORING_AREA, STAGING_AREA, LIVE_AREA, ADMIN_AREA, ARCHIVE_AREA, TRASH_AREA, INFO_AREA_PREFIX + AUTHORING_AREA, INFO_AREA_PREFIX + STAGING_AREA, INFO_AREA_PREFIX + LIVE_AREA, INFO_AREA_PREFIX + ARCHIVE_AREA, INFO_AREA_PREFIX + TRASH_AREA };
- private String id;
- private PublishingEnvironment environment;
- private File servletContext;
- private DocumentIdToPathMapper mapper = null;
- private ArrayList languages = new ArrayList();
- private String defaultLanguage = null;
- private String breadcrumbprefix = null;
- private String sslprefix = null;
- private String livemountpoint = null;
- private HashMap siteTrees = new HashMap();
- private String[] rewriteAttributeXPaths = {};
- private boolean hasSitetree = true;
- private static final String ELEMENT_PROXY = "proxy";
- private static final String ATTRIBUTE_AREA = "area";
- private static final String ATTRIBUTE_URL = "url";
- private static final String ATTRIBUTE_SSL = "ssl";
- private static final String ELEMENT_REWRITE_ATTRIBUTE = "link-attribute";
- private static final String ATTRIBUTE_XPATH = "xpath";
- private static final String ELEMENT_CONTENT_DIR = "content-dir";
- // Lenya1.3 - BEGIN
- private Modules modules;
- private Content content;
- private File publicationDirectory;
- private File contentDirectory;
- private String contentType = "hierarchical";
- // Lenya1.3 - END
- /**
- * Creates a new instance of Publication
- * @param id the publication id
- * @param servletContextPath the servlet context of this publication
- * @throws PublicationException if there was a problem reading the config file
- */
- protected AbstractPublication(String id, String servletContextPath) throws PublicationException {
- // assert id != null;
- this.id = id;
- // assert servletContextPath != null;
- File servletContext = new File(servletContextPath);
- // assert servletContext.exists();
- this.servletContext = servletContext;
- // FIXME: remove PublishingEnvironment from publication
- environment = new PublishingEnvironment(servletContextPath, id);
- File configFile = new File(getDirectory(), CONFIGURATION_FILE);
- DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
- Configuration config;
- String pathMapperClassName = null;
- String documentBuilderClassName = null;
- try{
- config = builder.buildFromFile(configFile);
- try{
- pathMapperClassName = config.getChild(ELEMENT_PATH_MAPPER).getValue();
- Class pathMapperClass = Class.forName(pathMapperClassName);
- this.mapper = (DocumentIdToPathMapper) pathMapperClass.newInstance();
- }catch(ClassNotFoundException e){
- throw new PublicationException("Cannot instantiate documentToPathMapper: [" + pathMapperClassName + "]", e);
- }
- try{
- Configuration documentBuilderConfiguration = config.getChild(ELEMENT_DOCUMENT_BUILDER, false);
- if(documentBuilderConfiguration != null){
- documentBuilderClassName = documentBuilderConfiguration.getValue();
- Class documentBuilderClass = Class.forName(documentBuilderClassName);
- this.documentBuilder = (DocumentBuilder) documentBuilderClass.newInstance();
- }
- }catch(ClassNotFoundException e){
- throw new PublicationException("Cannot instantiate document builder: [" + pathMapperClassName + "]", e);
- }
- Configuration[] languages = config.getChild(LANGUAGES).getChildren();
- for(int i = 0; i < languages.length; i++){
- Configuration languageConfig = languages[i];
- String language = languageConfig.getValue();
- this.languages.add(language);
- if(languageConfig.getAttribute(DEFAULT_LANGUAGE_ATTR, null) != null){
- defaultLanguage = language;
- }
- }
- Configuration siteStructureConfiguration = config.getChild(ELEMENT_SITE_STRUCTURE, false);
- if(siteStructureConfiguration != null){
- String siteStructureType = siteStructureConfiguration.getAttribute(ATTRIBUTE_TYPE);
- if(!siteStructureType.equals("sitetree")){
- hasSitetree = false;
- }
- }
- Configuration[] proxyConfigs = config.getChildren(ELEMENT_PROXY);
- for(int i = 0; i < proxyConfigs.length; i++){
- String url = proxyConfigs[i].getAttribute(ATTRIBUTE_URL);
- String ssl = proxyConfigs[i].getAttribute(ATTRIBUTE_SSL);
- String area = proxyConfigs[i].getAttribute(ATTRIBUTE_AREA);
- Proxy proxy = new Proxy();
- proxy.setUrl(url);
- Object key = getProxyKey(area, Boolean.valueOf(ssl).booleanValue());
- this.areaSsl2proxy.put(key, proxy);
- if(log.isDebugEnabled()){
- log.debug("Adding proxy: [" + proxy + "] for area=[" + area + "] SSL=[" + ssl + "]");
- }
- }
- Configuration[] rewriteAttributeConfigs = config.getChildren(ELEMENT_REWRITE_ATTRIBUTE);
- List xPaths = new ArrayList();
- for(int i = 0; i < rewriteAttributeConfigs.length; i++){
- String xPath = rewriteAttributeConfigs[i].getAttribute(ATTRIBUTE_XPATH);
- xPaths.add(xPath);
- }
- this.rewriteAttributeXPaths = (String[]) xPaths.toArray(new String[xPaths.size()]);
- Configuration[] contentDirConfigs = config.getChildren(ELEMENT_CONTENT_DIR);
- for(int i = 0; i < contentDirConfigs.length; i++){
- String area = contentDirConfigs[i].getAttribute(ATTRIBUTE_AREA);
- String dir = contentDirConfigs[i].getValue();
- Object key = getContentDirKey(area);
- this.areaContentDir.put(key, dir);
- }
- // Lenya1.3 - BEGIN
- // Content
- Configuration contentConfig = config.getChild("content");
- contentType = contentConfig.getAttribute("type", "hierarchical");
- String contentConfigValue = contentConfig.getValue(CONTENT_PATH);
- publicationDirectory = new File(getServletContext(), PUBLICATION_PREFIX + File.separator + getId());
- contentDirectory = new File(publicationDirectory, contentConfigValue);
- if(contentType.equalsIgnoreCase("flat")){
- content = (Content) new FlatContent(contentDirectory, getLanguages());
+ private static Logger log = Logger.getLogger(AbstractPublication.class);
+ private static final String[] areas = {AUTHORING_AREA, STAGING_AREA, LIVE_AREA, ADMIN_AREA, ARCHIVE_AREA, TRASH_AREA, INFO_AREA_PREFIX + AUTHORING_AREA, INFO_AREA_PREFIX + STAGING_AREA, INFO_AREA_PREFIX + LIVE_AREA, INFO_AREA_PREFIX + ARCHIVE_AREA, INFO_AREA_PREFIX + TRASH_AREA};
+ private String id;
+ private PublishingEnvironment environment;
+ private File servletContext;
+ private DocumentIdToPathMapper mapper = null;
+ private ArrayList languages = new ArrayList();
+ private String defaultLanguage = null;
+ private String breadcrumbprefix = null;
+ private String sslprefix = null;
+ private String livemountpoint = null;
+ private HashMap siteTrees = new HashMap();
+ private String[] rewriteAttributeXPaths = {};
+ private boolean hasSitetree = true;
+ private static final String ELEMENT_PROXY = "proxy";
+ private static final String ATTRIBUTE_AREA = "area";
+ private static final String ATTRIBUTE_URL = "url";
+ private static final String ATTRIBUTE_SSL = "ssl";
+ private static final String ELEMENT_REWRITE_ATTRIBUTE = "link-attribute";
+ private static final String ATTRIBUTE_XPATH = "xpath";
+ private static final String ELEMENT_CONTENT_DIR = "content-dir";
+ // Lenya1.3 - BEGIN
+ private Modules modules;
+ private Content content;
+ private File publicationDirectory;
+ private File contentDirectory;
+ private String contentType = "hierarchical";
+ // Lenya1.3 - END
+ /**
+ * Creates a new instance of Publication
+ *
+ * @param id
+ * the publication id
+ * @param servletContextPath
+ * the servlet context of this publication
+ * @throws PublicationException
+ * if there was a problem reading the config file
+ */
+ protected AbstractPublication(String id, String servletContextPath) throws PublicationException {
+ // assert id != null;
+ this.id = id;
+ // assert servletContextPath != null;
+ // System.out.println("Publication ServletContextPath=" +
+ // servletContextPath);
+ File servletContext = new File(servletContextPath);
+ // assert servletContext.exists();
+ this.servletContext = servletContext;
+ // FIXME: remove PublishingEnvironment from publication
+ environment = new PublishingEnvironment(servletContextPath, id);
+ File configFile = new File(getDirectory(), CONFIGURATION_FILE);
+ DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
+ Configuration config;
+ String pathMapperClassName = null;
+ String documentBuilderClassName = null;
+ try{
+ config = builder.buildFromFile(configFile);
+ try{
+ pathMapperClassName = config.getChild(ELEMENT_PATH_MAPPER).getValue();
+ Class pathMapperClass = Class.forName(pathMapperClassName);
+ this.mapper = (DocumentIdToPathMapper) pathMapperClass.newInstance();
+ }catch(ClassNotFoundException e){
+ throw new PublicationException("Cannot instantiate documentToPathMapper: [" + pathMapperClassName + "]", e);
+ }
+ try{
+ Configuration documentBuilderConfiguration = config.getChild(ELEMENT_DOCUMENT_BUILDER, false);
+ if(documentBuilderConfiguration != null){
+ documentBuilderClassName = documentBuilderConfiguration.getValue();
+ Class documentBuilderClass = Class.forName(documentBuilderClassName);
+ this.documentBuilder = (DocumentBuilder) documentBuilderClass.newInstance();
+ }
+ }catch(ClassNotFoundException e){
+ throw new PublicationException("Cannot instantiate document builder: [" + pathMapperClassName + "]", e);
+ }
+ Configuration[] languages = config.getChild(LANGUAGES).getChildren();
+ for(int i = 0; i < languages.length; i++){
+ Configuration languageConfig = languages[i];
+ String language = languageConfig.getValue();
+ this.languages.add(language);
+ if(languageConfig.getAttribute(DEFAULT_LANGUAGE_ATTR, null) != null){
+ defaultLanguage = language;
+ }
+ }
+ Configuration siteStructureConfiguration = config.getChild(ELEMENT_SITE_STRUCTURE, false);
+ if(siteStructureConfiguration != null){
+ String siteStructureType = siteStructureConfiguration.getAttribute(ATTRIBUTE_TYPE);
+ if(!siteStructureType.equals("sitetree")){
+ hasSitetree = false;
+ }
+ }
+ Configuration[] proxyConfigs = config.getChildren(ELEMENT_PROXY);
+ for(int i = 0; i < proxyConfigs.length; i++){
+ String url = proxyConfigs[i].getAttribute(ATTRIBUTE_URL);
+ String ssl = proxyConfigs[i].getAttribute(ATTRIBUTE_SSL);
+ String area = proxyConfigs[i].getAttribute(ATTRIBUTE_AREA);
+ Proxy proxy = new Proxy();
+ proxy.setUrl(url);
+ Object key = getProxyKey(area, Boolean.valueOf(ssl).booleanValue());
+ this.areaSsl2proxy.put(key, proxy);
+ if(log.isDebugEnabled()){
+ log.debug("Adding proxy: [" + proxy + "] for area=[" + area + "] SSL=[" + ssl + "]");
+ }
+ }
+ Configuration[] rewriteAttributeConfigs = config.getChildren(ELEMENT_REWRITE_ATTRIBUTE);
+ List xPaths = new ArrayList();
+ for(int i = 0; i < rewriteAttributeConfigs.length; i++){
+ String xPath = rewriteAttributeConfigs[i].getAttribute(ATTRIBUTE_XPATH);
+ xPaths.add(xPath);
+ }
+ this.rewriteAttributeXPaths = (String[]) xPaths.toArray(new String[xPaths.size()]);
+ Configuration[] contentDirConfigs = config.getChildren(ELEMENT_CONTENT_DIR);
+ for(int i = 0; i < contentDirConfigs.length; i++){
+ String area = contentDirConfigs[i].getAttribute(ATTRIBUTE_AREA);
+ String dir = contentDirConfigs[i].getValue();
+ Object key = getContentDirKey(area);
+ this.areaContentDir.put(key, dir);
+ }
+ // Lenya1.3 - BEGIN
+ // Content
+ Configuration contentConfig = config.getChild("content");
+ contentType = contentConfig.getAttribute("type", "hierarchical");
+ String contentConfigValue = contentConfig.getValue(CONTENT_PATH);
+ publicationDirectory = new File(getServletContext(), PUBLICATION_PREFIX + File.separator + getId());
+ contentDirectory = new File(publicationDirectory, contentConfigValue);
+ if(contentType.equalsIgnoreCase("flat")){
+ content = (Content) new FlatContent(contentDirectory, getLanguages());
+ }else{
+ content = (Content) new HierarchicalContent(contentDirectory, getLanguages());
+ }
+ // Modules
+ modules = new Modules(id, servletContextPath, config.getChild("modules"));
+ // Lenya1.3 - END
+ }catch(PublicationException e){
+ throw e;
+ }catch(Exception e){
+ log.error(e);
+ throw new PublicationException("Problem with config file: " + configFile.getAbsolutePath(), e);
+ }
+ breadcrumbprefix = config.getChild(BREADCRUMB_PREFIX).getValue("");
+ sslprefix = config.getChild(SSL_PREFIX).getValue("");
+ livemountpoint = config.getChild(LIVE_MOUNT_POINT).getValue("");
+ }
+ // Lenya1.3 - BEGIN
+ public Modules getModules() {
+ return modules;
+ }
+ public Content getContent() {
+ return content;
+ }
+ public File getContentDirectory() {
+ return contentDirectory;
+ }
+ public String getContentType() {
+ return contentType;
+ }
+ // Lenya1.3 - END
+ /**
+ * Returns the publication ID.
+ *
+ * @return A string value.
+ */
+ public String getId() {
+ return id;
+ }
+ /**
+ * Returns the publishing environment of this publication.
+ *
+ * @return A {@link PublishingEnvironment}object.
+ * @deprecated It is planned to decouple the environments from the
+ * publication.
+ */
+ public PublishingEnvironment getEnvironment() {
+ return environment;
+ }
+ /**
+ * Returns the servlet context this publication belongs to (usually, the
+ * <code>webapps/lenya</code> directory).
+ *
+ * @return A <code>File</code> object.
+ */
+ public File getServletContext() {
+ return servletContext;
+ }
+ // Lenya1.3 BEGIN - changed
+ /**
+ * Returns the publication directory.
+ *
+ * @return A <code>File</code> object.
+ */
+ public File getDirectory() {
+ if(null == publicationDirectory)
+ publicationDirectory = new File(getServletContext(), PUBLICATION_PREFIX + File.separator + getId());
+ return publicationDirectory;
+ }
+ // Lenya1.3 - deprecated
+ /**
+ * Return the directory of a specific area.
+ *
+ * @param area
+ * a <code>File</code> representing the root of the area content
+ * directory.
+ * @return the directory of the given content area.
+ * @deprecated Areas are bad. Do not use them.
+ */
+ // Lenya1.3 END
+ public File getContentDirectory(String area) {
+ Object key = getContentDirKey(area);
+ String contentDir = (String) this.areaContentDir.get(key);
+ if(contentDir != null){
+ return new File(contentDir);
+ }else{
+ return new File(getDirectory(), CONTENT_PATH + File.separator + area);
+ }
+ }
+ /**
+ * DOCUMENT ME!
+ *
+ * @param mapper
+ * DOCUMENT ME!
+ */
+ public void setPathMapper(DefaultDocumentIdToPathMapper mapper) {
+ // assert mapper != null;
+ this.mapper = mapper;
+ }
+ /**
+ * Returns the path mapper.
+ *
+ * @return a <code>DocumentIdToPathMapper</code>
+ */
+ public DocumentIdToPathMapper getPathMapper() {
+ return mapper;
+ }
+ /**
+ * Returns if a given string is a valid area name.
+ *
+ * @param area
+ * The area string to test.
+ * @return A boolean value.
+ */
+ public static boolean isValidArea(String area) {
+ return area != null && Arrays.asList(areas).contains(area);
+ }
+ /**
+ * Get the default language
+ *
+ * @return the default language
+ */
+ public String getDefaultLanguage() {
+ return defaultLanguage;
+ }
+ /**
+ * Set the default language
+ *
+ * @param language
+ * the default language
+ */
+ public void setDefaultLanguage(String language) {
+ defaultLanguage = language;
+ }
+ /**
+ * Get all available languages for this publication
+ *
+ * @return an <code>Array</code> of languages
+ */
+ public String[] getLanguages() {
+ return (String[]) languages.toArray(new String[languages.size()]);
+ }
+ /**
+ * Get the breadcrumb prefix. It can be used as a prefix if a publication is
+ * part of a larger site
+ *
+ * @return the breadcrumb prefix
+ */
+ public String getBreadcrumbPrefix() {
+ return breadcrumbprefix;
+ }
+ /**
+ * Get the SSL prefix. If you want to serve SSL-protected pages through a
+ * special site, use this prefix. This can come in handy if you have multiple
+ * sites that need SSL protection and you want to share one SSL certificate.
+ *
+ * @return the SSL prefix
+ */
+ public String getSSLPrefix() {
+ return sslprefix;
+ }
+ /**
+ * Get the Live mount point. The live mount point is used to rewrite links
+ * that are of the form /contextprefix/publication/area/documentid to
+ * /livemountpoint/documentid This is useful if you serve your live area
+ * through mod_proxy. to enable this functionality, set the Live mount point
+ * to / or something else. An empty mount point disables the feature.
+ *
+ * @return the Live mount point
+ */
+ public String getLiveMountPoint() {
+ return livemountpoint;
+ }
+ /**
+ * Get the sitetree for a specific area of this publication. Sitetrees are
+ * created on demand and are cached.
+ *
+ * @param area
+ * the area
+ * @return the sitetree for the specified area
+ * @throws SiteTreeException
+ * if an error occurs
+ */
+ public SiteTree getTree(String area) throws SiteTreeException {
+ SiteTree sitetree = null;
+ if(hasSitetree){
+ if(siteTrees.containsKey(area)){
+ sitetree = (SiteTree) siteTrees.get(area);
+ }else{
+ sitetree = new DefaultSiteTree(getDirectory(), area);
+ siteTrees.put(area, sitetree);
+ }
+ }
+ return sitetree;
+ }
+ /**
+ * Get the sitetree for a specific area of this publication. Sitetrees are
+ * created on demand and are cached.
+ *
+ * @deprecated Please use getTree() because this method returns the interface
+ * and not a specific implementation
+ * @see getTree()
+ * @param area
+ * the area
+ * @return the sitetree for the specified area
+ * @throws SiteTreeException
+ * if an error occurs
+ */
+ public DefaultSiteTree getSiteTree(String area) throws SiteTreeException {
+ DefaultSiteTree sitetree = null;
+ if(hasSitetree){
+ if(siteTrees.containsKey(area)){
+ sitetree = (DefaultSiteTree) siteTrees.get(area);
+ }else{
+ sitetree = new DefaultSiteTree(getDirectory(), area);
+ siteTrees.put(area, sitetree);
+ }
+ }
+ return sitetree;
+ }
+ private DocumentBuilder documentBuilder;
+ /**
+ * Returns the document builder of this instance.
+ *
+ * @return A document builder.
+ */
+ public DocumentBuilder getDocumentBuilder() {
+ if(documentBuilder == null){
+ throw new IllegalStateException("The document builder was not defined in publication.xconf!");
+ }
+ return documentBuilder;
+ }
+ /**
+ * Creates a version of the document object in another area.
+ *
+ * @param document
+ * The document to clone.
+ * @param area
+ * The destination area.
+ * @return A document.
+ * @throws PublicationException
+ * when an error occurs.
+ */
+ public Document getAreaVersion(Document document, String area) throws PublicationException {
+ DocumentBuilder builder = getDocumentBuilder();
+ String url = builder.buildCanonicalUrl(this, area, document.getId(), document.getLanguage());
+ Document destinationDocument = builder.buildDocument(this, url);
+ return destinationDocument;
+ }
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object object) {
+ boolean equals = false;
+ if(getClass().isInstance(object)){
+ Publication publication = (Publication) object;
+ equals = getId().equals(publication.getId()) && getServletContext().equals(publication.getServletContext());
+ }
+ return equals;
+ }
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ String key = getServletContext() + ":" + getId();
+ return key.hashCode();
+ }
+ /**
+ * Template method to copy a document. Override
+ * {@link #copyDocumentSource(Document, Document)} to implement access to a
+ * custom repository.
+ *
+ * @see org.apache.lenya.cms.publication.Publication#copyDocument(org.apache.lenya.cms.publication.Document,
+ * org.apache.lenya.cms.publication.Document)
+ */
+ public void copyDocument(Document sourceDocument, Document destinationDocument) throws PublicationException {
+ copyDocumentSource(sourceDocument, destinationDocument);
+ copySiteStructure(sourceDocument, destinationDocument);
+ }
+ /**
+ * Copies a document in the site structure.
+ *
+ * @param sourceDocument
+ * The source document.
+ * @param destinationDocument
+ * The destination document.
+ * @throws PublicationException
+ * when something went wrong.
+ */
+ protected void copySiteStructure(Document sourceDocument, Document destinationDocument) throws PublicationException {
+ if(hasSitetree){
+ try{
+ SiteTree sourceTree = getSiteTree(sourceDocument.getArea());
+ SiteTree destinationTree = getSiteTree(destinationDocument.getArea());
+ SiteTreeNode sourceNode = sourceTree.getNode(sourceDocument.getId());
+ if(sourceNode == null){
+ throw new PublicationException("The node for source document [" + sourceDocument.getId() + "] doesn't exist!");
+ }
+ SiteTreeNode[] siblings = sourceNode.getNextSiblings();
+ String parentId = sourceNode.getAbsoluteParentId();
+ SiteTreeNode sibling = null;
+ String siblingDocId = null;
+ // same document ID -> insert at the same position
+ if(sourceDocument.getId().equals(destinationDocument.getId())){
+ for(int i = 0; i < siblings.length; i++){
+ String docId = parentId + "/" + siblings[i].getId();
+ sibling = destinationTree.getNode(docId);
+ if(sibling != null){
+ siblingDocId = docId;
+ break;
+ }
+ }
+ }
+ Label label = sourceNode.getLabel(sourceDocument.getLanguage());
+ if(label == null){
+ // the node that we're trying to publish
+ // doesn't have this language
+ throw new PublicationException("The node " + sourceDocument.getId() + " doesn't contain a label for language " + sourceDocument.getLanguage());
+ }
+ SiteTreeNode destinationNode = destinationTree.getNode(destinationDocument.getId());
+ if(destinationNode == null){
+ Label[] labels = {label};
+ if(siblingDocId == null){
+ destinationTree.addNode(destinationDocument.getId(), labels, sourceNode.visibleInNav(), sourceNode.getHref(), sourceNode.getSuffix(), sourceNode.hasLink());
+ }else{
+ destinationTree.addNode(destinationDocument.getId(), labels, sourceNode.visibleInNav(), sourceNode.getHref(), sourceNode.getSuffix(), sourceNode.hasLink(), siblingDocId);
+ }
}else{
- content = (Content) new HierarchicalContent(contentDirectory, getLanguages());
- }
- // Modules
- modules = new Modules(id, servletContextPath, config.getChild("modules"));
- // Lenya1.3 - END
- }catch(PublicationException e){
- throw e;
- }catch(Exception e){
- log.error(e);
- throw new PublicationException("Problem with config file: " + configFile.getAbsolutePath(), e);
- }
- breadcrumbprefix = config.getChild(BREADCRUMB_PREFIX).getValue("");
- sslprefix = config.getChild(SSL_PREFIX).getValue("");
- livemountpoint = config.getChild(LIVE_MOUNT_POINT).getValue("");
- }
- // Lenya1.3 - BEGIN
- public Modules getModules() {
- return modules;
- }
- public Content getContent() {
- return content;
- }
- public File getContentDirectory() {
- return contentDirectory;
- }
- public String getContentType() {
- return contentType;
- }
- // Lenya1.3 - END
- /**
- * Returns the publication ID.
- * @return A string value.
- */
- public String getId() {
- return id;
- }
- /**
- * Returns the publishing environment of this publication.
- * @return A {@link PublishingEnvironment}object.
- * @deprecated It is planned to decouple the environments from the publication.
- */
- public PublishingEnvironment getEnvironment() {
- return environment;
- }
- /**
- * Returns the servlet context this publication belongs to (usually, the <code>webapps/lenya</code> directory).
- * @return A <code>File</code> object.
- */
- public File getServletContext() {
- return servletContext;
- }
- // Lenya1.3 BEGIN - changed
- /**
- * Returns the publication directory.
- * @return A <code>File</code> object.
- */
- public File getDirectory() {
- if(null == publicationDirectory) publicationDirectory = new File(getServletContext(), PUBLICATION_PREFIX + File.separator + getId());
- return publicationDirectory;
- }
- // Lenya1.3 - deprecated
- /**
- * Return the directory of a specific area.
- * @param area a <code>File</code> representing the root of the area content directory.
- * @return the directory of the given content area.
- * @deprecated Areas are bad. Do not use them.
- */
- // Lenya1.3 END
- public File getContentDirectory(String area) {
- Object key = getContentDirKey(area);
- String contentDir = (String) this.areaContentDir.get(key);
- if(contentDir != null){
- return new File(contentDir);
- }else{
- return new File(getDirectory(), CONTENT_PATH + File.separator + area);
- }
- }
- /**
- * DOCUMENT ME!
- * @param mapper DOCUMENT ME!
- */
- public void setPathMapper(DefaultDocumentIdToPathMapper mapper) {
- // assert mapper != null;
- this.mapper = mapper;
- }
- /**
- * Returns the path mapper.
- * @return a <code>DocumentIdToPathMapper</code>
- */
- public DocumentIdToPathMapper getPathMapper() {
- return mapper;
- }
- /**
- * Returns if a given string is a valid area name.
- * @param area The area string to test.
- * @return A boolean value.
- */
- public static boolean isValidArea(String area) {
- return area != null && Arrays.asList(areas).contains(area);
- }
- /**
- * Get the default language
- * @return the default language
- */
- public String getDefaultLanguage() {
- return defaultLanguage;
- }
- /**
- * Set the default language
- * @param language the default language
- */
- public void setDefaultLanguage(String language) {
- defaultLanguage = language;
- }
- /**
- * Get all available languages for this publication
- * @return an <code>Array</code> of languages
- */
- public String[] getLanguages() {
- return (String[]) languages.toArray(new String[languages.size()]);
- }
- /**
- * Get the breadcrumb prefix. It can be used as a prefix if a publication is part of a larger site
- * @return the breadcrumb prefix
- */
- public String getBreadcrumbPrefix() {
- return breadcrumbprefix;
- }
- /**
- * Get the SSL prefix. If you want to serve SSL-protected pages through a special site, use this prefix. This can come in handy if you have multiple sites that need SSL protection and you want to share one SSL certificate.
- * @return the SSL prefix
- */
- public String getSSLPrefix() {
- return sslprefix;
- }
- /**
- * Get the Live mount point. The live mount point is used to rewrite links that are of the form /contextprefix/publication/area/documentid to /livemountpoint/documentid This is useful if you serve your live area through mod_proxy. to enable this functionality, set the Live mount point to / or something else. An empty mount point disables the feature.
- * @return the Live mount point
- */
- public String getLiveMountPoint() {
- return livemountpoint;
- }
- /**
- * Get the sitetree for a specific area of this publication. Sitetrees are created on demand and are cached.
- * @param area the area
- * @return the sitetree for the specified area
- * @throws SiteTreeException if an error occurs
- */
- public SiteTree getTree(String area) throws SiteTreeException {
- SiteTree sitetree = null;
- if(hasSitetree){
- if(siteTrees.containsKey(area)){
- sitetree = (SiteTree) siteTrees.get(area);
- }else{
- sitetree = new DefaultSiteTree(getDirectory(), area);
- siteTrees.put(area, sitetree);
- }
- }
- return sitetree;
- }
- /**
- * Get the sitetree for a specific area of this publication. Sitetrees are created on demand and are cached.
- * @deprecated Please use getTree() because this method returns the interface and not a specific implementation
- * @see getTree()
- * @param area the area
- * @return the sitetree for the specified area
- * @throws SiteTreeException if an error occurs
- */
- public DefaultSiteTree getSiteTree(String area) throws SiteTreeException {
- DefaultSiteTree sitetree = null;
- if(hasSitetree){
- if(siteTrees.containsKey(area)){
- sitetree = (DefaultSiteTree) siteTrees.get(area);
- }else{
- sitetree = new DefaultSiteTree(getDirectory(), area);
- siteTrees.put(area, sitetree);
- }
- }
- return sitetree;
- }
- private DocumentBuilder documentBuilder;
- /**
- * Returns the document builder of this instance.
- * @return A document builder.
- */
- public DocumentBuilder getDocumentBuilder() {
- if(documentBuilder == null){ throw new IllegalStateException("The document builder was not defined in publication.xconf!"); }
- return documentBuilder;
- }
- /**
- * Creates a version of the document object in another area.
- * @param document The document to clone.
- * @param area The destination area.
- * @return A document.
- * @throws PublicationException when an error occurs.
- */
- public Document getAreaVersion(Document document, String area) throws PublicationException {
- DocumentBuilder builder = getDocumentBuilder();
- String url = builder.buildCanonicalUrl(this, area, document.getId(), document.getLanguage());
- Document destinationDocument = builder.buildDocument(this, url);
- return destinationDocument;
- }
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- boolean equals = false;
- if(getClass().isInstance(object)){
- Publication publication = (Publication) object;
- equals = getId().equals(publication.getId()) && getServletContext().equals(publication.getServletContext());
- }
- return equals;
- }
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- String key = getServletContext() + ":" + getId();
- return key.hashCode();
- }
- /**
- * Template method to copy a document. Override {@link #copyDocumentSource(Document, Document)} to implement access to a custom repository.
- * @see org.apache.lenya.cms.publication.Publication#copyDocument(org.apache.lenya.cms.publication.Document, org.apache.lenya.cms.publication.Document)
- */
- public void copyDocument(Document sourceDocument, Document destinationDocument) throws PublicationException {
- copyDocumentSource(sourceDocument, destinationDocument);
- copySiteStructure(sourceDocument, destinationDocument);
- }
- /**
- * Copies a document in the site structure.
- * @param sourceDocument The source document.
- * @param destinationDocument The destination document.
- * @throws PublicationException when something went wrong.
- */
- protected void copySiteStructure(Document sourceDocument, Document destinationDocument) throws PublicationException {
- if(hasSitetree){
- try{
- SiteTree sourceTree = getSiteTree(sourceDocument.getArea());
- SiteTree destinationTree = getSiteTree(destinationDocument.getArea());
- SiteTreeNode sourceNode = sourceTree.getNode(sourceDocument.getId());
- if(sourceNode == null){ throw new PublicationException("The node for source document [" + sourceDocument.getId() + "] doesn't exist!"); }
- SiteTreeNode[] siblings = sourceNode.getNextSiblings();
- String parentId = sourceNode.getAbsoluteParentId();
- SiteTreeNode sibling = null;
- String siblingDocId = null;
- // same document ID -> insert at the same position
- if(sourceDocument.getId().equals(destinationDocument.getId())){
- for(int i = 0; i < siblings.length; i++){
- String docId = parentId + "/" + siblings[i].getId();
- sibling = destinationTree.getNode(docId);
- if(sibling != null){
- siblingDocId = docId;
- break;
- }
- }
- }
- Label label = sourceNode.getLabel(sourceDocument.getLanguage());
- if(label == null){
- // the node that we're trying to publish
- // doesn't have this language
- throw new PublicationException("The node " + sourceDocument.getId() + " doesn't contain a label for language " + sourceDocument.getLanguage());
- }
- SiteTreeNode destinationNode = destinationTree.getNode(destinationDocument.getId());
- if(destinationNode == null){
- Label[] labels = {label };
- if(siblingDocId == null){
- destinationTree.addNode(destinationDocument.getId(), labels, sourceNode.visibleInNav(), sourceNode.getHref(), sourceNode.getSuffix(), sourceNode.hasLink());
- }else{
- destinationTree.addNode(destinationDocument.getId(), labels, sourceNode.visibleInNav(), sourceNode.getHref(), sourceNode.getSuffix(), sourceNode.hasLink(), siblingDocId);
- }
- }else{
- // if the node already exists in the live
- // tree simply insert the label in the
- // live tree
- destinationTree.setLabel(destinationDocument.getId(), label);
- // and synchronize visibilityinnav attribute with the one in
- // the source area
- String visibility = "true";
- if(!sourceNode.visibleInNav()) visibility = "false";
- destinationNode.setNodeAttribute(SiteTreeNodeImpl.VISIBLEINNAV_ATTRIBUTE_NAME, visibility);
- // also update the link attribute if necessary
- if(sourceNode.hasLink() != destinationNode.hasLink()){
- String link = (sourceNode.hasLink() ? "true" : "false");
- destinationNode.setNodeAttribute(SiteTreeNodeImpl.LINK_ATTRIBUTE_NAME, link);
- }
- }
- destinationTree.save();
- }catch(SiteTreeException e){
- throw new PublicationException(e);
- }
- }
- }
- /**
- * Copies a document source.
- * @param sourceDocument The source document.
- * @param destinationDocument The destination document.
- * @throws PublicationException when something went wrong.
- */
- protected abstract void copyDocumentSource(Document sourceDocument, Document destinationDocument) throws PublicationException;
- /**
- * @see org.apache.lenya.cms.publication.Publication#deleteDocument(org.apache.lenya.cms.publication.Document)
- */
- public void deleteDocument(Document document) throws PublicationException {
- if(!document.exists()){ throw new PublicationException("Document [" + document + "] does not exist!"); }
- deleteFromSiteStructure(document);
- deleteDocumentSource(document);
- }
- /**
- * Deletes a document from the site structure.
- * @param document The document to remove.
- * @throws PublicationException when something went wrong.
- */
- protected void deleteFromSiteStructure(Document document) throws PublicationException {
- if(hasSitetree){
- SiteTree tree;
- try{
- tree = getSiteTree(document.getArea());
- }catch(SiteTreeException e){
- throw new PublicationException(e);
- }
- SiteTreeNode node = tree.getNode(document.getId());
- if(node == null){ throw new PublicationException("Sitetree node for document [" + document + "] does not exist!"); }
- Label label = node.getLabel(document.getLanguage());
- if(label == null){ throw new PublicationException("Sitetree label for document [" + document + "] in language [" + document.getLanguage() + "]does not exist!"); }
- if(node.getLabels().length == 1 && node.getChildren().length > 0){ throw new PublicationException("Cannot delete last language version of document [" + document + "] because this node has children."); }
- node.removeLabel(label);
- try{
- if(node.getLabels().length == 0){
- tree.deleteNode(document.getId());
- }
- tree.save();
- }catch(SiteTreeException e){
- throw new PublicationException(e);
- }
- }
- }
- /**
- * Deletes the source of a document.
- * @param document The document to delete.
- * @throws PublicationException when something went wrong.
- */
- protected abstract void deleteDocumentSource(Document document) throws PublicationException;
- /**
- * @see org.apache.lenya.cms.publication.Publication#moveDocument(org.apache.lenya.cms.publication.Document, org.apache.lenya.cms.publication.Document)
- */
- public void moveDocument(Document sourceDocument, Document destinationDocument) throws PublicationException {
- copyDocument(sourceDocument, destinationDocument);
- deleteDocument(sourceDocument);
- }
- private Map areaSsl2proxy = new HashMap();
- /**
- * Generates a hash key for a area-SSL combination.
- * @param area The area.
- * @param isSslProtected If the proxy is assigned for SSL-protected pages.
- * @return An object.
- */
- protected Object getProxyKey(String area, boolean isSslProtected) {
- return area + ":" + isSslProtected;
- }
- /**
- * @see org.apache.lenya.cms.publication.Publication#getProxy(org.apache.lenya.cms.publication.Document, boolean)
- */
- public Proxy getProxy(Document document, boolean isSslProtected) {
- Object key = getProxyKey(document.getArea(), isSslProtected);
- Proxy proxy = (Proxy) this.areaSsl2proxy.get(key);
- if(log.isDebugEnabled()){
- log.debug("Resolving proxy for [" + document + "] SSL=[" + isSslProtected + "]");
- log.debug("Resolved proxy: [" + proxy + "]");
- }
- return proxy;
- }
- /**
- * @see org.apache.lenya.cms.publication.Publication#getRewriteAttributeXPaths()
- */
- public String[] getRewriteAttributeXPaths() {
- return this.rewriteAttributeXPaths;
- }
- private Map areaContentDir = new HashMap();
- protected Object getContentDirKey(String area) {
- return area;
- }
+ // if the node already exists in the live
+ // tree simply insert the label in the
+ // live tree
+ destinationTree.setLabel(destinationDocument.getId(), label);
+ // and synchronize visibilityinnav attribute with the one in
+ // the source area
+ String visibility = "true";
+ if(!sourceNode.visibleInNav())
+ visibility = "false";
+ destinationNode.setNodeAttribute(SiteTreeNodeImpl.VISIBLEINNAV_ATTRIBUTE_NAME, visibility);
+ // also update the link attribute if necessary
+ if(sourceNode.hasLink() != destinationNode.hasLink()){
+ String link = (sourceNode.hasLink() ? "true" : "false");
+ destinationNode.setNodeAttribute(SiteTreeNodeImpl.LINK_ATTRIBUTE_NAME, link);
+ }
+ }
+ destinationTree.save();
+ }catch(SiteTreeException e){
+ throw new PublicationException(e);
+ }
+ }
+ }
+ /**
+ * Copies a document source.
+ *
+ * @param sourceDocument
+ * The source document.
+ * @param destinationDocument
+ * The destination document.
+ * @throws PublicationException
+ * when something went wrong.
+ */
+ protected abstract void copyDocumentSource(Document sourceDocument, Document destinationDocument) throws PublicationException;
+ /**
+ * @see org.apache.lenya.cms.publication.Publication#deleteDocument(org.apache.lenya.cms.publication.Document)
+ */
+ public void deleteDocument(Document document) throws PublicationException {
+ if(!document.exists()){
+ throw new PublicationException("Document [" + document + "] does not exist!");
+ }
+ deleteFromSiteStructure(document);
+ deleteDocumentSource(document);
+ }
+ /**
+ * Deletes a document from the site structure.
+ *
+ * @param document
+ * The document to remove.
+ * @throws PublicationException
+ * when something went wrong.
+ */
+ protected void deleteFromSiteStructure(Document document) throws PublicationException {
+ if(hasSitetree){
+ SiteTree tree;
+ try{
+ tree = getSiteTree(document.getArea());
+ }catch(SiteTreeException e){
+ throw new PublicationException(e);
+ }
+ SiteTreeNode node = tree.getNode(document.getId());
+ if(node == null){
+ throw new PublicationException("Sitetree node for document [" + document + "] does not exist!");
+ }
+ Label label = node.getLabel(document.getLanguage());
+ if(label == null){
+ throw new PublicationException("Sitetree label for document [" + document + "] in language [" + document.getLanguage() + "]does not exist!");
+ }
+ if(node.getLabels().length == 1 && node.getChildren().length > 0){
+ throw new PublicationException("Cannot delete last language version of document [" + document + "] because this node has children.");
+ }
+ node.removeLabel(label);
+ try{
+ if(node.getLabels().length == 0){
+ tree.deleteNode(document.getId());
+ }
+ tree.save();
+ }catch(SiteTreeException e){
+ throw new PublicationException(e);
+ }
+ }
+ }
+ /**
+ * Deletes the source of a document.
+ *
+ * @param document
+ * The document to delete.
+ * @throws PublicationException
+ * when something went wrong.
+ */
+ protected abstract void deleteDocumentSource(Document document) throws PublicationException;
+ /**
+ * @see org.apache.lenya.cms.publication.Publication#moveDocument(org.apache.lenya.cms.publication.Document,
+ * org.apache.lenya.cms.publication.Document)
+ */
+ public void moveDocument(Document sourceDocument, Document destinationDocument) throws PublicationException {
+ copyDocument(sourceDocument, destinationDocument);
+ deleteDocument(sourceDocument);
+ }
+ private Map areaSsl2proxy = new HashMap();
+ /**
+ * Generates a hash key for a area-SSL combination.
+ *
+ * @param area
+ * The area.
+ * @param isSslProtected
+ * If the proxy is assigned for SSL-protected pages.
+ * @return An object.
+ */
+ protected Object getProxyKey(String area, boolean isSslProtected) {
+ return area + ":" + isSslProtected;
+ }
+ /**
+ * @see org.apache.lenya.cms.publication.Publication#getProxy(org.apache.lenya.cms.publication.Document,
+ * boolean)
+ */
+ public Proxy getProxy(Document document, boolean isSslProtected) {
+ Object key = getProxyKey(document.getArea(), isSslProtected);
+ Proxy proxy = (Proxy) this.areaSsl2proxy.get(key);
+ if(log.isDebugEnabled()){
+ log.debug("Resolving proxy for [" + document + "] SSL=[" + isSslProtected + "]");
+ log.debug("Resolved proxy: [" + proxy + "]");
+ }
+ return proxy;
+ }
+ /**
+ * @see org.apache.lenya.cms.publication.Publication#getRewriteAttributeXPaths()
+ */
+ public String[] getRewriteAttributeXPaths() {
+ return this.rewriteAttributeXPaths;
+ }
+ private Map areaContentDir = new HashMap();
+ protected Object getContentDirKey(String area) {
+ return area;
+ }
}
Added: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Modules.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Modules.java?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Modules.java (added)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/cms/publication/Modules.java Fri Jan 25 00:04:53 2008
@@ -0,0 +1,285 @@
+package org.apache.lenya.cms.publication;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
+
+//TODO: Rearchitect so can reset all without restarting Lenya?
+
+public class Modules {
+ private ArrayList templates = new ArrayList(); // Default list of Publications for inherit.
+//TODO: external and exclude should have defaults in module.xml.
+//Current algorithm needs replacing.
+//Use TRUE, FALSE, UNSET rather than Boolean.
+//Change exclude to Map.
+ private Map external = new HashMap(); // Every Module in Publication with Boolean.
+ private Set exclude = new HashSet(); // Only Modules excluded.
+ private Map inherit = new HashMap(); // Only Modules overriding inherit.
+ private Map modules = new HashMap(); // Only Modules overriding inherit with new moduleID.
+ boolean allAllowed = true;
+ boolean allExternal = true;
+ static Map variables = new HashMap(); //publication.module.variablename = value from publication.xconf
+ static Map defaultvariables = new HashMap(); //publication.module.variablename = value from module.xml
+ static Map globalvariables = new HashMap(); //module.variable = value from global module.xml
+ static boolean isGlobalvariablesSet = false;
+ private String servletContextPath;
+
+//Dev testing
+ Configuration config;
+
+ public Modules(String publication, String servletContextPath, Configuration config){
+ if(null == config) return;
+ int i;
+ this.servletContextPath = servletContextPath;
+ this.config = config; //TESTING
+
+ String[] attrnames = config.getAttributeNames();
+ for(i = 0; i < attrnames.length; i++ ) {
+ try{
+ String attribute = attrnames[i];
+ String value = config.getAttribute(attrnames[i]);
+ if(attribute.equalsIgnoreCase("include")){
+ if(!value.equalsIgnoreCase("all")) allAllowed = false;
+ }else if(attribute.equalsIgnoreCase("external")){
+ if(!(value.equalsIgnoreCase("all") | value.equalsIgnoreCase("true"))) allExternal = false;
+ }else if((attribute.equalsIgnoreCase("inherit")|attribute.equalsIgnoreCase("template"))){
+ templates.add(value);
+ }
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException ce){
+ //TODO: Log Errors?
+ }
+ } //For each Attribute
+ Configuration[] children = config.getChildren();
+ for(int c = 0; c < children.length; c++ ) {
+ String element = children[c].getName();
+ attrnames = children[c].getAttributeNames();
+ if(element.equalsIgnoreCase("inherit")){
+ for(i = 0; i < attrnames.length; i++ ) {
+ try{
+ templates.add(children[c].getAttribute(attrnames[i]));
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException ce){
+ //TODO: Log Errors?
+ }
+ }
+ try{
+ templates.add(children[c].getValue());
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException ce){
+ // Error means no value
+ }
+ }else if(element.equalsIgnoreCase("module")){
+ boolean isExternal = true;
+ boolean isExcluded = false;
+ String name = "";
+ String template = "";
+ String module = "";
+ for(i = 0; i < attrnames.length; i++ ) {
+ String attribute = attrnames[i];
+ try{
+ String value = children[c].getAttribute(attrnames[i]);
+ if(attribute.equalsIgnoreCase("external")){
+ if(!(value.equalsIgnoreCase("yes") | value.equalsIgnoreCase("true"))) isExternal = false;
+ }else if(attribute.equalsIgnoreCase("exclude")){
+ if(!(value.equalsIgnoreCase("yes") | value.equalsIgnoreCase("true"))) isExcluded = true;
+ }else if(attribute.equalsIgnoreCase("name")){
+ name = value;
+ }else if((attribute.equalsIgnoreCase("inherit")|attribute.equalsIgnoreCase("template"))){
+ template = value;
+ }else if(attribute.equalsIgnoreCase("module")){
+ module = value;
+ }
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException ce){
+ //TODO: Log Errors?
+ }
+ }
+ if(name.length() > 0){
+ if(isExcluded){
+ exclude.add(name);
+ }else{
+ external.put(name, new Boolean(isExternal));
+ if(template.length() > 0) inherit.put(name, template);
+ if(module.length() > 0) inherit.put(name, module);
+ //Variables
+ Map varmap = getVariablesFromConfiguration(children[c]);
+ Iterator keys = varmap.keySet().iterator();
+ while(keys.hasNext()){
+ String key = (String) keys.next();
+ variables.put(publication + "." + name + "." + key, varmap.get(key));
+ }
+/* OBSOLETE
+ Configuration[] vchildren = children[c].getChildren();
+ for(int v = 0; v < vchildren.length; v++ ) {
+ String velement = vchildren[v].getName();
+ if(velement.equalsIgnoreCase("variable")|velement.equalsIgnoreCase("param")|
+ velement.equalsIgnoreCase("parameter")){
+ try{
+ String vname = vchildren[v].getAttribute("name");
+ String vvalue = vchildren[v].getValue();
+ variables.put(publication + "." + name + "." + vname, vvalue);
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException vce){
+ // Do Nothing?
+ } //try
+ } // if variable
+ } //for
+OBSOLETE - END */
+ } // isExcluded
+ } // Has name
+ } //element tag
+ } // for each child
+ // Get variables from module.xml if each is not set
+ loadModuleVariables(publication);
+ loadGlobalVariables();
+ } // function
+ public boolean isExternal(String moduleID){
+ if(exclude.contains(moduleID)) return false;
+ if(allExternal) return true;
+ if(external.containsKey(moduleID)) return ((Boolean) external.get(moduleID)).booleanValue();
+ //TODO: Check parent templates?
+ return allAllowed;
+ }
+
+ public boolean isAllowed(String moduleID){
+ if(exclude.contains(moduleID)) return false;
+ if(allAllowed) return true;
+ if(external.containsKey(moduleID)) return true;
+ return false;
+ }
+ public String[] getTemplates(String moduleId){
+ if(inherit.containsKey(moduleId)){
+ ArrayList tmpArray = new ArrayList();
+ tmpArray.add(inherit.get(moduleId));
+ tmpArray.addAll(templates);
+ return (String[]) tmpArray.toArray(new String[0]);
+ }
+ return (String[]) templates.toArray(new String[0]);
+ }
+ public String getInheritedModule(String moduleId){
+ if(modules.containsKey(moduleId)) return (String) modules.get(moduleId);
+ return moduleId;
+ }
+
+ public String getVariable(String publication, String module, String varname){
+ String moduleID = module;
+ if(exclude.contains(moduleID)) return "";
+ if(variables.containsKey(publication + "." + moduleID + "." + varname)){
+ return (String) variables.get(publication + "." + moduleID + "." + varname);
+ }
+//TODO: ModuleID could change with inheritance. Use inherit.
+ String[] templates = getTemplates(moduleID);
+ for(int i = 0; i < templates.length; i++) {
+ if(variables.containsKey(templates[i] + "." + moduleID + "." + varname)){
+ return (String) variables.get(templates[i] + "." + moduleID + "." + varname);
+ }
+ }
+ moduleID = module;
+ //Check Module Variables
+ if(defaultvariables.containsKey(publication + "." + moduleID + "." + varname)){
+ return (String) defaultvariables.get(publication + "." + moduleID + "." + varname);
+ }
+//TODO: ModuleID could change with inheritance. Use inherit.
+ for(int i = 0; i < templates.length; i++) {
+ if(defaultvariables.containsKey(templates[i] + "." + moduleID + "." + varname)){
+ return (String) defaultvariables.get(templates[i] + "." + moduleID + "." + varname);
+ }
+ }
+ //Check Global Variables
+ //ModuleID could change with inheritance. Only check highest inheritance, not current module.
+ if(globalvariables.containsKey(moduleID + "." + varname)){
+ return (String) globalvariables.get(moduleID + "." + varname);
+ }
+ //Default
+ return "";
+ }
+
+ public void loadModuleVariables(String publication){
+ File directory = new File(servletContextPath, Publication.PUBLICATION_PREFIX
+ + File.separator + publication + File.separator + "modules");
+ //For each directory in pub/modules, check directory/module.xml
+ if(directory.exists() && directory.isDirectory()){
+ String[] files = directory.list();
+ for(int f = 0; f < files.length; f++) {
+ File moduledirectory = new File(directory, files[f]);
+ if(moduledirectory.exists() && moduledirectory.isDirectory()){
+ File modulexml = new File(moduledirectory, "module.xml");
+ if(modulexml.exists()){
+ Map varmap = getModuleXMLValues(modulexml);
+ Iterator keys = varmap.keySet().iterator();
+ while(keys.hasNext()){
+ String key = (String) keys.next();
+ defaultvariables.put(publication + "." + files[f] + "." + key, varmap.get(key));
+System.out.println("Default:"+ publication + "." + files[f] + "." + key +"="+ varmap.get(key));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void loadGlobalVariables(){
+ if(!isGlobalvariablesSet){
+ File directory = new File(servletContextPath, "lenya" + File.separator + "modules");
+//For each directory in lenya/modules, check directory/module.xml
+ if(directory.exists() && directory.isDirectory()){
+ String[] files = directory.list();
+ for(int f = 0; f < files.length; f++) {
+ File moduledirectory = new File(directory, files[f]);
+ if(moduledirectory.exists() && moduledirectory.isDirectory()){
+ File modulexml = new File(moduledirectory, "module.xml");
+ if(modulexml.exists()){
+ Map varmap = getModuleXMLValues(modulexml);
+ Iterator keys = varmap.keySet().iterator();
+ while(keys.hasNext()){
+ String key = (String) keys.next();
+ globalvariables.put(files[f] + "." + key, varmap.get(key));
+ }
+ }
+ }
+ }
+ }
+ //Finish
+ isGlobalvariablesSet = true;
+ }
+ }
+ private Map getModuleXMLValues(File modulexml){
+ DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
+ try{
+ Configuration config = builder.buildFromFile(modulexml);
+//TEST: Is top level?
+ return getVariablesFromConfiguration(config);
+ }catch(org.xml.sax.SAXException saxe){
+ }catch(java.io.IOException ioe){
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException ce){
+ }
+ return new HashMap();
+ }
+ private Map getVariablesFromConfiguration(Configuration config){
+ Map map = new HashMap();
+ Configuration[] vchildren = config.getChildren();
+ for(int v = 0; v < vchildren.length; v++ ) {
+ String velement = vchildren[v].getName();
+//Standardize on "parameter"?
+ if(velement.equalsIgnoreCase("variable")|velement.equalsIgnoreCase("param")
+ |velement.equalsIgnoreCase("parameter")){
+ try{
+ map.put(vchildren[v].getAttribute("name"), vchildren[v].getValue());
+ }catch(org.apache.avalon.framework.configuration.ConfigurationException vce){
+ // Do Nothing?
+ } //try
+ } // if variable
+ } //for
+ return map;
+ }
+
+ private Publication getPublication(String publication){
+ try{
+ return PublicationFactory.getPublication(publication, servletContextPath);
+ }catch(org.apache.lenya.cms.publication.PublicationException pe){
+ return (Publication) null;
+ }
+ }
+}
\ No newline at end of file
Modified: lenya/branches/revolution/1.3.x/src/targets/properties-build.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/targets/properties-build.xml?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/targets/properties-build.xml (original)
+++ lenya/branches/revolution/1.3.x/src/targets/properties-build.xml Fri Jan 25 00:04:53 2008
@@ -35,7 +35,7 @@
<property file="build.properties"/>
<condition property="local.properties.in.sync">
- <equals arg1="${build.properties.version}" arg2="157866"/>
+ <equals arg1="${build.properties.version}" arg2="157867"/>
</condition>
<fail unless="local.properties.in.sync" message="It seems that your local.build.properties is NOT in sync with build.properties! The file build.properties has probably been modified by some Apache Lenya developer. Re-copy build.properties to local.build.properties and re-set your local properties to get the two files back in sync. Please apologoize the inconvenience."/>
Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xml?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xml Fri Jan 25 00:04:53 2008
@@ -1,6 +1,14 @@
<module id="authoring" name="Authoring">
-<version>1.3</version>
-<content>Hierarchical</content>
-<description>This is the Lenya 1.2 authoring code moved to a Module. It only supports the Hierarchical Content.</description>
-<usage></usage>
+ <version>
+ <minimum>1.2</minimum>
+ <created>1.3</created>
+ <content>hierarchical</content>
+ </version>
+ <dependencies>
+ <required id="navigation">Used to build pages</required>
+ <recommended id="edit">Failover if called by a flat content publication.</recommended>
+ </dependencies>
+<description>This is the Lenya 1.2 authoring code moved to a Module. It only supports Hierarchical Content.</description>
+ <usage>
+ </usage>
</module>
Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xml?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xml Fri Jan 25 00:04:53 2008
@@ -1,7 +1,14 @@
<module id="cache" name="Cache">
-<version>1.3</version>
-<content>All</content>
-<description>Handles smart caching of Resources.</description>
-<usage></usage>
<parameter name="cache-dir">module:///work/</parameter>
+<!-- Parameter was top-level -->
+ <version>
+ <minimum>1.2</minimum>
+ <created>1.3</created>
+ </version>
+ <parameters>
+<parameter name="cache-dir">module:///work/</parameter>
+ </parameters>
+<description>Handles smart caching of Resources.</description>
+ <usage>
+ </usage>
</module>
Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xml?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xml Fri Jan 25 00:04:53 2008
@@ -1,6 +1,13 @@
<module id="edit" name="Edit">
-<version>Flat</version>
+ <version>
+ <minimum>1.3</minimum>
+ <created>1.3</created>
+ <content>flat</content>
+ </version>
+ <dependencies>
+ <recommended id="authoring">Failover for hierarchical content publications.</recommended>
+ </dependencies>
<description>PageModule for editing Resources.</description>
-<usage>
-</usage>
+ <usage>
+ </usage>
</module>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xml?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xml Fri Jan 25 00:04:53 2008
@@ -0,0 +1,15 @@
+<module id="file" name="File">
+ <version>
+ <minimum>1.3</minimum>
+ <created>1.3</created>
+ <content>flat</content>
+ </version>
+ <dependencies>
+ <resourcePath>/</resourcePath>
+ <required id="form">Required.</required>
+ <recommended id="edit">Because.</recommended>
+ </dependencies>
+ <description>Handles binary file Resources.</description>
+ <usage>
+ </usage>
+</module>
\ No newline at end of file
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xml?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xml Fri Jan 25 00:04:53 2008
@@ -0,0 +1,12 @@
+<module id="flat" name="MigrateHierarchicalToFlat">
+ <version>
+ <minimum>1.3</minimum>
+ <maximum>1.3.1</maximum>
+ <created>1.3</created>
+ <content>hierarchical</content>
+ </version>
+ <description>Migrates hierarchical content to flat content. Does not change the publication content type.</description>
+ <usage>
+See 13UPGRADE.txt
+ </usage>
+</module>
\ No newline at end of file
Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml?rev=615137&r1=615136&r2=615137&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/form/module.xml Fri Jan 25 00:04:53 2008
@@ -1,6 +1,8 @@
<module id="form" name="Form">
-<version>1.3</version>
-<content>All</content>
+ <version>
+ <minimum>1.2</minimum>
+ <created>1.3</created>
+ </version>
<description>Handles forms.</description>
<usage>
=== post.xsp
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/module.xml?rev=615137&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/module.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/module.xml Fri Jan 25 00:04:53 2008
@@ -0,0 +1,15 @@
+<module id="homepage" name="Homepage" inherit="xhtml">
+ <!-- Homepage Concept was originally xml/homepage Resource type. This should be child of /xml/xhtml and inherit xmap from live/xml/xhtml.
+ Allows removal of special case in live/module.xmap once 1.2 backwards-compatibility is not needed.
+ Change migration (flat) module. -->
+ <version>
+ <minimum>1.3</minimum>
+ <created>1.3</created>
+ </version>
+ <dependencies>
+ <resourcePath>/xml/xhtml</resourcePath>
+ </dependencies>
+ <description>Alternate XSL for home resource type.</description>
+ <usage>
+ </usage>
+</module>
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.