Ignore:
Timestamp:
01/07/14 11:05:14 (10 years ago)
Author:
twagoo
Message:

Merged twagoo branch of to-wicket-1.6 back to original, removed this branch

Location:
vlo/branches/to-wicket-1.6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/to-wicket-1.6

  • vlo/branches/to-wicket-1.6/vlo_web_app

    • Property svn:ignore
      •  

        old new  
        11target
         2vlo-importer.log*
  • vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java

    r4199 r4220  
    77import eu.clarin.cmdi.vlo.pages.BasePanel;
    88import eu.clarin.cmdi.vlo.pages.FacetedSearchPage;
    9 import java.util.Map;
    109import javax.servlet.ServletContext;
    11 import org.apache.wicket.Application;
    12 import org.apache.wicket.RequestCycle;
    13 import org.apache.wicket.request.RequestParameters;
    14 import org.apache.wicket.Response;
     10import org.apache.wicket.Session;
    1511import org.apache.wicket.protocol.http.WebApplication;
    16 import org.apache.wicket.protocol.http.WebRequest;
    17 import org.apache.wicket.protocol.http.WebRequestCycle;
    18 import org.apache.wicket.protocol.http.WebResponse;
     12import org.apache.wicket.request.IRequestParameters;
     13import org.apache.wicket.request.Request;
     14import org.apache.wicket.request.Response;
     15import org.apache.wicket.request.cycle.RequestCycle;
     16import org.apache.wicket.request.cycle.RequestCycleContext;
     17import org.apache.wicket.util.string.StringValue;
    1918
    2019/**
     
    3736     * the in the application object.
    3837     */
    39     private class CustomCycle extends WebRequestCycle {       
     38    private class CustomCycle extends RequestCycle {       
    4039       
    4140        // find out why this is necessary
    42         CustomCycle (WebApplication app, WebRequest req, Response res){
    43             super (app, req, res);
     41        CustomCycle (RequestCycleContext context){
     42            super(context);
    4443        }   
    4544
     
    5251            super.onBeginRequest();
    5352            // after that, get the parameters of the request itself
    54             RequestParameters reqParam = this.request.getRequestParameters();
     53            IRequestParameters reqParam = getRequest().getRequestParameters();
     54           
    5555            // from these, get the parameters represented in the URL
    56             Map <String, String[]> map = this.getWebRequest().getParameterMap();
     56            //Map <String, String[]> map = this.getWebRequest().getParameterMap();
    5757            // check if there is a theme parameter       
    58             String[] object = map.get("theme");
     58            StringValue object = reqParam.getParameterValue("theme");
    5959                       
    60             if (object == null) {
     60            if (object.isEmpty()) {
    6161                // no theme choosen, keep the current one
    6262            } else {
    6363                // check if the users requests a different theme
    64                 if (object[0].matches(((VloSession)getSession()).getCurrentTheme().name)) {
     64                if (object.toString().matches(((VloSession)Session.get()).getCurrentTheme().name)) {
    6565                    // current theme requested, nothing to do
    6666                } else {
    6767                    // different theme requested, compose it
    68                     ((VloSession)getSession()).setCurrentTheme(new Theme (object[0]));
     68                    ((VloSession)Session.get()).setCurrentTheme(new Theme (object.toString()));
    6969                    // remember the theme as a vlo session page parameter
    70                     ((VloSession)getSession()).vloSessionPageParameters.add("theme", object[0]);
     70                    ((VloSession)Session.get()).vloSessionPageParameters.add("theme", object);
    7171                }
    7272            }
     
    112112            VloContextConfig.switchToExternalConfig(servletContext);
    113113        }
    114        
    115         // install the custom request cycle
    116         WebRequest req = (WebRequest) RequestCycle.get().getRequest();
    117         WebResponse res = (WebResponse) RequestCycle.get().getResponse();
    118            
    119         CustomCycle cycle;
    120         cycle = new CustomCycle(this, req, res);
    121114
    122115        // creata an object referring to the search results
     
    188181        return searchResults;
    189182    }
     183
     184    @Override
     185    public VloSession newSession(Request request, Response response) {
     186        return new VloSession(request);
     187    }
     188   
     189   
    190190}
Note: See TracChangeset for help on using the changeset viewer.