Revision: 1161
Author:   lstreepy
Date:     2006-05-16 06:16:47 -0700 (Tue, 16 May 2006)
ViewCVS:  http://svn.sourceforge.net/spring-rich-c/?rev=1161&view=rev

Log Message:
-----------
Fix RCP-346: update for new service refactoring

Modified Paths:
--------------
    
trunk/spring-richclient/archetype/src/main/resources/archetype-resources/src/main/resources/ctx/richclient-application-context.xml
Modified: 
trunk/spring-richclient/archetype/src/main/resources/archetype-resources/src/main/resources/ctx/richclient-application-context.xml
===================================================================
--- 
trunk/spring-richclient/archetype/src/main/resources/archetype-resources/src/main/resources/ctx/richclient-application-context.xml
  2006-05-15 14:14:29 UTC (rev 1160)
+++ 
trunk/spring-richclient/archetype/src/main/resources/archetype-resources/src/main/resources/ctx/richclient-application-context.xml
  2006-05-16 13:16:47 UTC (rev 1161)
@@ -5,11 +5,16 @@
 
     <!--
         The application context is used to configure components and services 
within
-        the platform.  The platform defines a number of "magic" bean names 
that it
-        uses to locate specific components, so they must be named exactly as 
shown.
-        These magic beans are identified in the documentation below and they 
are
-        marked as required or optional.
+        the platform.  The platform utilizes a number of services at runtime, 
and
+        these must be configured here.  The two key beans for this are the 
serviceLocator
+        and applicationServices.  Many of the services have reasonable default
+        implementations, meaning that you probably won't need to define them 
here
+        unless you have specific needs not addressed in the default 
implementation.
         
+        Beyond the services, you will define the various components that make 
up
+        your application, like the application descriptor, views, lifecycle 
advisor,
+        validation rules, etc.
+        
         This may look a little daunting at first, but hang in there.  The good 
news
         is that you don't have to change many of the bean configurations 
provided
         here when you are setting up your application.
@@ -27,20 +32,15 @@
 
     <!-- 
         Bean: application
-        Type: magic
-        Usage: required
+        Usage: Platform required
         Description: This defines the singleton application instance to be 
used.
             Note that, currently, this object is not pluggable.  You must use 
the
             class specified below and configure it as needed.
     -->
        <bean id="application" 
                class="org.springframework.richclient.application.Application">
-               <constructor-arg index="0">
-                       <ref bean="applicationDescriptor"/>
-               </constructor-arg>
-               <constructor-arg index="1">
-                       <ref bean="lifecycleAdvisor"/>
-               </constructor-arg>
+               <constructor-arg index="0" ref="applicationDescriptor"/>
+               <constructor-arg index="1" ref="lifecycleAdvisor"/>
        </bean>
        
     <!-- 
@@ -66,15 +66,40 @@
     -->
     <bean id="lifecycleAdvisor"
         class="${package}.SimpleLifecycleAdvisor">
-        <property name="windowCommandBarDefinitions">
-            <value>ui/commands-context.xml</value>
+        <property name="windowCommandBarDefinitions" 
value="ui/commands-context.xml"/>
+        <property name="startingPageId" value="initialView"/>
+        <property name="eventExceptionHandler"
+                  value="${package}.SimpleApp$AWTExceptionHandler"/>
+    </bean>
+
+    <!-- 
+        Bean: serviceLocator
+        Usage: Platform required
+        Description: This defines the singleton application service locator 
instance.
+            This is a trivial singleton object providing access to the 
configured
+            services, as specified on the applicationServices property.
+    -->
+    <bean id="serviceLocator" 
class="org.springframework.richclient.application.ApplicationServicesLocator">
+        <property name="applicationServices" ref="applicationServices"/>
+    </bean>
+
+    <!-- 
+        Bean: applicationServices
+        Usage: Platform required (unless you set this up programmatically)
+        Description: This configures the application services available to the 
platform.
+            There are specific setter methods for all the standard services, 
see the
+            javadoc on teh DefaultApplicationServices class for more details.
+            NOTE: The use of applicationObjectConfigurerBeanId instead of a 
direct bean
+            reference is required in order to break a circular dependency with 
the
+            ApplicationObjectConfigurer (which is a BeanPostProcessor).
+    -->
+    <bean id="applicationServices"
+        
class="org.springframework.richclient.application.support.DefaultApplicationServices">
+        <property name="imageSource" ref="imageSource" />
+        <property name="formComponentInterceptorFactory" 
ref="formComponentInterceptorFactory" />
+        <property name="applicationObjectConfigurerBeanId">
+            <idref bean="applicationObjectConfigurer" />
         </property>
-        <property name="startingPageId">
-            <value>initialView</value>
-        </property>
-        <property name="eventExceptionHandler">
-            <value>${package}.SimpleApp$AWTExceptionHandler</value>
-        </property>
     </bean>
 
     <!-- 
@@ -89,70 +114,29 @@
 
     <!-- 
         Bean: applicationDescriptor
-        Type: user named
         Usage: platform required
         Description: This defines the Application metadata to be used by the
             Application.  Note the reference to this bean in the constructor
             args in the application bean.
     -->
     <bean id="applicationDescriptor" 
-               
class="org.springframework.richclient.application.support.DefaultApplicationDescriptor">
-               <property name="version">
-                       <value>1.0</value>
-               </property>
-               <property name="buildId">
-                       <value>20060408-001</value>
-               </property>
-       </bean>
+        
class="org.springframework.richclient.application.support.DefaultApplicationDescriptor">
+        <property name="version" value="1.0"/>
+        <property name="buildId" value="20060408-001"/>
+    </bean>
 
     <!-- 
-        Bean: applicationDescriptor
-        Type: magic
-        Usage: platform required (because it requires configuration)
+        Bean: applicationObjectConfigurer
+        Usage: platform required (because it is a bean post processor)
         Description: This defines the object responsible for configuring other 
objects
             constructed via the platform.  This is a critical part of the I18N 
support.
-            Unless you have very special needs, you should use the default 
implementation,
-            as is done here.  The implementation is configured with three other
-            components responsible for providing I18N messages, images, and 
icons.
     -->
-       <bean id="applicationObjectConfigurer"
-               
class="org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer">
-               <constructor-arg index="0">
-                       <ref bean="messageSource"/>
-               </constructor-arg>
-               <constructor-arg index="1">
-                       <ref bean="imageSource"/>
-               </constructor-arg>
-               <constructor-arg index="2">
-                       <ref bean="iconSource"/>
-               </constructor-arg>
-       </bean>
+    <bean id="applicationObjectConfigurer" depends-on="serviceLocator"
+        
class="org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer">
+    </bean>
                
     <!-- 
-        Bean: componentFactory
-        Type: magic
-        Usage: platform required (because it requires configuration)
-        Description: This defines the factory responsible for constructing UI
-            components that are configured according to the platform standards.
-            This is a critical part of the I18N support.
-            If you have special needs when constructing UI controls, then you
-            may need to override the default implementation.
-            The imlpementation is configured with two other
-            components responsible for providing I18N messages and icons.
-    -->
-       <bean id="componentFactory" 
-               
class="org.springframework.richclient.factory.DefaultComponentFactory">
-               <property name="iconSource">
-                       <ref bean="iconSource"/>
-               </property>
-               <property name="messageSource">
-                       <ref bean="messageSource"/>
-               </property>
-       </bean>
-
-    <!-- 
         Bean: lookAndFeelConfigurer
-        Type: magic
         Usage: platform optional
         Description: The platform doesn't specifically make direct use of this
             object (other than instantiating it).  It is expected that the 
object
@@ -170,7 +154,6 @@
        
     <!-- 
         Bean: messageSource
-        Type: user named
         Usage: platform required (not really, but you can't do much without it)
         Description: This specifies the component that is responsible for 
providing
             messages (all kinds of text) to the platform.  This is a critical 
piece
@@ -193,7 +176,6 @@
        
     <!-- 
         Bean: imageResourcesFactory
-        Type: user named
         Usage: platform required (if you are using the DefaultImageSource, see 
below)
         Description: This specifies the component that is responsible for 
providing
             image resources locations.  This factory uses the specified 
properties
@@ -207,14 +189,11 @@
                                <value>classpath:ui/images.properties</value>
                        </list>
                </property>
-               <property name="resourceBasePath">
-                       <value>images/</value>
-               </property>
+        <property name="resourceBasePath" value="images/"/>
        </bean>
        
     <!-- 
         Bean: imageSource
-        Type: user named
         Usage: platform required
         Description: This specifies the component that is responsible for 
providing
             images to the platform.  It makes use of a resource factory that 
converts
@@ -224,32 +203,12 @@
     -->
        <bean id="imageSource" 
                class="org.springframework.richclient.image.DefaultImageSource">
-               <constructor-arg index="0">
-                       <ref bean="imageResourcesFactory"/>
-               </constructor-arg>
-               <property name="brokenImageIndicator">
-                       <value>images/alert/error_obj.gif</value>
-               </property>
+        <constructor-arg index="0" ref="imageResourcesFactory"/>
+        <property name="brokenImageIndicator" 
value="images/alert/error_obj.gif"/>
        </bean>
        
     <!-- 
-        Bean: iconSource
-        Type: user named
-        Usage: platform required (because it requires configuration)
-        Description: This specifies the component that is responsible for 
providing
-            icons to the platform.  It makes use of an image source to locate 
the
-            image resources for the named icons.
-    -->
-       <bean id="iconSource" 
-               class="org.springframework.richclient.image.DefaultIconSource">
-               <constructor-arg index="0">
-                       <ref bean="imageSource"/>
-               </constructor-arg>
-       </bean>
-
-    <!-- 
         Bean: formComponentInterceptorFactory
-        Type: magic
         Usage: platform optional
         Description: This specifies the list of interceptors to attach to 
controls
             constructed by the platform.  This allows for a declarative model 
for
@@ -263,24 +222,17 @@
                <property name="interceptorFactories">
                        <list>
                                <bean 
class="org.springframework.richclient.form.builder.support.ColorValidationInterceptorFactory">
-                                       <property name="errorColor">
-                                               <value>255,245,245</value>
-                                       </property>
+                                       <property name="errorColor" 
value="255,245,245"/>
                                </bean>
                                <bean 
class="org.springframework.richclient.form.builder.support.OverlayValidationInterceptorFactory"/>
                                <bean 
class="org.springframework.richclient.text.TextComponentPopupInterceptorFactory"/>
-                               <bean 
class="org.springframework.richclient.list.ComboBoxAutoCompletionInterceptorFactory">
-                                       <property name="messageSource">
-                                               <ref bean="messageSource"/>
-                                       </property>
-                               </bean>
+                               <bean 
class="org.springframework.richclient.list.ComboBoxAutoCompletionInterceptorFactory"/>
                        </list>
                </property>
        </bean>
 
        <!-- 
         Bean: initialView
-        Type: user named
         Usage: application
         Description: This specifies the component that describes the initial 
view
             to present when the application is started.  The application window


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
spring-rich-c-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to