vgritsenko 2002/10/21 18:53:00
Modified: . changes.xml
src/java/org/apache/cocoon/acting ResourceExistsAction.java
Log:
Src attribute can be used now with ResourceExistsAction. Old parameter
syntax preserved.
Revision Changes Path
1.268 +6 -2 xml-cocoon2/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/changes.xml,v
retrieving revision 1.267
retrieving revision 1.268
diff -u -r1.267 -r1.268
--- changes.xml 18 Oct 2002 15:40:13 -0000 1.267
+++ changes.xml 22 Oct 2002 01:52:59 -0000 1.268
@@ -40,6 +40,10 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="VG" type="update">
+ Src attribute can be used now with ResourceExistsAction. Old parameter
+ syntax preserved.
+ </action>
<action dev="CH" type="add">
New chaining InputModule that allows to use additional modules when an attribute
is not
present or null.
@@ -67,7 +71,7 @@
This introduces a new "name" attribute for matchers and actions
</action>
<action dev="TC" type="add">
- added support for direct access of root level sitemap variables {/1}
+ Added support for direct access of root level sitemap variables {/1}
</action>
<action dev="SW" type="add" fixes-bug="12780" due-to="Michael Melhem"
due-to-email="[EMAIL PROTECTED]">
New pipeline hint attribute to allow pipeline components (i.e. map:generate,
map:transform
1.8 +9 -8
xml-cocoon2/src/java/org/apache/cocoon/acting/ResourceExistsAction.java
Index: ResourceExistsAction.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/ResourceExistsAction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ResourceExistsAction.java 11 Sep 2002 08:26:44 -0000 1.7
+++ ResourceExistsAction.java 22 Oct 2002 01:53:00 -0000 1.8
@@ -61,9 +61,11 @@
import java.util.Map;
/**
- * This action simply checks to see if a given resource exists. It takes a
- * single parameter named 'url' and returns an empty map if it exists and
- * null otherwise. It has only been tested with context urls.
+ * This action simply checks to see if a given resource exists. It checks
+ * whether the specified in the src attribute source exists or not.
+ * The action returns empty <code>Map</code> if it exists, null otherwise.
+ * <p>Instead of src attribute, source can be specified using
+ * parameter named 'url' (this is old syntax).
*
* @author <a href="mailto:balld@;apache.org">Donald Ball</a>
* @version CVS $Id$
@@ -71,18 +73,17 @@
public class ResourceExistsAction extends ComposerAction implements ThreadSafe {
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
String source, Parameters parameters) throws Exception {
- String urlstring = parameters.getParameter("url",null);
+ String urlstring = parameters.getParameter("url", src);
Source src = null;
try {
src = resolver.resolveURI(urlstring);
src.getInputStream();
} catch (Exception e) {
- getLogger().warn("ResourceExistsAction: exception: ",e);
+ getLogger().warn("Exception", e);
return null;
} finally {
- resolver.release( src );
+ resolver.release(src);
}
return EMPTY_MAP;
}
-
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]