Changeset 2590
- Timestamp:
- 02/14/13 15:46:12 (11 years ago)
- Location:
- vlo/branches/vlo-2.13-param/vlo_webapp/src
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/VloApplication.java
r2577 r2590 14 14 private final SearchResultsDao searchResults; 15 15 16 static WebAppConfig config; 17 16 18 public VloApplication() { 17 // BeanFactory factory = new ClassPathXmlApplicationContext(new String[] { Configuration.CONFIG_FILE }); 18 // factory.getBean("configuration"); //Use Configuration.getInstance to get the Configuration just loading the instance here. 19 WebAppConfig.setServletContext(this.getServletContext()); 20 String test = WebAppConfig.open().getSolrUrl(); 21 19 /** 20 * The new way of doing things. In case of the web application tests: 21 * just extend this class, and override the constructor by invoking the 22 * open method of the extended test web application configuration class. 23 * Also, change the way in which the get methods are being invoked. From 24 * now on, you only have to invoke config.get ... 25 */ 26 config = WebAppConfig.open(); 27 // String test; 28 // test = config.getVloHomeLink(); 29 22 30 searchResults = new SearchResultsDao(); 23 31 } -
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/ConfigFromFile.java
r2577 r2590 26 26 * @author keeloo 27 27 */ 28 public abstract class ConfigF ileParam{28 public abstract class ConfigFromFile { 29 29 30 30 /** 31 31 * Empty constructor 32 32 */ 33 public ConfigF ileParam() {33 public ConfigFromFile() { 34 34 } 35 35 … … 52 52 * @return the object with values assigned to annotated members 53 53 */ 54 public static synchronized ConfigF ileParam read(ConfigFileParamconfig) {54 public static synchronized ConfigFromFile read(ConfigFromFile config) { 55 55 56 56 ConfigFilePersister persister; … … 59 59 60 60 // assign the members their values 61 config = (ConfigF ileParam) persister.ConfigFromFile();61 config = (ConfigFromFile) persister.ConfigFromFile(); 62 62 return config; 63 63 } … … 69 69 * written to a file in the form of an XML definition. 70 70 */ 71 public static void write(ConfigF ileParamconfig) {71 public static void write(ConfigFromFile config) { 72 72 73 73 ConfigFilePersister persister; -
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/ImporterConfig.java
r2570 r2590 18 18 */ 19 19 @Root // directive for Simple 20 public class ImporterConfig extends ConfigF ileParam{20 public class ImporterConfig extends ConfigFromFile { 21 21 22 22 /** -
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/WebAppConfig.java
r2577 r2590 66 66 */ 67 67 @Root 68 public class WebAppConfig extends ConfigF ileParam{68 public class WebAppConfig extends ConfigFromFile { 69 69 70 70 // create a reference to the application logging … … 94 94 ConfigFilePersister.setLogger(WebAppConfig.logger); 95 95 } 96 96 97 97 /** 98 98 * XML File in which the application configuration is stored … … 161 161 /* Contrary to Simple, the servlet context parameters are not retrieved 162 162 * by annotation. Get them by invoking a local method. 163 * 164 * Here also invoke a superclass method 163 165 */ 164 166 config = addServletContext(config); … … 567 569 568 570 servletContext = context; 569 } 570 571 572 // servletContest can be null 573 } 574 571 575 /** 572 576 * Add properties of the {@literal servlet's} context<br><br> … … 582 586 583 587 // retrieve parameter valies from the servlet context 584 585 config.solrUrl = servletContext.getInitParameter("solrUrl"); 588 589 if (servletContext == null) { 590 // no servlet context yet 591 592 } else { 593 config.solrUrl = servletContext.getInitParameter("solrUrl"); 594 } 586 595 587 596 return config; … … 595 604 */ 596 605 597 @Element598 606 private String solrUrl = ""; 599 607 -
vlo/branches/vlo-2.13-param/vlo_webapp/src/main/webapp/META-INF/context.xml
r2577 r2590 16 16 17 17 <Context antiJARLocking="true" path="/vlo"> 18 <Parameter name=solrU RLvalue="http://localhost:8084/vlo_solr/"/>18 <Parameter name=solrUrl value="http://localhost:8084/vlo_solr/"/> 19 19 </Context> -
vlo/branches/vlo-2.13-param/vlo_webapp/src/test/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanelTest.java
r1093 r2590 17 17 @Before 18 18 public void setUp() { 19 new WicketTester(new VloApplication()); 19 WicketTester wicketTester; 20 wicketTester = new WicketTester(new VloApplication()); 20 21 } 21 22
Note: See TracChangeset
for help on using the changeset viewer.