svn commit: r1175728 [2/2] - in /lenya/trunk: ./ externals/ org.apache.lenya.core.api/ org.apache.lenya.core.api/src/main/java/org/apache/lenya/exceptions/ org.apache.lenya.core.api/src/test/java/org/ org.apache.lenya.core.document.api/ org.apache.leny...
[email protected] Mon, 26 Sep 2011 09:06:27 -0000
| Newsgroups | gmane.comp.cms.lenya.cvs |
|---|---|
| Message-ID | <[email protected]> |
Modified: lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/publication/RepositoryImpl.java Mon Sep 26 09:06:23 2011
@@ -17,73 +17,87 @@
*/
package org.apache.lenya.cms.publication;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import org.apache.cocoon.util.AbstractLogEnabled;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.lang.Validate;
-import org.apache.lenya.ac.Identity;
+import org.apache.excalibur.source.SourceResolver;
+//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.SessionImpl;
-import org.apache.lenya.cms.repository.Session;
+//florent : session remove
+//import org.apache.lenya.cms.repository.SessionImpl;
+//import org.apache.lenya.cms.repository.Session;
public class RepositoryImpl implements Repository {
+
+ //TODO : bean / cocoon wiring
+ private SourceResolver sourceResolver;
private RepositoryManager repositoryManager;
private DocumentFactoryBuilder documentFactoryBuilder;
- public Session getSession(HttpServletRequest request) {
- Validate.notNull(request);
- SessionImpl session = (SessionImpl) request.getAttribute(Session.class.getName());
-
- if (session == null) {
- Identity identity = getIdentity(request);
- // attach a read-only repository session to the HTTP request
- session = (SessionImpl) startSession(identity, false);
- request.setAttribute(Session.class.getName(), session);
- } else if (session.getIdentity() == null) {
- Identity identity = getIdentity(request);
- if (identity != null) {
- session.setIdentity(identity);
- }
- }
- return session;
- }
-
- public Session startSession(Identity identity, boolean modifiable) {
-
- if (modifiable && identity == null) {
- throw new IllegalArgumentException(
- "Can't start a modifiable session without an identity.");
- }
-
- /*florent : user the repository session
- IdentityWrapper wrapper = new IdentityWrapper(identity);
- org.apache.lenya.cms.repository.Session repoSession;
- try {
- repoSession = this.repositoryManager.createSession(wrapper, modifiable);
- } catch (RepositoryException e) {
- throw new RuntimeException(e);
- }
- SessionImpl session = new SessionImpl(this, repoSession);*/
- SessionImpl session = new SessionImpl(identity,modifiable);
- session.setDocumentFactoryBuilder(this.documentFactoryBuilder);
- return session;
- }
+// public Session getSession(HttpServletRequest request) {
+// Validate.notNull(request);
+// SessionImpl session = (SessionImpl) request.getAttribute(Session.class.getName());
+//
+// if (session == null) {
+// Identity identity = getIdentity(request);
+// // attach a read-only repository session to the HTTP request
+// session = (SessionImpl) startSession(identity, false);
+// request.setAttribute(Session.class.getName(), session);
+// } else if (session.getIdentity() == null) {
+// Identity identity = getIdentity(request);
+// if (identity != null) {
+// session.setIdentity(identity);
+// }
+// }
+// return session;
+// }
+//
+// public Session startSession(Identity identity, boolean modifiable) {
+//
+// if (modifiable && identity == null) {
+// throw new IllegalArgumentException(
+// "Can't start a modifiable session without an identity.");
+// }
+//
+// /*florent : user the repository session
+// IdentityWrapper wrapper = new IdentityWrapper(identity);
+// org.apache.lenya.cms.repository.Session repoSession;
+// try {
+// repoSession = this.repositoryManager.createSession(wrapper, modifiable);
+// } catch (RepositoryException e) {
+// throw new RuntimeException(e);
+// }
+// SessionImpl session = new SessionImpl(this, repoSession);*/
+// SessionImpl session = new SessionImpl(identity,modifiable);
+// session.setDocumentFactoryBuilder(this.documentFactoryBuilder);
+// return session;
+// }
+ //florent : repository don't have to deal with identity
+ /*
protected static Identity getIdentity(HttpServletRequest request) {
HttpSession session = request.getSession();
return (Identity) session.getAttribute(Identity.class.getName());
- }
+ }*/
/**
* Removes the repository session from the servlet session.
* @param request The current request.
*/
- public void removeSession(HttpServletRequest request) {
- request.removeAttribute(Session.class.getName());
- }
+// public void removeSession(HttpServletRequest request) {
+// request.removeAttribute(Session.class.getName());
+// }
public void setRepositoryManager(RepositoryManager repositoryManager) {
this.repositoryManager = repositoryManager;
@@ -96,5 +110,54 @@ public class RepositoryImpl implements R
public void setDocumentFactoryBuilder(DocumentFactoryBuilder documentFactoryBuilder) {
this.documentFactoryBuilder = documentFactoryBuilder;
}
+
+ protected void create(InputStream stream, Document document) throws Exception {
+
+ // Read initial contents as DOM
+ /* florent : to re-enable the logger add "extends AbstractLogEnabled" on the class
+ if (getLogger().isDebugEnabled())
+ getLogger().debug(
+ "DefaultCreator::create(), ready to read initial contents from URI [" + stream
+ + "]");
+ */
+
+ copy(getSourceResolver(), stream, document);
+ }
+
+ protected void copy(SourceResolver resolver, InputStream sourceInputStream, Document destination)
+ throws IOException {
+
+ boolean useBuffer = true;
+
+ OutputStream destOutputStream = null;
+ try {
+ destOutputStream = destination.getOutputStream();
+
+ if (useBuffer) {
+ final ByteArrayOutputStream sourceBos = new ByteArrayOutputStream();
+ IOUtils.copy(sourceInputStream, sourceBos);
+ IOUtils.write(sourceBos.toByteArray(), destOutputStream);
+ } else {
+ IOUtils.copy(sourceInputStream, destOutputStream);
+ }
+ } finally {
+ if (destOutputStream != null) {
+ destOutputStream.flush();
+ destOutputStream.close();
+ }
+ if (sourceInputStream != null) {
+ sourceInputStream.close();
+ }
+ }
+ }
+
+ public SourceResolver getSourceResolver() {
+ return sourceResolver;
+ }
+
+ public void setSourceResolver(SourceResolver sourceResolver) {
+ this.sourceResolver = sourceResolver;
+ }
+
}
Modified: lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryItemFactoryWrapper.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryItemFactoryWrapper.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryItemFactoryWrapper.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryItemFactoryWrapper.java Mon Sep 26 09:06:23 2011
@@ -27,22 +27,24 @@ import org.apache.lenya.transaction.Iden
public class RepositoryItemFactoryWrapper implements IdentifiableFactory {
private RepositoryItemFactory delegate;
- private Session session;
+ //florent : remove session private Session session;
/**
* Ctor.
* @param delegate The factory to wrap.
* @param session The session.
*/
- public RepositoryItemFactoryWrapper(RepositoryItemFactory delegate, Session session) {
+ //public RepositoryItemFactoryWrapper(RepositoryItemFactory delegate, Session session) {
+ public RepositoryItemFactoryWrapper(RepositoryItemFactory delegate) {
Validate.notNull(delegate, "factory");
- Validate.notNull(session, "session");
+ //Validate.notNull(session, "session");
this.delegate = delegate;
- this.session = session;
+ //this.session = session;
}
public Object build(IdentityMap map, String key) throws Exception {
- return delegate.buildItem(this.session, key);
+ //return delegate.buildItem(this.session, key);
+ return delegate.buildItem(key);
}
public String getType() {
Modified: lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryManagerImpl.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryManagerImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/RepositoryManagerImpl.java Mon Sep 26 09:06:23 2011
@@ -21,23 +21,23 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lenya.cms.observation.ObservationRegistry;
//florent import org.apache.lenya.transaction.Identity;
-import org.apache.lenya.ac.Identity;
-import org.apache.lenya.cms.repository.SessionImpl;
-import org.apache.lenya.cms.repository.Session;
+//import org.apache.lenya.ac.Identity;
+//florent remove session
+//import org.apache.lenya.cms.repository.SessionImpl;
+//import org.apache.lenya.cms.repository.Session;
/**
* Repository manager implementation.
- * @version $Id:$
*/
public class RepositoryManagerImpl implements RepositoryManager {
private static final Log logger = LogFactory.getLog(RepositoryManagerImpl.class);
- public Session createSession(Identity identity, boolean modifiable) throws RepositoryException {
- SessionImpl session = new SessionImpl(identity, modifiable);
- session.setObservationRegistry(getObservationRegistry());
- session.setSharedItemStore(getSharedItemStore());
- return session;
- }
+// public Session createSession(Identity identity, boolean modifiable) throws RepositoryException {
+// SessionImpl session = new SessionImpl(identity, modifiable);
+// session.setObservationRegistry(getObservationRegistry());
+// session.setSharedItemStore(getSharedItemStore());
+// return session;
+// }
private SharedItemStore sharedItemStore;
private UUIDGenerator uuidGenerator;
Modified: lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java Mon Sep 26 09:06:23 2011
@@ -22,7 +22,7 @@ import org.apache.lenya.cms.observation.
import org.apache.lenya.cms.observation.RepositoryListener;
//florent remove this identity as duplication of the core-ac one
//import org.apache.lenya.transaction.Identity;
-import org.apache.lenya.ac.Identity;
+//import org.apache.lenya.ac.Identity;
import org.apache.lenya.transaction.Lock;
import org.apache.lenya.transaction.Lockable;
import org.apache.lenya.transaction.TransactionException;
@@ -33,7 +33,7 @@ import org.apache.lenya.transaction.Tran
*/
public class SharedItemStoreImpl extends AbstractLogEnabled implements SharedItemStore {
- private Session session;
+ //florent : remove session private Session session;
private RepositoryManager repositoryManager;
public RepositoryManager getRepositoryManager() {
@@ -44,16 +44,16 @@ public class SharedItemStoreImpl extends
this.repositoryManager = repositoryManager;
}
- public synchronized Session getSession() {
- if (this.session == null) {
- try {
- this.session = getRepositoryManager().createSession(null, false);
- } catch (RepositoryException e) {
- throw new RuntimeException(e);
- }
- }
- return this.session;
- }
+// public synchronized Session getSession() {
+// if (this.session == null) {
+// try {
+// this.session = getRepositoryManager().createSession(null, false);
+// } catch (RepositoryException e) {
+// throw new RuntimeException(e);
+// }
+// }
+// return this.session;
+// }
public void addListener(RepositoryListener listener) throws RepositoryException {
throw new UnsupportedOperationException();
@@ -67,13 +67,14 @@ public class SharedItemStoreImpl extends
throw new UnsupportedOperationException();
}
- public Identity getIdentity() {
+ /*public Identity getIdentity() {
throw new UnsupportedOperationException();
- }
+ }*/
public RepositoryItem getRepositoryItem(RepositoryItemFactory factory, String key)
throws RepositoryException {
- return (RepositoryItem) getSession().getRepositoryItem(factory, key);
+ //florent remove session return (RepositoryItem) getSession().getRepositoryItem(factory, key);
+ throw new UnsupportedOperationException();
}
public boolean isListenerRegistered(RepositoryListener listener) {
@@ -88,9 +89,9 @@ public class SharedItemStoreImpl extends
throw new UnsupportedOperationException();
}
- public void setIdentity(Identity identity) {
+ /*public void setIdentity(Identity identity) {
throw new UnsupportedOperationException();
- }
+ }*/
public Lock createLock(Lockable lockable, int version) throws TransactionException {
throw new UnsupportedOperationException();
@@ -116,20 +117,20 @@ public class SharedItemStoreImpl extends
throw new UnsupportedOperationException();
}
- public synchronized void clear() {
- this.session = null;
- }
+// public synchronized void clear() {
+// this.session = null;
+// }
public String getId() {
return getClass().getName();
}
- public SessionHolder getHolder() {
+ /*public SessionHolder getHolder() {
throw new UnsupportedOperationException();
}
public void setHolder(SessionHolder holder) {
throw new UnsupportedOperationException();
- }
+ }*/
}
Added: lenya/trunk/org.apache.lenya.core.session.api/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.api/pom.xml?rev=1175728&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.session.api/pom.xml (added)
+++ lenya/trunk/org.apache.lenya.core.session.api/pom.xml Mon Sep 26 09:06:23 2011
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-parent</artifactId>
+ <version>2.2.0-SNAPSHOT</version>
+ <relativePath>../org.apache.lenya.parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-session-api</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Lenya Session interface</name>
+ <description>Interface for the lenya session API</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-transaction-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-identity</artifactId>
+ </dependency>
+<dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-repository-api</artifactId>
+ </dependency>
+<dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-publication-api</artifactId>
+ </dependency>
+
+ <!-- TODO : see if all theses dependencies are required -->
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-servlet-service-components</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-template-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-flowscript-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: lenya/trunk/org.apache.lenya.core.session.api/rcl.properties
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.api/rcl.properties?rev=1175728&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.session.api/rcl.properties (added)
+++ lenya/trunk/org.apache.lenya.core.session.api/rcl.properties Mon Sep 26 09:06:23 2011
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+org.apache.lenya.lenya-session-api.service%classes-dir=./target/classes
Added: lenya/trunk/org.apache.lenya.core.session.impl/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.impl/pom.xml?rev=1175728&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.session.impl/pom.xml (added)
+++ lenya/trunk/org.apache.lenya.core.session.impl/pom.xml Mon Sep 26 09:06:23 2011
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-parent</artifactId>
+ <version>2.2.0-SNAPSHOT</version>
+ <relativePath>../org.apache.lenya.parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-session-impl</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Lenya session implementation</name>
+ <description>Implementation of the session interface</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-session-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-repository-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-observation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-identity</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-transaction-impl</artifactId>
+ </dependency>
+ <!-- TODO : see to have just a dependency with publication-api and not with impl -->
+ <dependency>
+ <groupId>org.apache.lenya</groupId>
+ <artifactId>lenya-core-publication-impl</artifactId>
+ </dependency>
+ <!-- TODO : see if all theses dependencies are required -->
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-servlet-service-components</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-template-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-flowscript-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: lenya/trunk/org.apache.lenya.core.session.impl/rcl.properties
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.impl/rcl.properties?rev=1175728&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.session.impl/rcl.properties (added)
+++ lenya/trunk/org.apache.lenya.core.session.impl/rcl.properties Mon Sep 26 09:06:23 2011
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+org.apache.lenya.lenya-session-impl.service%classes-dir=./target/classes
Copied: lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java (from r1073181, lenya/trunk/org.apache.lenya.core.publication.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java)
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java?p2=lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java&p1=lenya/trunk/org.apache.lenya.core.publication.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java&r1=1073181&r2=1175728&rev=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.publication.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/publication/SessionImpl.java Mon Sep 26 09:06:23 2011
@@ -35,11 +35,12 @@ public class SessionImpl implements Sess
private static final Log logger = LogFactory.getLog(SessionImpl.class);
private org.apache.lenya.cms.repository.Session repositorySession;
- private RepositoryImpl repository;
+ //florent private RepositoryImpl repository;
+ private Repository repository;
private DocumentFactory documentFactory;
private DocumentFactoryBuilder documentFactoryBuilder;
- public SessionImpl(RepositoryImpl repository,
+ public SessionImpl(Repository repository,
org.apache.lenya.cms.repository.Session repoSession) {
Validate.notNull(repository, "repository");
Validate.notNull(repoSession, "repository session");
Copied: lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java (from r1073181, lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java)
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java?p2=lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java&p1=lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java&r1=1073181&r2=1175728&rev=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.repository.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.session.impl/src/main/java/org/apache/lenya/cms/repository/SessionImpl.java Mon Sep 26 09:06:23 2011
@@ -36,7 +36,7 @@ import org.apache.lenya.transaction.Conc
//import org.apache.lenya.transaction.Identity;
import org.apache.lenya.ac.Identity;
import org.apache.lenya.transaction.IdentityMap;
-import org.apache.lenya.transaction.IdentityMapImpl;
+//import org.apache.lenya.transaction.IdentityMapImpl;
import org.apache.lenya.transaction.Lock;
import org.apache.lenya.transaction.Lockable;
import org.apache.lenya.transaction.TransactionException;
@@ -129,7 +129,7 @@ public class SessionImpl implements Sess
synchronized (TransactionLock.LOCK) {
getUnitOfWork().commit();
- getSharedItemStore().clear();
+ //florent : remove session getSharedItemStore().clear();
}
} catch (ConcurrentModificationException e) {
throw e;
@@ -194,7 +194,8 @@ public class SessionImpl implements Sess
*/
public RepositoryItem getRepositoryItem(RepositoryItemFactory factory, String key)
throws RepositoryException {
- RepositoryItemFactoryWrapper wrapper = new RepositoryItemFactoryWrapper(factory, this);
+ //florent remove session RepositoryItemFactoryWrapper wrapper = new RepositoryItemFactoryWrapper(factory, this);
+ RepositoryItemFactoryWrapper wrapper = new RepositoryItemFactoryWrapper(factory);
return (RepositoryItem) getIdentityMap().get(wrapper, key);
}
@@ -249,7 +250,7 @@ public class SessionImpl implements Sess
private SessionHolder holder;
public synchronized void enqueueEvent(RepositoryEvent event) {
- Validate.isTrue(event.getSession() == this, "event belongs to session");
+ //florent : remove session Validate.isTrue(event.getSession() == this, "event belongs to session");
if (!isModifiable()) {
throw new RuntimeException("Can't enqueue event in unmodifiable session!");
}
Modified: lenya/trunk/org.apache.lenya.core.transaction.api/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.transaction.api/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.transaction.api/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.transaction.api/pom.xml Mon Sep 26 09:06:23 2011
@@ -16,29 +16,10 @@
<description>API for Lenya Transactions</description>
<dependencies>
-
- <!-- TODO : see if all theses dependencies are required -->
- <dependency>
- <groupId>org.apache.cocoon</groupId>
- <artifactId>cocoon-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.cocoon</groupId>
- <artifactId>cocoon-servlet-service-components</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.cocoon</groupId>
- <artifactId>cocoon-template-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.cocoon</groupId>
- <artifactId>cocoon-flowscript-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
</dependencies>
</project>
Modified: lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/TransactionException.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/TransactionException.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/TransactionException.java (original)
+++ lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/TransactionException.java Mon Sep 26 09:06:23 2011
@@ -20,7 +20,6 @@ package org.apache.lenya.transaction;
/**
* Transaction exception.
*
- * @version $Id$
*/
public class TransactionException extends Exception {
Modified: lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/UnitOfWork.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/UnitOfWork.java?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/UnitOfWork.java (original)
+++ lenya/trunk/org.apache.lenya.core.transaction.api/src/main/java/org/apache/lenya/transaction/UnitOfWork.java Mon Sep 26 09:06:23 2011
@@ -27,7 +27,6 @@ package org.apache.lenya.transaction;
*
* <p>This interface may be extended in the future to allow for access to further types of business objects.</p>
*
- * @version $Id$
*/
public interface UnitOfWork {
Modified: lenya/trunk/org.apache.lenya.core.transaction.impl/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.transaction.impl/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.transaction.impl/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.transaction.impl/pom.xml Mon Sep 26 09:06:23 2011
@@ -12,7 +12,7 @@
<groupId>org.apache.lenya</groupId>
<artifactId>lenya-core-transaction-impl</artifactId>
<packaging>jar</packaging>
- <name>Apache Lenya Transactions</name>
+ <name>Apache Lenya Transaction implementation</name>
<description>Deals with transactions</description>
<dependencies>
Modified: lenya/trunk/org.apache.lenya.parent/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.parent/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.parent/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.parent/pom.xml Mon Sep 26 09:06:23 2011
@@ -320,6 +320,7 @@
</plugins>
</build>
+ <!-- TODO : see if all dependencies have to be here. Maybe just all application shared one -->
<dependencyManagement>
<dependencies>
<dependency>
@@ -334,6 +335,11 @@
<version>1.4</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.3</version>
@@ -368,6 +374,13 @@
<artifactId>avalon-framework-impl</artifactId>
<version>${avalon.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.excalibur.components</groupId>
+ <artifactId>excalibur-sourceresolve</artifactId>
+ <version>2.2.3</version>
+ </dependency>
+
<!--
<dependency>
<groupId>batik</groupId>
Modified: lenya/trunk/org.apache.lenya.webapp.welcome/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp.welcome/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp.welcome/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.webapp.welcome/pom.xml Mon Sep 26 09:06:23 2011
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.lenya</groupId>
- <artifactId>lenya</artifactId>
+ <artifactId>lenya-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../org.apache.lenya.parent/pom.xml</relativePath>
</parent>
Modified: lenya/trunk/org.apache.lenya.webapp/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.webapp/pom.xml Mon Sep 26 09:06:23 2011
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.lenya</groupId>
- <artifactId>lenya</artifactId>
+ <artifactId>lenya-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
<relativePath>../org.apache.lenya.parent/pom.xml</relativePath>
</parent>
Modified: lenya/trunk/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/pom.xml?rev=1175728&r1=1175727&r2=1175728&view=diff
==============================================================================
--- lenya/trunk/pom.xml (original)
+++ lenya/trunk/pom.xml Mon Sep 26 09:06:23 2011
@@ -31,7 +31,7 @@
<groupId>org.apache.lenya</groupId>
<artifactId>lenya</artifactId>
- <name>Apache Lenya Project</name>
+ <name>Apache Lenya</name>
<reporting>
<plugins>
@@ -44,79 +44,89 @@
</reporting>
<modules>
<module>org.apache.lenya.parent</module>
- <module>org.apache.lenya.core.ac</module>
- <module>org.apache.lenya.core.acusecases</module>
- <module>org.apache.lenya.core.administration</module>
+ <!-- foundation modules -->
<module>org.apache.lenya.core.api</module>
- <module>org.apache.lenya.core.cache</module>
- <module>org.apache.lenya.core.gui</module>
- <module>org.apache.lenya.core.i18n</module>
- <module>org.apache.lenya.core.impl</module>
- <!-- <module>org.apache.lenya.core.janitor</module> -->
- <module>org.apache.lenya.core.ldap</module>
- <module>org.apache.lenya.core.linking</module>
+ <module>org.apache.lenya.core.transaction.api</module>
+ <!-- <module>org.apache.lenya.core.transaction.impl</module>-->
<module>org.apache.lenya.core.metadata.api</module>
- <module>org.apache.lenya.core.metadata.impl</module>
- <module>org.apache.lenya.core.monitoring</module>
+ <!-- <module>org.apache.lenya.core.metadata.impl</module>-->
<module>org.apache.lenya.core.observation</module>
- <module>org.apache.lenya.core.properties</module>
+ <!-- document and repository layers -->
+ <module>org.apache.lenya.core.document.api</module>
+ <!-- <module>org.apache.lenya.core.document.impl</module>-->
<module>org.apache.lenya.core.repository.api</module>
<module>org.apache.lenya.core.repository.impl</module>
- <module>org.apache.lenya.core.resourcetype</module>
- <module>org.apache.lenya.core.sitemanagement</module>
- <module>org.apache.lenya.core.templating</module>
- <module>org.apache.lenya.core.usecase</module>
- <module>org.apache.lenya.core.workflow</module>
- <module>org.apache.lenya.core.utils</module>
- <module>org.apache.lenya.core.cocoon</module>
- <module>org.apache.lenya.core.publication.api</module>
- <module>org.apache.lenya.core.publication.impl</module>
- <module>org.apache.lenya.core.document.api</module>
- <module>org.apache.lenya.core.document.impl</module>
- <module>org.apache.lenya.core.transaction.api</module>
- <module>org.apache.lenya.core.transaction.impl</module>
- <module>org.apache.lenya.core.identity</module>
- <module>org.apache.lenya.core.proxy</module>
- <module>org.apache.lenya.core.session.api</module>
- <module>org.apache.lenya.core.session.impl</module>
- <module>org.apache.lenya.module.blog</module>
- <module>org.apache.lenya.module.bxe</module>
- <module>org.apache.lenya.module.cforms</module>
- <module>org.apache.lenya.module.collection</module>
- <module>org.apache.lenya.module.contactform</module>
- <module>org.apache.lenya.module.development</module>
- <module>org.apache.lenya.module.editors</module>
- <module>org.apache.lenya.module.export</module>
- <module>org.apache.lenya.module.fckeditor</module>
- <module>org.apache.lenya.module.kupu</module>
- <module>org.apache.lenya.module.languageselector</module>
- <module>org.apache.lenya.module.lenyadoc</module>
- <module>org.apache.lenya.module.linkcheck</module>
- <module>org.apache.lenya.module.links</module>
- <module>org.apache.lenya.module.lucene</module>
- <module>org.apache.lenya.module.menubar</module>
- <module>org.apache.lenya.module.migration</module>
- <module>org.apache.lenya.module.navigation</module>
- <module>org.apache.lenya.module.neutron</module>
- <module>org.apache.lenya.module.news</module>
- <module>org.apache.lenya.module.notification</module>
- <module>org.apache.lenya.module.opendocument</module>
- <module>org.apache.lenya.module.prettyprinting</module>
- <module>org.apache.lenya.module.profiling</module>
- <module>org.apache.lenya.module.resource</module>
- <module>org.apache.lenya.module.simplesite</module>
- <module>org.apache.lenya.module.sitetree</module>
- <module>org.apache.lenya.module.sourcerepository</module>
- <module>org.apache.lenya.module.svg</module>
- <module>org.apache.lenya.module.tinymce</module>
- <module>org.apache.lenya.module.usecasedocument</module>
- <module>org.apache.lenya.module.webdav</module>
- <module>org.apache.lenya.module.xhtml</module>
- <module>org.apache.lenya.module.xopus</module>
- <module>org.apache.lenya.optional.jcrsource</module>
- <module>org.apache.lenya.webapp</module>
- <module>org.apache.lenya.webapp.welcome</module>
- <module>org.apache.lenya.deprecated</module>
+
+
+
+<!-- <module>org.apache.lenya.core.identity</module> -->
+<!-- <module>org.apache.lenya.core.ac</module>-->
+<!-- <module>org.apache.lenya.core.acusecases</module>-->
+<!-- <module>org.apache.lenya.core.administration</module>-->
+<!-- <module>org.apache.lenya.core.api</module>-->
+<!-- <module>org.apache.lenya.core.cache</module>-->
+<!-- <module>org.apache.lenya.core.gui</module>-->
+<!-- <module>org.apache.lenya.core.i18n</module>-->
+<!-- <module>org.apache.lenya.core.impl</module>-->
+ <!-- <module>org.apache.lenya.core.janitor</module> -->
+<!-- <module>org.apache.lenya.core.ldap</module>-->
+<!-- <module>org.apache.lenya.core.linking</module>-->
+
+<!-- <module>org.apache.lenya.core.monitoring</module>-->
+<!-- <module>org.apache.lenya.core.observation</module>-->
+<!-- <module>org.apache.lenya.core.properties</module>-->
+<!-- <module>org.apache.lenya.core.resourcetype</module>-->
+<!-- <module>org.apache.lenya.core.sitemanagement</module>-->
+<!-- <module>org.apache.lenya.core.templating</module>-->
+<!-- <module>org.apache.lenya.core.usecase</module>-->
+<!-- <module>org.apache.lenya.core.workflow</module>-->
+<!-- <module>org.apache.lenya.core.utils</module>-->
+<!-- <module>org.apache.lenya.core.cocoon</module>-->
+<!-- <module>org.apache.lenya.core.publication.api</module>-->
+<!-- <module>org.apache.lenya.core.publication.impl</module>-->
+
+
+<!-- <module>org.apache.lenya.core.proxy</module>-->
+<!-- <module>org.apache.lenya.core.session.api</module>-->
+<!-- <module>org.apache.lenya.core.session.impl</module>-->
+<!-- <module>org.apache.lenya.module.blog</module>-->
+<!-- <module>org.apache.lenya.module.bxe</module>-->
+<!-- <module>org.apache.lenya.module.cforms</module>-->
+<!-- <module>org.apache.lenya.module.collection</module>-->
+<!-- <module>org.apache.lenya.module.contactform</module>-->
+<!-- <module>org.apache.lenya.module.development</module>-->
+<!-- <module>org.apache.lenya.module.editors</module>-->
+<!-- <module>org.apache.lenya.module.export</module>-->
+<!-- <module>org.apache.lenya.module.fckeditor</module>-->
+<!-- <module>org.apache.lenya.module.kupu</module>-->
+<!-- <module>org.apache.lenya.module.languageselector</module>-->
+<!-- <module>org.apache.lenya.module.lenyadoc</module>-->
+<!-- <module>org.apache.lenya.module.linkcheck</module>-->
+<!-- <module>org.apache.lenya.module.links</module>-->
+<!-- <module>org.apache.lenya.module.lucene</module>-->
+<!-- <module>org.apache.lenya.module.menubar</module>-->
+<!-- <module>org.apache.lenya.module.migration</module>-->
+<!-- <module>org.apache.lenya.module.navigation</module>-->
+<!-- <module>org.apache.lenya.module.neutron</module>-->
+<!-- <module>org.apache.lenya.module.news</module>-->
+<!-- <module>org.apache.lenya.module.notification</module>-->
+<!-- <module>org.apache.lenya.module.opendocument</module>-->
+<!-- <module>org.apache.lenya.module.prettyprinting</module>-->
+<!-- <module>org.apache.lenya.module.profiling</module>-->
+<!-- <module>org.apache.lenya.module.resource</module>-->
+<!-- <module>org.apache.lenya.module.simplesite</module>-->
+<!-- <module>org.apache.lenya.module.sitetree</module>-->
+<!-- <module>org.apache.lenya.module.sourcerepository</module>-->
+<!-- <module>org.apache.lenya.module.svg</module>-->
+<!-- <module>org.apache.lenya.module.tinymce</module>-->
+<!-- <module>org.apache.lenya.module.usecasedocument</module>-->
+<!-- <module>org.apache.lenya.module.webdav</module>-->
+<!-- <module>org.apache.lenya.module.xhtml</module>-->
+<!-- <module>org.apache.lenya.module.xopus</module>-->
+<!-- <module>org.apache.lenya.optional.jcrsource</module>-->
+<!-- <module>org.apache.lenya.webapp</module>-->
+<!-- <module>org.apache.lenya.webapp.welcome</module>-->
+<!-- <module>org.apache.lenya.deprecated</module>-->
</modules>
<scm>