Author: andreas
Date: Tue Feb 10 22:33:01 2009
New Revision: 743138
URL: http://svn.apache.org/viewvc?rev=743138&view=rev
Log:
Continuing making the tests work, added declarations for some resource types (to be continued).
Added:
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistryWrapper.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeResolverImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-elements.xml
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-terms.xml
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/document.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.spring.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.xtest
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.spring.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.xtest
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.spring.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.xtest
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.spring.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.xtest
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/test-components.xml
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/lenya-module-cforms-components.xml
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/
lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/cforms.xml
lenya/trunk/org.apache.lenya.module.links/src/main/resources/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/lenya-module-links-components.xml
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/
lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/links.xml
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/lenya-module-opendocument-components.xml
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/
lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/opendocument.xml
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/cocoon/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/cocoon/spring/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/cocoon/spring/lenya-module-xhtml-components.xml
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/lenya/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/lenya/resourcetypes/
lenya/trunk/org.apache.lenya.module.xhtml/src/main/resources/META-INF/lenya/resourcetypes/xhtml.xml
Removed:
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/ConfigurableElementSet.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/ElementImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeSelector.java
Modified:
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistry.java
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ResourceType.java
lenya/trunk/org.apache.lenya.core.impl/pom.xml
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/AreaImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryBuilderImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java
lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java
lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml
lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml
lenya/trunk/org.apache.lenya.core.repository/pom.xml
lenya/trunk/org.apache.lenya.core.repository/src/main/resources/META-INF/cocoon/spring/lenya-core-repository-components.xml
lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SaxTreeWriter.java
lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeFactory.java
lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeImpl.java
lenya/trunk/org.apache.lenya.module.sitetree/src/main/resources/META-INF/cocoon/spring/lenya-module-sitetree-components.xml
lenya/trunk/org.apache.lenya.module.xhtml/pom.xml
lenya/trunk/org.apache.lenya.parent/pom.xml
lenya/trunk/pom.xml
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistry.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistry.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistry.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistry.java Tue Feb 10 22:33:01 2009
@@ -43,14 +43,6 @@
boolean isRegistered(String namespaceUri) throws MetaDataException;
/**
- * Register an element set.
- * @param namespaceUri The namespace URI.
- * @param elementSet The element set.
- * @throws MetaDataException if a set is already registered for this name.
- */
- void register(String namespaceUri, ElementSet elementSet) throws MetaDataException;
-
- /**
* @return The registered namespace URIs.
* @throws MetaDataException if an error occurs.
*/
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ResourceType.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ResourceType.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ResourceType.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ResourceType.java Tue Feb 10 22:33:01 2009
@@ -93,11 +93,6 @@
Sample getSample(String name);
/**
- * @param name The name of the resource type.
- */
- void setName(String name);
-
- /**
* @return All supported formats.
*/
String[] getFormats();
Modified: lenya/trunk/org.apache.lenya.core.impl/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/pom.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/pom.xml Tue Feb 10 22:33:01 2009
@@ -127,6 +127,26 @@
<artifactId>lenya-module-sourcerepository</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-module-xhtml</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-module-links</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-module-opendocument</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-module-cforms</artifactId>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
</project>
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistryWrapper.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistryWrapper.java?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistryWrapper.java (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/metadata/MetaDataRegistryWrapper.java Tue Feb 10 22:33:01 2009
@@ -0,0 +1,54 @@
+package org.apache.lenya.cms.metadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.lenya.cms.repository.metadata.MetaDataException;
+
+public class MetaDataRegistryWrapper implements MetaDataRegistry {
+
+ private org.apache.lenya.cms.repository.metadata.MetaDataRegistry metaDataRegistry;
+
+ private Map<String, ElementSetWrapper> elementSets = new HashMap<String, ElementSetWrapper>();
+
+ public ElementSet getElementSet(String namespaceUri)
+ throws org.apache.lenya.cms.metadata.MetaDataException {
+ ElementSetWrapper wrapper = this.elementSets.get(namespaceUri);
+ if (wrapper == null) {
+ try {
+ wrapper = new ElementSetWrapper(this.metaDataRegistry.getElementSet(namespaceUri));
+ } catch (MetaDataException e) {
+ throw new org.apache.lenya.cms.metadata.MetaDataException(e);
+ }
+ this.elementSets.put(namespaceUri, wrapper);
+ }
+ return wrapper;
+ }
+
+ public String[] getNamespaceUris() throws org.apache.lenya.cms.metadata.MetaDataException {
+ try {
+ return this.metaDataRegistry.getNamespaceUris();
+ } catch (MetaDataException e) {
+ throw new org.apache.lenya.cms.metadata.MetaDataException(e);
+ }
+ }
+
+ public boolean isRegistered(String namespaceUri)
+ throws org.apache.lenya.cms.metadata.MetaDataException {
+ try {
+ return this.metaDataRegistry.isRegistered(namespaceUri);
+ } catch (MetaDataException e) {
+ throw new org.apache.lenya.cms.metadata.MetaDataException(e);
+ }
+ }
+
+ public void setRepositoryMetaDataRegistry(
+ org.apache.lenya.cms.repository.metadata.MetaDataRegistry metaDataRegistry) {
+ this.metaDataRegistry = metaDataRegistry;
+ }
+
+ public org.apache.lenya.cms.repository.metadata.MetaDataRegistry getRepositoryMetaDataRegistry() {
+ return this.metaDataRegistry;
+ }
+
+}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/AreaImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/AreaImpl.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/AreaImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/AreaImpl.java Tue Feb 10 22:33:01 2009
@@ -25,6 +25,7 @@
import org.apache.lenya.cms.repository.Node;
import org.apache.lenya.cms.repository.NodeFactory;
import org.apache.lenya.cms.repository.RepositoryException;
+import org.apache.lenya.cms.repository.SessionHolder;
import org.apache.lenya.cms.site.SiteException;
import org.apache.lenya.cms.site.SiteManager;
import org.apache.lenya.cms.site.SiteNode;
@@ -64,7 +65,8 @@
} else {
String sourceUri = DocumentImpl.getSourceURI(pub, name, uuid, language);
try {
- org.apache.lenya.cms.repository.Session repoSession = (org.apache.lenya.cms.repository.Session) this.session;
+ org.apache.lenya.cms.repository.Session repoSession = ((SessionHolder) this.session)
+ .getRepositorySession();
Node node = (Node) repoSession.getRepositoryItem(getNodeFactory(), sourceUri);
return node.exists();
} catch (RepositoryException e) {
@@ -81,7 +83,8 @@
return getDocumentFactory().get(getPublication(), getName(), uuid, language);
}
- public Document getDocument(String uuid, String language, int revision) throws ResourceNotFoundException {
+ public Document getDocument(String uuid, String language, int revision)
+ throws ResourceNotFoundException {
return getDocumentFactory().get(getPublication(), getName(), uuid, language, revision);
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryBuilderImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryBuilderImpl.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryBuilderImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryBuilderImpl.java Tue Feb 10 22:33:01 2009
@@ -32,6 +32,7 @@
private MetaDataCache metaDataCache;
private SourceResolver sourceResolver;
private NodeFactory nodeFactory;
+ private ResourceTypeResolver resourceTypeResolver;
public DocumentFactory createDocumentFactory(Session session) {
DocumentFactoryImpl factory = new DocumentFactoryImpl(session);
@@ -39,6 +40,7 @@
factory.setPublicationManager(getPublicationManager());
factory.setSourceResolver(getSourceResolver());
factory.setNodeFactory(this.nodeFactory);
+ factory.setResourceTypeResolver(this.resourceTypeResolver);
return factory;
}
@@ -70,5 +72,8 @@
this.nodeFactory = nodeFactory;
}
+ public void setResourceTypeResolver(ResourceTypeResolver resourceTypeResolver) {
+ this.resourceTypeResolver = resourceTypeResolver;
+ }
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java Tue Feb 10 22:33:01 2009
@@ -44,6 +44,7 @@
private MetaDataCache metaDataCache;
private SourceResolver sourceResolver;
private NodeFactory nodeFactory;
+ private ResourceTypeResolver resourceTypeResolver;
/**
* @return The session.
@@ -306,6 +307,7 @@
doc.setMetaDataCache(getMetaDataCache());
doc.setSourceResolver(getSourceResolver());
doc.setNodeFactory(this.nodeFactory);
+ doc.setResourceTypeResolver(this.resourceTypeResolver);
return doc;
}
@@ -365,4 +367,8 @@
this.nodeFactory = nodeFactory;
}
+ public void setResourceTypeResolver(ResourceTypeResolver resourceTypeResolver) {
+ this.resourceTypeResolver = resourceTypeResolver;
+ }
+
}
\ No newline at end of file
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentImpl.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/DocumentImpl.java Tue Feb 10 22:33:01 2009
@@ -25,7 +25,6 @@
import java.util.Date;
import java.util.List;
-import org.apache.cocoon.spring.configurator.WebAppContextUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -57,6 +56,7 @@
private DocumentIdentifier identifier;
private org.apache.lenya.cms.publication.Session session;
private NodeFactory nodeFactory;
+ private ResourceTypeResolver resourceTypeResolver;
private int revision = -1;
/**
@@ -408,8 +408,7 @@
if (name == null) {
throw new DocumentException("No resource type defined for document [" + this + "]!");
}
- this.resourceType = (ResourceType) WebAppContextUtils.getCurrentWebApplicationContext()
- .getBean(ResourceType.class.getName() + "/" + name);
+ this.resourceType = this.resourceTypeResolver.getResourceType(name);
}
return this.resourceType;
}
@@ -512,9 +511,6 @@
private Node repositoryNode;
- /**
- * @see org.apache.lenya.cms.publication.Document#getRepositoryNode()
- */
public Node getRepositoryNode() {
if (this.repositoryNode == null) {
SessionHolder holder = (SessionHolder) getSession();
@@ -644,7 +640,7 @@
}
public Session getRepositorySession() {
- return (Session) getSession();
+ return ((SessionHolder) getSession()).getRepositorySession();
}
public int getRevisionNumber() {
@@ -782,4 +778,8 @@
}
}
+ public void setResourceTypeResolver(ResourceTypeResolver resourceTypeResolver) {
+ this.resourceTypeResolver = resourceTypeResolver;
+ }
+
}
\ No newline at end of file
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeResolverImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeResolverImpl.java?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeResolverImpl.java (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/ResourceTypeResolverImpl.java Tue Feb 10 22:33:01 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.publication;
+
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
+import org.springframework.web.context.WebApplicationContext;
+
+public class ResourceTypeResolverImpl implements ResourceTypeResolver {
+
+ public boolean existsResourceType(String name) {
+ return getAppContext().containsBean(getBeanName(name));
+ }
+
+ public ResourceType getResourceType(String name) {
+ return (ResourceType) getAppContext().getBean(getBeanName(name));
+ }
+
+ protected String getBeanName(String name) {
+ return ResourceType.class.getName() + "/" + name;
+ }
+
+ protected WebApplicationContext getAppContext() {
+ return WebAppContextUtils.getCurrentWebApplicationContext();
+ }
+}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml Tue Feb 10 22:33:01 2009
@@ -19,57 +19,92 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
xmlns="http://www.springframework.org/schema/beans">
-
+
<bean name="org.apache.lenya.cms.publication.Repository"
class="org.apache.lenya.cms.publication.RepositoryImpl">
<property name="repositoryManager" ref="org.apache.lenya.cms.repository.RepositoryManager"/>
- <property name="documentFactoryBuilder" ref="org.apache.lenya.cms.publication.DocumentFactoryBuilder"/>
+ <property name="documentFactoryBuilder"
+ ref="org.apache.lenya.cms.publication.DocumentFactoryBuilder"/>
</bean>
-
+
<bean name="org.apache.lenya.cms.repository.RepositoryManager"
class="org.apache.lenya.cms.repository.RepositoryManagerImpl">
<property name="observationRegistry" ref="org.apache.lenya.cms.observation.ObservationRegistry"/>
<property name="uuidGenerator" ref="org.apache.lenya.cms.repository.UUIDGenerator"/>
<property name="sharedItemStore" ref="org.apache.lenya.cms.repository.SharedItemStore"/>
</bean>
-
+
<bean name="org.apache.lenya.cms.publication.PublicationManager"
class="org.apache.lenya.cms.publication.PublicationManagerImpl">
<property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
<property name="pubBaseUri" value="resource://pubs"/>
</bean>
-
+
+ <bean name="org.apache.lenya.cms.metadata.MetaDataRegistry"
+ class="org.apache.lenya.cms.metadata.MetaDataRegistryWrapper">
+ <property name="repositoryMetaDataRegistry"
+ ref="org.apache.lenya.cms.repository.metadata.MetaDataRegistry"/>
+ </bean>
+
<bean name="org.apache.lenya.cms.metadata.MetaDataCache"
- class="org.apache.lenya.cms.metadata.MetaDataCache"/>
-
+ class="org.apache.lenya.cms.metadata.MetaDataCache"/>
+
<bean name="org.apache.lenya.cms.publication.DocumentFactoryBuilder"
class="org.apache.lenya.cms.publication.DocumentFactoryBuilderImpl">
<property name="publicationManager" ref="org.apache.lenya.cms.publication.PublicationManager"/>
<property name="metaDataCache" ref="org.apache.lenya.cms.metadata.MetaDataCache"/>
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
<property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
+ <property name="resourceTypeResolver"
+ ref="org.apache.lenya.cms.publication.ResourceTypeResolver"/>
</bean>
-
+
+ <bean name="org.apache.lenya.cms.publication.ResourceTypeResolver"
+ class="org.apache.lenya.cms.publication.ResourceTypeResolverImpl"/>
+
<bean name="org.apache.lenya.cms.publication.DocumentManager"
class="org.apache.lenya.cms.publication.DocumentManagerImpl">
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
<property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
<property name="uuidGenerator" ref="org.apache.lenya.cms.repository.UUIDGenerator"/>
</bean>
-
+
<bean name="org.apache.lenya.cms.module.ModuleManager"
- class="org.apache.lenya.cms.module.ModuleManagerImpl"/>
-
+ class="org.apache.lenya.cms.module.ModuleManagerImpl"/>
+
<bean name="org.apache.lenya.cms.repository.SharedItemStore"
class="org.apache.lenya.cms.repository.SharedItemStoreImpl">
<property name="repositoryManager" ref="org.apache.lenya.cms.repository.RepositoryManager"/>
</bean>
-
+
<bean name="org.apache.lenya.cms.repository.UUIDGenerator"
- class="org.apache.lenya.cms.repository.LenyaUUIDGenerator"/>
-
+ class="org.apache.lenya.cms.repository.LenyaUUIDGenerator"/>
+
<bean name="org.apache.lenya.cms.publication.DocumentBuilder/default"
class="org.apache.lenya.cms.publication.DefaultDocumentBuilder"/>
+
+ <!-- Meta Data -->
+ <bean init-method="register"
+ name="org.apache.lenya.cms.repository.metadata.ElementSet/http://apache.org/lenya/metadata/document/1.0"
+ class="org.apache.lenya.cms.repository.metadata.impl.ConfigurableElementSet">
+ <property name="configUri" value="resource://META-INF/lenya/metadata/document.xml"/>
+ <property name="registry" ref="org.apache.lenya.cms.repository.metadata.MetaDataRegistry"/>
+ <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ </bean>
+ <bean init-method="register"
+ name="org.apache.lenya.cms.repository.metadata.ElementSet/http://purl.org/dc/elements/1.1/"
+ class="org.apache.lenya.cms.repository.metadata.impl.ConfigurableElementSet">
+ <property name="configUri" value="resource://META-INF/lenya/metadata/dc-elements.xml"/>
+ <property name="registry" ref="org.apache.lenya.cms.repository.metadata.MetaDataRegistry"/>
+ <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ </bean>
+ <bean init-method="register"
+ name="org.apache.lenya.cms.repository.metadata.ElementSet/http://purl.org/dc/terms/"
+ class="org.apache.lenya.cms.repository.metadata.impl.ConfigurableElementSet">
+ <property name="configUri" value="resource://META-INF/lenya/metadata/dc-terms.xml"/>
+ <property name="registry" ref="org.apache.lenya.cms.repository.metadata.MetaDataRegistry"/>
+ <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ </bean>
</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-elements.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-elements.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-elements.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-elements.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<metadata namespace="http://purl.org/dc/elements/1.1/">
+ <element name="title" multiple="false" editable="true" searchable="true"/>
+ <element name="creator" multiple="false" editable="true"/>
+ <element name="subject" multiple="false" editable="true" searchable="true"/>
+ <element name="description" multiple="false" editable="true" searchable="true"/>
+ <element name="publisher" multiple="false" editable="true"/>
+ <element name="contributor" multiple="false" editable="true"/>
+ <element name="date" multiple="false" editable="true"/>
+ <element name="type" multiple="false" editable="true"/>
+ <element name="format" multiple="false" editable="true"/>
+ <element name="identifier" multiple="false" editable="true"/>
+ <element name="source" multiple="false" editable="true"/>
+ <element name="language" multiple="false" editable="true"/>
+ <element name="relation" multiple="false" editable="true"/>
+ <element name="coverage" multiple="false" editable="true"/>
+ <element name="rights" multiple="false" editable="true"/>
+</metadata>
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-terms.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-terms.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-terms.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/dc-terms.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<metadata namespace="http://purl.org/dc/terms/"
+ class="org.apache.lenya.cms.metadata.ConfigurableElementSet">
+ <element name="abstract" multiple="false" editable="true" searchable="true"/>
+ <element name="accessRights" multiple="false" editable="true"/>
+ <element name="alternative" multiple="false" editable="true"/>
+ <element name="audience" multiple="false" editable="true"/>
+ <element name="available" multiple="false" editable="true"/>
+ <element name="bibliographicCitation" multiple="false" editable="true"/>
+ <element name="conformsTo" multiple="false" editable="true"/>
+ <element name="created" multiple="false" editable="true"/>
+ <element name="dateAccepted" multiple="false" editable="true"/>
+ <element name="dateCopyrighted" multiple="false" editable="true"/>
+ <element name="dateSubmitted" multiple="false" editable="true"/>
+ <element name="educationLevel" multiple="false" editable="true"/>
+ <element name="extent" multiple="false" editable="true"/>
+ <element name="hasFormat" multiple="false" editable="true"/>
+ <element name="hasPart" multiple="false" editable="true"/>
+ <element name="hasVersion" multiple="false" editable="true"/>
+ <element name="isFormatOf" multiple="false" editable="true"/>
+ <element name="isPartOf" multiple="false" editable="true"/>
+ <element name="isReferencedBy" multiple="false" editable="true"/>
+ <element name="isReplacedBy" multiple="false" editable="true"/>
+ <element name="isRequiredBy" multiple="false" editable="true"/>
+ <element name="issued" multiple="false" editable="true"/>
+ <element name="isVersionOf" multiple="false" editable="true"/>
+ <element name="license" multiple="false" editable="true"/>
+ <element name="mediator" multiple="false" editable="true"/>
+ <element name="medium" multiple="false" editable="true"/>
+ <element name="modified" multiple="false" editable="true"/>
+ <element name="references" multiple="false" editable="true"/>
+ <element name="replaces" multiple="false" editable="true"/>
+ <element name="requires" multiple="false" editable="true"/>
+ <element name="rightsHolder" multiple="false" editable="true"/>
+ <element name="spatial" multiple="false" editable="true"/>
+ <element name="tableOfContents" multiple="false" editable="true"/>
+ <element name="temporal" multiple="false" editable="true"/>
+ <element name="valid" multiple="false" editable="true"/>
+</metadata>
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/document.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/document.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/document.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/lenya/metadata/document.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metadata namespace="http://apache.org/lenya/metadata/document/1.0">
+ <element name="resourceType" multiple="false"/>
+ <element name="contentType" multiple="false"/>
+ <element name="mimeType" multiple="false"/>
+ <element name="expires" multiple="false"/>
+ <element name="extension" multiple="false"/>
+</metadata>
Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java Tue Feb 10 22:33:01 2009
@@ -23,6 +23,7 @@
import org.apache.lenya.cms.metadata.dublincore.DublinCore;
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.repository.metadata.Element;
/**
* Meta data test.
@@ -36,7 +37,8 @@
public void testMetaData() throws Exception {
Publication publication = getSession().getPublication("test");
- Document doc = publication.getArea("authoring").getSite().getNode("/index").getLink("en").getDocument();
+ Document doc = publication.getArea("authoring").getSite().getNode("/index").getLink("en")
+ .getDocument();
String namespaceUri = "foobar";
Exception e = null;
@@ -81,36 +83,35 @@
String NAMESPACE = "http://apache.org/lenya/test/metadata";
protected void checkOnCopy(Publication pub) throws Exception {
- MetaDataRegistry registry = null;
+ MetaDataRegistryWrapper registry = null;
try {
- registry = (MetaDataRegistry) getManager().lookup(MetaDataRegistry.ROLE);
- ElementSet set = new TestElementSet();
- registry.register(NAMESPACE, set);
- }
- finally {
+ registry = (MetaDataRegistryWrapper) getManager().lookup(MetaDataRegistry.ROLE);
+ org.apache.lenya.cms.repository.metadata.ElementSet set = new TestElementSet();
+ registry.getRepositoryMetaDataRegistry().register(NAMESPACE, set);
+ } finally {
getManager().release(registry);
}
-
+
Document source = pub.getArea(Publication.AUTHORING_AREA).getDocument("/index", "en");
Document target = pub.getArea(Publication.AUTHORING_AREA).getDocument("/index", "en");
-
+
MetaData sourceMeta = source.getMetaData(NAMESPACE);
sourceMeta.setValue("copy", "sourceCopy");
sourceMeta.setValue("ignore", "sourceIgnore");
sourceMeta.setValue("delete", "sourceDelete");
-
+
MetaData targetMeta = target.getMetaData(NAMESPACE);
targetMeta.setValue("ignore", "targetIgnore");
targetMeta.setValue("delete", "targetDelete");
-
+
targetMeta.replaceBy(sourceMeta);
-
+
assertTrue(targetMeta.getValues("copy").length == 1);
assertEquals(sourceMeta.getValues("copy"), targetMeta.getValues("copy"));
-
+
assertTrue(targetMeta.getValues("ignore").length == 1);
assertEquals(targetMeta.getFirstValue("ignore"), "targetIgnore");
-
+
assertTrue(targetMeta.getValues("delete").length == 0);
}
@@ -119,7 +120,7 @@
assertTrue(dc.getValues("title").length == 0);
}
- protected class TestElement implements Element {
+ protected class TestElement implements org.apache.lenya.cms.repository.metadata.Element {
private String name;
private int actionOnCopy;
@@ -155,13 +156,14 @@
}
- protected class TestElementSet implements ElementSet {
+ protected class TestElementSet implements org.apache.lenya.cms.repository.metadata.ElementSet {
- private Element[] elements = { new TestElement("copy", Element.ONCOPY_COPY),
+ private org.apache.lenya.cms.repository.metadata.Element[] elements = {
+ new TestElement("copy", Element.ONCOPY_COPY),
new TestElement("ignore", Element.ONCOPY_IGNORE),
new TestElement("delete", Element.ONCOPY_DELETE) };
-
- private Map name2element;
+
+ private Map<String, org.apache.lenya.cms.repository.metadata.Element> name2element;
protected TestElementSet() {
for (int i = 0; i < elements.length; i++) {
@@ -173,11 +175,12 @@
return true;
}
- public Element getElement(String name) throws MetaDataException {
- return (Element) this.name2element.get(name);
+ public org.apache.lenya.cms.repository.metadata.Element getElement(String name)
+ throws org.apache.lenya.cms.repository.metadata.MetaDataException {
+ return (org.apache.lenya.cms.repository.metadata.Element) this.name2element.get(name);
}
- public Element[] getElements() {
+ public org.apache.lenya.cms.repository.metadata.Element[] getElements() {
return elements;
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java Tue Feb 10 22:33:01 2009
@@ -27,15 +27,13 @@
public class DocumentFactoryTest extends AbstractAccessControlTest {
private static final Log logger = LogFactory.getLog(DocumentFactoryTest.class);
-
- private Repository repository;
/**
* Tests the meta data.
* @throws Exception
*/
public void testDocumentFactory() throws Exception {
- Session session = this.repository.getSession(getRequest());
+ Session session = getSession();
DocumentFactory factoryA = new DocumentFactoryImpl(session);
Publication publication = getSession().getPublication("test");
@@ -51,8 +49,4 @@
assertSame(docA1, docB1);
}
- public void setRepository(Repository repository) {
- this.repository = repository;
- }
-
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java Tue Feb 10 22:33:01 2009
@@ -57,7 +57,7 @@
protected void doTestCopyToArea(DocumentManager docManager, String sourceAreaName,
String destAreaName, String path1, String path2) throws Exception {
- Publication pub = getSession().addPublication("test");
+ Publication pub = getSession().getPublication("test");
SiteStructure sourceArea = pub.getArea(sourceAreaName).getSite();
SiteStructure destArea = pub.getArea(destAreaName).getSite();
Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -19,10 +19,5 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-impl-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-observation-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-module-sourcerepository-components.xml"/>
-
+ <import resource="classpath:test-components.xml"/>
</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.spring.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.spring.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <import resource="classpath:test-components.xml"/>
+</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.xtest?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentBuilderTest.xtest Tue Feb 10 22:33:01 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<testcase>
+ <roles>
+ <role name="org.apache.excalibur.source.SourceFactorySelector"
+ shorthand="source-factories"
+ default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+ <role name="org.apache.excalibur.source.SourceResolver"
+ shorthand="source-resolver"
+ default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+ />
+ </roles>
+
+ <components>
+
+ <source-factories>
+ <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+ <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+ <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+ <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+ </source-factories>
+
+ </components>
+
+</testcase>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.spring.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.spring.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <import resource="classpath:test-components.xml"/>
+</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.xtest?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DefaultDocumentTest.xtest Tue Feb 10 22:33:01 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<testcase>
+ <roles>
+ <role name="org.apache.excalibur.source.SourceFactorySelector"
+ shorthand="source-factories"
+ default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+ <role name="org.apache.excalibur.source.SourceResolver"
+ shorthand="source-resolver"
+ default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+ />
+ </roles>
+
+ <components>
+
+ <source-factories>
+ <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+ <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+ <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+ <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+ </source-factories>
+
+ </components>
+
+</testcase>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.spring.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.spring.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <import resource="classpath:test-components.xml"/>
+</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.xtest?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentFactoryTest.xtest Tue Feb 10 22:33:01 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<testcase>
+ <roles>
+ <role name="org.apache.excalibur.source.SourceFactorySelector"
+ shorthand="source-factories"
+ default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+ <role name="org.apache.excalibur.source.SourceResolver"
+ shorthand="source-resolver"
+ default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+ />
+ </roles>
+
+ <components>
+
+ <source-factories>
+ <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+ <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+ <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+ <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+ </source-factories>
+
+ </components>
+
+</testcase>
Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -19,13 +19,5 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-impl-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-observation-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-core-repository-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-module-sourcerepository-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/lenya-module-sitetree-components.xml"/>
- <import resource="classpath:META-INF/cocoon/spring/cocoon-xml-impl.xml"/>
-
+ <import resource="classpath:test-components.xml"/>
</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.spring.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.spring.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.spring.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+ <import resource="classpath:test-components.xml"/>
+</beans>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.xtest?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DublinCoreTest.xtest Tue Feb 10 22:33:01 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<testcase>
+ <roles>
+ <role name="org.apache.excalibur.source.SourceFactorySelector"
+ shorthand="source-factories"
+ default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+ <role name="org.apache.excalibur.source.SourceResolver"
+ shorthand="source-resolver"
+ default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+ />
+ </roles>
+
+ <components>
+
+ <source-factories>
+ <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+ <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+ <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+ <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+ <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+ </source-factories>
+
+ </components>
+
+</testcase>
Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/test-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/test-components.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/test-components.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/test-components.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <import resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-core-impl-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-core-observation-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-core-repository-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-core-resourcetype-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-cforms-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-links-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-opendocument-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-sitetree-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-sourcerepository-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/lenya-module-xhtml-components.xml"/>
+ <import resource="classpath:META-INF/cocoon/spring/cocoon-xml-impl.xml"/>
+
+</beans>
Modified: lenya/trunk/org.apache.lenya.core.repository/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/pom.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.repository/pom.xml Tue Feb 10 22:33:01 2009
@@ -23,5 +23,15 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
+ <!-- TODO: remove dependencies on Avalon and Excalibur -->
+ <dependency>
+ <groupId>org.apache.avalon.framework</groupId>
+ <artifactId>avalon-framework-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.excalibur.components</groupId>
+ <artifactId>excalibur-sourceresolve</artifactId>
+ <version>2.2.3</version>
+ </dependency>
</dependencies>
</project>
Modified: lenya/trunk/org.apache.lenya.core.repository/src/main/resources/META-INF/cocoon/spring/lenya-core-repository-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository/src/main/resources/META-INF/cocoon/spring/lenya-core-repository-components.xml?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository/src/main/resources/META-INF/cocoon/spring/lenya-core-repository-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.repository/src/main/resources/META-INF/cocoon/spring/lenya-core-repository-components.xml Tue Feb 10 22:33:01 2009
@@ -21,6 +21,6 @@
xmlns="http://www.springframework.org/schema/beans">
<bean name="org.apache.lenya.cms.repository.metadata.MetaDataRegistry"
- class="org.apache.lenya.cms.repository.metadata.MetaDataRegistryImpl"/>
+ class="org.apache.lenya.cms.repository.metadata.impl.MetaDataRegistryImpl"/>
</beans>
Added: lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/lenya-module-cforms-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/lenya-module-cforms-components.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/lenya-module-cforms-components.xml (added)
+++ lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/cocoon/spring/lenya-module-cforms-components.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
+ xmlns="http://www.springframework.org/schema/beans">
+
+ <bean name="org.apache.lenya.cms.publication.ResourceType/cforms"
+ factory-bean="org.apache.lenya.cms.publication.ResourceTypeFactory"
+ factory-method="createResourceType">
+ <constructor-arg value="resource://META-INF/lenya/resourcetypes/cforms.xml"/>
+ </bean>
+
+</beans>
Added: lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/cforms.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/cforms.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/cforms.xml (added)
+++ lenya/trunk/org.apache.lenya.module.cforms/src/main/resources/META-INF/lenya/resourcetypes/cforms.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resource-type name="cforms">
+ <schema
+ uri="fallback://lenya/modules/cforms/schemas/cforms.rng"
+ namespace="http://relaxng.org/ns/structure/0.9"
+ />
+ <sample
+ mime-type="application/xml"
+ uri="fallback://lenya/modules/cforms/samples/cforms.xml"
+ />
+ <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
+ <format name="xhtml" uri="cocoon://modules/cforms/xhtml.xml"/>
+</resource-type>
Added: lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/lenya-module-links-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/lenya-module-links-components.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/lenya-module-links-components.xml (added)
+++ lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/cocoon/spring/lenya-module-links-components.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
+ xmlns="http://www.springframework.org/schema/beans">
+
+ <bean name="org.apache.lenya.cms.publication.ResourceType/links"
+ factory-bean="org.apache.lenya.cms.publication.ResourceTypeFactory"
+ factory-method="createResourceType">
+ <constructor-arg value="resource://META-INF/lenya/resourcetypes/links.xml"/>
+ </bean>
+
+</beans>
Added: lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/links.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/links.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/links.xml (added)
+++ lenya/trunk/org.apache.lenya.module.links/src/main/resources/META-INF/lenya/resourcetypes/links.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resource-type name="links">
+ <schema
+ namespace="http://relaxng.org/ns/structure/0.9"
+ uri="fallback://lenya/modules/links/resources/schema/links.rng"
+ />
+ <sample
+ mime-type="application/xml"
+ uri="fallback://lenya/modules/links/samples/links.xml"
+ />
+ <format name="xhtml" uri="cocoon://modules/links/xhtml.xml"/>
+ <format name="luceneIndex" uri="cocoon://modules/xhtml/lucene-index"/>
+ <format name="webdavGET" uri="cocoon://modules/xhtml/davget.xml"/>
+</resource-type>
Added: lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/lenya-module-opendocument-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/lenya-module-opendocument-components.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/lenya-module-opendocument-components.xml (added)
+++ lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/cocoon/spring/lenya-module-opendocument-components.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
+ xmlns="http://www.springframework.org/schema/beans">
+
+ <bean name="org.apache.lenya.cms.publication.ResourceType/opendocument"
+ factory-bean="org.apache.lenya.cms.publication.ResourceTypeFactory"
+ factory-method="createResourceType">
+ <constructor-arg value="resource://META-INF/lenya/resourcetypes/opendocument.xml"/>
+ </bean>
+
+</beans>
Added: lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/opendocument.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/opendocument.xml?rev=743138&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/opendocument.xml (added)
+++ lenya/trunk/org.apache.lenya.module.opendocument/src/main/resources/META-INF/lenya/resourcetypes/opendocument.xml Tue Feb 10 22:33:01 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resource-type name="opendocument">
+ <sample
+ mime-type="application/vnd.oasis.opendocument.text"
+ uri="fallback://lenya/modules/opendocument/samples/helloworld.odt"
+ />
+ <!-- NOTE: Will be matched within sitemap of this module (modules/opendocument/sitemap.xmap) -->
+ <format name="xhtml" uri="cocoon://modules/opendocument/xhtml.xml"/>
+ <format name="webdavGET" uri="cocoon://modules/opendocument/davget.xml"/>
+</resource-type>
Modified: lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SaxTreeWriter.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SaxTreeWriter.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SaxTreeWriter.java (original)
+++ lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SaxTreeWriter.java Tue Feb 10 22:33:01 2009
@@ -19,11 +19,7 @@
import java.io.OutputStream;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
import org.apache.cocoon.serialization.Serializer;
-import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.excalibur.xml.sax.XMLizable;
import org.apache.lenya.cms.repository.Node;
import org.apache.lenya.cms.site.Link;
@@ -32,7 +28,7 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-public class SaxTreeWriter extends AbstractLogEnabled implements TreeWriter, XMLizable, Serviceable {
+public class SaxTreeWriter implements TreeWriter, XMLizable {
protected static final String NS = SiteTreeImpl.NAMESPACE;
protected static final String TYPE_CDATA = "CDATA";
@@ -46,25 +42,24 @@
protected static final String ELEM_LABEL = SaxTreeBuilder.ELEM_LABEL;
private SiteTreeImpl tree;
- private ServiceManager manager;
+ private Serializer serializer;
+
+ public void setSerializer(Serializer serializer) {
+ this.serializer = serializer;
+ }
public void writeTree(SiteTreeImpl tree) throws Exception {
this.tree = tree;
- Serializer serializer = null;
OutputStream stream = null;
try {
- serializer = (Serializer) this.manager.lookup(ROLE + "Serializer");
stream = tree.getRepositoryNode().getOutputStream();
- serializer.setOutputStream(stream);
+ this.serializer.setOutputStream(stream);
toSAX(serializer);
} finally {
if (stream != null) {
stream.close();
}
- if (serializer != null) {
- this.manager.release(serializer);
- }
}
}
@@ -127,8 +122,4 @@
handler.endElement(NS, ELEM_LABEL, ELEM_LABEL);
}
- public void service(ServiceManager manager) throws ServiceException {
- this.manager = manager;
- }
-
}
Modified: lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeFactory.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeFactory.java?rev=743138&r1=743137&r2=743138&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeFactory.java (original)
+++ lenya/trunk/org.apache.lenya.module.sitetree/src/main/java/org/apache/lenya/cms/site/tree2/SiteTreeFactory.java Tue Feb 10 22:33:01 2009
@@ -17,11 +17,11 @@
*/
package org.apache.lenya.cms.site.tree2;
-import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lenya.cms.publication.Area;
import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.repository.NodeFactory;
import org.apache.lenya.cms.repository.RepositoryException;
import org.apache.lenya.cms.repository.RepositoryItem;
import org.apache.lenya.cms.repository.RepositoryItemFactory;
@@ -40,6 +40,8 @@
private SharedItemStore sharedItemStore;
private TreeBuilder treeBuilder;
+ private TreeWriter treeWriter;
+ private NodeFactory nodeFactory;
public RepositoryItem buildItem(Session session, String key) throws RepositoryException {
String[] snippets = key.split(":");
@@ -53,7 +55,11 @@
Session storeSession = this.sharedItemStore.getSession();
if (session.isModifiable() || session == storeSession) {
- return new SiteTreeImpl(this.treeBuilder, area);
+ SiteTreeImpl tree = new SiteTreeImpl(area);
+ tree.setBuilder(this.treeBuilder);
+ tree.setWriter(this.treeWriter);
+ tree.setNodeFactory(this.nodeFactory);
+ return tree;
} else {
return new DelegatingSiteTree(area, this, storeSession, key);
}
@@ -74,4 +80,12 @@
this.treeBuilder = treeBuilder;
}
+ public void setTreeWriter(TreeWriter treeWriter) {
+ this.treeWriter = treeWriter;
+ }
+
+ public void setNodeFactory(NodeFactory nodeFactory) {
+ this.nodeFactory = nodeFactory;
+ }
+
}
\ 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.