Changeset 2659


Ignore:
Timestamp:
03/07/13 08:48:58 (11 years ago)
Author:
keeloo
Message:

Removed VloConfig?.get() and made the member variables static themselves. Cleaned up the VloConfig? class.

Location:
vlo/branches/vlo-2.13-param
Files:
21 edited
2 moved

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java

    r2657 r2659  
    1717 * the VLO web application.
    1818 *
    19  * A member is annotated by prepending @element. When the VloConfig class is
    20  * reflected into the Simple framework, the framework will assign the values
    21  * it finds in the VloConfig.xml file to the members in the VloConfig class.
    22  *
    23  * By invoking the get method defined in the VloConfig class, a VLO application
    24  * can query the value of a parameter. If you just instantiate an instance of
    25  * the VloConfig class, the members will be assigned values from the packaged
    26  * the VloConfig.xml file.
    27  *
    28  * Alternatively, the readConfig methods will let you specify an xml file of
    29  * your choice.
    30  *
    31  * Whenever you like to add a parameter the VLO configuration, add a member
    32  * with the appropriate name and type, and prepend an at aign to the
     19 * A member is annotated by prepending {@literal @element}. When the VloConfig
     20 * class is reflected into the Simple framework, the framework will assign the
     21 * values it finds in the VloConfig.xml file to the members in the VloConfig
     22 * class.
     23 *
     24 * Whenever you need to add a parameter the VLO configuration, add a member
     25 * with the appropriate name and type, and prepend an at sign to the
    3326 * declaration, like this:
    3427 *
    3528 * {@literal @element}<br> {@literal parameterMember}<br><br>
    3629 *
    37  * The xml file used should in this case contain a definition like
     30 * The XML should in this case contain a definition like
    3831 *
    3932 * {@literal<parameterMember>} "the value of the
     
    4134 *
    4235 * If you want to add a type of member that is not included in VloConfig class
    43  * yet, or if you are looking for more information on the framework, please refer
    44  * to <url> <br><br>
    45  *
    46  * The parameters are stored statically. This means that after you have create
    47  * a VloConfig object, you can reference a parameter outside the scope in which
    48  * the object was originally created. So after a VloConfig object has been
    49  * created, get() in
     36 * yet, or if you are looking for more information on the framework, please
     37 * refer to <url> <br><br>
     38 *
     39 * In the VloConfig class, the parameters are stored statically. This means that
     40 * after
     41 *
     42 * {@literal VloConfig.read();}<br><br>
     43 *
     44 * or
     45 *
     46 * {@literal VloConfig.read();}<br><br>
     47 *
     48 * has been issued from a certain context, you can reference a parameter by
     49 *
     50 * {@literal WebAppConfig.getSomeParameter();}<br><br>
    5051 *
    51  * WebAppConfig.get().getSomeParameter();<br><br>
     52 * in any scope, also the scope from which the read message was send.
    5253 *
    53  * will return the configuration, and getSomeParameter() will return a
    54  * specific parameter in it.
    55  *
    5654 * Through the get and set methods, the application is indifferent to the origin
    5755 * of a parameter: you can get and set the value of a parameter without having
    5856 * to worry about how the parameter was defined originally.
    5957 *
    60  * By invoking the read method, and by querying the context, the web
    61  * application, on initialization, determines which definition to use.
    62  *
    6358 * Also, the get and set methods allow for a modification of the original value
    6459 * of the parameter. For example, if the format of a parameter changes, this
     
    128123
    129124    /**
     125     * Read the configuration from the packaged XML configuration file. 
     126     *
     127     * @param fileName the name of the file to read the configuration from
     128     *
     129     * @return the configuration
     130     */
     131    public static VloConfig readPackagedConfig() {
     132       
     133        // set the name of the packaged configuration file
     134        String fileName = "/VloConfig";
     135       
     136        config = VloConfig.readConfig (fileName);
     137       
     138        return config;
     139    }
     140   
     141    /**
    130142     * Read the configuration from an XML file.
    131143     *
     
    138150     */
    139151    public static VloConfig readConfig(String fileName) {
     152       
     153        // may it is safe to first expand the name a litte bit more
     154
    140155        if (config == null) {
    141156            // the configuration is not there yet; create it now
     
    152167     * Read the configuration from an XML file.
    153168     *
    154      * Invole this method instead of readConfig() if you want to change
     169     * Invoke this method instead of readConfig() if you want to change
    155170     * the parameters because the application is run in a context different
    156171     * from the usual one. Here, modifications of the parameters inspired on
    157172     * the difference in context can be made.
    158173     *
    159      * A web application can serve as a tipical example of a difference in
     174     * A web application can serve as a typical example of a difference in
    160175     * context: the application itself runs in a web server container, while the
    161176     * tests associated with the web application will be run outside this
     
    167182     */
    168183    public static VloConfig readTestConfig(String fileName) {
    169         if (config == null) {
    170             // the configuration is not there yet; create it now
    171             config = new VloConfig();
    172         }
    173 
    174         // get the XML file configuration from the file by invoking ...
    175         config = (VloConfig) read(fileName, config);
     184
     185        config = VloConfig.readConfig (fileName);
    176186       
    177         // modify the parameters here
    178 
    179         return config;
    180     }
    181    
    182     /**
    183      * Return the reference to the configuration
    184      *
    185      * @return the configuration
    186      */
    187     public static VloConfig get (){
     187        // modify the configuration here
     188
    188189        return config;
    189190    }
     
    200201   
    201202    @Element // directive for Simple
    202     private boolean deleteAllFirst = false;
    203    
    204     @Element
    205     private boolean printMapping = false;
     203    private static boolean deleteAllFirst = false;
     204   
     205    @Element
     206    private static boolean printMapping = false;
    206207   
    207208    @ElementList // directive for Simple
    208     private List<DataRoot> dataRoots;
    209    
    210     public List<DataRoot> getDataRoots() {
     209    private static List<DataRoot> dataRoots;
     210   
     211    public static List<DataRoot> getDataRoots() {
    211212        return dataRoots;
    212213    }
    213214   
    214215    @Element
    215     private String vloHomeLink = "";
    216    
    217     @Element
    218     private String solrUrl = "";
    219    
    220     @Element
    221     private String profileSchemaUrl = "";
    222 
    223     @Element
    224     private String componentRegistryRESTURL = "";
    225    
    226     @Element
    227     private String handleServerUrl = "";
    228    
    229     @Element
    230     private String imdiBrowserUrl = "";
     216    private static String vloHomeLink = "";
     217   
     218    @Element
     219    private static String solrUrl = "";
     220   
     221    @Element
     222    private static String profileSchemaUrl = "";
     223
     224    @Element
     225    private static String componentRegistryRESTURL = "";
     226   
     227    @Element
     228    private static String handleServerUrl = "";
     229   
     230    @Element
     231    private static String imdiBrowserUrl = "";
    231232   
    232233    /**
     
    235236     */
    236237    @Element
    237     private String nationalProjectMapping = "";
     238    private static String nationalProjectMapping = "";
    238239   
    239240    /**
     
    261262     */
    262263    @ElementArray(entry = "facetField")
    263     private String[] facetFields = {"", "", ""};
    264    
    265     @Element
    266     private String countryComponentUrl = "";
    267    
    268     @Element
    269     private String language2LetterCodeComponentUrl = "";
    270    
    271     @Element
    272     private String language3LetterCodeComponentUrl = "";
    273    
    274     @Element
    275     private String silToISO639CodesUrl = "";
    276    
    277     @Element
    278     private String FederatedContentSearchUrl = " ";
     264    private static String[] facetFields = {"", "", ""};
     265   
     266    @Element
     267    private static String countryComponentUrl = "";
     268   
     269    @Element
     270    private static String language2LetterCodeComponentUrl = "";
     271   
     272    @Element
     273    private static String language3LetterCodeComponentUrl = "";
     274   
     275    @Element
     276    private static String silToISO639CodesUrl = "";
     277   
     278    @Element
     279    private static String FederatedContentSearchUrl = " ";
    279280
    280281    /**
     
    294295     * @param dataRoots the value
    295296     */
    296     public void setDataRoots(List<DataRoot> dataRoots) {
    297         this.dataRoots = dataRoots;
     297    public static void setDataRoots(List<DataRoot> param) {
     298        dataRoots = param;
    298299    }
    299300
     
    306307     * @return the value
    307308     */
    308     public void setDeleteAllFirst(boolean deleteAllFirst) {
    309         this.deleteAllFirst = deleteAllFirst;
     309    public static void setDeleteAllFirst(boolean param) {
     310        deleteAllFirst = param;
    310311    }
    311312
     
    318319     * @return the value
    319320     */
    320     public boolean isDeleteAllFirst() {
     321    public static boolean isDeleteAllFirst() {
    321322        return deleteAllFirst;
    322323    }
     
    330331     * @param printMapping the value
    331332     */
    332     public void setPrintMapping(boolean printMapping) {
    333         this.printMapping = printMapping;
     333    public static void setPrintMapping(boolean param) {
     334        printMapping = param;
    334335    }
    335336
     
    342343     * @return the value
    343344     */
    344     public boolean isPrintMapping() {
     345    public static boolean isPrintMapping() {
    345346        return printMapping;
    346347    }
     
    354355     * @return the value
    355356     */
    356     public String getVloHomeLink() {
     357    public static String getVloHomeLink() {
    357358        return vloHomeLink;
    358359    }
     
    366367     * @param vloHomeLink the value
    367368     */
    368     public void setVloHomeLink(String link) {
    369         this.vloHomeLink = link;
     369    public static void setVloHomeLink(String param) {
     370        vloHomeLink = param;
    370371    }
    371372
     
    378379     * @return the value
    379380     */
    380     public String getSolrUrl() {
     381    static public String getSolrUrl() {
    381382        return solrUrl;
    382383    }
     
    390391     * @param url the parameter
    391392     */
    392     public void setSolrUrl(String url) {
    393         this.solrUrl = url;
     393    public static void setSolrUrl(String param) {
     394        solrUrl = param;
    394395    }
    395396
     
    402403     * @return the value
    403404     */
    404     public String getComponentRegistryProfileSchema(String id) {
     405    public static String getComponentRegistryProfileSchema(String id) {
    405406        return profileSchemaUrl.replace("{PROFILE_ID}", id);
    406407    }
     
    414415     * @param profileId the value
    415416     */
    416     public void setProfileSchemaUrl(String url) {
    417         this.profileSchemaUrl = url;
     417    public static void setProfileSchemaUrl(String param) {
     418        profileSchemaUrl = param;
    418419    }
    419420
     
    426427     * @return the value
    427428     */
    428     public String getComponentRegistryRESTURL() {
     429    public static String getComponentRegistryRESTURL() {
    429430        return componentRegistryRESTURL;
    430431    }
     
    438439     * @param componentRegistryRESTURL the value
    439440     */
    440     public void setComponentRegistryRESTURL(String url) {
    441         this.componentRegistryRESTURL = url;
     441    public static void setComponentRegistryRESTURL(String param) {
     442        componentRegistryRESTURL = param;
    442443    }
    443444
     
    450451     * @return the value
    451452     */
    452     public String getHandleServerUrl() {
     453    public static String getHandleServerUrl() {
    453454        return handleServerUrl;
    454455    }
     
    462463     * @param handleServerUrl the value
    463464     */
    464     public void setHandleServerUrl(String url) {
    465         this.handleServerUrl = url;
     465    public static void setHandleServerUrl(String param) {
     466        handleServerUrl = param;
    466467    }
    467468
     
    474475     * @param imdiBrowserUrl the value
    475476     */
    476     public void setIMDIBrowserUrl(String url) {
    477         this.imdiBrowserUrl = url;
     477    public static void setIMDIBrowserUrl(String param) {
     478        imdiBrowserUrl = param;
    478479    }
    479480
     
    485486     * @return the value
    486487     */
    487     public String getIMDIBrowserUrl(String handle) {
     488    public static String getIMDIBrowserUrl(String handle) {
    488489        String result;
    489490        try {
     
    503504     * @return the value
    504505     */
    505     public void setFederatedContentSearchUrl(String url) {
    506         this.FederatedContentSearchUrl = url;
     506    public static void setFederatedContentSearchUrl(String param) {
     507        FederatedContentSearchUrl = param;
    507508    }
    508509
     
    515516     * @param FederatedContentSearchUrl the value
    516517     */
    517     public String getFederatedContentSearchUrl() {
     518    public static String getFederatedContentSearchUrl() {
    518519        return FederatedContentSearchUrl;
    519520    }
     
    527528     * @param nationalProjectMapping the value
    528529     */
    529     public void setNationalProjectMapping(String mapping) {
    530         this.nationalProjectMapping = mapping;
    531     }
     530    public static void setNationalProjectMapping(String param) {
     531        nationalProjectMapping = param;
     532    }
     533   
    532534
    533535    /**
     
    539541     * @return the value
    540542     */
    541     public String getNationalProjectMapping() {
     543    public static String getNationalProjectMapping() {
    542544        return nationalProjectMapping;
    543545    }
     
    551553     * @return the value
    552554     */
    553     public String[] getFacetFields() {
     555    public static String[] getFacetFields() {
    554556        return facetFields;
    555557    }
     
    563565     * @param facetFields the value, a list of facet fields
    564566     */
    565     public void setFacetFields(String[] fields) {
    566         this.facetFields = fields;
     567    public static void setFacetFields(String[] param) {
     568        facetFields = param;
    567569    }
    568570
     
    575577     * @return the value
    576578     */
    577     public String getCountryComponentUrl() {
     579    public static String getCountryComponentUrl() {
    578580        return countryComponentUrl;
    579581    }
     
    587589     * @param countryComponentUrl the value
    588590     */
    589     public void setCountryComponentUrl(String url) {
    590         this.countryComponentUrl = url;
     591    public static void setCountryComponentUrl(String param) {
     592        countryComponentUrl = param;
    591593    }
    592594
     
    599601     * @return the value
    600602     */
    601     public String getLanguage2LetterCodeComponentUrl() {
     603    public static String getLanguage2LetterCodeComponentUrl() {
    602604        return language2LetterCodeComponentUrl;
    603605    }
     
    611613     * @param language2LetterCodeComponentUrl the value
    612614     */
    613     public void setLanguage2LetterCodeComponentUrl(String url) {
    614         this.language2LetterCodeComponentUrl = url;
     615    public static void setLanguage2LetterCodeComponentUrl(String param) {
     616        language2LetterCodeComponentUrl = param;
    615617    }
    616618
     
    623625     * @return the value
    624626     */
    625     public String getLanguage3LetterCodeComponentUrl() {
     627    public static String getLanguage3LetterCodeComponentUrl() {
    626628        return language3LetterCodeComponentUrl;
    627629    }
     
    635637     * @param language3LetterCodeComponentUrl the value
    636638     */
    637     public void setLanguage3LetterCodeComponentUrl(String url) {
    638         this.language3LetterCodeComponentUrl = url;
     639    public static void setLanguage3LetterCodeComponentUrl(String param) {
     640        language3LetterCodeComponentUrl = param;
    639641    }
    640642
     
    647649     * @return the value
    648650     */
    649     public String getSilToISO639CodesUrl() {
     651    public static String getSilToISO639CodesUrl() {
    650652        return silToISO639CodesUrl;
    651653    }
     
    659661     * @param silToISO639CodesUrl the value
    660662     */
    661     public void setSilToISO639CodesUrl(String url) {
    662         this.silToISO639CodesUrl = url;
     663    public static void setSilToISO639CodesUrl(String param) {
     664        silToISO639CodesUrl = param;
    663665    }
    664666}
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloContextConfig.java

    r2657 r2659  
    6969            // overrule the current value of solrUrl
    7070
    71             VloConfig.get().setSolrUrl(url);
     71            VloConfig.setSolrUrl(url);
    7272        }
    7373       
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIComponentProfileNamePostProcessor.java

    r2627 r2659  
    6969        }
    7070        vg = new VTDGen();
    71         BASE_URL = VloConfig.get().getComponentRegistryRESTURL();
     71        BASE_URL = VloConfig.getComponentRegistryRESTURL();
    7272    }
    7373}
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIParserVTDXML.java

    r2627 r2659  
    7979        if (index != -1) {
    8080            String profileId = nav.toString(index).trim();
    81             result = VloConfig.get().getComponentRegistryProfileSchema(profileId);
     81            result = VloConfig.getComponentRegistryProfileSchema(profileId);
    8282        }
    8383        return result;
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CountryNamePostProcessor.java

    r2627 r2659  
    4141        LOG.debug("Creating country code map.");
    4242        try {
    43             Map<String, String> result = CommonUtils.createCMDIComponentItemMap(VloConfig.get().getCountryComponentUrl());
     43            Map<String, String> result = CommonUtils.createCMDIComponentItemMap(VloConfig.getCountryComponentUrl());
    4444            return result;
    4545        } catch (Exception e) {
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/LanguageCodePostProcessor.java

    r2627 r2659  
    9898    private Map<String, String> getTwoLetterCountryCodeMap() {
    9999        if (twoLetterCodesMap == null) {
    100             twoLetterCodesMap = createCodeMap(VloConfig.get().getLanguage2LetterCodeComponentUrl());
     100            twoLetterCodesMap = createCodeMap(VloConfig.getLanguage2LetterCodeComponentUrl());
    101101        }
    102102        return twoLetterCodesMap;
     
    105105    private Map<String, String> getThreeLetterCountryCodeMap() {
    106106        if (threeLetterCodesMap == null) {
    107             threeLetterCodesMap = createCodeMap(VloConfig.get().getLanguage3LetterCodeComponentUrl());
     107            threeLetterCodesMap = createCodeMap(VloConfig.getLanguage3LetterCodeComponentUrl());
    108108        }
    109109        return threeLetterCodesMap;
     
    112112    protected Map<String, String> getLanguageNameToIso639Map() {
    113113        if (languageNameToIso639Map == null) {
    114                         languageNameToIso639Map = createReverseCodeMap(VloConfig.get().getLanguage3LetterCodeComponentUrl());
     114                        languageNameToIso639Map = createReverseCodeMap(VloConfig.getLanguage3LetterCodeComponentUrl());
    115115        }
    116116        return languageNameToIso639Map;
     
    119119    private Map<String, String> getIso639ToLanguageNameMap() {
    120120        if (iso639ToLanguageNameMap == null) {
    121                 iso639ToLanguageNameMap = createCodeMap(VloConfig.get().getLanguage3LetterCodeComponentUrl());
     121                iso639ToLanguageNameMap = createCodeMap(VloConfig.getLanguage3LetterCodeComponentUrl());
    122122        }
    123123
     
    151151            DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    152152            domFactory.setNamespaceAware(true);
    153             URL url = new URL(VloConfig.get().getSilToISO639CodesUrl());
     153            URL url = new URL(VloConfig.getSilToISO639CodesUrl());
    154154            DocumentBuilder builder = domFactory.newDocumentBuilder();
    155155            Document doc = builder.parse(url.openStream());
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java

    r2651 r2659  
    119119        try {
    120120            // Delete the whole Solr db
    121             if (VloConfig.get().isDeleteAllFirst()) {
     121            if (VloConfig.isDeleteAllFirst()) {
    122122                LOG.info("Deleting original data...");
    123123                solrServer.deleteByQuery("*:*");
     
    175175     */
    176176    private List<DataRoot> checkDataRoots() {
    177         List<DataRoot> dataRoots = VloConfig.get().getDataRoots();
     177        List<DataRoot> dataRoots = VloConfig.getDataRoots();
    178178        for (DataRoot dataRoot : dataRoots) {
    179179            if (!dataRoot.getRootFile().exists()) {
     
    210210     */
    211211    protected void initSolrServer() throws MalformedURLException {
    212         String solrUrl = VloConfig.get().getSolrUrl();
     212        String solrUrl = VloConfig.getSolrUrl();
    213213        LOG.info("Initializing Solr Server on " + solrUrl);
    214214        solrServer = new StreamingUpdateSolrServer(solrUrl, 1000, 2) {
  • vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/NationalProjectPostProcessor.java

    r2627 r2659  
    5151
    5252        private Map<String, String> getNationalProjectMapping() {
    53         String mappingFileName = VloConfig.get().getNationalProjectMapping();
     53        String mappingFileName = VloConfig.getNationalProjectMapping();
    5454        if(mappingFileName == null){
    5555            throw new RuntimeException("Configuration Error, NationalProjectMapping is null");
  • vlo/branches/vlo-2.13-param/vlo_importer/src/test/java/eu/clarin/cmdi/vlo/importer/ImporterTestcase.java

    r2639 r2659  
    4141        // optionally, modify the configuration here
    4242       
    43         VloConfig.get().setComponentRegistryRESTURL("http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/");
     43        VloConfig.setComponentRegistryRESTURL("http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/");
    4444    }
    4545
  • vlo/branches/vlo-2.13-param/vlo_importer/src/test/java/eu/clarin/cmdi/vlo/importer/MetadataImporterTest.java

    r2639 r2659  
    1414import org.apache.solr.common.SolrInputDocument;
    1515import static org.junit.Assert.assertEquals;
    16 import org.junit.Before;
    1716import org.junit.Test;
    1817
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java

    r2658 r2659  
    1111 * {@literal VLO} web application.<br><br>
    1212 *
    13  * Because the VloApplication class extends WebApplication, a class instance
     13 * Because the VloWebApplication class extends WebApplication, a class instance
    1414 * will normally reside inside a web server container. By running the Start
    1515 * class however, an instance of the application will reside outside a server
     
    1717 *
    1818 */
    19 public class VloApplication extends WebApplication {
     19public class VloWebApplication extends WebApplication {
    2020
    2121    private SearchResultsDao searchResults;
     
    6161     * server container.
    6262     */
    63     public VloApplication() {
     63    public VloWebApplication() {
    6464
    6565        /**
    66          * Read the application's configuration. Because on instantiation a web
    67          * application cannot said to be living in a context, context parameters
    68          * can only be added to the configuration later, in this case: when the
    69          * {@literal init()} method will be invoked.
     66         * Read the application's configuration.
     67         *
     68         * Because on instantiation a web application cannot said to be living
     69         * in a web server context, parameters defined in the context can only
     70         * be added to the configuration later, in this case: when the {@literal
     71         * init()} method will be invoked.
    7072         */
    71         String fileName = VloConfig.class.getResource("/VloConfig.xml").getFile();
    7273       
    73         // configSource = getClass().getClassLoader().getResourceAsStream(fileName);
    74        
    75         config = VloConfig.readConfig(fileName);
     74        config = VloConfig.readPackagedConfig();
    7675
    7776        // let the {@literal init()} method know that there will be a context
     
    9897     * context associated with this container will be ignored.
    9998     */
    100     public VloApplication(VloConfig testConfig) {
     99    public VloWebApplication(VloConfig testConfig) {
    101100
    102         // let the application use the configuration created outside of it
    103 
     101        // remember that the application does not live in a web server context
     102       
    104103        inContext = false;
     104       
     105        // set the current configuration to the test configuration
    105106
    106107        config = testConfig;
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/dao/DaoLocator.java

    r2641 r2659  
    33import org.apache.wicket.RequestCycle;
    44
    5 import eu.clarin.cmdi.vlo.VloApplication;
     5import eu.clarin.cmdi.vlo.VloWebApplication;
    66
    77
     
    1010    public static SearchResultsDao getSearchResultsDao()
    1111    {
    12         VloApplication app = (VloApplication)RequestCycle.get().getApplication();
     12        VloWebApplication app = (VloWebApplication)RequestCycle.get().getApplication();
    1313        return app.getSearchResultsDao();
    1414    }
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/dao/SolrDao.java

    r2641 r2659  
    11package eu.clarin.cmdi.vlo.dao;
    22
     3import eu.clarin.cmdi.vlo.config.VloConfig;
    34import java.net.MalformedURLException;
    4 
    55import org.apache.solr.client.solrj.SolrQuery;
    66import org.apache.solr.client.solrj.SolrServerException;
     
    1313import org.slf4j.LoggerFactory;
    1414
    15 import eu.clarin.cmdi.vlo.config.VloConfig;
    16 
    1715public class SolrDao {
    1816
     
    2220    public SolrDao() {
    2321        String solrUrl;
    24         solrUrl = VloConfig.get().getSolrUrl();
     22        solrUrl = VloConfig.getSolrUrl();
    2523        try {
    2624            solrServer = new CommonsHttpSolrServer(solrUrl);
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetedSearchPage.java

    r2641 r2659  
    5656                public SearchBoxForm(String id, SearchPageQuery query) {
    5757                        super(id, new CompoundPropertyModel<SearchPageQuery>(query));
    58                         add(new ExternalLink("vloHomeLink", VloConfig.get().getVloHomeLink()));
     58                        add(new ExternalLink("vloHomeLink", VloConfig.getVloHomeLink()));
    5959                        searchBox = new AutoCompleteTextField<String>("searchQuery") {
    6060                                @Override
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/HtmlFormCreator.java

    r2641 r2659  
    3434                }               
    3535               
    36                 String form = "<form method=\"post\" action=\""+VloConfig.get().getFederatedContentSearchUrl()+"\"> \n"
     36                String form = "<form method=\"post\" action=\""+VloConfig.getFederatedContentSearchUrl()+"\"> \n"
    3737                                + "<fieldset style=\"border:0px;\"> \n"
    3838                                + "\t  <label for=\"query\">CQL query:</label> \n"
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ResourceLinkPanel.java

    r2641 r2659  
    6969            if (resourceLink.startsWith(FacetConstants.HANDLE_PREFIX)) {
    7070                String handle = resourceLink.substring(FacetConstants.HANDLE_PREFIX.length());
    71                 result = VloConfig.get().getHandleServerUrl() + handle;
     71                result = VloConfig.getHandleServerUrl() + handle;
    7272            } else if(resourceLink.startsWith(FacetConstants.URN_NBN_PREFIX)) {
    7373                result = URN_NBN_RESOLVER_URL+resourceLink;
     
    115115            if (resourceLink.startsWith(FacetConstants.HANDLE_PREFIX)) {
    116116                String handle = resourceLink.substring(FacetConstants.HANDLE_PREFIX.length());
    117                 resourceLink = VloConfig.get().getHandleServerUrl() + handle;
     117                resourceLink = VloConfig.getHandleServerUrl() + handle;
    118118                // Now points to something like http://hdl.handle.net/1839/00-0000-0000-0004-3357-F
    119119                HttpURLConnection con = null;
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/SearchPageQuery.java

    r2641 r2659  
    7171        result.setFacet(true);
    7272        result.setFacetMinCount(1);
    73         result.addFacetField(VloConfig.get().getFacetFields());
     73        result.addFacetField(VloConfig.getFacetFields());
    7474        return result;
    7575    }
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java

    r2641 r2659  
    117117            }
    118118            if (linkToOriginalContext.startsWith(FacetConstants.HANDLE_MPI_PREFIX)) {
    119                 result = VloConfig.get().getIMDIBrowserUrl(linkToOriginalContext);
     119                result = VloConfig.getIMDIBrowserUrl(linkToOriginalContext);
    120120            } else {
    121121                try {
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/main/webapp/WEB-INF/web.xml

    r2641 r2659  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
     2
     3<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
     4         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     5         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     6         version="2.4"
     7>
    48
    59  <display-name>vlo</display-name>
     
    1014    <init-param>
    1115      <param-name>applicationClassName</param-name>
    12       <param-value>eu.clarin.cmdi.vlo.VloApplication</param-value>
     16      <param-value>eu.clarin.cmdi.vlo.VloWebApplication</param-value>
    1317    </init-param>
    1418    <init-param>
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/TestFacetedSearchPage.java

    r2641 r2659  
    2727        // optionally, modify the test configuration here
    2828
    29         wicketTester = new WicketTester(new VloApplication(config));
     29        wicketTester = new WicketTester(new VloWebApplication(config));
    3030    }
    3131
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanelTest.java

    r2641 r2659  
    11package eu.clarin.cmdi.vlo.pages;
    22
    3 import eu.clarin.cmdi.vlo.VloApplication;
     3import eu.clarin.cmdi.vlo.VloWebApplication;
    44import eu.clarin.cmdi.vlo.config.VloConfig;
    55import java.util.List;
     
    2525        // optionally, modify the test configuration here
    2626       
    27         wicketTester = new WicketTester(new VloApplication(testConfig));
     27        wicketTester = new WicketTester(new VloWebApplication(testConfig));
    2828    }
    2929
  • vlo/branches/vlo-2.13-param/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/pages/ResourceLinkPanelTest.java

    r2641 r2659  
    22
    33import eu.clarin.cmdi.vlo.FacetConstants;
    4 import eu.clarin.cmdi.vlo.VloApplication;
     4import eu.clarin.cmdi.vlo.VloWebApplication;
    55import eu.clarin.cmdi.vlo.config.VloConfig;
    66import org.apache.wicket.util.tester.WicketTester;
     
    2828        // optionally, modify the test configuration here
    2929
    30         wicketTester = new WicketTester(new VloApplication(testConfig));
     30        wicketTester = new WicketTester(new VloWebApplication(testConfig));
    3131    }
    3232
Note: See TracChangeset for help on using the changeset viewer.