source: vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloPageParameters.java @ 4220

Last change on this file since 4220 was 4220, checked in by twagoo, 10 years ago

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

File size: 2.4 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5package eu.clarin.cmdi.vlo;
6
7import java.util.Iterator;
8import java.util.List;
9import java.util.Map;
10import java.util.Set;
11import org.apache.wicket.Session;
12import org.apache.wicket.request.mapper.parameter.PageParameters;
13
14/**
15 * VLO web page parameters
16 *
17 * @author keeloo
18 */
19public class VloPageParameters extends PageParameters {
20   
21    public VloPageParameters (){
22        // needs to be here because of the other constructor
23        super ();
24        // add the theme parameter
25        // ...
26    }
27   
28    public VloPageParameters (PageParameters parameters){
29        // store the parameters as VloPageParameters
30    }
31   
32    public PageParameters convert (){
33       
34        PageParameters param;
35       
36        // needs to be implemented
37       
38        // present the page parameters in the old style
39       
40        param = null;
41       
42        return param;
43    }
44
45    /**
46     * Take in  old style parameters.
47     *
48     *
49     * not being used at the moment; use code in the previous method
50     *
51     * @param param
52     * @return
53     */
54    public static VloPageParameters convert (PageParameters param){
55        List<NamedPair> entries = param.getAllNamed();       
56        // iterate over the set, and put entries in new page parameters
57        VloPageParameters VloPageParameters;
58        VloPageParameters = new VloPageParameters ();
59        for (Iterator<NamedPair> it = entries.iterator(); it.hasNext();) {
60            NamedPair entry = it.next();
61            VloPageParameters.add(entry.getKey(), entry.getValue());
62        }
63       
64        return VloPageParameters;
65    }
66
67    /**
68     *
69     * @param PersistentParameters parameters concerning theme and other
70     * non query related parameters. These parameters are to kept in the URL
71     * during the session.
72     */
73    public void merge(PageParameters parameters) {   
74       
75        // get a themed session from the current thread
76        VloSession themedSession;
77        themedSession = (VloSession)Session.get();
78       
79        // get the parameters associated with the session
80        PageParameters persistentParameters;
81        persistentParameters = themedSession.getVloSessionPageParameters();
82       
83        // merge the parameters with the persistent ones and return the result
84       
85        // ...
86       
87    }
88}
Note: See TracBrowser for help on using the repository browser.