Author: vgritsenko
Date: Thu Oct 7 08:33:25 2004
New Revision: 53987
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/renderkit/Util.java
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateFieldDefinition.java
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletSession.java
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/WebApplicationDefinitionImpl.java
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/TagDefinition.java
cocoon/branches/BRANCH_2_1_X/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinition.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
Log:
fix some javadoc errors / warnings
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
Thu Oct 7 08:33:25 2004
@@ -48,7 +48,7 @@
protected Context context;
protected ServiceManager manager;
-
+
/* (non-Javadoc)
* @see
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
*/
@@ -62,26 +62,27 @@
public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
}
-
- /**
+
+ /**
* Fill the authentication context.
* This method can be overwritten to add any application specific data
* to the user.
* (Don't forget to call this implementation via super as well as it
* adds the ID).
- * @param context The context. This document has already the authentication
- * root node.
+ *
+ * @param contextDoc The context. This document has already the
authentication
+ * root node.
*/
protected void fillContext(Document contextDoc) {
final Request req = ContextHelper.getRequest(this.context);
final Element root = contextDoc.getDocumentElement();
-
+
// append the ID
final Element id = contextDoc.createElement("ID");
id.appendChild(contextDoc.createTextNode(req.getRemoteUser()));
- root.appendChild(id);
+ root.appendChild(id);
}
-
+
/* (non-Javadoc)
* @see
org.apache.cocoon.webapps.authentication.components.Authenticator#authenticate(org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration,
org.apache.excalibur.source.SourceParameters)
*/
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/renderkit/Util.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/renderkit/Util.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/components/renderkit/Util.java
Thu Oct 7 08:33:25 2004
@@ -193,7 +193,7 @@
/**
* NOTE: Commented out to remove JSTL dependency.
- *
+ *
* Return a Locale instance using the following algorithm: <P>
*
* <UL>
@@ -256,7 +256,7 @@
* Render any boolean "passthru" attributes.
* <P>
*
- * @see passthruAttributes
+ * @see #passthruAttributes
*/
public static String renderBooleanPassthruAttributes(FacesContext context,
@@ -294,7 +294,7 @@
* Padded with leading and trailing ' '. If there are no passthru
* attributes in the component, return the empty String.
*
- * @see passthruAttributes
+ * @see #passthruAttributes
*/
public static String renderPassthruAttributes(FacesContext context,
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateFieldDefinition.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateFieldDefinition.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateFieldDefinition.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -27,7 +27,7 @@
/**
* The [EMAIL PROTECTED] WidgetDefinition} part of a AggregateField widget,
see [EMAIL PROTECTED] AggregateField} for more information.
*
- * @version $Id: AggregateFieldDefinition.java,v 1.3 2004/05/07 17:32:58 joerg
Exp $
+ * @version $Id$
*/
public class AggregateFieldDefinition extends FieldDefinition {
@@ -48,8 +48,8 @@
private Pattern splitPattern;
/**
- * Message to be displayed when the [EMAIL PROTECTED] #splitPattern} does
not match what the
- * user entered. Optional.
+ * Message to be displayed when the [EMAIL PROTECTED]
#setSplitPattern(Pattern, String) splitPattern}
+ * does not match what the user entered. Optional.
*/
protected XMLizable splitFailMessage;
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
Thu Oct 7 08:33:25 2004
@@ -20,30 +20,29 @@
/**
* Helper class for the implementation of the CForms template language with
JXTemplate macros.
- *
+ *
* @version CVS $Id$
*/
public class JXMacrosHelper {
-
+
private XMLConsumer cocoonConsumer;
private ArrayStack stack = new ArrayStack();
-
- private Map classes = null; // lazily created
-
+ private Map classes; // lazily created
+
/**
* Builds and helper object, given the generator's consumer.
- *
+ *
* @param consumer the generator's consumer
* @return a helper object
*/
public static JXMacrosHelper createHelper(XMLConsumer consumer) {
return new JXMacrosHelper(consumer);
}
-
+
public JXMacrosHelper(XMLConsumer consumer) {
this.cocoonConsumer = consumer;
}
-
+
public void startForm(Map attributes) throws SAXException {
// build attributes
AttributesImpl attrs = new AttributesImpl();
@@ -52,26 +51,25 @@
Map.Entry entry = (Map.Entry)iter.next();
attrs.addCDATAAttribute((String)entry.getKey(),
(String)entry.getValue());
}
-
+
this.cocoonConsumer.startPrefixMapping(Constants.INSTANCE_PREFIX,
Constants.INSTANCE_NS);
- this.cocoonConsumer.startElement(
- Constants.INSTANCE_NS,
- "form-template",
- Constants.INSTANCE_PREFIX_COLON + "form-template",
- attrs);
+ this.cocoonConsumer.startElement(Constants.INSTANCE_NS,
+ "form-template",
+ Constants.INSTANCE_PREFIX_COLON +
"form-template",
+ attrs);
}
-
+
public void endForm() throws SAXException {
- this.cocoonConsumer.endElement(
- Constants.INSTANCE_NS,
- "form-template",
- Constants.INSTANCE_PREFIX_COLON + "form-template");
- this.cocoonConsumer.endPrefixMapping(Constants.INSTANCE_PREFIX);
+ this.cocoonConsumer.endElement(Constants.INSTANCE_NS,
+ "form-template",
+ Constants.INSTANCE_PREFIX_COLON +
"form-template");
+ this.cocoonConsumer.endPrefixMapping(Constants.INSTANCE_PREFIX);
}
-
+
/**
- * Flush the root element name that has been stored in [EMAIL PROTECTED]
#generateSaxFragment(Widget, Locale)}
- *
+ * Flush the root element name that has been stored in
+ * [EMAIL PROTECTED] #generateWidget(Widget, Locale)}.
+ *
* @param obj the object that is terminated (widget or validation error)
* @throws SAXException
*/
@@ -79,33 +77,32 @@
Object stackObj = stack.pop();
if (stackObj != obj) {
throw new IllegalStateException("Flushing on wrong widget
(expected " + stackObj +
- ", got " + obj + ")");
+ ", got " + obj + ")");
}
- ((RootBufferingPipe)stack.pop()).flushRoot();
+ ((RootBufferingPipe) stack.pop()).flushRoot();
}
-
+
/**
* Get a child widget of a given widget, throwing an exception if no such
child exists.
- *
+ *
* @param currentWidget
* @param id
- * @return
*/
public Widget getWidget(Widget currentWidget, String id) {
Widget result = null;
-
+
if (currentWidget instanceof ContainerWidget) {
result = ((ContainerWidget)currentWidget).getChild(id);
}
-
+
if (result != null) {
return result;
} else {
throw new IllegalArgumentException("Widget '" + currentWidget +
- "' has no child named '" + id + "'");
+ "' has no child named '" + id +
"'");
}
}
-
+
public Repeater getRepeater(Widget currentWidget, String id) {
Widget child = getWidget(currentWidget, id);
if (child instanceof Repeater) {
@@ -114,11 +111,11 @@
throw new IllegalArgumentException("Widget '" + child + "' is not
a repeater");
}
}
-
+
/**
* Generate a widget's SAX fragment, buffering the root element's
<code>endElement()</code>
* event so that the template can insert styling information in it.
- *
+ *
* @param widget
* @param locale
* @throws SAXException
@@ -130,19 +127,19 @@
this.stack.push(widget);
widget.generateSaxFragment(pipe, locale);
}
-
+
public void generateWidgetLabel(Widget widget, String id) throws
SAXException {
getWidget(widget, id).generateLabel(this.cocoonConsumer);
}
-
+
public void generateRepeaterWidgetLabel(Widget widget, String id, String
widgetId) throws SAXException {
getRepeater(widget, id).generateWidgetLabel(widgetId,
this.cocoonConsumer);
}
-
+
public void generateRepeaterSize(Widget widget, String id) throws
SAXException {
getRepeater(widget, id).generateSize(this.cocoonConsumer);
}
-
+
public void generateValidationError(ValidationError error) throws
SAXException {
// Needs to be buffered
RootBufferingPipe pipe = new RootBufferingPipe(this.cocoonConsumer);
@@ -150,51 +147,51 @@
this.stack.push(error);
error.generateSaxFragment(pipe);
}
-
+
public void defineClassBody(Form form, String id, Object body) {
// TODO: check that class actually exists in the form
if (this.classes == null) {
this.classes = new HashMap();
}
-
+
// TODO: check if class doesn't already exist?
this.classes.put(id, body);
}
-
+
public Object getClassBody(String id) {
Object result = this.classes == null ? null : this.classes.get(id);
-
+
if (result == null) {
throw new IllegalArgumentException("No class '" + id + "' has been
defined.");
} else {
return result;
}
}
-
+
public boolean isSelectedCase(Widget unionWidget, String caseValue) {
String value = (String)unionWidget.getValue();
return caseValue.equals(value != null ? value : "");
}
-
+
/**
* A SAX pipe that buffers the <code>endElement()</code> event of the root
element.
* This is needed by the generator version of the Woody transformer (see
woody-jxmacros.xml).
- *
+ *
* @version CVS $Id$
*/
private static class RootBufferingPipe extends AbstractXMLPipe {
private int depth = 0;
-
+
private String rootUri;
private String rootLoc;
private String rootRaw;
-
+
public RootBufferingPipe(XMLConsumer next) {
this.setConsumer(next);
}
-
- public void startElement(String uri, String loc, String raw,
Attributes a) throws SAXException
- {
+
+ public void startElement(String uri, String loc, String raw,
Attributes a)
+ throws SAXException {
if (depth == 0) {
// Root element: keep its description
this.rootUri = uri;
@@ -204,16 +201,16 @@
depth++;
super.startElement(uri, loc, raw, a);
}
-
- public void endElement(String uri, String loc, String raw) throws
SAXException
- {
+
+ public void endElement(String uri, String loc, String raw)
+ throws SAXException {
depth--;
if (depth > 0) {
// Propagate all but root element
super.endElement(uri, loc, raw);
}
}
-
+
public void flushRoot() throws SAXException {
if (depth != 0) {
throw new IllegalStateException("Depth is not zero");
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletSession.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletSession.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletSession.java
Thu Oct 7 08:33:25 2004
@@ -29,7 +29,7 @@
* @see javax.portlet.PortletSession
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Rudnev</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
- * @version CVS $Id: PortletSession.java,v 1.3 2004/05/01 00:05:44 joerg Exp $
+ * @version CVS $Id$
*/
public final class PortletSession implements Session {
@@ -165,8 +165,9 @@
* containing the names of all the objects bound to this session.
*
* <p>Objects' names in portlet session scope will be prefixed with
- * [EMAIL PROTECTED] #PORTLET_SCOPE}, and names in application scope will
be prefixed
- * with [EMAIL PROTECTED] #APP_SCOPE}.
+ * [EMAIL PROTECTED] PortletEnvironment#SESSION_PORTLET_SCOPE}, and names
in
+ * application scope will be prefixed with
+ * [EMAIL PROTECTED] PortletEnvironment#SESSION_APPLICATION_SCOPE}.</p>
*
* @return an <code>Enumeration</code> of
* <code>String</code> objects specifying
the
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/WebApplicationDefinitionImpl.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/WebApplicationDefinitionImpl.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/WebApplicationDefinitionImpl.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 2004,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -41,13 +41,13 @@
import org.apache.cocoon.portal.pluto.om.common.DisplayNameSetImpl;
/**
- *
+ *
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- *
+ *
* @version CVS $Id$
*/
-public class WebApplicationDefinitionImpl
+public class WebApplicationDefinitionImpl
implements WebApplicationDefinition, Support {
@@ -66,7 +66,7 @@
public String ejbRef;
// </not used variables - only for castor>
- private String contextPath;
+ private String contextPath;
private DescriptionSet descriptions = new DescriptionSetImpl();
private DisplayNameSet displayNames = new DisplayNameSetImpl();
private String id = "";
@@ -196,15 +196,15 @@
((Support)servlets).preStore(this);
}
-
+
// additional methods.
-
- public void setCastorId(String id) {
+
+ public void setCastorId(String id) {
this.id = id;
objectId = null;
}
-
- public String getCastorId() {
+
+ public String getCastorId() {
if (id.length() > 0) {
return getId().toString();
} else {
@@ -235,7 +235,7 @@
public Collection getServletMappings() {
return servletMappings;
}
-
+
protected void setContextRoot(String contextRoot) {
// PATCH for IBM WebSphere
if (contextRoot != null && contextRoot.endsWith(".war") ) {
@@ -243,7 +243,7 @@
} else {
this.contextPath = contextRoot;
}
- }
+ }
public void setDescriptions(DescriptionSet descriptions) {
this.descriptions = descriptions;
@@ -262,7 +262,7 @@
}
/**
- * @return
+ *
*/
public Collection getCastorTagDefinitions() {
return castorTagDefinitions;
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/TagDefinition.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/TagDefinition.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/common/TagDefinition.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 2004,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -16,26 +16,24 @@
package org.apache.cocoon.portal.pluto.om.common;
/**
- *
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- *
* @version CVS $Id: TagDefinition.java 30941 2004-07-29 19:56:58Z vgritsenko $
*/
public class TagDefinition {
-
+
private String uri ="http://java.sun.com/portlet";
private String location = "/WEB-INF/tld/portlet.tld";
-
+
/**
- * @return
+ *
*/
public String getLocation() {
return this.location;
}
/**
- * @return
+ *
*/
public String getUri() {
return this.uri;
@@ -54,5 +52,4 @@
public void setUri(String string) {
this.uri = string;
}
-
}
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinition.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinition.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinition.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -27,7 +27,7 @@
/**
* The [EMAIL PROTECTED] WidgetDefinition} part of a AggregateField widget,
see [EMAIL PROTECTED] AggregateField} for more information.
*
- * @version $Id: AggregateFieldDefinition.java,v 1.11 2004/05/07 17:32:59
joerg Exp $
+ * @version $Id$
*/
public class AggregateFieldDefinition extends FieldDefinition {
@@ -48,8 +48,8 @@
private Pattern splitPattern;
/**
- * Message to be displayed when the [EMAIL PROTECTED] #splitPattern} does
not match what the
- * user entered. Optional.
+ * Message to be displayed when the [EMAIL PROTECTED]
#setSplitPattern(Pattern, String) splitPattern}
+ * does not match what the user entered. Optional.
*/
protected XMLizable splitFailMessage;
Modified:
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -26,21 +26,25 @@
/**
* <p>An aggregated [EMAIL PROTECTED] SourceValidity} for multiple sources.</p>
- *
+ *
* @author <a href="http://www.apache.org/~sylvain">Sylvain Wallez</a>
* @version CVS $Id$
*/
public class MultiSourceValidity extends AbstractAggregatedValidity
-implements SourceValidity {
+ implements SourceValidity {
/** <p>When validity expiration is performed.</p> */
private long expiry;
+
/** <p>The delay from <b>now</b> used to calculate the expiration
time.</p> */
private long delay;
+
/** <p>An ordered list of URIs which should be checked.</p> */
private List uris = new ArrayList();
+
/** <p>Is this instance is closed (accepts modifications or is validable)?
*/
private boolean isClosed = false;
+
/** <p>The [EMAIL PROTECTED] SourceResolver} to use (transient not to be
serialized). */
private transient SourceResolver resolver;
@@ -54,9 +58,9 @@
*
* <p>If the number of milliseconds is less than <b>zero</b>, or it's sum
with
* the number of <b>now</b> milliseconds is greater than the biggest long
- * representable, the expiration date will be set to [EMAIL PROTECTED]
Long.MAX_VALUE}
+ * representable, the expiration date will be set to [EMAIL PROTECTED]
Long#MAX_VALUE}
* milliseconds from the epoch.</p>
- *
+ *
* @param resolver the [EMAIL PROTECTED] SourceResolver} used to access
the sources.
* @param delay the number of milliseconds from <b>now</b> defining for
how long
* this instance will be valid.
@@ -71,7 +75,7 @@
/**
* <p>Add a [EMAIL PROTECTED] Source} to the list of [EMAIL PROTECTED]
Source}s monitored by this
* instance.</p>
- *
+ *
* @param src a <b>non-null</b> [EMAIL PROTECTED] Source}.
*/
public void addSource(Source src) {
@@ -97,7 +101,7 @@
this.isClosed = true;
this.resolver = null;
}
-
+
/**
* <p>Check the validity of this [EMAIL PROTECTED] SourceValidity}
instance.</p>
*
@@ -108,7 +112,7 @@
/* Validity not expired, so, don't even check */
return SourceValidity.VALID;
}
-
+
/* Re-calculate the expiry time based on the current time */
expiry = System.currentTimeMillis() + delay;
@@ -144,7 +148,7 @@
/**
* <p>Compute the status of this instance by checking every source.</p>
- *
+ *
* @param resolver The [EMAIL PROTECTED] SourceResolver} to use to access
sources.
* @return [EMAIL PROTECTED] SourceValidity.VALID}, [EMAIL PROTECTED]
SourceValidity.INVALID} or
* [EMAIL PROTECTED] SourceValidity.UNKNOWN} depending on the
status.
@@ -187,7 +191,7 @@
/* If the source is still valid, go to the next one */
if (newValidity == SourceValidity.VALID) break;
-
+
/* The source is not valid (or unknown), we invalidate the
lot */
return SourceValidity.INVALID;
@@ -196,7 +200,7 @@
return SourceValidity.INVALID;
}
}
-
+
/* All items checked successfully */
return 1;
}
Modified:
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
Thu Oct 7 08:33:25 2004
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed 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.
@@ -27,44 +27,44 @@
import org.xml.sax.SAXException;
/**
- * Enviroment facade, whose delegate object can be changed. This class is
required to handle internal redirects
- * in sitemap sources ("cocoon:"). This is because [EMAIL PROTECTED]
org.apache.cocoon.components.source.SitemapSource} keeps
- * the environment in which the internal request should be processed. But
internal redirects create a new
- * processing environment and there's no way to change the one held by the
<code>SitemapSource</code>. So the
- * processing of internal redirects actually changes the delegate of this
class, transparently for the
- * <code>SitemapSource</code>.
- *
- * @see org.apache.cocoon.components.source.impl.SitemapSource
- * @see
org.apache.cocoon.components.treeprocessor.TreeProcessor#handleCocoonRedirect(String,
Environment, org.apache.cocoon.components.treeprocessor.InvokeContext)
+ * Enviroment facade, whose delegate object can be changed. This class is
+ * required to handle internal redirects in sitemap sources ("cocoon:").
+ * This is because [EMAIL PROTECTED]
org.apache.cocoon.components.source.impl.SitemapSource}
+ * keeps the environment in which the internal request should be processed.
+ * But internal redirects create a new processing environment and there's
+ * no way to change the one held by the <code>SitemapSource</code>. So the
+ * processing of internal redirects actually changes the delegate of this
+ * class, transparently for the <code>SitemapSource</code>.
*
+ * @see org.apache.cocoon.components.source.impl.SitemapSource
* @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @version CVS $Id: MutableEnvironmentFacade.java,v 1.7 2004/03/18 15:08:12
cziegeler Exp $
+ * @version CVS $Id$
*/
public class MutableEnvironmentFacade implements Environment {
private EnvironmentWrapper env;
-
+
// Track the first values set for prefix and uri
- private String prefix = null;
- private String uri = null;
-
+ private String prefix;
+ private String uri;
+
public MutableEnvironmentFacade(EnvironmentWrapper env) {
this.env = env;
}
-
+
public EnvironmentWrapper getDelegate() {
return this.env;
}
-
+
public void setDelegate(EnvironmentWrapper env) {
this.env = env;
}
-
+
//----------------------------------
// EnvironmentWrapper-specific method (SW:still have to understand why
SitemapSource needs them)
public void setURI(String prefix, String uri) {
this.env.setURI(prefix, uri);
-
+
if (this.uri == null) {
// First call : keep the values to restore them on the wrapped
// enviromnent in reset()
@@ -80,12 +80,12 @@
public void changeToLastContext() {
this.env.changeToLastContext();
}
-
+
// Move this to the Environment interface ?
public String getRedirectURL() {
return this.env.getRedirectURL();
}
-
+
public void reset() {
this.env.reset();
// TODO - If we remove the line below, do we break something
@@ -295,21 +295,24 @@
/* (non-Javadoc)
* @see
org.apache.cocoon.environment.SourceResolver#resolve(java.lang.String)
*/
- public Source resolve(String systemID) throws ProcessingException,
SAXException, IOException {
+ public Source resolve(String systemID)
+ throws ProcessingException, SAXException, IOException {
return env.resolve(systemID);
}
/* (non-Javadoc)
* @see
org.apache.excalibur.source.SourceResolver#resolveURI(java.lang.String)
*/
- public org.apache.excalibur.source.Source resolveURI(String arg0) throws
MalformedURLException, IOException {
+ public org.apache.excalibur.source.Source resolveURI(String arg0)
+ throws MalformedURLException, IOException {
return env.resolveURI(arg0);
}
/* (non-Javadoc)
* @see
org.apache.excalibur.source.SourceResolver#resolveURI(java.lang.String,
java.lang.String, java.util.Map)
*/
- public org.apache.excalibur.source.Source resolveURI(String arg0, String
arg1, Map arg2) throws MalformedURLException, IOException {
+ public org.apache.excalibur.source.Source resolveURI(String arg0, String
arg1, Map arg2)
+ throws MalformedURLException, IOException {
return env.resolveURI(arg0, arg1, arg2);
}