You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by kp...@apache.org on 2002/11/13 23:46:16 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/modules/input SystemPropertyModule.java

kpiroumian    2002/11/13 14:46:16

  Modified:    src/java/org/apache/cocoon/components/modules modules.xconf
  Added:       src/java/org/apache/cocoon/components/modules/input
                        SystemPropertyModule.java
  Log:
  New input module for system (environment) variables.
  
  Revision  Changes    Path
  1.9       +2 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf
  
  Index: modules.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modules.xconf	18 Oct 2002 14:24:08 -0000	1.8
  +++ modules.xconf	13 Nov 2002 22:46:15 -0000	1.9
  @@ -11,6 +11,7 @@
         <component-instance logger="core.modules.input" name="request-attr" 	class="org.apache.cocoon.components.modules.input.RequestAttributeModule"/>
         <component-instance logger="core.modules.input" name="request-header"    	class="org.apache.cocoon.components.modules.input.HeaderAttributeModule"/>
         <component-instance logger="core.modules.input" name="session-attr"   	class="org.apache.cocoon.components.modules.input.SessionAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="system-property"   	class="org.apache.cocoon.components.modules.input.SystemPropertyModule"/>
         <component-instance logger="core.modules.input" name="constant"  		class="org.apache.cocoon.components.modules.input.StringConstantModule"/>
         <component-instance logger="core.modules.input" name="random"    		class="org.apache.cocoon.components.modules.input.RandomNumberModule"/>
         <component-instance logger="core.modules.input" name="digest"     	class="org.apache.cocoon.components.modules.input.DigestMetaModule"/>
  @@ -38,4 +39,4 @@
         <component-instance logger="core.modules.output" name="session-attr"   class="org.apache.cocoon.components.modules.output.SessionAttributeOutputModule"/>
      </output-modules>
   
  -</xconf>
  \ No newline at end of file
  +</xconf>
  
  
  
  1.1                  xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
  
  Index: SystemPropertyModule.java
  ===================================================================
  package org.apache.cocoon.components.modules.input;
  
  import java.util.Map;
  import java.util.Enumeration;
  
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.thread.ThreadSafe;
  
  /**
   * SystemPropertyModule is an JXPath based InputModule implementation that
   * provides access to system properties.
   *
   * JXPath allows to apply XPath functions to system properties.
   *
   * If there is a security manager, its <code>checkPropertiesAccess</code>
   * method is called with no arguments. This may result in a security exception
   * which is wrapped into a configuration exception and re-thrown.
   *
   * @author Konstantin Piroumian
   * @version $Id: SystemPropertyModule.java,v 1.1 2002/11/13 22:46:16 kpiroumian Exp $
   */
  public class SystemPropertyModule extends AbstractJXPathModule
      implements ThreadSafe {
  
      protected Object getContextObject(Configuration modeConf,
                                        Map objectModel) {
  
          return System.getProperties();
      }
  }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org