Author: andreas
Date: Fri Feb 6 23:56:29 2009
New Revision: 741792
URL: http://svn.apache.org/viewvc?rev=741792&view=rev
Log:
Continued springification, added some temporary resources and XSLTs to get started.
Added:
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttribute.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttributes.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributeImpl.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributesImpl.java
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/content/
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/content/readme.xml
- copied unchanged from r741695, lenya/branches/BRANCH_2_0_X/src/webapp/readme.xml
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/content/welcome.xml
- copied unchanged from r741695, lenya/branches/BRANCH_2_0_X/src/webapp/lenya/content/welcome.xml
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/
- copied from r741772, lenya/trunk/org.apache.lenya.webapp/src/main/webapp/lenya/
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/xslt/
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/xslt/welcome.xsl
- copied unchanged from r741694, lenya/branches/BRANCH_2_0_X/src/webapp/lenya/xslt/util/welcome.xsl
Modified:
lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java
lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java
lenya/trunk/org.apache.lenya.core.ac/src/main/resources/META-INF/cocoon/spring/lenya-core-ac-components.xml
lenya/trunk/org.apache.lenya.core.api/pom.xml
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Repository.java
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Session.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.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.linking/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java
lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/GlobalProxiesImpl.java
lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/avalon/lenya-core-linking-sitemap.xconf
lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/spring/lenya-core-linking-components.xml
lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/Usecase.java
lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/UsecaseInvoker.java
lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java
lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Publish.java
lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Reject.java
lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Submit.java
lenya/trunk/org.apache.lenya.module.lucene/src/main/java/org/apache/lenya/cms/lucene/IndexSite.java
lenya/trunk/org.apache.lenya.optional.jcrsource/src/main/java/org/apache/lenya/cms/jcr/usecases/JCRImport.java
lenya/trunk/org.apache.lenya.parent/pom.xml
lenya/trunk/org.apache.lenya.webapp/pom.xml
lenya/trunk/org.apache.lenya.webapp/rcl.properties
lenya/trunk/org.apache.lenya.welcome/rcl.properties
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/global-sitemap.xmap
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/lenya.xmap
lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/xslt/util/page2xhtml.xsl
Modified: lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java (original)
+++ lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/ac/PublicationAccessControllerResolver.java Fri Feb 6 23:56:29 2009
@@ -35,13 +35,10 @@
import org.apache.lenya.ac.AccessControlException;
import org.apache.lenya.ac.AccessController;
import org.apache.lenya.ac.impl.AbstractAccessControllerResolver;
-import org.apache.lenya.cms.publication.DocumentFactory;
-import org.apache.lenya.cms.publication.DocumentUtil;
import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.cms.publication.URLInformation;
-import org.apache.lenya.cms.repository.RepositoryManager;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
/**
* Resolves the access controller according to the <code>access-control.xml</code> file of a
@@ -53,7 +50,7 @@
.replace('/', File.separatorChar);
protected static final String TYPE_ATTRIBUTE = "type";
- private RepositoryManager repositoryManager;
+ private Repository repository;
private SourceResolver sourceResolver;
public SourceResolver getSourceResolver() {
@@ -125,10 +122,9 @@
ProcessInfoProvider process = (ProcessInfoProvider) WebAppContextUtils
.getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
HttpServletRequest request = process.getRequest();
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
- DocumentFactory factory = DocumentUtil.createDocumentFactory(session);
- if (pubId != null && factory.existsPublication(pubId)) {
- publication = factory.getPublication(pubId);
+ Session session = this.repository.getSession(request);
+ if (pubId != null && session.existsPublication(pubId)) {
+ publication = session.getPublication(pubId);
}
} catch (Exception e) {
throw new AccessControlException(e);
@@ -227,12 +223,8 @@
this.context = contextDir;
}
- public RepositoryManager getRepositoryManager() {
- return repositoryManager;
- }
-
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
}
Modified: lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java (original)
+++ lenya/trunk/org.apache.lenya.core.ac/src/main/java/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java Fri Feb 6 23:56:29 2009
@@ -33,9 +33,8 @@
import org.apache.lenya.ac.PolicyManager;
import org.apache.lenya.cms.linking.LinkRewriter;
import org.apache.lenya.cms.linking.OutgoingLinkRewriter;
-import org.apache.lenya.cms.repository.RepositoryManager;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.util.ServletHelper;
/**
@@ -51,7 +50,7 @@
*/
public static final String KEY_REDIRECT_URI = "redirectUri";
- private RepositoryManager repositoryManager;
+ private Repository repository;
public Map act(Redirector redirector, SourceResolver sourceResolver, Map objectModel,
String source, Parameters parameters) throws Exception {
@@ -76,7 +75,7 @@
Policy policy = policyManager.getPolicy(accessController.getAccreditableManager(),
url);
if (policy.isSSLProtected()) {
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
+ Session session = this.repository.getSession(request);
LinkRewriter rewriter = new OutgoingLinkRewriter(session, url, false, true,
false);
String sslUri = rewriter.rewrite(url);
@@ -88,11 +87,7 @@
return null;
}
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
- }
-
- public RepositoryManager getRepositoryManager() {
- return repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
}
Modified: lenya/trunk/org.apache.lenya.core.ac/src/main/resources/META-INF/cocoon/spring/lenya-core-ac-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.ac/src/main/resources/META-INF/cocoon/spring/lenya-core-ac-components.xml?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.ac/src/main/resources/META-INF/cocoon/spring/lenya-core-ac-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.ac/src/main/resources/META-INF/cocoon/spring/lenya-core-ac-components.xml Fri Feb 6 23:56:29 2009
@@ -24,6 +24,7 @@
<bean name="org.apache.lenya.ac.AccessControllerResolver/publication"
class="org.apache.lenya.cms.ac.PublicationAccessControllerResolver">
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
</bean>
<bean name="org.apache.lenya.cms.ac.AccessControllerResolver/global"
class="org.apache.lenya.ac.impl.ConfigurableAccessControllerResolver">
Modified: lenya/trunk/org.apache.lenya.core.api/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/pom.xml?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.api/pom.xml Fri Feb 6 23:56:29 2009
@@ -44,5 +44,9 @@
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-serializers-impl</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-chaperon-impl</artifactId>
+ </dependency>
</dependencies>
</project>
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Repository.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Repository.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Repository.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Repository.java Fri Feb 6 23:56:29 2009
@@ -19,8 +19,12 @@
import javax.servlet.http.HttpServletRequest;
+import org.apache.lenya.ac.Identity;
+
public interface Repository {
Session getSession(HttpServletRequest request);
+
+ Session startSession(Identity identity, boolean modifiable);
}
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Session.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Session.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Session.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/Session.java Fri Feb 6 23:56:29 2009
@@ -17,14 +17,28 @@
*/
package org.apache.lenya.cms.publication;
+import org.apache.lenya.ac.Identity;
+import org.apache.lenya.cms.repository.RepositoryException;
+import org.apache.lenya.transaction.ConcurrentModificationException;
+
public interface Session {
Repository getRepository();
Publication getPublication(String id);
+ Publication[] getPublications();
+
boolean existsPublication(String id);
DocumentFactory getDocumentFactory();
+ Identity getIdentity();
+
+ void commit() throws RepositoryException, ConcurrentModificationException;
+
+ void rollback() throws RepositoryException;
+
+ boolean isModifiable();
+
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java Fri Feb 6 23:56:29 2009
@@ -19,6 +19,7 @@
import javax.servlet.http.HttpServletRequest;
+import org.apache.lenya.ac.Identity;
import org.apache.lenya.cms.repository.RepositoryException;
import org.apache.lenya.cms.repository.RepositoryManager;
import org.apache.lenya.cms.repository.RepositoryUtil;
@@ -33,14 +34,24 @@
try {
org.apache.lenya.cms.repository.Session repoSession = RepositoryUtil.getSession(
this.repositoryManager, request);
+ return new SessionImpl(this, repoSession);
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
- return null;
}
public void setRepositoryManager(RepositoryManager repositoryManager) {
this.repositoryManager = repositoryManager;
}
+ public Session startSession(Identity identity, boolean modifiable) {
+ org.apache.lenya.cms.repository.Session repoSession;
+ try {
+ repoSession = this.repositoryManager.createSession(identity, modifiable);
+ } catch (RepositoryException e) {
+ throw new RuntimeException(e);
+ }
+ return new SessionImpl(this, repoSession);
+ }
+
}
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java Fri Feb 6 23:56:29 2009
@@ -17,6 +17,9 @@
*/
package org.apache.lenya.cms.publication;
+import org.apache.lenya.ac.Identity;
+import org.apache.lenya.cms.repository.RepositoryException;
+import org.apache.lenya.transaction.ConcurrentModificationException;
import org.springframework.util.Assert;
public class SessionImpl implements Session {
@@ -56,4 +59,24 @@
return getDocumentFactory().existsPublication(id);
}
+ public Publication[] getPublications() {
+ return getDocumentFactory().getPublications();
+ }
+
+ public Identity getIdentity() {
+ return getDocumentFactory().getSession().getIdentity();
+ }
+
+ public void commit() throws RepositoryException, ConcurrentModificationException {
+ getDocumentFactory().getSession().commit();
+ }
+
+ public void rollback() throws RepositoryException {
+ getDocumentFactory().getSession().rollback();
+ }
+
+ public boolean isModifiable() {
+ return getDocumentFactory().getSession().isModifiable();
+ }
+
}
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=741792&r1=741791&r2=741792&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 Fri Feb 6 23:56:29 2009
@@ -19,6 +19,10 @@
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"/>
+ </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"/>
@@ -27,7 +31,8 @@
</bean>
<bean name="org.apache.lenya.cms.publication.PublicationManager"
class="org.apache.lenya.cms.publication.PublicationManagerImpl">
- <property name="documentFactoryBuilder" ref="org.apache.lenya.cms.publication.DocumentFactoryBuilder"/>
+ <property name="documentFactoryBuilder"
+ ref="org.apache.lenya.cms.publication.DocumentFactoryBuilder"/>
<property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
</bean>
<bean name="org.apache.lenya.cms.metadata.MetaDataCache"
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java Fri Feb 6 23:56:29 2009
@@ -28,10 +28,11 @@
import org.apache.cocoon.environment.Request;
import org.apache.lenya.cms.linking.LinkRewriter;
import org.apache.lenya.cms.linking.OutgoingLinkRewriter;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.cms.repository.RepositoryException;
import org.apache.lenya.cms.repository.RepositoryManager;
import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
/**
* <p>
@@ -57,7 +58,7 @@
protected static final String PARAMETER_URLS = "urls";
private boolean relativeUrls;
- private RepositoryManager repositoryManager;
+ protected Repository repository;
/**
* @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
@@ -89,7 +90,7 @@
protected String rewrite(Request request, String url) throws RepositoryException,
ConfigurationException {
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
+ Session session = this.repository.getSession(request);
LinkRewriter rewriter = new OutgoingLinkRewriter(session, request.getRequestURI(), request
.isSecure(), false, this.relativeUrls);
if (!rewriter.matches(url)) {
@@ -137,12 +138,8 @@
}
}
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
- }
-
- public RepositoryManager getRepositoryManager() {
- return repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
}
\ No newline at end of file
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java Fri Feb 6 23:56:29 2009
@@ -22,12 +22,11 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.ParameterException;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
@@ -36,6 +35,8 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.transformation.AbstractSAXTransformer;
import org.apache.lenya.ac.AccessControlException;
+import org.apache.lenya.cms.linking.LinkRewriteAttribute;
+import org.apache.lenya.cms.linking.LinkRewriteAttributes;
import org.apache.lenya.cms.linking.LinkRewriter;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.URLInformation;
@@ -46,13 +47,12 @@
/**
* <p>
- * This transformer processes all links which are configured using
- * <code><transform/></code> elements.
+ * This transformer processes all links which are configured using <code><transform/></code>
+ * elements.
* </p>
* <p>
- * If the link rewriter returns <code>null</code> for a link, an attribute can
- * be added to the corresponding element, with an optional message of the form
- * "Broken link: ...".
+ * If the link rewriter returns <code>null</code> for a link, an attribute can be added to the
+ * corresponding element, with an optional message of the form "Broken link: ...".
* </p>
* <code><pre>
* <map:transformer ... >
@@ -62,19 +62,20 @@
* </map:transformer>
* </pre></code>
* <p>
- * The reference URL can optionally be passed using the <em>url</em>
- * parameter.
+ * The reference URL can optionally be passed using the <em>url</em> parameter.
* </p>
*/
public abstract class AbstractLinkTransformer extends AbstractSAXTransformer {
private String area;
protected static final String PARAM_URL = "url";
+
+ public AbstractLinkTransformer() {
+ }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters params)
throws ProcessingException, SAXException, IOException {
super.setup(resolver, objectModel, src, params);
-
String webappUrl = getWebappUrl(params, objectModel);
URLInformation url = new URLInformation(webappUrl);
this.area = url.getArea();
@@ -83,9 +84,8 @@
/**
* @param params
* @param objectModel
- * @return The web application URL which was passed using the <em>url</em>
- * parameter or the web application URL the transformer was called on,
- * respectively.
+ * @return The web application URL which was passed using the <em>url</em> parameter or the web
+ * application URL the transformer was called on, respectively.
* @throws ProcessingException
*/
protected String getWebappUrl(Parameters params, Map objectModel) throws ProcessingException {
@@ -108,77 +108,38 @@
*/
private Set localNames = new HashSet();
- private boolean markBrokenLinks;
private String brokenLinkAttribute;
private String brokenLinkValue;
private String brokenLinkMessageAttribute;
- public void configure(Configuration config) throws ConfigurationException {
- super.configure(config);
- Configuration[] transformConfigs = config.getChildren("transform");
- for (int i = 0; i < transformConfigs.length; i++) {
- String namespace = transformConfigs[i].getAttribute("namespace");
- String element = transformConfigs[i].getAttribute("element");
- String attribute = transformConfigs[i].getAttribute("attribute");
- AttributeConfiguration attrConfig = new AttributeConfiguration(namespace, element,
- attribute);
- String key = getCacheKey(namespace, element);
+ public void setBrokenLinkAttribute(String brokenLinkAttribute) {
+ this.brokenLinkAttribute = brokenLinkAttribute;
+ }
+
+ public void setBrokenLinkValue(String brokenLinkValue) {
+ this.brokenLinkValue = brokenLinkValue;
+ }
+
+ public void setBrokenLinkMessageAttribute(String brokenLinkMessageAttribute) {
+ this.brokenLinkMessageAttribute = brokenLinkMessageAttribute;
+ }
+
+ public void setAttributes(LinkRewriteAttributes attributes) {
+ List attrs = attributes.getAttributes();
+ for (Iterator i = attrs.iterator(); i.hasNext(); ) {
+ LinkRewriteAttribute attr = (LinkRewriteAttribute) i.next();
+ String key = getCacheKey(attr.getNamespace(), attr.getElement());
Set configs = (Set) this.namespaceLocalname2configSet.get(key);
if (configs == null) {
configs = new HashSet();
- this.localNames.add(element);
+ this.localNames.add(attr.getElement());
this.namespaceLocalname2configSet.put(key, configs);
}
- configs.add(attrConfig);
- }
- Configuration brokenLinksConfig = config.getChild("markBrokenLinks", false);
- if (brokenLinksConfig != null) {
- this.brokenLinkAttribute = brokenLinksConfig.getAttribute("attribute");
- this.brokenLinkValue = brokenLinksConfig.getAttribute("value");
- String messageAttr = brokenLinksConfig.getAttribute("messageAttribute", null);
- if (messageAttr != null) {
- this.brokenLinkMessageAttribute = messageAttr;
- }
- this.markBrokenLinks = true;
- } else {
- this.markBrokenLinks = false;
+ configs.add(attr);
}
}
/**
- * Declaration of an attribute which should be transformed.
- */
- public static class AttributeConfiguration {
-
- protected final String element;
- protected final String namespace;
- protected final String attribute;
-
- /**
- * @param namespace The namespace of the element.
- * @param element The local name of the element.
- * @param attribute The name of the attribute to transform.
- */
- public AttributeConfiguration(String namespace, String element, String attribute) {
- this.namespace = namespace;
- this.element = element;
- this.attribute = attribute;
- }
-
- /**
- * @param uri The namespace URI.
- * @param name The local name.
- * @param attrs The attributes.
- * @return If this configuration matches the parameters.
- */
- public boolean matches(String uri, String name, Attributes attrs) {
- return this.namespace.equals(uri) && this.element.equals(name)
- && attrs.getValue(this.attribute) != null;
- }
-
- }
-
- /**
* @param namespace The namespace URI.
* @param localName The local name.
* @param attrs The attributes.
@@ -197,7 +158,7 @@
Set configs = null;
Set allConfigs = (Set) this.namespaceLocalname2configSet.get(key);
for (Iterator i = allConfigs.iterator(); i.hasNext();) {
- AttributeConfiguration config = (AttributeConfiguration) i.next();
+ LinkRewriteAttribute config = (LinkRewriteAttribute) i.next();
if (config.matches(namespace, localName, attrs)) {
if (configs == null) {
configs = new HashSet();
@@ -237,8 +198,8 @@
protected boolean useIgnore = false;
/**
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
- * java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String,
+ * java.lang.String, org.xml.sax.Attributes)
*/
public void startElement(String uri, String name, String qname, Attributes attrs)
throws SAXException {
@@ -258,8 +219,8 @@
this.ignoreLinkElement = false;
for (Iterator i = configs.iterator(); i.hasNext();) {
- AttributeConfiguration config = (AttributeConfiguration) i.next();
- String linkUrl = newAttrs.getValue(config.attribute);
+ LinkRewriteAttribute config = (LinkRewriteAttribute) i.next();
+ String linkUrl = newAttrs.getValue(config.getAttribute());
try {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this.indent + "link URL: [" + linkUrl + "]");
@@ -299,29 +260,28 @@
* Handle a link in the source SAX stream.
* @param linkUrl The link URL.
* @param config The attribute configuration which matched the link.
- * @param newAttrs The new attributes which will be added to the result
- * element.
+ * @param newAttrs The new attributes which will be added to the result element.
* @throws Exception if an error occurs.
*/
- protected void handleLink(String linkUrl, AttributeConfiguration config, AttributesImpl newAttrs)
+ protected void handleLink(String linkUrl, LinkRewriteAttribute config, AttributesImpl newAttrs)
throws Exception {
if (getLinkRewriter().matches(linkUrl)) {
String rewrittenUrl = getLinkRewriter().rewrite(linkUrl);
if (rewrittenUrl != null) {
- setAttribute(newAttrs, config.attribute, rewrittenUrl);
+ setAttribute(newAttrs, config.getAttribute(), rewrittenUrl);
} else {
if (this.area != null && this.area.equals(Publication.LIVE_AREA)) {
this.ignoreLinkElement = true;
} else {
- markBrokenLink(newAttrs, config.attribute, linkUrl);
+ markBrokenLink(newAttrs, config.getAttribute(), linkUrl);
}
}
}
}
/**
- * @see org.xml.sax.ContentHandler#endElement(java.lang.String,
- * java.lang.String, java.lang.String)
+ * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String,
+ * java.lang.String)
*/
public void endElement(String uri, String name, String qname) throws SAXException {
if (getLogger().isDebugEnabled()) {
@@ -347,8 +307,7 @@
* @param attr The attributes.
* @param name The attribute name.
* @param value The value.
- * @throws IllegalArgumentException if the href attribute is not contained
- * in this attributes.
+ * @throws IllegalArgumentException if the href attribute is not contained in this attributes.
*/
protected void setAttribute(AttributesImpl attr, String name, String value) {
int position = attr.getIndex(name);
@@ -364,17 +323,15 @@
protected abstract LinkRewriter getLinkRewriter();
/**
- * Marks a link element as broken and removes the attribute which contained
- * the URL.
+ * Marks a link element as broken and removes the attribute which contained the URL.
* @param newAttrs The new attributes.
- * @param attrName The attribute name containing the URL which could not be
- * rewritten.
+ * @param attrName The attribute name containing the URL which could not be rewritten.
* @param brokenLinkUri The broken link URI.
* @throws AccessControlException when something went wrong.
*/
protected void markBrokenLink(AttributesImpl newAttrs, String attrName, String brokenLinkUri)
throws AccessControlException {
- if (this.markBrokenLinks) {
+ if (this.brokenLinkAttribute != null) {
if (newAttrs.getIndex(this.brokenLinkAttribute) > -1) {
newAttrs.removeAttribute(newAttrs.getIndex(this.brokenLinkAttribute));
}
@@ -397,7 +354,6 @@
}
public void recycle() {
- super.recycle();
this.area = null;
this.ignoreLinkElementStack.clear();
}
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java Fri Feb 6 23:56:29 2009
@@ -29,9 +29,8 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.lenya.cms.linking.LinkRewriter;
import org.apache.lenya.cms.linking.OutgoingLinkRewriter;
-import org.apache.lenya.cms.repository.RepositoryManager;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.xml.sax.SAXException;
/**
@@ -65,7 +64,7 @@
private boolean relativeUrls = false;
private LinkRewriter rewriter;
- private RepositoryManager repositoryManager;
+ private Repository repository;
public void setup(SourceResolver resolver, Map objectModel, String source, Parameters params)
throws ProcessingException, SAXException, IOException {
@@ -76,7 +75,7 @@
if (params.isParameter(PARAMETER_URLS)) {
setUrlType(params.getParameter(PARAMETER_URLS));
}
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
+ Session session = this.repository.getSession(request);
String webappUrl = getWebappUrl(params, objectModel);
this.rewriter = new OutgoingLinkRewriter(session, webappUrl, request.isSecure(), false,
this.relativeUrls);
@@ -114,12 +113,9 @@
this.rewriter = null;
}
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
- public RepositoryManager getRepositoryManager() {
- return repositoryManager;
- }
}
Added: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttribute.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttribute.java?rev=741792&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttribute.java (added)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttribute.java Fri Feb 6 23:56:29 2009
@@ -0,0 +1,38 @@
+/*
+ * 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.linking;
+
+import org.xml.sax.Attributes;
+
+public interface LinkRewriteAttribute {
+
+ String getNamespace();
+
+ String getElement();
+
+ String getAttribute();
+
+ /**
+ * @param uri The namespace URI.
+ * @param name The local name.
+ * @param attrs The attributes.
+ * @return If this configuration matches the parameters.
+ */
+ boolean matches(String uri, String name, Attributes attrs);
+
+}
Added: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttributes.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttributes.java?rev=741792&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttributes.java (added)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/LinkRewriteAttributes.java Fri Feb 6 23:56:29 2009
@@ -0,0 +1,26 @@
+/*
+ * 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.linking;
+
+import java.util.List;
+
+public interface LinkRewriteAttributes {
+
+ List getAttributes();
+
+}
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java Fri Feb 6 23:56:29 2009
@@ -32,13 +32,11 @@
import org.apache.lenya.ac.AccreditableManager;
import org.apache.lenya.ac.Policy;
import org.apache.lenya.ac.PolicyManager;
-import org.apache.lenya.cms.publication.DocumentFactory;
-import org.apache.lenya.cms.publication.DocumentUtil;
import org.apache.lenya.cms.publication.Proxy;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationException;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.cms.publication.URLInformation;
-import org.apache.lenya.cms.repository.Session;
import org.apache.lenya.util.StringUtil;
/**
@@ -56,10 +54,10 @@
private boolean relativeUrls;
private PolicyManager policyManager;
private AccreditableManager accreditableManager;
- private DocumentFactory factory;
private boolean ssl;
private GlobalProxies globalProxies;
private boolean considerSslPolicies;
+ private Session session;
/**
* @param session The current session.
@@ -81,7 +79,7 @@
ServiceSelector serviceSelector = null;
try {
- this.factory = DocumentUtil.createDocumentFactory(session);
+ this.session = session;
if (this.considerSslPolicies) {
AccessControllerResolver acResolver = (AccessControllerResolver) WebAppContextUtils
@@ -95,7 +93,7 @@
}
}
- Publication[] pubs = this.factory.getPublications();
+ Publication[] pubs = this.session.getPublications();
for (int i = 0; i < pubs.length; i++) {
this.publicationCache.put(pubs[i].getId(), pubs[i]);
}
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/GlobalProxiesImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/GlobalProxiesImpl.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/GlobalProxiesImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/GlobalProxiesImpl.java Fri Feb 6 23:56:29 2009
@@ -20,15 +20,9 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.avalon.framework.configuration.Configurable;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.processing.ProcessInfoProvider;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
import org.apache.cocoon.util.AbstractLogEnabled;
-import org.apache.lenya.cms.cocoon.components.context.ContextUtility;
import org.apache.lenya.cms.linking.GlobalProxies;
import org.apache.lenya.cms.publication.Proxy;
@@ -36,11 +30,9 @@
* GlobalProxy service implementation.
* The class is implemented as a singleton.
*/
-public class GlobalProxiesImpl extends AbstractLogEnabled implements GlobalProxies, Serviceable,
- ThreadSafe, Configurable {
+public class GlobalProxiesImpl extends AbstractLogEnabled implements GlobalProxies {
private Map ssl2proxy = new HashMap();
- private ServiceManager manager;
public Proxy getProxy(boolean ssl) {
Object key = Boolean.valueOf(ssl);
@@ -52,37 +44,24 @@
}
protected synchronized Proxy initializeProxy(Object key) {
- Proxy proxy;
- proxy = new Proxy();
- ContextUtility context = null;
- try {
- context = (ContextUtility) manager.lookup(ContextUtility.ROLE);
- proxy.setUrl(context.getRequest().getContextPath());
- } catch (ServiceException e) {
- throw new RuntimeException(e);
- }
- finally {
- if (context != null) {
- this.manager.release(context);
- }
- }
+ ProcessInfoProvider process = (ProcessInfoProvider) WebAppContextUtils
+ .getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
+ Proxy proxy = new Proxy();
+ proxy.setUrl(process.getRequest().getContextPath());
this.ssl2proxy.put(key, proxy);
return proxy;
}
-
- public void service(ServiceManager manager) throws ServiceException {
- this.manager = manager;
+
+ public void setNonSslProxyUrl(String url) {
+ Proxy proxy = new Proxy();
+ proxy.setUrl(url);
+ setProxy(false, proxy);
}
- public void configure(Configuration config) throws ConfigurationException {
- Configuration[] proxyConfigs = config.getChildren("proxy");
- for (int p = 0; p < proxyConfigs.length; p++) {
- boolean ssl = proxyConfigs[p].getAttributeAsBoolean("ssl");
- String url = proxyConfigs[p].getAttribute("url");
- Proxy proxy = new Proxy();
- proxy.setUrl(url);
- setProxy(ssl, proxy);
- }
+ public void setSslProxyUrl(String url) {
+ Proxy proxy = new Proxy();
+ proxy.setUrl(url);
+ setProxy(true, proxy);
}
/**
Added: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributeImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributeImpl.java?rev=741792&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributeImpl.java (added)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributeImpl.java Fri Feb 6 23:56:29 2009
@@ -0,0 +1,64 @@
+/*
+ * 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.linking.impl;
+
+import org.apache.lenya.cms.linking.LinkRewriteAttribute;
+import org.xml.sax.Attributes;
+
+public class LinkRewriteAttributeImpl implements LinkRewriteAttribute {
+
+ public String namespace;
+ public String element;
+ public String attribute;
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public String getElement() {
+ return element;
+ }
+
+ public void setElement(String element) {
+ this.element = element;
+ }
+
+ public String getAttribute() {
+ return attribute;
+ }
+
+ public void setAttribute(String attribute) {
+ this.attribute = attribute;
+ }
+
+ /**
+ * @param uri The namespace URI.
+ * @param name The local name.
+ * @param attrs The attributes.
+ * @return If this configuration matches the parameters.
+ */
+ public boolean matches(String uri, String name, Attributes attrs) {
+ return this.namespace.equals(uri) && this.element.equals(name)
+ && attrs.getValue(this.attribute) != null;
+ }
+
+}
Added: lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributesImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributesImpl.java?rev=741792&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributesImpl.java (added)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/java/org/apache/lenya/cms/linking/impl/LinkRewriteAttributesImpl.java Fri Feb 6 23:56:29 2009
@@ -0,0 +1,37 @@
+/*
+ * 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.linking.impl;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.lenya.cms.linking.LinkRewriteAttributes;
+
+public class LinkRewriteAttributesImpl implements LinkRewriteAttributes {
+
+ private List attributes;
+
+ public void setAttributes(List attributes) {
+ this.attributes = attributes;
+ }
+
+ public List getAttributes() {
+ return Collections.unmodifiableList(this.attributes);
+ }
+
+}
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/avalon/lenya-core-linking-sitemap.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/avalon/lenya-core-linking-sitemap.xconf?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/avalon/lenya-core-linking-sitemap.xconf (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/avalon/lenya-core-linking-sitemap.xconf Fri Feb 6 23:56:29 2009
@@ -17,6 +17,7 @@
-->
<map:components xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <!--
<map:transformers>
<map:transformer name="uuid2url-xhtml" logger="lenya.sitemap.transformer.uuid2url"
@@ -65,4 +66,5 @@
</map:transformer>
</map:transformers>
+ -->
</map:components>
Modified: lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/spring/lenya-core-linking-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/spring/lenya-core-linking-components.xml?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/spring/lenya-core-linking-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.linking/src/main/resources/META-INF/cocoon/spring/lenya-core-linking-components.xml Fri Feb 6 23:56:29 2009
@@ -18,9 +18,70 @@
<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:p="http://www.springframework.org/schema/p"
xmlns="http://www.springframework.org/schema/beans">
+
+ <!-- Input Modules -->
<bean name="org.apache.cocoon.components.modules.input.InputModule/proxy"
- class="org.apache.lenya.cms.cocoon.components.modules.input.ProxyModule"/>
+ class="org.apache.lenya.cms.cocoon.components.modules.input.ProxyModule">
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
+ </bean>
<bean name="org.apache.cocoon.components.modules.input.InputModule/uuid2url"
class="org.apache.lenya.cms.cocoon.components.modules.input.UuidToUrlModule"/>
+
+ <!-- Lenya can rewrite the links to cater to special proxy setups.
+ Make sure to update the proxy configuration in publication.xml as well.
+ For information about these settings, read
+ http://lenya.apache.org/docs/2_0_x/tutorials/proxy.html
+
+ The example setting below describes a test setup that corresponds to the example
+ in src/pubs/default/config/publication.xml.
+ -->
+ <bean name="org.apache.lenya.cms.linking.GlobalProxies"
+ class="org.apache.lenya.cms.linking.impl.GlobalProxiesImpl">
+ <!--
+ <property name="nonSslProxyUrl" value="http://www.example.com/lenya"/>
+ <property name="sslProxyUrl" value="https://www.example.com/lenya"/>
+ -->
+ </bean>
+
+ <bean id="xhtml-a-href" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="a" p:attribute="href"/>
+ <bean id="xhtml-object-data" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="object" p:attribute="data"/>
+ <bean id="xhtml-img-src" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="img" p:attribute="src"/>
+ <bean id="xhtml-link-href" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="link" p:attribute="href"/>
+ <bean id="xhtml-form-action" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="form" p:attribute="action"/>
+ <bean id="xhtml-script-src" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="script" p:attribute="src"/>
+ <bean id="xhtml-input-src" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributeImpl"
+ p:namespace="http://www.w3.org/1999/xhtml" p:element="input" p:attribute="src"/>
+
+ <bean id="link-rewriting-xhtml" class="org.apache.lenya.cms.linking.impl.LinkRewriteAttributesImpl">
+ <property name="attributes">
+ <list>
+ <ref bean="xhtml-a-href"/>
+ <ref bean="xhtml-object-data"/>
+ <ref bean="xhtml-img-src"/>
+ <ref bean="xhtml-link-href"/>
+ <ref bean="xhtml-form-action"/>
+ <ref bean="xhtml-script-src"/>
+ <ref bean="xhtml-input-src"/>
+ </list>
+ </property>
+ </bean>
+
+ <!-- Transformers -->
+ <bean name="org.apache.cocoon.transformation.Transformer/proxy-xhtml"
+ class="org.apache.lenya.cms.cocoon.transformation.ProxyTransformer"
+ scope="prototype">
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
+ <property name="attributes" ref="link-rewriting-xhtml"/>
+ </bean>
+
+
+
</beans>
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/AbstractUsecase.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/AbstractUsecase.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/AbstractUsecase.java (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/AbstractUsecase.java Fri Feb 6 23:56:29 2009
@@ -36,12 +36,11 @@
import org.apache.lenya.cms.publication.DocumentFactoryBuilder;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationException;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.cms.publication.URLInformation;
import org.apache.lenya.cms.repository.Node;
import org.apache.lenya.cms.repository.RepositoryException;
-import org.apache.lenya.cms.repository.RepositoryManager;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
import org.apache.lenya.transaction.ConcurrentModificationException;
import org.apache.lenya.transaction.LockException;
import org.apache.lenya.transaction.TransactionLock;
@@ -84,8 +83,7 @@
protected static final String PARAMETERS_INITIALIZED = "private.parametersInitialized";
- private DocumentFactoryBuilder documentFactoryBuilder;
- private RepositoryManager repositoryManager;
+ private Repository repository;
private UsecaseView view;
/**
@@ -551,8 +549,8 @@
protected DocumentFactory getDocumentFactory() {
DocumentFactory factory = (DocumentFactory) getParameter(PARAMETER_FACTORY);
Session session = getSession();
- if (factory == null || factory.getSession() != session) {
- factory = getDocumentFactoryBuilder().createDocumentFactory(session);
+ if (factory == null || factory != session.getDocumentFactory()) {
+ factory = session.getDocumentFactory();
setParameter(PARAMETER_FACTORY, factory);
}
return factory;
@@ -561,11 +559,11 @@
/**
* TODO: Add init-method to bean.
*/
- public final void initialize() throws RepositoryException {
+ public final void initialize() {
ProcessInfoProvider processInfo = (ProcessInfoProvider) WebAppContextUtils
.getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
HttpServletRequest request = processInfo.getRequest();
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
+ Session session = this.repository.getSession(request);
setSession(session);
setParameter(PARAMETER_STATE_MACHINE, new StateMachine(MODEL));
}
@@ -702,11 +700,7 @@
* @see org.apache.lenya.cms.usecase.Usecase#lockInvolvedObjects()
*/
public final void lockInvolvedObjects() throws UsecaseException {
- try {
- startTransaction();
- } catch (RepositoryException e) {
- throw new UsecaseException(e);
- }
+ startTransaction();
synchronized (TransactionLock.LOCK) {
lockInvolvedObjects(getNodesToLock());
}
@@ -717,9 +711,9 @@
* Start a transaction by using a new, modifiable session.
* @throws RepositoryException if an error occurs.
*/
- protected void startTransaction() throws RepositoryException {
+ protected void startTransaction() {
if (this.commitEnabled) {
- setSession(getRepositoryManager().createSession(getSession().getIdentity(), true));
+ setSession(this.repository.startSession(getSession().getIdentity(), true));
}
}
@@ -742,7 +736,9 @@
if (!objects[i].isLocked()) {
objects[i].lock();
}
- if (!isOptimistic() && !objects[i].isCheckedOutBySession(getSession())) {
+ if (!isOptimistic()
+ && !objects[i].isCheckedOutBySession(getSession().getDocumentFactory()
+ .getSession())) {
objects[i].checkout(checkoutRestrictedToSession());
}
}
@@ -755,7 +751,9 @@
boolean canExecute = true;
for (int i = 0; i < objects.length; i++) {
- if (objects[i].isCheckedOut() && !objects[i].isCheckedOutBySession(getSession())) {
+ if (objects[i].isCheckedOut()
+ && !objects[i].isCheckedOutBySession(getSession().getDocumentFactory()
+ .getSession())) {
if (getLogger().isDebugEnabled()) {
getLogger().debug(
"AbstractUsecase::lockInvolvedObjects() can not execute, object ["
@@ -819,7 +817,7 @@
return (Session) getParameter(PARAMETER_SESSION);
}
- protected void setSession(org.apache.lenya.cms.repository.Session session) {
+ protected void setSession(Session session) {
setParameter(PARAMETER_SESSION, session);
}
@@ -834,20 +832,12 @@
return getParameterAsBoolean(PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION, true);
}
- protected DocumentFactoryBuilder getDocumentFactoryBuilder() {
- return documentFactoryBuilder;
- }
-
- public void setDocumentFactoryBuilder(DocumentFactoryBuilder documentFactoryBuilder) {
- this.documentFactoryBuilder = documentFactoryBuilder;
- }
-
- protected RepositoryManager getRepositoryManager() {
- return repositoryManager;
+ protected Repository getRepository() {
+ return repository;
}
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
public void setParameters(Properties params) {
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/Usecase.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/Usecase.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/Usecase.java (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/Usecase.java Fri Feb 6 23:56:29 2009
@@ -20,7 +20,7 @@
import java.util.List;
import org.apache.cocoon.servlet.multipart.Part;
-import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.cms.publication.Session;
/**
* Usecase interface.
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/UsecaseInvoker.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/UsecaseInvoker.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/UsecaseInvoker.java (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/UsecaseInvoker.java Fri Feb 6 23:56:29 2009
@@ -20,7 +20,7 @@
import java.util.List;
import java.util.Map;
-import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.cms.publication.Session;
/**
* <p>
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/usecase/impl/UsecaseInvokerImpl.java Fri Feb 6 23:56:29 2009
@@ -37,10 +37,9 @@
import org.apache.lenya.cms.publication.DocumentFactory;
import org.apache.lenya.cms.publication.DocumentUtil;
import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.Session;
import org.apache.lenya.cms.publication.URLInformation;
-import org.apache.lenya.cms.repository.RepositoryManager;
-import org.apache.lenya.cms.repository.RepositoryUtil;
-import org.apache.lenya.cms.repository.Session;
import org.apache.lenya.cms.usecase.Usecase;
import org.apache.lenya.cms.usecase.UsecaseException;
import org.apache.lenya.cms.usecase.UsecaseInvoker;
@@ -56,7 +55,7 @@
public class UsecaseInvokerImpl extends AbstractLogEnabled implements UsecaseInvoker {
private String targetUrl;
- private RepositoryManager repositoryManager;
+ private Repository repository;
private UsecaseResolver usecaseResolver;
/**
@@ -75,10 +74,9 @@
ProcessInfoProvider process = (ProcessInfoProvider) context
.getBean(ProcessInfoProvider.ROLE);
HttpServletRequest request = process.getRequest();
- Session session = RepositoryUtil.getSession(getRepositoryManager(), request);
- DocumentFactory factory = DocumentUtil.createDocumentFactory(session);
+ Session session = this.repository.getSession(request);
URLInformation info = new URLInformation(webappUrl);
- Publication pub = factory.getPublication(info.getPublicationId());
+ Publication pub = session.getPublication(info.getPublicationId());
Role[] roles = PolicyUtil.getRoles(request);
Authorizer[] authorizers = accessController.getAuthorizers();
@@ -112,7 +110,7 @@
return;
}
- usecase = getUsecaseResolver().resolve(webappUrl, usecaseName);
+ usecase = this.usecaseResolver.resolve(webappUrl, usecaseName);
Session testSession = getTestSession();
if (testSession != null) {
@@ -233,20 +231,12 @@
this.testSession = session;
}
- public void setRepositoryManager(RepositoryManager repositoryManager) {
- this.repositoryManager = repositoryManager;
- }
-
- public RepositoryManager getRepositoryManager() {
- return repositoryManager;
+ public void setRepository(Repository repository) {
+ this.repository = repository;
}
public void setUsecaseResolver(UsecaseResolver usecaseResolver) {
this.usecaseResolver = usecaseResolver;
}
- public UsecaseResolver getUsecaseResolver() {
- return usecaseResolver;
- }
-
}
Modified: lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Publish.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Publish.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Publish.java (original)
+++ lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Publish.java Fri Feb 6 23:56:29 2009
@@ -381,9 +381,9 @@
Message message = new Message(subject, body, sender, recipients);
NotificationEventDescriptor descriptor = new NotificationEventDescriptor(message);
- RepositoryEvent event = RepositoryEventFactory.createEvent(getSession(), getLogger(),
- descriptor);
- getSession().enqueueEvent(event);
+ RepositoryEvent event = RepositoryEventFactory.createEvent(getSession()
+ .getDocumentFactory().getSession(), getLogger(), descriptor);
+ getSession().getDocumentFactory().getSession().enqueueEvent(event);
}
/**
Modified: lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Reject.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Reject.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Reject.java (original)
+++ lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Reject.java Fri Feb 6 23:56:29 2009
@@ -116,9 +116,9 @@
Message message = new Message(subject, body, sender, recipients);
NotificationEventDescriptor descriptor = new NotificationEventDescriptor(message);
- RepositoryEvent event = RepositoryEventFactory.createEvent(getSession(), getLogger(),
- descriptor);
- getSession().enqueueEvent(event);
+ RepositoryEvent event = RepositoryEventFactory.createEvent(getSession()
+ .getDocumentFactory().getSession(), getLogger(), descriptor);
+ getSession().getDocumentFactory().getSession().enqueueEvent(event);
}
}
}
Modified: lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Submit.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Submit.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Submit.java (original)
+++ lenya/trunk/org.apache.lenya.core.workflow/src/main/java/org/apache/lenya/cms/workflow/usecases/Submit.java Fri Feb 6 23:56:29 2009
@@ -100,8 +100,8 @@
Message message = new Message(subject, body, sender, recipients);
NotificationEventDescriptor descriptor = new NotificationEventDescriptor(message);
- RepositoryEvent event = RepositoryEventFactory.createEvent(getSession(), getLogger(),
- descriptor);
- getSession().enqueueEvent(event);
+ RepositoryEvent event = RepositoryEventFactory.createEvent(getSession()
+ .getDocumentFactory().getSession(), getLogger(), descriptor);
+ getSession().getDocumentFactory().getSession().enqueueEvent(event);
}
}
Modified: lenya/trunk/org.apache.lenya.module.lucene/src/main/java/org/apache/lenya/cms/lucene/IndexSite.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.lucene/src/main/java/org/apache/lenya/cms/lucene/IndexSite.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.lucene/src/main/java/org/apache/lenya/cms/lucene/IndexSite.java (original)
+++ lenya/trunk/org.apache.lenya.module.lucene/src/main/java/org/apache/lenya/cms/lucene/IndexSite.java Fri Feb 6 23:56:29 2009
@@ -44,8 +44,9 @@
for (int i = 0; i < docs.length; i++) {
try {
- getIndexUpdater().index(getSession(), docs[i].getResourceType(), pubId,
- area.getName(), docs[i].getUUID(), docs[i].getLanguage());
+ getIndexUpdater().index(getSession().getDocumentFactory().getSession(),
+ docs[i].getResourceType(), pubId, area.getName(), docs[i].getUUID(),
+ docs[i].getLanguage());
} catch (Exception e) {
String message = "Error indexing document [" + docs[i].getPath() + ":"
+ docs[i].getLanguage() + "], UUID=" + docs[i].getUUID();
Modified: lenya/trunk/org.apache.lenya.optional.jcrsource/src/main/java/org/apache/lenya/cms/jcr/usecases/JCRImport.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.optional.jcrsource/src/main/java/org/apache/lenya/cms/jcr/usecases/JCRImport.java?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.optional.jcrsource/src/main/java/org/apache/lenya/cms/jcr/usecases/JCRImport.java (original)
+++ lenya/trunk/org.apache.lenya.optional.jcrsource/src/main/java/org/apache/lenya/cms/jcr/usecases/JCRImport.java Fri Feb 6 23:56:29 2009
@@ -80,7 +80,7 @@
try {
Session session;
try {
- session = getRepository().login();
+ session = getJcrRepository().login();
} catch (LoginException e1) {
throw new JCRImportException("Login to repository failed", e1);
} catch (RepositoryException e1) {
@@ -169,7 +169,7 @@
this.repository = repository;
}
- public Repository getRepository() {
+ public Repository getJcrRepository() {
return repository;
}
Modified: lenya/trunk/org.apache.lenya.parent/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.parent/pom.xml?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.parent/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.parent/pom.xml Fri Feb 6 23:56:29 2009
@@ -263,6 +263,11 @@
<artifactId>cocoon-validation-impl</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-chaperon-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
<!-- Lenya -->
Modified: lenya/trunk/org.apache.lenya.webapp/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp/pom.xml?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.webapp/pom.xml Fri Feb 6 23:56:29 2009
@@ -27,12 +27,38 @@
</parent>
<artifactId>lenya-webapp</artifactId>
<version>2.2.0-SNAPSHOT</version>
- <packaging>war</packaging>
+ <packaging>jar</packaging>
<name>Apache Lenya Webapp</name>
<build>
<plugins>
<plugin>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-maven-plugin</artifactId>
+ <version>1.0.0-RC1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>rcl</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>rcl</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Cocoon-Block-Name>${pom.artifactId}</Cocoon-Block-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.7</version>
@@ -43,22 +69,40 @@
<maxIdleTime>30000</maxIdleTime>
</connector>
</connectors>
+ <!--
<webAppSourceDirectory>./target/lenya-webapp</webAppSourceDirectory>
+ -->
+ <webAppSourceDirectory>${project.build.directory}/rcl/webapp</webAppSourceDirectory>
<contextPath>${jetty.context}</contextPath>
</configuration>
</plugin>
+ <!--
+ <plugin>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-maven-plugin</artifactId>
+ <version>1.0.0-RC1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>rcl</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>rcl</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
</plugins>
<finalName>lenya-webapp</finalName>
</build>
-
+
<dependencies>
- <!-- Cocoon Core -->
+ <!-- Cocoon -->
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-core</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-servlet-service-impl</artifactId>
@@ -72,7 +116,11 @@
<artifactId>cocoon-block-deployment</artifactId>
</dependency>
- <!-- Lenya Welcome Page -->
+ <!-- Lenya -->
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.lenya</groupId>
<artifactId>lenya-welcome</artifactId>
Modified: lenya/trunk/org.apache.lenya.webapp/rcl.properties
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp/rcl.properties?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp/rcl.properties (original)
+++ lenya/trunk/org.apache.lenya.webapp/rcl.properties Fri Feb 6 23:56:29 2009
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-org.apache.lenya.lenya-webapp.service%classes-dir=./target/classes
\ No newline at end of file
+org.apache.lenya-welcome.block%classes-dir=../org.apache.lenya.welcome/target/classes
Modified: lenya/trunk/org.apache.lenya.welcome/rcl.properties
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.welcome/rcl.properties?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.welcome/rcl.properties (original)
+++ lenya/trunk/org.apache.lenya.welcome/rcl.properties Fri Feb 6 23:56:29 2009
@@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-org.apache.cocoon-welcome.block%classes-dir=./target/classes
+org.apache.lenya-welcome.block%classes-dir=./target/classes
Modified: lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/global-sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/global-sitemap.xmap?rev=741792&r1=741791&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/global-sitemap.xmap (original)
+++ lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/global-sitemap.xmap Fri Feb 6 23:56:29 2009
@@ -23,11 +23,17 @@
<map:resource name="style-cms-page">
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"/>
- </map:transform>
- <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
+ </map:transform>
+ <map:transform src="lenya/xslt/util/page2xhtml.xsl"/>
<map:transform type="proxy-xhtml"/>
- <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
- <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>
+ <!--
+ <map:transform src="lenya/xslt/util/strip_namespaces.xsl"/>
+ -->
+ <!--
+ <map:transform type="servletService">
+ <map:parameter name="service" value="servlet:org.apache.lenya.module.prettyprinting:/xml2nicexml"/>
+ </map:transform>
+ -->
</map:resource>
<map:resource name="i18n">
@@ -218,11 +224,13 @@
<!-- the Lenya welcome page with a list of available publications -->
<map:match pattern="index.html">
<map:aggregate element="aggregation-wrapper" label="aggregate">
+ <!--
<map:part src="cocoon:/aggregate-publications"/>
- <map:part src="lenya/content/welcome.xml"/>
- <map:part src="readme.xml"/>
+ -->
+ <map:part src="content/welcome.xml"/>
+ <map:part src="content/readme.xml"/>
</map:aggregate>
- <map:transform src="lenya/xslt/util/welcome.xsl"/>
+ <map:transform src="xslt/welcome.xsl"/>
<map:call resource="style-cms-page"/>
<map:serialize />
</map:match>
Modified: lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/lenya.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/lenya.xmap?rev=741792&r1=741772&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/lenya.xmap (original)
+++ lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/lenya.xmap Fri Feb 6 23:56:29 2009
@@ -24,9 +24,9 @@
<map:resource name="proxy-css">
<map:generate type="text" src="{url}.css"/>
<map:transform type="pattern" src="fallback://lenya/chaperon/grammars/link.xlex"/>
- <map:transform src="fallback://lenya/chaperon/stylesheets/pattern-to-link.xsl"/>
- <map:transform type="proxy"/>
- <map:transform src="fallback://lenya/chaperon/stylesheets/a-to-txt.xsl"/>
+ <map:transform src="chaperon/stylesheets/pattern-to-link.xsl"/>
+ <map:transform type="proxy-xhtml"/>
+ <map:transform src="chaperon/stylesheets/a-to-txt.xsl"/>
<map:serialize type="text" mime-type="text/css"/>
</map:resource>
</map:resources>
Modified: lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/xslt/util/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/xslt/util/page2xhtml.xsl?rev=741792&r1=741772&r2=741792&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/xslt/util/page2xhtml.xsl (original)
+++ lenya/trunk/org.apache.lenya.welcome/src/main/resources/COB-INF/lenya/xslt/util/page2xhtml.xsl Fri Feb 6 23:56:29 2009
@@ -27,7 +27,7 @@
exclude-result-prefixes="page xhtml i18n"
>
- <xsl:include href="fallback://lenya/xslt/util/toggle.xsl"/>
+ <xsl:include href="toggle.xsl"/>
<xsl:template match="page:page">
<html>
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.