Author: andreas
Date: Sun Aug 19 14:45:47 2007
New Revision: 567484
URL: http://svn.apache.org/viewvc?rev=567484&view=rev
Log:
Moving SSL handling from OutgoingLinkRewriter to SslRedirectAction (much better performance)
Added:
lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java
Modified:
lenya/trunk/src/modules-core/ac/config/module.xml
lenya/trunk/src/modules-core/ac/config/sitemap/actions.xmap
lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java
lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java
lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java
lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java
lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java
lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap
Modified: lenya/trunk/src/modules-core/ac/config/module.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac/config/module.xml?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/ac/config/module.xml (original)
+++ lenya/trunk/src/modules-core/ac/config/module.xml Sun Aug 19 14:45:47 2007
@@ -22,6 +22,7 @@
<id>org.apache.lenya.modules.ac</id>
<export package="org.apache.lenya.ac.file"/>
<depends module="org.apache.lenya.modules.cache"/>
+ <depends module="org.apache.lenya.modules.linking"/>
<package>org.apache.lenya.modules</package>
<version>0.1-dev</version>
<name>Access control</name>
Modified: lenya/trunk/src/modules-core/ac/config/sitemap/actions.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac/config/sitemap/actions.xmap?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/ac/config/sitemap/actions.xmap (original)
+++ lenya/trunk/src/modules-core/ac/config/sitemap/actions.xmap Sun Aug 19 14:45:47 2007
@@ -17,7 +17,9 @@
-->
<!-- $Id: actions.xmap 280060 2005-09-11 01:56:31Z chestnut $ -->
-<xmap xpath="/sitemap/components/actions" unless="/sitemap/components/actions/action[@name = 'authenticator']">
- <map:action name="authenticator" src="org.apache.lenya.cms.cocoon.acting.DelegatingAuthenticatorAction" logger="lenya.sitemap.action.authenticator"/>
- <map:action name="authorizer" src="org.apache.lenya.cms.cocoon.acting.DelegatingAuthorizerAction" logger="lenya.sitemap.action.authorizer"/>
+<xmap xpath="/sitemap/components/actions" unless="/sitemap/components/actions/action[@name = 'authenticator']"
+ xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:action name="authenticator" src="org.apache.lenya.cms.cocoon.acting.DelegatingAuthenticatorAction" logger="lenya.sitemap.action.authenticator"/>
+ <map:action name="authorizer" src="org.apache.lenya.cms.cocoon.acting.DelegatingAuthorizerAction" logger="lenya.sitemap.action.authorizer"/>
+ <map:action name="ssl-redirect" src="org.apache.lenya.cms.cocoon.acting.SslRedirectAction" logger="lenya.sitemap.action.ssl-redirect"/>
</xmap>
Added: lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java?rev=567484&view=auto
==============================================================================
--- lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java (added)
+++ lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/cms/cocoon/acting/SslRedirectAction.java Sun Aug 19 14:45:47 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.cocoon.acting;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.lenya.ac.AccessController;
+import org.apache.lenya.ac.Policy;
+import org.apache.lenya.ac.PolicyManager;
+import org.apache.lenya.cms.linking.LinkRewriter;
+import org.apache.lenya.cms.linking.OutgoingLinkRewriter;
+import org.apache.lenya.cms.repository.RepositoryUtil;
+import org.apache.lenya.cms.repository.Session;
+import org.apache.lenya.util.ServletHelper;
+
+/**
+ * Returns a map if the current request needs a redirect to the <code>https://</code> protocol.
+ * This is the case if the policy requires SSL protection and the current request is not secure. The
+ * map contains the redirect URI as value for the key <em>redirectUri</em>. Otherwise,
+ * <code>null</code> is returned.
+ */
+public class SslRedirectAction extends AccessControlAction {
+
+ /**
+ * The key to obtain the redirect URI from the returned map.
+ */
+ public static final String KEY_REDIRECT_URI = "redirectUri";
+
+ protected Map doAct(Redirector redirector, SourceResolver resolver, Map objectModel,
+ String source, Parameters parameters) throws Exception {
+
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ if (!request.isSecure()) {
+ AccessController controller = getAccessController();
+ PolicyManager policyManager = controller.getPolicyManager();
+ String url = ServletHelper.getWebappURI(request);
+ Policy policy = policyManager.getPolicy(controller.getAccreditableManager(), url);
+ if (policy.isSSLProtected()) {
+ Map map = new HashMap();
+ Session session = RepositoryUtil.getSession(this.manager, request);
+ LinkRewriter rewriter = new OutgoingLinkRewriter(this.manager, session, url, false,
+ true, false);
+ String sslUri = rewriter.rewrite(url);
+ map.put(KEY_REDIRECT_URI, sslUri);
+ return map;
+ }
+ }
+
+ return null;
+ }
+}
Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/components/modules/input/ProxyModule.java Sun Aug 19 14:45:47 2007
@@ -83,7 +83,7 @@
ConfigurationException {
Session session = RepositoryUtil.getSession(this.manager, request);
LinkRewriter rewriter = new OutgoingLinkRewriter(this.manager, session, request
- .getRequestURI(), request.isSecure(), false);
+ .getRequestURI(), request.isSecure(), false, false);
if (!rewriter.matches(url)) {
throw new ConfigurationException("The URL [" + url + "] can't be rewritten!");
}
Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java Sun Aug 19 14:45:47 2007
@@ -17,9 +17,12 @@
*/
package org.apache.lenya.cms.cocoon.transformation;
-import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -42,14 +45,12 @@
* </pre></code>
*/
public abstract class AbstractLinkTransformer extends AbstractSAXTransformer {
-
- private List attrConfigs = new ArrayList();
-
- protected AttributeConfiguration[] getAttributeConfigurations() {
- return (AttributeConfiguration[]) this.attrConfigs
- .toArray(new AttributeConfiguration[this.attrConfigs.size()]);
- }
-
+
+ /**
+ * Set of supported local names for quick pre-checks.
+ */
+ private Set localNames = new HashSet();
+
public void configure(Configuration config) throws ConfigurationException {
super.configure(config);
Configuration[] transformConfigs = config.getChildren("transform");
@@ -59,7 +60,14 @@
String attribute = transformConfigs[i].getAttribute("attribute");
AttributeConfiguration attrConfig = new AttributeConfiguration(namespace, element,
attribute);
- this.attrConfigs.add(attrConfig);
+ String key = getCacheKey(namespace, element);
+ Set configs = (Set) this.namespaceLocalname2configSet.get(key);
+ if (configs == null) {
+ configs = new HashSet();
+ this.localNames.add(element);
+ this.namespaceLocalname2configSet.put(key, configs);
+ }
+ configs.add(attrConfig);
}
}
@@ -96,29 +104,58 @@
}
- protected AttributeConfiguration[] getMatchingConfigurations(String namespace,
+ /**
+ * @param namespace The namespace URI.
+ * @param localName The local name.
+ * @param attrs The attributes.
+ * @return A set of {@link AttributeConfiguration} objects.
+ */
+ protected Set getMatchingConfigurations(String namespace,
String localName, Attributes attrs) {
- List configs = new ArrayList();
- for (Iterator i = this.attrConfigs.iterator(); i.hasNext();) {
+
+ // pre-check for performance reasons
+ if (!existsMatchingConfiguration(namespace, localName)) {
+ return Collections.EMPTY_SET;
+ }
+
+ String key = getCacheKey(namespace, localName);
+
+ // don't initialize yet for performance reasons
+ Set configs = null;
+ Set allConfigs = (Set) this.namespaceLocalname2configSet.get(key);
+ for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
AttributeConfiguration config = (AttributeConfiguration) i.next();
if (config.matches(namespace, localName, attrs)) {
+ if (configs == null) {
+ configs = new HashSet();
+ }
configs.add(config);
}
}
- return (AttributeConfiguration[]) configs
- .toArray(new AttributeConfiguration[configs.size()]);
+ if (configs == null) {
+ configs = Collections.EMPTY_SET;
+ }
+ return configs;
}
+
+ /**
+ * Cache to improve performance.
+ */
+ private Map namespaceLocalname2configSet = new HashMap();
protected boolean existsMatchingConfiguration(String namespace, String localName) {
- boolean matches = false;
- AttributeConfiguration[] attrConfigs = getAttributeConfigurations();
- for (int i = 0; i < attrConfigs.length; i++) {
- if (attrConfigs[i].namespace.equals(namespace)
- && attrConfigs[i].element.equals(localName)) {
- matches = true;
- }
- }
- return matches;
+ // quick pre-check
+ if (!this.localNames.contains(localName)) {
+ return false;
+ }
+
+ // more expensive check
+ String key = getCacheKey(namespace, localName);
+ return this.namespaceLocalname2configSet.containsKey(key);
+ }
+
+ protected String getCacheKey(String namespace, String localName) {
+ return namespace + " " + localName;
}
protected String indent = "";
@@ -140,14 +177,14 @@
AttributesImpl newAttrs = null;
- AttributeConfiguration[] configs = getMatchingConfigurations(uri, name, attrs);
+ Set configs = getMatchingConfigurations(uri, name, attrs);
- if (configs.length > 0) {
+ if (!configs.isEmpty()) {
this.ignoreLinkElement = false;
- for (int i = 0; i < configs.length; i++) {
- AttributeConfiguration config = configs[i];
+ for (Iterator i = configs.iterator(); i.hasNext(); ) {
+ AttributeConfiguration config = (AttributeConfiguration) i.next();
String linkUrl = attrs.getValue(config.attribute);
try {
if (getLogger().isDebugEnabled()) {
@@ -166,7 +203,7 @@
getLogger().debug(this.indent + "ignoreAElement: " + this.ignoreLinkElement);
}
- if (!(configs.length > 0 && this.ignoreLinkElement)) {
+ if (!(!configs.isEmpty() && this.ignoreLinkElement)) {
if (newAttrs != null) {
attrs = newAttrs;
}
Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/ProxyTransformer.java Sun Aug 19 14:45:47 2007
@@ -75,7 +75,7 @@
}
Session session = RepositoryUtil.getSession(this.manager, _request);
this.rewriter = new OutgoingLinkRewriter(this.manager, session, _request
- .getRequestURI(), request.isSecure(), this.relativeUrls);
+ .getRequestURI(), request.isSecure(), false, this.relativeUrls);
} catch (final Exception e) {
throw new RuntimeException(e);
}
Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/UuidToUrlTransformer.java Sun Aug 19 14:45:47 2007
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.util.Map;
+import java.util.StringTokenizer;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.parameters.Parameters;
@@ -127,12 +128,12 @@
url = linkUrl;
}
- String[] linkUriAndQuery = url.split("\\?");
- String linkUri = linkUriAndQuery[0];
+ StringTokenizer tokenizer = new StringTokenizer(url, "?");
+ String linkUri = tokenizer.nextToken();
String queryString = null;
String requiredExtension = null;
- if (linkUriAndQuery.length > 1) {
- queryString = linkUriAndQuery[1];
+ if (tokenizer.hasMoreTokens()) {
+ queryString = tokenizer.nextToken();
Query query = new Query(queryString);
requiredExtension = query.getValue(EXTENSION_PARAM);
query.removeValue(EXTENSION_PARAM);
@@ -169,7 +170,8 @@
String prefix = "/" + info.getPublicationId() + "/";
if (linkUrl.startsWith(prefix)) {
String pubUrl = linkUrl.substring(prefix.length());
- String area = pubUrl.split("/")[0];
+ StringTokenizer tokenizer = new StringTokenizer(pubUrl, "/");
+ String area = tokenizer.nextToken();
// don't rewrite /{pub}/modules/...
if (area.equals(Publication.AUTHORING_AREA)) {
Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/OutgoingLinkRewriter.java Sun Aug 19 14:45:47 2007
@@ -18,9 +18,12 @@
package org.apache.lenya.cms.linking;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
@@ -34,15 +37,16 @@
import org.apache.lenya.cms.publication.DocumentUtil;
import org.apache.lenya.cms.publication.Proxy;
import org.apache.lenya.cms.publication.Publication;
+import org.apache.lenya.cms.publication.PublicationException;
import org.apache.lenya.cms.publication.URLInformation;
import org.apache.lenya.cms.repository.Session;
import org.apache.lenya.util.StringUtil;
/**
* <p>
- * Converts web application links to links which will be sent to the browser by
- * using the publication's proxy settings. If the current request is
- * SSL-encrypted, all link URLs will use the SSL proxy.
+ * Converts web application links to links which will be sent to the browser by using the
+ * publication's proxy settings. If the current request is SSL-encrypted, all link URLs will use the
+ * SSL proxy.
* </p>
* <p>
* Objects of this class are not thread-safe.
@@ -56,21 +60,26 @@
private DocumentFactory factory;
private boolean ssl;
private GlobalProxies globalProxies;
+ private boolean considerSslPolicies;
/**
* @param manager The service manager to use.
* @param session The current session.
* @param requestUrl The request URL where the links should be rewritten.
* @param ssl If the current page is SSL-encrypted.
+ * @param considerSslPolicies If the SSL protection of policies should be considered when
+ * resolving the corresponding proxy. Setting this to <code>true</code> leads to a
+ * substantial performance overhead.
* @param relativeUrls If relative URLs should be created.
*/
public OutgoingLinkRewriter(ServiceManager manager, Session session, String requestUrl,
- boolean ssl, boolean relativeUrls) {
+ boolean ssl, boolean considerSslPolicies, boolean relativeUrls) {
super(manager);
this.requestUrl = requestUrl;
this.relativeUrls = relativeUrls;
this.ssl = ssl;
+ this.considerSslPolicies = considerSslPolicies;
ServiceSelector serviceSelector = null;
AccessControllerResolver acResolver = null;
@@ -78,15 +87,23 @@
try {
this.factory = DocumentUtil.createDocumentFactory(this.manager, session);
- serviceSelector = (ServiceSelector) this.manager.lookup(AccessControllerResolver.ROLE
- + "Selector");
- acResolver = (AccessControllerResolver) serviceSelector
- .select(AccessControllerResolver.DEFAULT_RESOLVER);
- AccessController accessController = acResolver.resolveAccessController(requestUrl);
- if (accessController != null) {
- this.accreditableManager = accessController.getAccreditableManager();
- this.policyManager = accessController.getPolicyManager();
+ if (this.considerSslPolicies) {
+ serviceSelector = (ServiceSelector) this.manager
+ .lookup(AccessControllerResolver.ROLE + "Selector");
+ acResolver = (AccessControllerResolver) serviceSelector
+ .select(AccessControllerResolver.DEFAULT_RESOLVER);
+ AccessController accessController = acResolver.resolveAccessController(requestUrl);
+ if (accessController != null) {
+ this.accreditableManager = accessController.getAccreditableManager();
+ this.policyManager = accessController.getPolicyManager();
+ }
+ }
+
+ Publication[] pubs = this.factory.getPublications();
+ for (int i = 0; i < pubs.length; i++) {
+ this.publicationCache.put(pubs[i].getId(), pubs[i]);
}
+
} catch (final Exception e) {
throw new RuntimeException(e);
} finally {
@@ -114,27 +131,38 @@
return url.startsWith("/");
}
+ private Map publicationCache = new HashMap();
+
+ protected Publication getPublication(String pubId) throws PublicationException {
+ return (Publication) this.publicationCache.get(pubId);
+ }
+
public String rewrite(final String url) {
-
+
String rewrittenUrl = "";
try {
- final String normalizedUrl = new URI(url).normalize().toString();
+ String normalizedUrl = normalizeUrl(url);
if (this.relativeUrls) {
rewrittenUrl = getRelativeUrlTo(normalizedUrl);
} else {
boolean useSsl = this.ssl;
if (!useSsl && this.policyManager != null) {
- Policy policy = this.policyManager.getPolicy(this.accreditableManager, normalizedUrl);
+ Policy policy = this.policyManager.getPolicy(this.accreditableManager,
+ normalizedUrl);
useSsl = policy.isSSLProtected();
}
URLInformation info = new URLInformation(normalizedUrl);
String pubId = info.getPublicationId();
+ Publication pub = null;
+ if (pubId != null) {
+ pub = getPublication(pubId);
+ }
+
// link points to publication
- if (pubId != null && isPublication(pubId)) {
- Publication pub = this.factory.getPublication(pubId);
+ if (pub != null) {
rewrittenUrl = rewriteLink(normalizedUrl, pub, useSsl);
}
@@ -150,7 +178,36 @@
return rewrittenUrl;
}
+ protected String normalizeUrl(final String url) throws URISyntaxException {
+ String normalizedUrl;
+ if (url.indexOf("..") > -1) {
+ normalizedUrl = new URI(url).normalize().toString();
+ }
+ else {
+ normalizedUrl = url;
+ }
+ return normalizedUrl;
+ }
+
private String requestUrl;
+
+ private Map pubId2areaList = new HashMap();
+
+ /**
+ * Checks if a publication has an area by using a cache for performance reasons.
+ * @param pub The publication.
+ * @param area The area name.
+ * @return if the publication contains the area.
+ */
+ protected boolean hasArea(Publication pub, String area) {
+ String pubId = pub.getId();
+ List areas = (List) this.pubId2areaList.get(pubId);
+ if (areas == null) {
+ areas = Arrays.asList(pub.getAreaNames());
+ this.pubId2areaList.put(pubId, areas);
+ }
+ return areas.contains(area);
+ }
/**
* @param linkUrl The original link URL.
@@ -164,7 +221,7 @@
String areaName = info.getArea();
// valid area
- if (areaName != null && Arrays.asList(pub.getAreaNames()).contains(areaName)) {
+ if (areaName != null && hasArea(pub, areaName)) {
Proxy proxy = pub.getProxy(areaName, ssl);
rewrittenUrl = proxy.getUrl() + info.getDocumentUrl();
}
@@ -203,19 +260,6 @@
protected List toList(String url) {
return new ArrayList(Arrays.asList(url.substring(1).split("/", -1)));
- }
-
- /**
- * @param pubId The publication ID.
- * @return If a publication with this ID exists.
- */
- protected boolean isPublication(String pubId) {
- Publication[] pubs = this.factory.getPublications();
- List pubIds = new ArrayList();
- for (int i = 0; i < pubs.length; i++) {
- pubIds.add(pubs[i].getId());
- }
- return pubIds.contains(pubId);
}
}
Modified: lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap?rev=567484&r1=567483&r2=567484&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap (original)
+++ lenya/trunk/src/webapp/lenya/config/sitemap/pipelines.xmap Sun Aug 19 14:45:47 2007
@@ -62,7 +62,13 @@
<map:pipeline>
- <map:match pattern="**">
+ <map:match pattern="**">
+
+ <!-- redirect to SSL if the policy requires this -->
+ <map:act type="ssl-redirect">
+ <map:redirect-to uri="{redirectUri}" session="true"/>
+ </map:act>
+
<map:match pattern="*/webdav**">
<map:act type="authorizer">
<map:mount check-reload="true" reload-method="synchron" src="global-sitemap.xmap" uri-prefix=""/>
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.