svn commit: r743041 [2/9] - in /lenya/trunk: org.apache.lenya.core.api/ org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/ org.apache.lenya.core.api/src/test/ org.apache.lenya.core.api/src/test/java/ org.apache.lenya.core.api/src...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationConfiguration.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationConfiguration.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationConfiguration.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationConfiguration.java Tue Feb 10 18:22:23 2009
@@ -32,11 +32,13 @@
 import org.apache.avalon.framework.configuration.DefaultConfigurationSerializer;
 import org.apache.cocoon.util.AbstractLogEnabled;
 import org.apache.commons.lang.Validate;
+import org.apache.excalibur.source.ModifiableSource;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.cms.repository.Node;
 
 /**
- * A publication's configuration. Keep in sync with
- * src/resources/build/publication.rng!
+ * A publication's configuration. Keep in sync with src/resources/build/publication.rng!
  */
 public class PublicationConfiguration extends AbstractLogEnabled implements Publication {
 
@@ -47,8 +49,8 @@
     private String lenyaVersion;
     private String lenyaRevision;
     private String cocoonVersion;
-    
-    private File servletContext;
+
+    private String pubBaseUri;
     private DocumentIdToPathMapper mapper = null;
     private SortedSet languages = new TreeSet();
     private String defaultLanguage = null;
@@ -57,14 +59,14 @@
     private String contentDir = null;
     private SortedSet modules = new TreeSet();
     private String contextPath;
+    private SourceResolver sourceResolver;
 
     private boolean isConfigLoaded = false;
 
     /**
      * <code>CONFIGURATION_FILE</code> The publication configuration file
      */
-    public static final String CONFIGURATION_FILE = CONFIGURATION_PATH + File.separator
-            + "publication.xml";
+    public static final String CONFIGURATION_URI = CONFIGURATION_PATH + "/" + "publication.xml";
 
     private static final String CONFIGURATION_NAMESPACE = "http://apache.org/cocoon/lenya/publication/1.1";
 
@@ -98,25 +100,28 @@
     private static final String ATTRIBUTE_AREA = "area";
     private static final String ATTRIBUTE_URL = "url";
     private static final String ATTRIBUTE_SSL = "ssl";
-    
+
     protected static final String NAMESPACE = "http://apache.org/cocoon/lenya/publication/1.1";
     protected static final String NS_PREFIX = "";
 
     /**
      * Creates a new instance of Publication
      * @param _id the publication id
-     * @param servletContextPath the servlet context directory of this publication
+     * @param pubBaseUri The base filesystem path where publications are located.
      * @param servletContextUrlPath The servlet context path (URL snippet).
-     * @throws PublicationException if there was a problem reading the config
-     *         file
+     * @throws PublicationException if there was a problem reading the config file
      */
-    protected PublicationConfiguration(String _id, String servletContextPath, String servletContextUrlPath)
+    protected PublicationConfiguration(String _id, String pubBaseUri, String servletContextUrlPath)
             throws PublicationException {
         this.id = _id;
-        this.servletContext = new File(servletContextPath);
+        this.pubBaseUri = pubBaseUri;
         this.contextPath = servletContextUrlPath;
     }
 
+    public void setSourceResolver(SourceResolver resolver) {
+        this.sourceResolver = resolver;
+    }
+
     /**
      * Loads the configuration.
      */
@@ -130,38 +135,43 @@
             getLogger().debug("Loading configuration for publication [" + getId() + "]");
         }
 
-        File configFile = getConfigurationFile();
-
-        if (!configFile.exists()) {
-            getLogger().error(
-                    "Config file [" + configFile.getAbsolutePath() + "] does not exist: ",
-                    new RuntimeException());
-            throw new RuntimeException("The configuration file [" + configFile
-                    + "] does not exist!");
-        } else {
-            getLogger().debug("Configuration file [" + configFile + "] exists.");
-        }
-
-        final boolean ENABLE_XML_NAMESPACES = true;
-        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(ENABLE_XML_NAMESPACES);
-
+        String configUri = getConfigurationUri();
         Configuration config;
+        Source source = null;
+        try {
+            source = this.sourceResolver.resolveURI(configUri);
+            if (!source.exists()) {
+                throw new RuntimeException("The configuration file [" + configUri
+                        + "] does not exist!");
+            } else {
+                getLogger().debug("Configuration file [" + configUri + "] exists.");
+            }
+            final boolean ENABLE_XML_NAMESPACES = true;
+            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(
+                    ENABLE_XML_NAMESPACES);
+            config = builder.build(source.getInputStream());
+        } catch (final Exception e) {
+            throw new RuntimeException("Problem with config file: " + configUri, e);
+        } finally {
+            if (source != null) {
+                this.sourceResolver.release(source);
+            }
+        }
 
         String pathMapperClassName = null;
 
         try {
-            config = builder.buildFromFile(configFile);
 
             String pubName = config.getChild(ELEMENT_NAME).getValue(null);
             if (pubName == null) {
-                getLogger().warn("No publication name set for publication [" + getId() +
-                        "], using default name.");
+                getLogger().warn(
+                        "No publication name set for publication [" + getId()
+                                + "], using default name.");
                 this.name = getId();
-            }
-            else {
+            } else {
                 this.name = pubName;
             }
-            
+
             this.description = config.getChild(ELEMENT_DESCRIPTION).getValue("");
             this.version = config.getChild(ELEMENT_VERSION).getValue("");
             this.lenyaVersion = config.getChild(ELEMENT_LENYA_VERSION).getValue("");
@@ -176,7 +186,7 @@
                 if (config.getChild(ELEMENT_PATH_MAPPER).getNamespace() != CONFIGURATION_NAMESPACE) {
                     getLogger().warn(
                             "Deprecated configuration: the publication configuration elements in "
-                                    + configFile + " must be in the " + CONFIGURATION_NAMESPACE
+                                    + configUri + " must be in the " + CONFIGURATION_NAMESPACE
                                     + " namespace."
                                     + " See webapp/lenya/resources/schemas/publication.xml.");
                 }
@@ -275,25 +285,23 @@
             }
 
         } catch (final Exception e) {
-            throw new RuntimeException("Problem with config file: " + configFile.getAbsolutePath(),
-                    e);
+            throw new RuntimeException("Problem with config file: " + configUri, e);
         }
 
         this.breadcrumbprefix = config.getChild(ELEMENT_BREADCRUMB_PREFIX).getValue("");
 
         isConfigLoaded = true;
     }
-    
+
     protected String getDefaultProxyUrl(String area) {
         return this.contextPath + "/" + this.id + "/" + area;
     }
 
     /**
-     * @return The configuration file ({@link #CONFIGURATION_FILE}).
+     * @return The configuration file ({@link #CONFIGURATION_URI}).
      */
-    protected File getConfigurationFile() {
-        File configFile = new File(getDirectory(), CONFIGURATION_FILE);
-        return configFile;
+    protected String getConfigurationUri() {
+        return getPubBaseUri() + "/" + getId() + "/" + CONFIGURATION_URI;
     }
 
     /**
@@ -309,8 +317,8 @@
      * <code>webapps/lenya</code> directory).
      * @return A <code>File</code> object.
      */
-    public File getServletContext() {
-        return this.servletContext;
+    public String getPubBaseUri() {
+        return this.pubBaseUri;
     }
 
     /**
@@ -318,7 +326,7 @@
      * @return A <code>File</code> object.
      */
     public File getDirectory() {
-        return new File(getServletContext(), PUBLICATION_PREFIX + File.separator + getId());
+        return new File(getPubBaseUri(), getId());
     }
 
     /**
@@ -366,8 +374,8 @@
     public void setDefaultLanguage(String language) {
         Validate.notNull(language);
         if (!Arrays.asList(getLanguages()).contains(language)) {
-            throw new IllegalArgumentException("The publication [" + this +
-                    "] doesn't contain the language [" + language + "]!");
+            throw new IllegalArgumentException("The publication [" + this
+                    + "] doesn't contain the language [" + language + "]!");
         }
         this.defaultLanguage = language;
     }
@@ -382,8 +390,8 @@
     }
 
     /**
-     * Get the breadcrumb prefix. It can be used as a prefix if a publication is
-     * part of a larger site
+     * Get the breadcrumb prefix. It can be used as a prefix if a publication is part of a larger
+     * site
      * @return the breadcrumb prefix
      */
     public String getBreadcrumbPrefix() {
@@ -411,7 +419,7 @@
         if (getClass().isInstance(object)) {
             Publication publication = (Publication) object;
             equals = getId().equals(publication.getId())
-                    && getServletContext().equals(publication.getServletContext());
+                    && getPubBaseUri().equals(publication.getPubBaseUri());
         }
 
         return equals;
@@ -421,7 +429,7 @@
      * @see java.lang.Object#hashCode()
      */
     public int hashCode() {
-        String key = getServletContext() + ":" + getId();
+        String key = getPubBaseUri() + ":" + getId();
         return key.hashCode();
     }
 
@@ -436,14 +444,13 @@
     protected String getProxyKey(String area, boolean isSslProtected) {
         return area + ":" + isSslProtected;
     }
-    
+
     protected String getProxyUrl(String area, boolean isSslProtected) {
         loadConfiguration();
         Object key = getProxyKey(area, isSslProtected);
         return (String) this.areaSsl2proxy.get(key);
     }
 
-    
     public Proxy getProxy(Document document, boolean isSslProtected) {
         return getProxy(document.getArea(), isSslProtected);
     }
@@ -457,14 +464,24 @@
         }
         return proxy;
     }
-    
+
     private String siteManagerName;
 
     /**
      * @see org.apache.lenya.cms.publication.Publication#exists()
      */
     public boolean exists() {
-        return getConfigurationFile().exists();
+        Source source = null;
+        try {
+            source = this.sourceResolver.resolveURI(getConfigurationUri());
+            return source.exists();
+        } catch (final Exception e) {
+            throw new RuntimeException(e);
+        } finally {
+            if (source != null) {
+                this.sourceResolver.release(source);
+            }
+        }
     }
 
     private String template;
@@ -505,14 +522,14 @@
     }
 
     protected String getDefaultContentDir() {
-        return new File(getDirectory(), CONTENT_PATH).getAbsolutePath();
+        return getPubBaseUri() + "/" + getId() + "/" + CONTENT_PATH;
     }
 
     /**
      * @see org.apache.lenya.cms.publication.Publication#getSourceURI()
      */
     public String getSourceURI() {
-        return Node.LENYA_PROTOCOL + PUBLICATION_PREFIX_URI + "/" + this.id;
+        return Node.LENYA_PROTOCOL + "/" + this.id;
     }
 
     /**
@@ -590,12 +607,12 @@
     public void removeLanguage(String language) {
         Validate.notNull(language);
         if (!Arrays.asList(getLanguages()).contains(language)) {
-            throw new IllegalArgumentException("The publication [" + this +
-                    "] doesn't contain the language [" + language + "]!");
+            throw new IllegalArgumentException("The publication [" + this
+                    + "] doesn't contain the language [" + language + "]!");
         }
         if (language.equals(getDefaultLanguage())) {
-            throw new IllegalArgumentException("Can't remove the language [" + language +
-                    "] because it is the default language.");
+            throw new IllegalArgumentException("Can't remove the language [" + language
+                    + "] because it is the default language.");
         }
         this.languages.remove(language);
     }
@@ -605,7 +622,7 @@
         Validate.isTrue(name.length() > 0, "name must not be empty");
         this.name = name;
     }
-    
+
     protected DefaultConfiguration createConfig(String name) {
         return new DefaultConfiguration(name, "", NAMESPACE, NS_PREFIX);
     }
@@ -623,105 +640,112 @@
     }
 
     public void saveConfiguration() {
-        File configFile = getConfigurationFile();
-
-        DefaultConfiguration config = new DefaultConfiguration("publication", "", NAMESPACE, NS_PREFIX);
 
-        try {
+        DefaultConfiguration config = new DefaultConfiguration("publication", "", NAMESPACE,
+                NS_PREFIX);
 
-            config.addChild(createConfig(ELEMENT_NAME, getName()));
-            config.addChild(createConfig(ELEMENT_DESCRIPTION, this.description));
-            config.addChild(createConfig(ELEMENT_VERSION, this.version));
-            config.addChild(createConfig(ELEMENT_LENYA_VERSION, this.lenyaVersion));
-            config.addChild(createConfig(ELEMENT_LENYA_REVISION, this.lenyaRevision));
-            config.addChild(createConfig(ELEMENT_COCOON_VERSION, this.cocoonVersion));
-
-            config.addChild(createConfig(ELEMENT_PATH_MAPPER, getPathMapper().getClass().getName()));
-            config.addChild(createConfig(ELEMENT_DOCUMENT_BUILDER, ATTRIBUTE_NAME, getDocumentBuilderHint()));
-            
-            String[] languages = getLanguages();
-            String defaultLanguage = getDefaultLanguage();
-            
-            DefaultConfiguration languagesConfig = createConfig(ELEMENT_LANGUAGES);
-            for (int i = 0; i < languages.length; i++) {
-                DefaultConfiguration languageConfig = createConfig(ELEMENT_LANGUAGE);
-                languageConfig.setValue(languages[i]);
-                if (languages[i].equals(defaultLanguage)) {
-                    languageConfig.setAttribute(ATTRIBUTE_DEFAULT_LANGUAGE, true);
-                }
-                languagesConfig.addChild(languageConfig);
-            }
-            config.addChild(languagesConfig);
-            
-            config.addChild(createConfig(ELEMENT_SITE_MANAGER, ATTRIBUTE_NAME, getSiteManagerHint()));
-            
-            DefaultConfiguration proxiesConfig = createConfig(ELEMENT_PROXIES);
-            config.addChild(proxiesConfig);
-            Boolean[] booleans = { Boolean.FALSE, Boolean.TRUE };
-            String[] areas = getAreaNames();
-            for (int b = 0; b < booleans.length; b++) {
-                for (int a = 0; a < areas.length; a++) {
-                    boolean ssl = booleans[b].booleanValue();
-                    
-                    Proxy proxy = getProxy(areas[a], ssl);
-                    
-                    // add only proxy URLs for non-default proxies
-                    if (!proxy.getUrl().equals(proxy.getDefaultUrl())) {
-                        DefaultConfiguration proxyConf = createConfig(ELEMENT_PROXY);
-                        proxyConf.setAttribute(ATTRIBUTE_AREA, areas[a]);
-                        proxyConf.setAttribute(ATTRIBUTE_SSL, ssl);
-                        proxyConf.setAttribute(ATTRIBUTE_URL, proxy.getUrl());
-                        proxiesConfig.addChild(proxyConf);
-                    }
-                    
+        config.addChild(createConfig(ELEMENT_NAME, getName()));
+        config.addChild(createConfig(ELEMENT_DESCRIPTION, this.description));
+        config.addChild(createConfig(ELEMENT_VERSION, this.version));
+        config.addChild(createConfig(ELEMENT_LENYA_VERSION, this.lenyaVersion));
+        config.addChild(createConfig(ELEMENT_LENYA_REVISION, this.lenyaRevision));
+        config.addChild(createConfig(ELEMENT_COCOON_VERSION, this.cocoonVersion));
+
+        config.addChild(createConfig(ELEMENT_PATH_MAPPER, getPathMapper().getClass().getName()));
+        config.addChild(createConfig(ELEMENT_DOCUMENT_BUILDER, ATTRIBUTE_NAME,
+                getDocumentBuilderHint()));
+
+        String[] languages = getLanguages();
+        String defaultLanguage = getDefaultLanguage();
+
+        DefaultConfiguration languagesConfig = createConfig(ELEMENT_LANGUAGES);
+        for (int i = 0; i < languages.length; i++) {
+            DefaultConfiguration languageConfig = createConfig(ELEMENT_LANGUAGE);
+            languageConfig.setValue(languages[i]);
+            if (languages[i].equals(defaultLanguage)) {
+                languageConfig.setAttribute(ATTRIBUTE_DEFAULT_LANGUAGE, true);
+            }
+            languagesConfig.addChild(languageConfig);
+        }
+        config.addChild(languagesConfig);
+
+        config.addChild(createConfig(ELEMENT_SITE_MANAGER, ATTRIBUTE_NAME, getSiteManagerHint()));
+
+        DefaultConfiguration proxiesConfig = createConfig(ELEMENT_PROXIES);
+        config.addChild(proxiesConfig);
+        Boolean[] booleans = { Boolean.FALSE, Boolean.TRUE };
+        String[] areas = getAreaNames();
+        for (int b = 0; b < booleans.length; b++) {
+            for (int a = 0; a < areas.length; a++) {
+                boolean ssl = booleans[b].booleanValue();
+
+                Proxy proxy = getProxy(areas[a], ssl);
+
+                // add only proxy URLs for non-default proxies
+                if (!proxy.getUrl().equals(proxy.getDefaultUrl())) {
+                    DefaultConfiguration proxyConf = createConfig(ELEMENT_PROXY);
+                    proxyConf.setAttribute(ATTRIBUTE_AREA, areas[a]);
+                    proxyConf.setAttribute(ATTRIBUTE_SSL, ssl);
+                    proxyConf.setAttribute(ATTRIBUTE_URL, proxy.getUrl());
+                    proxiesConfig.addChild(proxyConf);
                 }
+
             }
-            
-            String template = getTemplateId();
-            if (template != null) {
-                config.addChild(createConfig(ELEMENT_TEMPLATE, ATTRIBUTE_ID, template));
-            }
-
-            String instantiatorHint = getInstantiatorHint();
-            if (instantiatorHint != null) {
-                config.addChild(createConfig(ELEMENT_TEMPLATE_INSTANTIATOR, ATTRIBUTE_NAME, instantiatorHint));
-            }
-            
-            String contentDir = getContentDir();
-            if (!contentDir.equals(getDefaultContentDir())) {
-                config.addChild(createConfig(ELEMENT_CONTENT_DIR, ATTRIBUTE_SRC, this.contentDir));
-            }
-            
-            DefaultConfiguration resourceTypesConf = createConfig(ELEMENT_RESOURCE_TYPES);
-            config.addChild(resourceTypesConf);
-            String[] resourceTypes = getResourceTypeNames();
-            for (int i = 0; i < resourceTypes.length; i++) {
-                String type = resourceTypes[i];
-                DefaultConfiguration resourceTypeConf = createConfig(ELEMENT_RESOURCE_TYPE, ATTRIBUTE_NAME, type);
-                if (this.resourceType2workflow.containsKey(type)) {
-                    resourceTypeConf.setAttribute(ATTRIBUTE_WORKFLOW, (String)
-                            this.resourceType2workflow.get(type));
-                }
-                resourceTypesConf.addChild(resourceTypeConf);
+        }
+
+        String template = getTemplateId();
+        if (template != null) {
+            config.addChild(createConfig(ELEMENT_TEMPLATE, ATTRIBUTE_ID, template));
+        }
+
+        String instantiatorHint = getInstantiatorHint();
+        if (instantiatorHint != null) {
+            config.addChild(createConfig(ELEMENT_TEMPLATE_INSTANTIATOR, ATTRIBUTE_NAME,
+                    instantiatorHint));
+        }
+
+        String contentDir = getContentDir();
+        if (!contentDir.equals(getDefaultContentDir())) {
+            config.addChild(createConfig(ELEMENT_CONTENT_DIR, ATTRIBUTE_SRC, this.contentDir));
+        }
+
+        DefaultConfiguration resourceTypesConf = createConfig(ELEMENT_RESOURCE_TYPES);
+        config.addChild(resourceTypesConf);
+        String[] resourceTypes = getResourceTypeNames();
+        for (int i = 0; i < resourceTypes.length; i++) {
+            String type = resourceTypes[i];
+            DefaultConfiguration resourceTypeConf = createConfig(ELEMENT_RESOURCE_TYPE,
+                    ATTRIBUTE_NAME, type);
+            if (this.resourceType2workflow.containsKey(type)) {
+                resourceTypeConf.setAttribute(ATTRIBUTE_WORKFLOW,
+                        (String) this.resourceType2workflow.get(type));
             }
-            
-            DefaultConfiguration modulesConf = createConfig(ELEMENT_MODULES);
-            config.addChild(modulesConf);
-            String[] modules = getModuleNames();
-            for (int i = 0; i < modules.length; i++) {
-                DefaultConfiguration moduleConf = createConfig(ELEMENT_MODULE, ATTRIBUTE_NAME, modules[i]);
-                modulesConf.addChild(moduleConf);
-            }
-            
-            config.addChild(createConfig(ELEMENT_BREADCRUMB_PREFIX, getBreadcrumbPrefix()));
-            
-            DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
-            serializer.setIndent(true);
-            serializer.serializeToFile(getConfigurationFile(), config);
+            resourceTypesConf.addChild(resourceTypeConf);
+        }
 
+        DefaultConfiguration modulesConf = createConfig(ELEMENT_MODULES);
+        config.addChild(modulesConf);
+        String[] modules = getModuleNames();
+        for (int i = 0; i < modules.length; i++) {
+            DefaultConfiguration moduleConf = createConfig(ELEMENT_MODULE, ATTRIBUTE_NAME,
+                    modules[i]);
+            modulesConf.addChild(moduleConf);
+        }
+
+        config.addChild(createConfig(ELEMENT_BREADCRUMB_PREFIX, getBreadcrumbPrefix()));
+
+        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
+        serializer.setIndent(true);
+        ModifiableSource source = null;
+        try {
+            source = (ModifiableSource) this.sourceResolver.resolveURI(getConfigurationUri());
+            serializer.serialize(source.getOutputStream(), config);
         } catch (final Exception e) {
-            throw new RuntimeException("Problem with config file: " + configFile.getAbsolutePath(),
-                    e);
+            throw new RuntimeException("Problem with config file: " + getConfigurationUri(), e);
+        } finally {
+            if (source != null) {
+                this.sourceResolver.release(source);
+            }
         }
     }
 

Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationFactory.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationFactory.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationFactory.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationFactory.java Tue Feb 10 18:22:23 2009
@@ -21,7 +21,6 @@
 import org.apache.lenya.cms.repository.RepositoryException;
 import org.apache.lenya.cms.repository.RepositoryItem;
 import org.apache.lenya.cms.repository.RepositoryItemFactory;
-import org.apache.lenya.cms.repository.Session;
 
 /**
  * Publication factory.
@@ -30,18 +29,19 @@
 
     private PublicationConfiguration config;
     private NodeFactory nodeFactory;
+    private Session session;
 
     /**
      * @param config The publication configuration.
      */
-    public PublicationFactory(NodeFactory nodeFactory, PublicationConfiguration config) {
+    public PublicationFactory(Session session, NodeFactory nodeFactory, PublicationConfiguration config) {
         this.config = config;
         this.nodeFactory = nodeFactory;
+        this.session = session;
     }
 
-    public RepositoryItem buildItem(Session session, String key) throws RepositoryException {
-        return new PublicationImpl((org.apache.lenya.cms.publication.Session) session,
-                this.nodeFactory, config);
+    public RepositoryItem buildItem(org.apache.lenya.cms.repository.Session session, String key) throws RepositoryException {
+        return new PublicationImpl(this.session, this.nodeFactory, config);
     }
 
     public String getItemType() {

Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationImpl.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationImpl.java Tue Feb 10 18:22:23 2009
@@ -28,6 +28,7 @@
 import org.apache.cocoon.processing.ProcessInfoProvider;
 import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 import org.apache.cocoon.util.AbstractLogEnabled;
+import org.apache.commons.lang.Validate;
 import org.apache.lenya.cms.repository.NodeFactory;
 import org.apache.lenya.cms.repository.RepositoryItem;
 
@@ -82,9 +83,9 @@
         if (this.documentBuilder == null) {
             try {
                 this.documentBuilder = (DocumentBuilder) WebAppContextUtils
-                        .getCurrentWebApplicationContext()
-                        .getBean(
-                                DocumentBuilder.class.getName() + delegate.getDocumentBuilderHint());
+                        .getCurrentWebApplicationContext().getBean(
+                                DocumentBuilder.class.getName() + "/"
+                                        + delegate.getDocumentBuilderHint());
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
@@ -143,8 +144,8 @@
         return (String[]) this.allResourceTypes.toArray(new String[this.allResourceTypes.size()]);
     }
 
-    public File getServletContext() {
-        return delegate.getServletContext();
+    public String getPubBaseUri() {
+        return delegate.getPubBaseUri();
     }
 
     public String getSiteManagerHint() {

Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java Tue Feb 10 18:22:23 2009
@@ -20,9 +20,8 @@
 
 package org.apache.lenya.cms.publication;
 
-import java.io.File;
-import java.io.FileFilter;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -33,9 +32,12 @@
 import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 import org.apache.cocoon.util.AbstractLogEnabled;
 import org.apache.commons.lang.Validate;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.TraversableSource;
+import org.apache.excalibur.source.impl.ResourceSource;
 import org.apache.lenya.cms.repository.NodeFactory;
 import org.apache.lenya.cms.repository.RepositoryException;
-import org.apache.lenya.cms.repository.Session;
 
 /**
  * Factory for creating publication objects.
@@ -44,28 +46,42 @@
 
     private Map id2config;
     private NodeFactory nodeFactory;
+    private String publicationBaseUri;
+    private SourceResolver sourceResolver;
 
     protected synchronized Map getId2config() throws PublicationException {
         if (this.id2config == null) {
             this.id2config = new HashMap();
-            File servletContext = new File(getServletContextPath());
-            File publicationsDirectory = new File(servletContext, Publication.PUBLICATION_PREFIX);
-            if (publicationsDirectory.isDirectory()) {
-                File[] publicationDirectories = publicationsDirectory.listFiles(new FileFilter() {
-                    public boolean accept(File file) {
-                        File configFile = new File(file,
-                                PublicationConfiguration.CONFIGURATION_FILE);
-                        return configFile.exists();
+            ResourceSource res;
+            Source source = null;
+            try {
+                source = this.sourceResolver.resolveURI(getPubBaseUri());
+                if (source instanceof TraversableSource) {
+                    TraversableSource pubsSource = (TraversableSource) source;
+                    if (pubsSource.isCollection()) {
+                        Collection pubSources = pubsSource.getChildren();
+                        for (Iterator i = pubSources.iterator(); i.hasNext();) {
+                            TraversableSource pubSource = (TraversableSource) i.next();
+                            TraversableSource configSource = (TraversableSource) this.sourceResolver
+                                    .resolveURI(pubSource.getURI() + "/"
+                                            + PublicationConfiguration.CONFIGURATION_URI);
+                            if (configSource.exists()) {
+                                String id = pubSource.getName();
+                                addPublication(id);
+                            }
+                        }
+                    } else {
+                        getLogger().warn(
+                                "The publications directory " + pubsSource
+                                        + " does not exist.");
                     }
-                });
-                for (int i = 0; i < publicationDirectories.length; i++) {
-                    String id = publicationDirectories[i].getName();
-                    addPublication(id);
                 }
-            } else {
-                getLogger().warn(
-                        "The publications directory " + publicationsDirectory.getAbsolutePath()
-                                + " does not exist.");
+            } catch (final Exception e) {
+                throw new PublicationException(e);
+            } finally {
+                if (source != null) {
+                    this.sourceResolver.release(source);
+                }
             }
         }
         return this.id2config;
@@ -80,9 +96,11 @@
         }
 
         PublicationConfiguration config = (PublicationConfiguration) id2config.get(id);
-        PublicationFactory pubFactory = new PublicationFactory(getNodeFactory(), config);
+        PublicationFactory pubFactory = new PublicationFactory(factory.getSession(),
+                getNodeFactory(), config);
         try {
-            org.apache.lenya.cms.repository.Session repoSession = (Session) factory.getSession();
+            org.apache.lenya.cms.repository.Session repoSession = ((SessionImpl) factory
+                    .getSession()).getRepositorySession();
             return (Publication) repoSession.getRepositoryItem(pubFactory, id);
         } catch (RepositoryException e) {
             throw new PublicationException(e);
@@ -125,12 +143,17 @@
         }
         ProcessInfoProvider process = (ProcessInfoProvider) WebAppContextUtils
                 .getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
-        PublicationConfiguration config = new PublicationConfiguration(pubId,
-                getServletContextPath(), process.getRequest().getContextPath());
+        PublicationConfiguration config = new PublicationConfiguration(pubId, getPubBaseUri(),
+                process.getRequest().getContextPath());
+        config.setSourceResolver(this.sourceResolver);
         id2config.put(pubId, config);
     }
 
-    protected String getServletContextPath() {
+    protected String getPubBaseUri() throws PublicationException {
+        return this.publicationBaseUri == null ? getServletContext() : this.publicationBaseUri;
+    }
+
+    private String getServletContext() {
         return WebAppContextUtils.getCurrentWebApplicationContext().getServletContext()
                 .getRealPath("/");
     }
@@ -143,4 +166,12 @@
         this.nodeFactory = nodeFactory;
     }
 
+    public void setPubBaseUri(String uri) {
+        this.publicationBaseUri = uri;
+    }
+
+    public void setSourceResolver(SourceResolver sourceResolver) {
+        this.sourceResolver = sourceResolver;
+    }
+
 }

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=743041&r1=743040&r2=743041&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 Tue Feb 10 18:22:23 2009
@@ -28,6 +28,7 @@
 public class RepositoryImpl implements Repository {
 
     private RepositoryManager repositoryManager;
+    private DocumentFactoryBuilder documentFactoryBuilder;
 
     public Session getSession(HttpServletRequest request) {
         Validate.notNull(request);
@@ -47,7 +48,6 @@
     }
 
     public Session startSession(Identity identity, boolean modifiable) {
-
         IdentityWrapper wrapper = new IdentityWrapper(identity);
         org.apache.lenya.cms.repository.Session repoSession;
         try {
@@ -57,6 +57,7 @@
             throw new RuntimeException(e);
         }
         SessionImpl session = new SessionImpl(this, repoSession);
+        session.setDocumentFactoryBuilder(this.documentFactoryBuilder);
         return session;
     }
 
@@ -81,4 +82,8 @@
         return repositoryManager;
     }
 
+    public void setDocumentFactoryBuilder(DocumentFactoryBuilder documentFactoryBuilder) {
+        this.documentFactoryBuilder = documentFactoryBuilder;
+    }
+
 }

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=743041&r1=743040&r2=743041&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 Tue Feb 10 18:22:23 2009
@@ -17,64 +17,42 @@
  */
 package org.apache.lenya.cms.publication;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
 import org.apache.commons.lang.Validate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.lenya.ac.Identity;
-import org.apache.lenya.cms.observation.ObservationRegistry;
 import org.apache.lenya.cms.observation.RepositoryEvent;
 import org.apache.lenya.cms.observation.RepositoryEventFactory;
-import org.apache.lenya.cms.observation.RepositoryListener;
-import org.apache.lenya.cms.repository.Node;
-import org.apache.lenya.cms.repository.Persistable;
-import org.apache.lenya.cms.repository.RepositoryItem;
-import org.apache.lenya.cms.repository.RepositoryItemFactory;
-import org.apache.lenya.cms.repository.RepositoryItemFactoryWrapper;
-import org.apache.lenya.cms.repository.SharedItemStore;
-import org.apache.lenya.cms.repository.UUIDGenerator;
-import org.apache.lenya.transaction.ConcurrentModificationException;
-import org.apache.lenya.transaction.IdentityMap;
-import org.apache.lenya.transaction.IdentityMapImpl;
-import org.apache.lenya.transaction.Lock;
-import org.apache.lenya.transaction.Lockable;
-import org.apache.lenya.transaction.TransactionException;
-import org.apache.lenya.transaction.TransactionLock;
-import org.apache.lenya.transaction.Transactionable;
+import org.apache.lenya.cms.repository.SessionHolder;
 import org.apache.lenya.transaction.UnitOfWork;
-import org.apache.lenya.transaction.UnitOfWorkImpl;
 
-public class SessionImpl implements Session {
+public class SessionImpl implements Session, SessionHolder {
 
     private static final Log logger = LogFactory.getLog(SessionImpl.class);
-    
+
     private org.apache.lenya.cms.repository.Session repositorySession;
     private RepositoryImpl repository;
     private DocumentFactory documentFactory;
     private DocumentFactoryBuilder documentFactoryBuilder;
 
-    
-    public SessionImpl(RepositoryImpl repository, org.apache.lenya.cms.repository.Session repoSession) {
+    public SessionImpl(RepositoryImpl repository,
+            org.apache.lenya.cms.repository.Session repoSession) {
         Validate.notNull(repository, "repository");
         Validate.notNull(repoSession, "repository session");
         this.repository = repository;
         this.repositorySession = repoSession;
+        this.repositorySession.setHolder(this);
     }
 
-    protected org.apache.lenya.cms.repository.Session getRepositorySession() {
+    public org.apache.lenya.cms.repository.Session getRepositorySession() {
         return this.repositorySession;
     }
 
-    public Publication getPublication(String id) {
+    public Publication getPublication(String id) throws ResourceNotFoundException {
         try {
             return getDocumentFactory().getPublication(id);
         } catch (PublicationException e) {
-            throw new RuntimeException(e);
+            throw new ResourceNotFoundException(e);
         }
     }
 
@@ -82,7 +60,7 @@
         return this.repository;
     }
 
-    public DocumentFactory getDocumentFactory() {
+    protected DocumentFactory getDocumentFactory() {
         if (this.documentFactory == null) {
             this.documentFactory = this.documentFactoryBuilder.createDocumentFactory(this);
         }
@@ -102,7 +80,6 @@
     }
 
     private UnitOfWork unitOfWork;
-    private SharedItemStore sharedItemStore;
 
     /**
      * @return The unit of work.
@@ -159,4 +136,17 @@
         return getRepositorySession().isModifiable();
     }
 
+    public void setDocumentFactoryBuilder(DocumentFactoryBuilder documentFactoryBuilder) {
+        this.documentFactoryBuilder = documentFactoryBuilder;
+    }
+
+    public Publication addPublication(String id) throws RepositoryException {
+        if (existsPublication(id)) {
+            throw new RepositoryException("The publication '" + id + "' already exists.");
+        }
+        DocumentFactoryImpl factory = (DocumentFactoryImpl) getDocumentFactory();
+        factory.getPublicationManager().addPublication(id);
+        return getPublication(id);
+    }
+
 }

Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/SharedItemStoreImpl.java Tue Feb 10 18:22:23 2009
@@ -54,19 +54,19 @@
     }
 
     public void addListener(RepositoryListener listener) throws RepositoryException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void commit() throws RepositoryException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void enqueueEvent(RepositoryEvent event) {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public Identity getIdentity() {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public RepositoryItem getRepositoryItem(RepositoryItemFactory factory, String key)
@@ -83,15 +83,15 @@
     }
 
     public void rollback() throws RepositoryException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void setIdentity(Identity identity) {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public Lock createLock(Lockable lockable, int version) throws TransactionException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public boolean isDirty(Transactionable transactionable) {
@@ -99,19 +99,19 @@
     }
 
     public void registerDirty(Transactionable object) throws TransactionException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void registerNew(Transactionable object) throws TransactionException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void registerRemoved(Transactionable object) throws TransactionException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public void removeLock(Lockable lockable) throws TransactionException {
-        throw new IllegalStateException("Operation not permitted.");
+        throw new UnsupportedOperationException();
     }
 
     public synchronized void clear() {
@@ -122,4 +122,12 @@
         return getClass().getName();
     }
 
+    public SessionHolder getHolder() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setHolder(SessionHolder holder) {
+        throw new UnsupportedOperationException();
+    }
+
 }

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=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml Tue Feb 10 18:22:23 2009
@@ -19,40 +19,57 @@
   xsi:schemaLocation="http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
   xmlns="http://www.springframework.org/schema/beans">
+  
   <bean name="org.apache.lenya.cms.publication.Repository"
     class="org.apache.lenya.cms.publication.RepositoryImpl">
     <property name="repositoryManager" ref="org.apache.lenya.cms.repository.RepositoryManager"/>
+    <property name="documentFactoryBuilder" ref="org.apache.lenya.cms.publication.DocumentFactoryBuilder"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.repository.RepositoryManager"
     class="org.apache.lenya.cms.repository.RepositoryManagerImpl">
     <property name="observationRegistry" ref="org.apache.lenya.cms.observation.ObservationRegistry"/>
     <property name="uuidGenerator" ref="org.apache.lenya.cms.repository.UUIDGenerator"/>
     <property name="sharedItemStore" ref="org.apache.lenya.cms.repository.SharedItemStore"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.publication.PublicationManager"
     class="org.apache.lenya.cms.publication.PublicationManagerImpl">
     <property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
+    <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+    <property name="pubBaseUri" value="resource://pubs"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.metadata.MetaDataCache"
-    class="org.apache.lenya.cms.metadata.MetaDataCache"/>
+  class="org.apache.lenya.cms.metadata.MetaDataCache"/>
+  
   <bean name="org.apache.lenya.cms.publication.DocumentFactoryBuilder"
     class="org.apache.lenya.cms.publication.DocumentFactoryBuilderImpl">
     <property name="publicationManager" ref="org.apache.lenya.cms.publication.PublicationManager"/>
     <property name="metaDataCache" ref="org.apache.lenya.cms.metadata.MetaDataCache"/>
     <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+    <property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.publication.DocumentManager"
     class="org.apache.lenya.cms.publication.DocumentManagerImpl">
     <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
     <property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
     <property name="uuidGenerator" ref="org.apache.lenya.cms.repository.UUIDGenerator"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.module.ModuleManager"
-    class="org.apache.lenya.cms.module.ModuleManagerImpl"/>
+  class="org.apache.lenya.cms.module.ModuleManagerImpl"/>
+  
   <bean name="org.apache.lenya.cms.repository.SharedItemStore"
     class="org.apache.lenya.cms.repository.SharedItemStoreImpl">
     <property name="repositoryManager" ref="org.apache.lenya.cms.repository.RepositoryManager"/>
   </bean>
+  
   <bean name="org.apache.lenya.cms.repository.UUIDGenerator"
-    class="org.apache.lenya.cms.repository.LenyaUUIDGenerator"/>
+  class="org.apache.lenya.cms.repository.LenyaUUIDGenerator"/>
+  
+  <bean name="org.apache.lenya.cms.publication.DocumentBuilder/default"
+    class="org.apache.lenya.cms.publication.DefaultDocumentBuilder"/>
+  
 </beans>

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/metadata/MetaDataTest.java Tue Feb 10 18:22:23 2009
@@ -19,7 +19,7 @@
 
 import java.util.Map;
 
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.cms.metadata.dublincore.DublinCore;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.Publication;

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DefaultDocumentTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DefaultDocumentTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DefaultDocumentTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DefaultDocumentTest.java Tue Feb 10 18:22:23 2009
@@ -22,7 +22,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 
 /**
  * 

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentFactoryTest.java Tue Feb 10 18:22:23 2009
@@ -19,7 +19,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 
 /**
  * Document factory test.

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DocumentManagerTest.java Tue Feb 10 18:22:23 2009
@@ -22,7 +22,7 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.cms.site.NodeSet;
 import org.apache.lenya.cms.site.SiteException;
 import org.apache.lenya.cms.site.SiteNode;
@@ -34,7 +34,7 @@
  * Document manager test.
  */
 public class DocumentManagerTest extends AbstractAccessControlTest {
-    
+
     private DocumentManager docManager;
 
     /**
@@ -55,10 +55,9 @@
     }
 
     protected void doTestCopyToArea(DocumentManager docManager, String sourceAreaName,
-            String destAreaName, String path1, String path2) throws PublicationException,
-            SiteException {
+            String destAreaName, String path1, String path2) throws Exception {
 
-        Publication pub = getSession().getPublication("test");
+        Publication pub = getSession().addPublication("test");
         SiteStructure sourceArea = pub.getArea(sourceAreaName).getSite();
         SiteStructure destArea = pub.getArea(destAreaName).getSite();
 
@@ -185,11 +184,10 @@
 
     }
 
-    public void setDocManager(DocumentManager docManager) {
-        this.docManager = docManager;
-    }
-
     public DocumentManager getDocManager() {
+        if (this.docManager == null) {
+            this.docManager = (DocumentManager) getBeanFactory().getBean(DocumentManager.ROLE);
+        }
         return docManager;
     }
 }

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DublinCoreTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DublinCoreTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DublinCoreTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/DublinCoreTest.java Tue Feb 10 18:22:23 2009
@@ -18,7 +18,7 @@
 
 package org.apache.lenya.cms.publication;
 
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.cms.metadata.MetaData;
 import org.apache.lenya.cms.metadata.dublincore.DublinCore;
 

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/PublicationTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/PublicationTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/PublicationTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/PublicationTest.java Tue Feb 10 18:22:23 2009
@@ -22,7 +22,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 
 /**
  * Publication test.

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/file/FilePublicationTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/file/FilePublicationTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/file/FilePublicationTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/publication/file/FilePublicationTest.java Tue Feb 10 18:22:23 2009
@@ -22,7 +22,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentException;
 import org.apache.lenya.cms.publication.Publication;

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RCMLTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RCMLTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RCMLTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RCMLTest.java Tue Feb 10 18:22:23 2009
@@ -23,7 +23,7 @@
 import java.io.PrintWriter;
 
 import org.w3c.dom.Document;
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.xml.DocumentHelper;
 
 /**

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RevisionControllerTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RevisionControllerTest.java?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RevisionControllerTest.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/java/org/apache/lenya/cms/rc/RevisionControllerTest.java Tue Feb 10 18:22:23 2009
@@ -20,7 +20,7 @@
 
 package org.apache.lenya.cms.rc;
 
-import org.apache.lenya.ac.impl.AbstractAccessControlTest;
+import org.apache.lenya.cms.AbstractAccessControlTest;
 import org.apache.lenya.cms.publication.Document;
 import org.apache.lenya.cms.publication.DocumentManager;
 import org.apache.lenya.cms.repository.RepositoryException;

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.spring.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+  
+  <import resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/lenya-core-impl-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/lenya-core-observation-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/lenya-module-sourcerepository-components.xml"/>
+  
+</beans>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.xtest?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/metadata/MetaDataTest.xtest Tue Feb 10 18:22:23 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<testcase>
+  <roles>
+    <role name="org.apache.excalibur.source.SourceFactorySelector"
+      shorthand="source-factories"
+      default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+    <role name="org.apache.excalibur.source.SourceResolver"
+      shorthand="source-resolver"
+      default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+    />
+  </roles>
+  
+  <components>
+    
+    <source-factories>
+      <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+      <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+      <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+      <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+      <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+    </source-factories>
+    
+  </components>
+  
+</testcase>

Modified: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml?rev=743041&r1=743040&r2=743041&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.spring.xml Tue Feb 10 18:22:23 2009
@@ -20,12 +20,12 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
   
-  <bean name="org.apache.excalibur.source.SourceResolver"
-    class="org.apache.cocoon.components.source.CocoonSourceResolver"/>
-  
   <import resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
   <import resource="classpath:META-INF/cocoon/spring/lenya-core-impl-components.xml"/>
   <import resource="classpath:META-INF/cocoon/spring/lenya-core-observation-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/lenya-core-repository-components.xml"/>
   <import resource="classpath:META-INF/cocoon/spring/lenya-module-sourcerepository-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/lenya-module-sitetree-components.xml"/>
+  <import resource="classpath:META-INF/cocoon/spring/cocoon-xml-impl.xml"/>
   
 </beans>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.xtest
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.xtest?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.xtest (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/org/apache/lenya/cms/publication/DocumentManagerTest.xtest Tue Feb 10 18:22:23 2009
@@ -0,0 +1,41 @@
+<?xml version="1.0" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<testcase>
+  <roles>
+    <role name="org.apache.excalibur.source.SourceFactorySelector"
+      shorthand="source-factories"
+      default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+    <role name="org.apache.excalibur.source.SourceResolver"
+      shorthand="source-resolver"
+      default-class="org.apache.excalibur.source.impl.SourceResolverImpl"
+    />
+  </roles>
+  
+  <components>
+    
+    <source-factories>
+      <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/>
+      <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/>
+      <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/>
+      <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/>
+      <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
+    </source-factories>
+    
+  </components>
+  
+</testcase>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/access-control.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/access-control.xml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/access-control.xml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/access-control.xml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: access-control.xml 666714 2008-06-11 15:42:59Z andreas $ -->
+
+<access-controller type="bypassable">
+  
+  <accreditable-manager type="file">
+    <parameter name="directory" value="resource://pubs/test/config/access-control/passwd"/>
+    
+    <user-manager>
+      <user-type class="org.apache.lenya.ac.file.FileUser" create-use-case="admin.addUser">Local User</user-type>
+      <!-- uncomment the following line if you want LDAP support -->
+      <!-- <user-type class="org.apache.lenya.ac.ldap.LDAPUser" create-use-case="admin.addUser">LDAP User</user-type> -->
+    </user-manager>
+  </accreditable-manager>
+  
+  <policy-manager type="document">
+    <policy-manager type="file">
+      <parameter name="directory" value="resource://pubs/test/config/access-control/policies"/>
+    </policy-manager>
+  </policy-manager>
+  <!--
+    FIXME: Disabled because of dependency to usecase module.
+  <authorizer type="usecase"/>
+  -->
+  
+</access-controller>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.gml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.gml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.gml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.gml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: admin.gml 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<group class="org.apache.lenya.ac.file.FileGroup" id="admin"/>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.rml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.rml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.rml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/admin.rml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: admin.rml 597037 2007-11-21 11:15:43Z andreas $ -->
+
+<role class="org.apache.lenya.ac.file.FileRole" id="admin" assignable="false"/>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/alice.iml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/alice.iml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/alice.iml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/alice.iml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: alice.iml 604189 2007-12-14 13:34:13Z andreas $ -->
+
+<identity id="alice" class="org.apache.lenya.ac.file.FileUser">
+  <name>Alice</name>
+  <description></description>
+  <email>[email protected]</email>
+  <password type="md5">8e07dafd13495561db9063ebe4db4b27</password>
+  <groups>
+    <group>editor</group>
+    <group>reviewer</group>
+  </groups>
+</identity>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/cifs.properties.sample
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/cifs.properties.sample?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/cifs.properties.sample (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/cifs.properties.sample Tue Feb 10 18:22:23 2009
@@ -0,0 +1,5 @@
+# the name of the domain controller (or samba sever) to authenticate against
+domain-controller=my-domain-controller
+
+# domain/workgroup name to use
+domain=WORKGROUP
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/edit.rml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/edit.rml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/edit.rml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/edit.rml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<role class="org.apache.lenya.ac.file.FileRole" id="edit"/>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/editor.gml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/editor.gml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/editor.gml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/editor.gml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: editor.gml 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<group class="org.apache.lenya.ac.file.FileGroup" id="editor"/>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/ldap.properties.sample
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/ldap.properties.sample?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/ldap.properties.sample (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/ldap.properties.sample Tue Feb 10 18:22:23 2009
@@ -0,0 +1,56 @@
+#############################################################################
+# File: ldap.properties.sample
+# $Id: ldap.properties.sample 557591 2007-07-19 12:11:39Z jann $
+#############################################################################
+
+#############################################################################
+# General settings 
+#    set handl-referrals to "follow" is your ldap server uses referrals
+#############################################################################
+provider-url=ldaps://ldap.example.com:389/dc=example,dc=com
+base-dn=dc=example,dc=com
+handle-referrals=
+
+#############################################################################
+# User parameters for authentication:
+# usr-branch: 
+#      if users are to be taken from a specific branch, set this.
+#      If you set this to empty, users will be searched in the whole 
+#      subtree, i.e.:
+#         usr-branch=
+# usr-authentication:
+#      authentication method when the user authenticates
+# domain-name:
+#      AFAIK, this is only relevant for MS Active Directory
+#############################################################################
+#usr-branch=ou=People
+usr-branch=
+usr-attr=uid
+usr-name-attr=sn
+usr-authentication=simple
+domain-name=
+
+############################################################################
+# Security settings
+# -----------------
+# security-authentication:
+#       you can set this to none if there is no manager authentication, i.e.:
+#         security-authentication=none
+# mgr-dn and mgr-pw:
+#       Manager/user which is allowed to retrieve a list of "all" users
+#       (fullname) from LDAP server. Leave it empty for anonymous bindings.
+# key-store:
+#       - If you do not use ssl, you can comment out this property.
+#       - keystore is taken relatively to the publication config/ac/passwd
+#       directory. You should put the Directory-Server certificate in this 
+#       file, if using ssl. 
+#       The keystore file can be generated as follows:
+#          keytool -import -keystore .keystore -file <ca_cert_file> 
+#                    -alias <yourdomain.com>
+#       
+############################################################################
+security-authentication=simple
+mgr-dn=
+mgr-pw=
+key-store=.keystore
+security-protocol=ssl

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/lenya.iml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/lenya.iml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/lenya.iml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/lenya.iml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: lenya.iml 604189 2007-12-14 13:34:13Z andreas $ -->
+
+<identity id="lenya" class="org.apache.lenya.ac.file.FileUser">
+  <name>Levi Vanya</name>
+  <description></description>
+  <email>[email protected]</email>
+  <password type="md5">8e07dafd13495561db9063ebe4db4b27</password>
+  <groups>
+    <group>editor</group>
+    <group>admin</group>
+    <group>sitemanager</group>
+  </groups>
+</identity>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/localhost.ipml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/localhost.ipml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/localhost.ipml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/localhost.ipml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: localhost.ipml 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<ip-range class="org.apache.lenya.ac.file.FileIPRange" id="localhost">
+  <name>Localhost</name>
+  <network-address>127.0.0.1</network-address>
+  <subnet-mask>255.255.255.0</subnet-mask>
+</ip-range>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/review.rml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/review.rml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/review.rml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/review.rml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<role class="org.apache.lenya.ac.file.FileRole" id="review"/>

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/reviewer.gml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/reviewer.gml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/reviewer.gml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/reviewer.gml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: reviewer.gml 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<group class="org.apache.lenya.ac.file.FileGroup" id="reviewer"/>
\ No newline at end of file

Added: lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/session.rml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/session.rml?rev=743041&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/session.rml (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/test/resources/pubs/test/config/access-control/passwd/session.rml Tue Feb 10 18:22:23 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<role class="org.apache.lenya.ac.file.FileRole" id="session"/>
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.