haul 2002/10/18 07:29:21
Modified: src/java/org/apache/cocoon/components/modules/input
AbstractInputModule.java DefaultsMetaModule.java
DigestMetaModule.java MapMetaModule.java
RandomNumberModule.java XMLMetaModule.java
Log:
Minor module updates and corrections
Revision Changes Path
1.3 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java
Index: AbstractInputModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractInputModule.java 31 Jul 2002 13:13:24 -0000 1.2
+++ AbstractInputModule.java 18 Oct 2002 14:29:21 -0000 1.3
@@ -60,9 +60,9 @@
import org.apache.cocoon.util.HashMap;
/**
- * AbstractDatabaseModule gives you the infrastructure for easily
- * deploying more InputModules. In order to get at the
- * Logger, use getLogger().
+ * AbstractInputModule gives you the infrastructure for easily
+ * deploying more InputModules. In order to get at the Logger, use
+ * getLogger().
*
* @author <a href="mailto:haul@;apache.org">Christian Haul</a>
* @version CVS $Id$
1.4 +3 -5
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java
Index: DefaultsMetaModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultsMetaModule.java 9 Aug 2002 08:32:11 -0000 1.3
+++ DefaultsMetaModule.java 18 Oct 2002 14:29:21 -0000 1.4
@@ -65,9 +65,6 @@
import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.components.modules.input.InputModule;
-import org.apache.cocoon.util.JDBCTypeConversions;
-
-import org.apache.cocoon.matching.AbstractWildcardMatcher;
import java.util.ArrayList;
import java.util.Map;
@@ -155,6 +152,7 @@
+"': Selector is
"+(this.inputSelector!=null?"not ":"")
+"null, Component is "
+(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
+ this.initialized = true;
}
} catch (Exception e) {
if (getLogger().isWarnEnabled())
@@ -234,7 +232,7 @@
}
iputSelector=(ComponentSelector)
this.manager.lookup(INPUT_MODULE_SELECTOR);
- if (this.defaultInput != null
+ if (inputName != null
&& iputSelector != null
&& iputSelector.hasComponent(inputName)) {
1.5 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java
Index: DigestMetaModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DigestMetaModule.java 9 Aug 2002 08:32:11 -0000 1.4
+++ DigestMetaModule.java 18 Oct 2002 14:29:21 -0000 1.5
@@ -97,7 +97,7 @@
/** The component manager instance */
protected ComponentManager manager;
- private String defaultInput = "request"; // default to request parameters
+ private String defaultInput = "request-param"; // default to request parameters
private Configuration inputConf = null; // will become an empty configuration
object
// during configure() so why bother
here...
String INPUT_MODULE_ROLE = InputModule.ROLE;
1.3 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java
Index: MapMetaModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MapMetaModule.java 27 Sep 2002 16:27:37 -0000 1.2
+++ MapMetaModule.java 18 Oct 2002 14:29:21 -0000 1.3
@@ -89,7 +89,7 @@
/** The component manager instance */
protected ComponentManager manager;
- protected String defaultInput = "attribute"; // default to request attributes
+ protected String defaultInput = "request-attr"; // default to request attributes
protected Configuration inputConf = null; // will become an empty
configuration object
// during configure() so why bother
here...
protected String INPUT_MODULE_ROLE = InputModule.ROLE;
1.3 +7 -4
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java
Index: RandomNumberModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RandomNumberModule.java 28 May 2002 13:41:28 -0000 1.2
+++ RandomNumberModule.java 18 Oct 2002 14:29:21 -0000 1.3
@@ -76,9 +76,12 @@
public Object getAttribute( String name, Configuration modeConf, Map
objectModel ) throws ConfigurationException {
- long min = Long.parseLong(modeConf.getAttribute("min","0"));
- long max = Long.parseLong(modeConf.getAttribute("max","9999999999"));
-
+ long min = 0;
+ long max = java.lang.Long.MAX_VALUE;
+ if (modeConf != null) {
+ min = Long.parseLong(modeConf.getAttribute("min","0"));
+ max = Long.parseLong(modeConf.getAttribute("max",String.valueOf(max)));
+ }
return
Long.toString(java.lang.Math.round(java.lang.Math.random()*(max-min)));
}
1.3 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/XMLMetaModule.java
Index: XMLMetaModule.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/XMLMetaModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLMetaModule.java 27 Sep 2002 16:27:37 -0000 1.2
+++ XMLMetaModule.java 18 Oct 2002 14:29:21 -0000 1.3
@@ -125,7 +125,7 @@
/** The component manager instance */
protected ComponentManager manager;
- protected String defaultInput = "request"; // default to request parameters
+ protected String defaultInput = "request-param"; // default to request
parameters
protected Configuration inputConf = null; // will become an empty
configuration object
// during configure() so why bother
here...
protected String INPUT_MODULE_ROLE = InputModule.ROLE;
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]