Subversion Repositories linid-dm

Compare Revisions

Rev 440 → Rev 441

/sample/trunk/src/main/java/org/linid/dm/sample/tap5/services/AppModule.java
2,6 → 2,7
 
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
 
import javax.naming.InvalidNameException;
21,6 → 22,7
import org.apache.tapestry5.ioc.annotations.SubModule;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.ioc.annotations.Value;
import org.apache.tapestry5.ioc.services.SymbolProvider;
import org.apache.tapestry5.ioc.services.SymbolSource;
import org.apache.tapestry5.services.BeanBlockContribution;
import org.apache.tapestry5.services.ComponentSource;
55,6 → 57,7
import org.linid.dm.wui.t5lib.services.impl.PropertiesSymbolProvider;
import org.linid.dm.wui.validator.ValidatorDefinition;
import org.slf4j.Logger;
import org.springframework.web.context.WebApplicationContext;
 
/**
* This module is automatically included as part of the Tapestry IoC Registry, it's a good place to
158,7 → 161,27
configuration.add("classpath:configuration.properties");
}
public static void contributeSymbolSource(OrderedConfiguration<SymbolProvider> providers,
@InjectService("ApplicationContext") WebApplicationContext context) {
 
PropertiesSymbolProvider propertiesSymbolProvider = new PropertiesSymbolProvider(context, Collections.singleton("classpath:configuration.properties"));
providers.add("properties-classpath", propertiesSymbolProvider);
 
try {
propertiesSymbolProvider = new PropertiesSymbolProvider(context, Collections.singleton("file:///etc/linid-dm/configuration.properties"));
providers.add("properties-default-etc", propertiesSymbolProvider, "before:*");
} catch (Exception e) {
//ignore non existing configuration
}
try {
propertiesSymbolProvider = new PropertiesSymbolProvider(context, Collections.singleton("file:///" + System.getProperty("linid.config.file")));
providers.add("properties-parametrized", propertiesSymbolProvider, "before:*");
} catch (Exception e) {
//ignore non existing configuration
}
}
public void contributeSampleSpecific(Configuration<SampleClassType> configuration, SymbolSource s,
@InjectService("cachedEschemaClassDao") ESchemaClassDao schemaClassDao) throws MissingEschemaException {