The following is inside my specialcases.xpt

It doesn't work. Basically, I'm trying to make it spit out a file that  
will sit in resources called "DataSourceConfig" that I can dump a  
default config file into and modify later - and then reference that  
bean in the SessionFactory for the data source.

It seems that Sculptor doesn't like EXPAND inside of an AOP template -  
or else I'm doing it wrong.

«IMPORT sculptormetamodel»
«EXTENSION extensions::helper»
«EXTENSION extensions::properties»

«AROUND *::sessionFactory FOR Application»
     «FILE "SessionFactory.xml" TO_GEN_RESOURCES-»
        «EXPAND header»
            «IF isWar() -»
              «EXPAND txManager»
            «ENDIF -»
        
        «EXPAND dataSourceConfig»
        <import resource="DataSourceConfig.xml"/>
        
        <bean id="sessionFactory"  
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
         <property name="dataSource">
             <ref bean="applicationDataSource" />
         </property>
         «EXPAND hibernateProperties»
         «EXPAND hibernateMappingResources»

         <property name="entityInterceptor">
             <ref bean="auditInterceptor" />
         </property>
     </bean>

     <bean id="auditInterceptor" class="«auditInterceptorClass()»"/>
</beans>

        «ENDFILE »
«ENDAROUND»

«DEFINE dataSourceConfig FOR Application»
  «FILE "DataSourceConfig.xml" TO_RESOURCES-»
        «EXPAND header»
        <bean id="applicationDataSource"  
class="org.springframework.jdbc.datasource.DriverManagerDataSource"  
destroy-method="close">
      <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
      <property name="url" value="jdbc:mysql://localhost:3306/ 
LibraryDS"/>
      <property name="username" value="root"/>
      <property name="password" value=""/>
        </bean>
    «ENDFILE »
«ENDDEFINE »

----

I COULD just make a patch to make Scupltor perform the way I want to  
by modifying Spring.xpt - but I don't know if everyone else wants the  
ability to reconfigure datasources in an easy-to-edit file or not.  
(I'm guessing not, since it's not in there at this point?)

Ryan
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to