The only thing you have missed is that you have to qualify the expand
definitions, since they are not in the same file.

«EXPAND templates::Spring::txManager»

I would like that we improve sculptor with all good ideas. I think using a
Spring data source configuration might be useful, even though I'm still in
doubt for the location of the db password for a production scenario. Please
add a request in jira, which you can assign to yourself. We should make this
feature configurable using sculptor generator properties.

We haven't created Fornax accounts/permissions for you yet. Maybe it is time
to do that?

/Patrik


Ryan Gardner wrote:
> 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-EXPAND-in-an-AOP-template...-%28trying-to-revise-the-datasource-generation%29-tp18818731s17564p18820063.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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