You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2009/02/14 14:43:17 UTC
svn commit: r744496 - in /lenya/trunk:
org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/
org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/
org.apache.lenya.core.api/src/main/resources/...
Author: andreas
Date: Sat Feb 14 13:43:16 2009
New Revision: 744496
URL: http://svn.apache.org/viewvc?rev=744496&view=rev
Log:
Fixed publication introduction page.
Added:
lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/cocoon/source/PublicationSourceFactory.java
lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/xslt/introduction.xsl
Removed:
lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/lenya/xslt/util/introduction.xsl
Modified:
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/AbstractPageEnvelopeModule.java
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelope.java
lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelopeFactory.java
lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-inputModules.xml
lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-sourceFactories.xml
lenya/trunk/org.apache.lenya.core.impl.tests/src/test/resources/test-components.xml
lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml
lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java
lenya/trunk/org.apache.lenya.core.usecase/src/main/resources/META-INF/cocoon/spring/lenya-core-usecase.xml
lenya/trunk/org.apache.lenya.module.simplesite/src/test/resources/test-components.xml
lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/global-sitemap.xmap
lenya/trunk/pubs/default/config/access-control/access-control.xml
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/AbstractPageEnvelopeModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/AbstractPageEnvelopeModule.java?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/AbstractPageEnvelopeModule.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/cocoon/components/modules/input/AbstractPageEnvelopeModule.java Sat Feb 14 13:43:16 2009
@@ -20,11 +20,9 @@
package org.apache.lenya.cms.cocoon.components.modules.input;
-import java.io.File;
import java.util.Map;
import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.cocoon.environment.Context;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.apache.lenya.cms.publication.PageEnvelope;
@@ -68,8 +66,6 @@
}
String contextPath = request.getContextPath();
- Context context = ObjectModelHelper.getContext(objectModel);
- String servletContextPath = context.getRealPath("");
try {
Session session = getSession();
@@ -81,7 +77,6 @@
envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(
contextPath,
webappUrl,
- new File(servletContextPath),
pub);
} catch (Exception e) {
throw new ConfigurationException("Resolving page envelope failed: ", e);
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelope.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelope.java?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelope.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelope.java Sat Feb 14 13:43:16 2009
@@ -31,7 +31,7 @@
* document.
*/
public class PageEnvelope {
- private final static Log logger = LogFactory.getLog(PageEnvelope.class);
+ private final static Log logger = LogFactory.getLog(PageEnvelope.class);
/**
* The names of the page envelope parameters.
*/
@@ -60,8 +60,7 @@
*/
public static final String IS_PUBLICATION = "is-publication";
/**
- * <code>PUBLICATION_LANGUAGES_CSV</code> A list of the publication's languages,
- * comma-seperated
+ * <code>PUBLICATION_LANGUAGES_CSV</code> A list of the publication's languages, comma-seperated
*/
public static final String PUBLICATION_LANGUAGES_CSV = "publication-languages-csv";
/**
@@ -105,8 +104,8 @@
*/
public static final String DOCUMENT_URL = "document-url";
/**
- * <code>DOCUMENT_URL_WITHOUT_LANGUAGE</code> The URL of the current document without a
- * language extension.
+ * <code>DOCUMENT_URL_WITHOUT_LANGUAGE</code> The URL of the current document without a language
+ * extension.
*/
public static final String DOCUMENT_URL_WITHOUT_LANGUAGE = "document-url-without-language";
/**
@@ -134,8 +133,8 @@
*/
public static final String DOCUMENT_LANGUAGE = "document-language";
/**
- * This attribute returns the document language if the document exists, or the
- * default language otherwise. This makes it suitable for 404 pages.
+ * This attribute returns the document language if the document exists, or the default language
+ * otherwise. This makes it suitable for 404 pages.
*/
public static final String LANGUAGE = "language";
/**
@@ -152,8 +151,7 @@
*/
public static final String DOCUMENT_LASTMODIFIED = "document-lastmodified";
/**
- * <code>BREADCRUMB_PREFIX</code> The breadcrumb prefix of the publication, used for
- * navigation
+ * <code>BREADCRUMB_PREFIX</code> The breadcrumb prefix of the publication, used for navigation
*/
public static final String BREADCRUMB_PREFIX = "breadcrumb-prefix";
/**
@@ -184,12 +182,10 @@
* @param session The session to use.
* @param contextPath The servlet context prefix.
* @param webappUrl The web application URL.
- * @param servletContext The servlet context directory.
* @param publication The publication.
* @throws PageEnvelopeException when something went wrong.
*/
- public PageEnvelope(String contextPath,
- String webappUrl, File servletContext, Publication publication)
+ public PageEnvelope(String contextPath, String webappUrl, Publication publication)
throws PageEnvelopeException {
this.context = contextPath;
this.webappUrl = webappUrl;
@@ -251,7 +247,7 @@
public String getContext() {
return this.context;
}
-
+
private String path;
/**
@@ -263,8 +259,8 @@
if (this.path == null) {
final Document doc = getDocument();
try {
- this.path = doc != null ? doc.getPath() :
- getPublication().getDocumentBuilder().getLocator(getSession(), this.webappUrl).getPath();
+ this.path = doc != null ? doc.getPath() : getPublication().getDocumentBuilder()
+ .getLocator(getSession(), this.webappUrl).getPath();
} catch (final Exception e) {
throw new RuntimeException(e);
}
@@ -307,7 +303,7 @@
public void setDocument(Document _document) {
this.document = _document;
}
-
+
/**
* @return The document language or the default language if the document doesn't exist.
* @see #LANGUAGE
@@ -317,7 +313,8 @@
if (document == null) {
Publication pub = getPublication();
if (pub == null) {
- throw new RuntimeException("The language attribute can't be used outside a publication.");
+ throw new RuntimeException(
+ "The language attribute can't be used outside a publication.");
}
return pub.getDefaultLanguage();
} else {
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelopeFactory.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelopeFactory.java?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelopeFactory.java (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/java/org/apache/lenya/cms/publication/PageEnvelopeFactory.java Sat Feb 14 13:43:16 2009
@@ -20,10 +20,8 @@
package org.apache.lenya.cms.publication;
-import java.io.File;
import java.util.Map;
-import org.apache.cocoon.environment.Context;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.apache.lenya.util.ServletHelper;
@@ -35,7 +33,7 @@
/**
* Creates a new PageEnvelopeFactory.
*/
- protected PageEnvelopeFactory() {
+ private PageEnvelopeFactory() {
// do nothing
}
@@ -63,24 +61,21 @@
throws PageEnvelopeException {
Request request = ObjectModelHelper.getRequest(objectModel);
String contextPath = request.getContextPath();
- Context context = ObjectModelHelper.getContext(objectModel);
String webappUrl = ServletHelper.getWebappURI(request);
- String servletContextPath = context.getRealPath("");
- return getPageEnvelope(contextPath, webappUrl, new File(servletContextPath), pub);
+ return getPageEnvelope(contextPath, webappUrl, pub);
}
/**
* Creates a page envelope.
* @param contextPath The servlet context prefix.
* @param webappUrl The web application URL.
- * @param servletContext The servlet context directory.
* @param pub The publication.
* @return A page envelope.
* @throws PageEnvelopeException if something went wrong.
*/
- public PageEnvelope getPageEnvelope(String contextPath, String webappUrl, File servletContext,
- Publication pub) throws PageEnvelopeException {
- PageEnvelope envelope = new PageEnvelope(contextPath, webappUrl, servletContext, pub);
+ public PageEnvelope getPageEnvelope(String contextPath, String webappUrl, Publication pub)
+ throws PageEnvelopeException {
+ PageEnvelope envelope = new PageEnvelope(contextPath, webappUrl, pub);
return envelope;
}
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-inputModules.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-inputModules.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-inputModules.xml (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-inputModules.xml Sat Feb 14 13:43:16 2009
@@ -19,18 +19,26 @@
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.cocoon.components.modules.input.InputModule/fallback"
class="org.apache.lenya.cms.cocoon.components.modules.input.FallbackModule">
<property name="protocol" value="fallback"/>
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
<property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
</bean>
+
<bean name="org.apache.cocoon.components.modules.input.InputModule/page-envelope"
- class="org.apache.lenya.cms.cocoon.components.modules.input.PageEnvelopeModule"/>
+ class="org.apache.lenya.cms.cocoon.components.modules.input.PageEnvelopeModule">
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
+ </bean>
+
<bean name="org.apache.cocoon.components.modules.input/resource-type"
- class="org.apache.lenya.cms.cocoon.components.modules.input.ResourceTypeModule"/>
+ class="org.apache.lenya.cms.cocoon.components.modules.input.ResourceTypeModule"/>
+
<bean name="org.apache.cocoon.components.modules.input/doc-info"
- class="org.apache.lenya.cms.cocoon.components.modules.input.DocumentInfoModule"/>
+ class="org.apache.lenya.cms.cocoon.components.modules.input.DocumentInfoModule"/>
+
<bean name="org.apache.cocoon.components.modules.input/document-url"
- class="org.apache.lenya.cms.cocoon.components.modules.input.DocumentURLModule"/>
+ class="org.apache.lenya.cms.cocoon.components.modules.input.DocumentURLModule"/>
+
</beans>
Modified: lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-sourceFactories.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-sourceFactories.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-sourceFactories.xml (original)
+++ lenya/trunk/org.apache.lenya.core.api/src/main/resources/META-INF/cocoon/spring/lenya-core-api-sourceFactories.xml Sat Feb 14 13:43:16 2009
@@ -26,4 +26,11 @@
<property name="templateManager" ref="org.apache.lenya.cms.publication.templating.PublicationTemplateManager"/>
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
</bean>
+ <bean name="org.apache.excalibur.source.SourceFactory/aggregate-fallback"
+ class="org.apache.lenya.cms.cocoon.source.AggregatingFallbackSourceFactory">
+ <property name="moduleManager" ref="org.apache.lenya.cms.module.ModuleManager"/>
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
+ <property name="templateManager" ref="org.apache.lenya.cms.publication.templating.PublicationTemplateManager"/>
+ <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ </bean>
</beans>
Modified: lenya/trunk/org.apache.lenya.core.impl.tests/src/test/resources/test-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl.tests/src/test/resources/test-components.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl.tests/src/test/resources/test-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl.tests/src/test/resources/test-components.xml Sat Feb 14 13:43:16 2009
@@ -21,6 +21,7 @@
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-cache-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"/>
Added: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/cocoon/source/PublicationSourceFactory.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/cocoon/source/PublicationSourceFactory.java?rev=744496&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/cocoon/source/PublicationSourceFactory.java (added)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/cocoon/source/PublicationSourceFactory.java Sat Feb 14 13:43:16 2009
@@ -0,0 +1,70 @@
+package org.apache.lenya.cms.cocoon.source;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.cocoon.processing.ProcessInfoProvider;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceFactory;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.Repository;
+import org.apache.lenya.cms.publication.ResourceNotFoundException;
+import org.apache.lenya.cms.publication.Session;
+
+/**
+ * Syntax: pub:{pubId}:/path/to/file
+ */
+public class PublicationSourceFactory implements SourceFactory {
+
+ protected static final String PROTOCOL = "pub";
+
+ private Repository repository;
+ private SourceResolver sourceResolver;
+
+ public Source getSource(final String location, final Map parameters) throws IOException,
+ MalformedURLException {
+
+ final String pathInfo = location.substring(PROTOCOL.length() + 1);
+
+ final int colonIndex = pathInfo.indexOf(":");
+ if (colonIndex < 0) {
+ throw new MalformedURLException("The URI " + location
+ + " must contain the publication ID.");
+ }
+
+ final String pubId = pathInfo.substring(0, colonIndex);
+ ProcessInfoProvider process = (ProcessInfoProvider) WebAppContextUtils
+ .getCurrentWebApplicationContext().getBean(ProcessInfoProvider.ROLE);
+ HttpServletRequest request = process.getRequest();
+ Session session = this.repository.getSession(request);
+ if (session.existsPublication(pubId)) {
+ Publication pub = session.getPublication(pubId);
+ final String path = pathInfo.substring(colonIndex + 1);
+ final String uri = pub.getSourceUri() + path;
+ return this.sourceResolver.resolveURI(uri);
+ } else {
+ throw new ResourceNotFoundException("The publication " + pubId + " does not exist.");
+ }
+ }
+
+ /**
+ * Does nothing because the delegated factory does this.
+ * @see org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source)
+ */
+ public void release(Source source) {
+ }
+
+ public void setRepository(Repository repository) {
+ this.repository = repository;
+ }
+
+ public void setSourceResolver(SourceResolver sourceResolver) {
+ this.sourceResolver = sourceResolver;
+ }
+
+}
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=744496&r1=744495&r2=744496&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 Sat Feb 14 13:43:16 2009
@@ -113,6 +113,11 @@
<property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
<property name="nodeFactory" ref="org.apache.lenya.cms.repository.NodeFactory"/>
</bean>
+ <bean name="org.apache.excalibur.source.SourceFactory/pub"
+ class="org.apache.lenya.cms.cocoon.source.PublicationSourceFactory">
+ <property name="repository" ref="org.apache.lenya.cms.publication.Repository"/>
+ <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+ </bean>
<!-- Sitemap Components -->
<bean name="org.apache.cocoon.generation.Generator/publications"
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/java/org/apache/lenya/cms/ac/usecase/impl/UsecaseAuthorizerImpl.java Sat Feb 14 13:43:16 2009
@@ -92,7 +92,7 @@
if (usecaseRoles.hasRoles(usecase)) {
getLogger().debug("Roles for usecase found.");
- List usecaseRoleIds = Arrays.asList(usecaseRoles.getRoles(usecase));
+ List<String> usecaseRoleIds = Arrays.asList(usecaseRoles.getRoles(usecase));
int i = 0;
while (!authorized && i < roles.length) {
@@ -132,7 +132,7 @@
configUri = configUri.substring("aggregate-".length());
}
UsecaseRoles usecaseRoles = getUsecaseRoles(configUri);
- List roles = Arrays.asList(usecaseRoles.getRoles(usecase));
+ List<String> roles = Arrays.asList(usecaseRoles.getRoles(usecase));
String roleId = role.getId();
if (granted) {
if (!roles.contains(roleId)) {
@@ -178,8 +178,7 @@
/**
* Returns the source URI of the usecase role configuration file for a certain publication.
- *
- * @param publication The publication.
+ * @param pubId The publication ID.
* @return A string representing a URI.
*/
protected String getConfigurationUri(String pubId) {
@@ -213,4 +212,8 @@
this.sourceResolver = sourceResolver;
}
+ public void setCache(SourceCache cache) {
+ this.cache = cache;
+ }
+
}
Modified: lenya/trunk/org.apache.lenya.core.usecase/src/main/resources/META-INF/cocoon/spring/lenya-core-usecase.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.usecase/src/main/resources/META-INF/cocoon/spring/lenya-core-usecase.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.usecase/src/main/resources/META-INF/cocoon/spring/lenya-core-usecase.xml (original)
+++ lenya/trunk/org.apache.lenya.core.usecase/src/main/resources/META-INF/cocoon/spring/lenya-core-usecase.xml Sat Feb 14 13:43:16 2009
@@ -21,7 +21,7 @@
xmlns="http://www.springframework.org/schema/beans">
<bean name="org.apache.lenya.ac.Authorizer/usecase"
- class="org.apache.lenya.cms.ac.usecase.impl.UsecaseAuthorizerIMpl">
+ class="org.apache.lenya.cms.ac.usecase.impl.UsecaseAuthorizerImpl">
<property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
<property name="cache" ref="org.apache.lenya.ac.cache.SourceCache"/>
</bean>
Modified: lenya/trunk/org.apache.lenya.module.simplesite/src/test/resources/test-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.simplesite/src/test/resources/test-components.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.simplesite/src/test/resources/test-components.xml (original)
+++ lenya/trunk/org.apache.lenya.module.simplesite/src/test/resources/test-components.xml Sat Feb 14 13:43:16 2009
@@ -21,6 +21,7 @@
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-cache-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"/>
Modified: lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/global-sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/global-sitemap.xmap?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/global-sitemap.xmap (original)
+++ lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/global-sitemap.xmap Sat Feb 14 13:43:16 2009
@@ -267,11 +267,12 @@
<map:match pattern="*/introduction.html">
<map:aggregate element="aggregation-wrapper">
<map:part src="aggregate-fallback://readme.xml"/>
- <map:part src="lenya/pubs/{1}/config/publication.xml"/>
+ <map:part src="pub:{1}:/config/publication.xml"/>
</map:aggregate>
- <map:transform src="lenya/xslt/util/introduction.xsl"/>
- <map:call resource="style-cms-page"/>
- <map:serialize />
+ <map:transform src="xslt/introduction.xsl"/>
+ <map:serialize type="servletService">
+ <map:parameter name="service" value="servlet:gui:/service/style-cms-page"/>
+ </map:serialize>
</map:match>
</map:pipeline>
@@ -325,7 +326,9 @@
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"></map:parameter>
</map:transform>
- <map:call resource="style-cms-page"/>
+ <map:serialize type="servletService">
+ <map:parameter name="service" value="servlet:gui:/service/style-cms-page"/>
+ </map:serialize>
<map:serialize status-code="404" />
</map:when>
<map:otherwise>
Added: lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/xslt/introduction.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/xslt/introduction.xsl?rev=744496&view=auto
==============================================================================
--- lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/xslt/introduction.xsl (added)
+++ lenya/trunk/org.apache.lenya.webapp.welcome/src/main/resources/COB-INF/xslt/introduction.xsl Sat Feb 14 13:43:16 2009
@@ -0,0 +1,199 @@
+<?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: publication.xsl 473861 2006-11-12 03:51:14Z gregor $ -->
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.1"
+ xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns="http://www.w3.org/1999/xhtml"
+ >
+
+
+ <xsl:key name="workflows" match="lenya:resource-type" use="@workflow"/>
+
+ <xsl:template match="/*">
+ <page:page>
+ <page:title><a href="../index.html">Apache Lenya</a> »
+ <i18n:translate>
+ <i18n:text>... Publication</i18n:text>
+ <i18n:param><xsl:value-of select="lenya:publication/lenya:name"/></i18n:param>
+ </i18n:translate>
+ </page:title>
+ <page:head/>
+ <page:body>
+ <div class="lenya-sidebar">
+ <h2><i18n:text>This Publication</i18n:text></h2>
+ <ul>
+ <li><a href="authoring/"><i18n:text>Login as Editor</i18n:text></a></li>
+ <li><a href="live/"><i18n:text>Live View</i18n:text></a></li>
+ </ul>
+ <h2><i18n:text>Links</i18n:text></h2>
+ <ul>
+ <li><a href="../index.html"><i18n:text>Other Publications</i18n:text></a></li>
+ <li><a href="http://lenya.apache.org/docs/index.html"><i18n:text>Documentation</i18n:text></a></li>
+ <li><a href="http://wiki.apache.org/lenya">Wiki</a></li>
+ </ul>
+ </div>
+
+ <div class="lenya-frontpage">
+ <h2><i18n:text>Publication properties</i18n:text>:</h2>
+ <xsl:apply-templates select="lenya:publication"/>
+ <xsl:apply-templates select="page:page"/>
+
+ </div>
+ </page:body>
+ </page:page>
+ </xsl:template>
+
+ <xsl:template match="lenya:publication">
+ <table class="lenya-table-list-noborder">
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Name</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:name"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Revision</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:version"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Description</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:description"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Available languages</i18n:text></th>
+ <td class="border">
+ <xsl:for-each select="lenya:languages/lenya:language">
+ <xsl:choose>
+ <xsl:when test="@default">
+ <strong><xsl:value-of select="."/></strong>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Available resource types</i18n:text></th>
+ <td class="border">
+ <xsl:if test="lenya:templates/lenya:template">
+ <i18n:text>Inherited: see template publication</i18n:text><br/>
+ </xsl:if>
+ <xsl:for-each
+ select="lenya:resource-types/lenya:resource-type[generate-id(.)=generate-id(key('workflows', @workflow)[1])]"
+ >
+ <xsl:sort select="@workflow"/>
+ <xsl:for-each select="key('workflows', @workflow)">
+ <xsl:sort select="@name"/>
+ <xsl:value-of select="@name"/>
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text> (Workflow: </xsl:text>
+ <xsl:value-of select="@workflow"/>
+ <xsl:text>)</xsl:text>
+ <xsl:if test="position() != last()">
+ <xsl:text>;</xsl:text><br />
+ </xsl:if>
+ </xsl:for-each>
+ </td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Required Lenya version</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:lenya-version"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Required Lenya revision</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:lenya-revision"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Required Cocoon version</i18n:text></th>
+ <td class="border"><xsl:value-of select="lenya:cocoon-version"/></td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Modules used</i18n:text></th>
+ <td class="border">
+ <xsl:if test="lenya:templates/lenya:template">
+ <i18n:text>Inherited: see template publication</i18n:text><br/>
+ </xsl:if>
+ <xsl:for-each select="lenya:modules/lenya:module">
+ <xsl:value-of select="@name"/>
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </td>
+ </tr>
+ <tr>
+ <th style="white-space: nowrap;"><i18n:text>Template used</i18n:text></th>
+ <td class="border">
+ <xsl:choose>
+ <xsl:when test="lenya:template">
+ <a href="../{lenya:template/@id}/introduction.html">
+ <xsl:value-of select="lenya:template/@id"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <i18n:text>none</i18n:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="page:page">
+ <!-- FIXME: aggregate-fallback seems to return the last document twice.
+ The position predicate is just a quick workaround and needs to be fixed! -->
+ <xsl:for-each select="page:body[position() < last()]">
+ <xsl:apply-templates select="*"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- we are aggretating into a new context:
+ (another good reason to move to xhtml2) -->
+ <xsl:template match="xhtml:h1">
+ <h2><xsl:apply-templates select="@*|node()"/></h2>
+ </xsl:template>
+ <xsl:template match="xhtml:h2">
+ <h3><xsl:apply-templates select="@*|node()"/></h3>
+ </xsl:template>
+ <xsl:template match="xhtml:h3">
+ <h4><xsl:apply-templates select="@*|node()"/></h4>
+ </xsl:template>
+ <xsl:template match="xhtml:h4">
+ <h5><xsl:apply-templates select="@*|node()"/></h5>
+ </xsl:template>
+ <xsl:template match="xhtml:h5|xhtml:h6">
+ <h6><xsl:apply-templates select="@*|node()"/></h6>
+ </xsl:template>
+
+ <xsl:template match="@*|node()">
+ <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Modified: lenya/trunk/pubs/default/config/access-control/access-control.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/pubs/default/config/access-control/access-control.xml?rev=744496&r1=744495&r2=744496&view=diff
==============================================================================
--- lenya/trunk/pubs/default/config/access-control/access-control.xml (original)
+++ lenya/trunk/pubs/default/config/access-control/access-control.xml Sat Feb 14 13:43:16 2009
@@ -21,7 +21,7 @@
<access-controller type="bypassable">
<accreditable-manager type="file">
- <parameter name="directory" value="context:///lenya/pubs/default/config/access-control/passwd"/>
+ <parameter name="directory" value="pub:default:/config/access-control/passwd"/>
<user-manager>
<user-type class="org.apache.lenya.ac.file.FileUser" create-use-case="admin.addUser">Local User</user-type>
@@ -32,7 +32,7 @@
<policy-manager type="document">
<policy-manager type="file">
- <parameter name="directory" value="context:///lenya/pubs/default/config/access-control/policies"/>
+ <parameter name="directory" value="pub:default:/config/access-control/policies"/>
</policy-manager>
</policy-manager>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org