portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r423192 - /portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml
Date Tue, 18 Jul 2006 18:47:14 GMT
Author: taylor
Date: Tue Jul 18 11:47:14 2006
New Revision: 423192

URL: http://svn.apache.org/viewvc?rev=423192&view=rev
Log:
contribution from David Gurney: 
http://issues.apache.org/jira/browse/JS2-557

This is the property loader valve that we discussed yesterday.  It
provides a convenient way to make information within a property file
available for the rendering of the decorators or portlets.

The concept is that this object is loaded via Spring.  There are three
different constructors.  In each case the key is used as the name of an
attribute on the request.  The value associated with this key is an
instance of org.apache.commons.configuration.PropertiesConfiguration

Constructors
===============
1. Key name and property configuration object
The property configuration object would need to be constructed and
provided to the constructor.  This is easily accomplished with Spring


2. Key name and full path to the properties file
The properties file is loaded into a property configuration object


3. Key name
The key name is used as both the key and the name of an environment
variable that should contain the full path to the property file.


The initialize method must be called at the time of creation so that the
property configuration object can be properly loaded.  An example of a
Spring config is shown below:

  <bean id="propertyLoaderValve"
        class="com.fmr.portal.pipeline.impl.PropertyLoaderValve"
        init-method="initialize">
    <constructor-arg index="0">
      <value>php.props</value>
    </constructor-arg>
  </bean>

The motivation for this valve was to externalize the configuration of a
properties file.  This becomes important when an application is
installed in different locations that require differently property
values.  Our operations group is able to modify the path of the
properties file within Websphere without having to edit any spring
configuration files.

Added:
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml?rev=423192&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml
(added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/extended-pipelines.xml
Tue Jul 18 11:47:14 2006
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+Copyright 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.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<!-- the three beans below are examples only -->
+<beans>
+  <bean id="propertyLoaderValve_1"
+        class="com.fmr.portal.pipeline.impl.PropertyLoaderValve"
+        init-method="initialize"> 
+      <constructor-arg index="0"> 
+          <value>php-properties</value>
+      </constructor-arg> 
+      <constructor-arg index="1"
+       type="org.apache.commons.configuration.PropertiesConfiguration"> 
+          <ref bean="ProductionConfiguration"/> 
+      </constructor-arg> 
+  </bean>
+  
+  <bean id="propertyLoaderValve_2"
+        class="com.fmr.portal.pipeline.impl.PropertyLoaderValve"
+        init-method="initialize"> 
+      <constructor-arg index="0"> 
+          <value>php-properties</value>
+      </constructor-arg>  
+      <constructor-arg index="1">
+          <value>/apps/jetspeed/etc/jetspeed-production.properties</value>
+      </constructor-arg> 
+  </bean>
+  
+  <bean id="propertyLoaderValve_3"
+        class="com.fmr.portal.pipeline.impl.PropertyLoaderValve"
+         init-method="initialize"> 
+      <constructor-arg index="0"> 
+          <value>app.props</value>
+      </constructor-arg> 
+  </bean>
+    
+</beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message