Ignore:
Timestamp:
02/20/13 11:36:52 (11 years ago)
Author:
keeloo
Message:

Changed WebAppConfig?.xml to VloConfig? to allow for the importerparameters to be included. Made the configuration sensitive to the web application context.

File:
1 edited

Legend:

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

    r2597 r2598  
    33import java.io.UnsupportedEncodingException;
    44import java.net.URLEncoder;
    5 import javax.servlet.GenericServlet;
    65import javax.servlet.ServletContext;
    76import org.simpleframework.xml.Element;
     
    8988    public VloConfig() {
    9089        // let the superclass know about the logger defined here
    91         // ConfigFileParam.logger = webAppConfigLogger;
    9290
    9391        logger = new WebAppConfigLogger();
     
    10098     */
    10199    public static final String CONFIG_FILE =
    102             VloConfig.class.getResource("/WebAppConfig.xml").getFile();
     100            VloConfig.class.getResource("/VloConfig.xml").getFile();
    103101
    104102    /**
     
    131129    /**
    132130     * kj: change the annotation. Instead of opening a context, it is now a
    133      * matter of initialising it. Make a new method for referencing.
     131     * matter of initializing it. Make a new method for referencing.
    134132     *
    135133     * Open a static context of WebAppConfig members, and assign values to
     
    151149     * @return the web application configuration in a new static context
    152150     */
    153     public static VloConfig setWebApp(ServletContext context) {
     151    public static VloConfig webApp() {
    154152        if (config == null) {
    155153            // the configuration is not there yet; create it now
     
    157155        }
    158156
    159         /**
    160          * get the XML file configuration from the file by invoking the
    161          * superclass method
    162          */
     157        // get the XML file configuration from the file by invoking the
     158
    163159        config = (VloConfig) read(config);
    164 
    165         /* Contrary to Simple, the servlet context parameters are not retrieved
    166          * by annotation. Get them by invoking a local method.
    167          *
    168          * Here also invoke a superclass method
    169          */
    170         config = addServletContext(config, context);
    171160
    172161        return config;
     
    177166     * method.
    178167     *
     168     * In this method, exceptions to the normal web application context can
     169     * be made.
     170     *
    179171     * @return
    180172     */
    181     public static VloConfig WebAppTest() {
     173    public static VloConfig testWebApp() {
    182174        if (config == null) {
    183175            // the configuration is not there yet; create it now
     
    185177        }
    186178
    187         /**
    188          * get the XML file configuration from the file by invoking the
    189          * superclass method
    190          */
     179        // get the XML file configuration from the file by invoking the
     180
    191181        config = (VloConfig) read(config);
    192182
     
    607597           
    608598    /**
     599     *
     600     * kj: repair annotation
     601     *
     602     * Contrary to Simple, the web application's context parameters are not
     603     * retrieved by annotation. Get them by invoking a local method.
     604     *
    609605     * Add properties of the {@literal servlet's} context<br><br>
    610      *
     606     *  
    611607     * Keep the properties in the static context of the WebAppConfig class, next
    612608     * to the members representing the values in WebAppConfig.xml file.<br><br>
     
    616612     * @return the static WebAppConfig member
    617613     */
    618     static VloConfig addServletContext(VloConfig config, ServletContext context) {
     614    public static VloConfig addServletContext(VloConfig config, ServletContext context) {
    619615
    620616        // retrieve parameter valies from the servlet context
Note: See TracChangeset for help on using the changeset viewer.