Changeset 4234
- Timestamp:
- 01/09/14 15:03:36 (10 years ago)
- Location:
- vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloSession.java
r4232 r4234 1 2 1 package eu.clarin.cmdi.vlo; 3 2 … … 7 6 8 7 /** 9 * A web session containing a VLO theme and parameters that are considered to 10 * bepersistent in a VLO session.11 * 8 * A web session containing a VLO theme and parameters that are considered to be 9 * persistent in a VLO session. 10 * 12 11 * Note that these parameters can include the specification of the theme. 13 * 12 * 14 13 * @author keeloo 15 14 */ … … 17 16 18 17 // remember the parameters that need to persist in URLs to VLO pages in this session 19 p ublicPageParameters vloSessionPageParameters = new PageParameters();18 private PageParameters vloSessionPageParameters = new PageParameters(); 20 19 21 20 // remember this session's theme … … 24 23 /** 25 24 * Construct a session object with a request parameter 26 * 27 * @param request 25 * 26 * @param request 28 27 */ 29 28 public VloSession(Request request) { … … 34 33 /** 35 34 * Get the session's theme 36 * 37 * @return the session's theme 35 * 36 * @return the session's theme 38 37 */ 39 38 public Theme getCurrentTheme() { … … 43 42 /** 44 43 * Set the session's theme 45 * 44 * 46 45 * @param theme the session's theme 47 46 */ … … 49 48 this.currentTheme = theme; 50 49 } 51 50 52 51 /** 53 52 * Return the session's persistent parameters 54 * 53 * 55 54 * @return session parameters 56 55 */ … … 61 60 /** 62 61 * Add parameters to the session's persistent parameters 63 * 62 * 64 63 * @param parameters a page parameter map 65 64 * 66 65 */ 67 66 public void addVloSessionPageParameters(PageParameters parameters) { 68 67 69 68 vloSessionPageParameters.mergeWith(parameters); 70 69 } -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java
r4232 r4234 18 18 import org.apache.wicket.request.cycle.AbstractRequestCycleListener; 19 19 import org.apache.wicket.request.cycle.RequestCycle; 20 import org.apache.wicket.request.mapper.parameter.PageParameters; 20 21 import org.apache.wicket.util.string.StringValue; 21 22 … … 63 64 ((VloSession) Session.get()).setCurrentTheme(new Theme(object.toString())); 64 65 // remember the theme as a vlo session page parameter 65 ((VloSession) Session.get()).vloSessionPageParameters.add("theme", object); 66 PageParameters params = new PageParameters(); 67 params.add("theme", object); 68 ((VloSession) Session.get()).addVloSessionPageParameters(params); 66 69 } 67 70 } -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/FacetLinkPanel.java
r4232 r4234 1 1 package eu.clarin.cmdi.vlo.pages; 2 2 3 import eu.clarin.cmdi.vlo.VloSession; 3 4 import org.apache.solr.client.solrj.response.FacetField.Count; 4 5 import org.apache.wicket.markup.html.basic.Label; … … 19 20 q.setFilterQuery(count); 20 21 PageParameters param = q.getPageParameters(); 22 param.mergeWith(((VloSession) VloSession.get()).getVloSessionPageParameters()); 21 23 22 24 Link<Count> facetLink = new BookmarkablePageLink("facetLink", FacetedSearchPage.class, param); -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java
r4232 r4234 74 74 public ShowResultPage(final PageParameters currentParam) { 75 75 super(currentParam); 76 // TODO: Is encoding/decoding of the page parameter required (or can it be automated?)76 //Document ID is assumed to have been encoded (typcially in DocumentLinkPanel) decode here 77 77 final String docId = UrlDecoder.QUERY_INSTANCE.decode( 78 78 getPageParameters().get(PARAM_DOC_ID).toString(), … … 83 83 84 84 // create parameters from the query, and add them with session related parameters 85 PageParameters newParam; 86 newParam = new PageParameters(query.getPageParameters()); 85 PageParameters newParam = new PageParameters(query.getPageParameters()); 87 86 // add the session persistent parameters 88 newParam.mergeWith(((VloSession) this.getSession()).getVloSessionPageParameters());87 newParam.mergeWith(((VloSession) this.getSession()).getVloSessionPageParameters()); 89 88 90 89 BookmarkablePageLink<String> backLink = new BookmarkablePageLink<String>("backLink", FacetedSearchPage.class, newParam); … … 429 428 PageParameters newParam = new PageParameters(parameters); 430 429 // add the session persistent paremeters 431 newParam.mergeWith(((VloSession) this.getSession()).getVloSessionPageParameters());430 newParam.mergeWith(((VloSession) this.getSession()).getVloSessionPageParameters()); 432 431 433 432 final RequestCycle reqCycle = getRequestCycle(); … … 460 459 PageParameters newParam; 461 460 newParam = new PageParameters(query.getPageParameters()); 462 // add the session persistent parameters463 // newParam.add(((VloSession)this.getSession()).getVloSessionPageParameters());464 461 newParam.add(ShowResultPage.PARAM_DOC_ID, UrlEncoder.QUERY_INSTANCE.encode( 465 462 docId, 466 463 Application.get().getRequestCycleSettings().getResponseRequestEncoding())); // get current character set from request cycle 467 464 // add the session persistent parameters 465 newParam.mergeWith(((VloSession) VloSession.get()).getVloSessionPageParameters()); 468 466 BookmarkablePageLink<ShowResultPage> docLink = new BookmarkablePageLink<ShowResultPage>(linkId, ShowResultPage.class, 469 467 newParam);
Note: See TracChangeset
for help on using the changeset viewer.