Changeset 4220 for vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java
- Timestamp:
- 01/07/14 11:05:14 (10 years ago)
- Location:
- vlo/branches/to-wicket-1.6
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/to-wicket-1.6
- Property svn:mergeinfo changed
/vlo/branches/to-wicket-1.6-twagoo (added) merged: 4212-4216,4218-4219
- Property svn:mergeinfo changed
-
vlo/branches/to-wicket-1.6/vlo_web_app
- Property svn:ignore
-
old new 1 1 target 2 vlo-importer.log*
-
- Property svn:ignore
-
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java
r4199 r4220 7 7 import eu.clarin.cmdi.vlo.pages.BasePanel; 8 8 import eu.clarin.cmdi.vlo.pages.FacetedSearchPage; 9 import java.util.Map;10 9 import 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; 10 import org.apache.wicket.Session; 15 11 import 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; 12 import org.apache.wicket.request.IRequestParameters; 13 import org.apache.wicket.request.Request; 14 import org.apache.wicket.request.Response; 15 import org.apache.wicket.request.cycle.RequestCycle; 16 import org.apache.wicket.request.cycle.RequestCycleContext; 17 import org.apache.wicket.util.string.StringValue; 19 18 20 19 /** … … 37 36 * the in the application object. 38 37 */ 39 private class CustomCycle extends WebRequestCycle {38 private class CustomCycle extends RequestCycle { 40 39 41 40 // 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); 44 43 } 45 44 … … 52 51 super.onBeginRequest(); 53 52 // after that, get the parameters of the request itself 54 RequestParameters reqParam = this.request.getRequestParameters(); 53 IRequestParameters reqParam = getRequest().getRequestParameters(); 54 55 55 // 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(); 57 57 // check if there is a theme parameter 58 String [] object = map.get("theme");58 StringValue object = reqParam.getParameterValue("theme"); 59 59 60 if (object == null) {60 if (object.isEmpty()) { 61 61 // no theme choosen, keep the current one 62 62 } else { 63 63 // 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)) { 65 65 // current theme requested, nothing to do 66 66 } else { 67 67 // different theme requested, compose it 68 ((VloSession) getSession()).setCurrentTheme(new Theme (object[0]));68 ((VloSession)Session.get()).setCurrentTheme(new Theme (object.toString())); 69 69 // 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); 71 71 } 72 72 } … … 112 112 VloContextConfig.switchToExternalConfig(servletContext); 113 113 } 114 115 // install the custom request cycle116 WebRequest req = (WebRequest) RequestCycle.get().getRequest();117 WebResponse res = (WebResponse) RequestCycle.get().getResponse();118 119 CustomCycle cycle;120 cycle = new CustomCycle(this, req, res);121 114 122 115 // creata an object referring to the search results … … 188 181 return searchResults; 189 182 } 183 184 @Override 185 public VloSession newSession(Request request, Response response) { 186 return new VloSession(request); 187 } 188 189 190 190 }
Note: See TracChangeset
for help on using the changeset viewer.