1 | /* |
---|
2 | * To change this template, choose Tools | Templates |
---|
3 | * and open the template in the editor. |
---|
4 | */ |
---|
5 | package eu.clarin.cmdi.vlo; |
---|
6 | |
---|
7 | import java.util.Iterator; |
---|
8 | import java.util.Map; |
---|
9 | import java.util.Set; |
---|
10 | import org.apache.wicket.Session; |
---|
11 | import org.apache.wicket.request.mapper.parameter.PageParameters; |
---|
12 | |
---|
13 | /** |
---|
14 | * VLO web page parameters |
---|
15 | * |
---|
16 | * @author keeloo |
---|
17 | */ |
---|
18 | public class VloPageParameters extends PageParameters { |
---|
19 | |
---|
20 | public VloPageParameters (){ |
---|
21 | // needs to be here because of the other constructor |
---|
22 | super (); |
---|
23 | } |
---|
24 | |
---|
25 | public VloPageParameters (PageParameters parameters){ |
---|
26 | // store the parameters as VloPageParameters |
---|
27 | } |
---|
28 | |
---|
29 | public org.apache.wicket.PageParameters convert (){ |
---|
30 | |
---|
31 | org.apache.wicket.PageParameters param; |
---|
32 | |
---|
33 | // needs to be implemented |
---|
34 | |
---|
35 | param = null; |
---|
36 | |
---|
37 | return param; |
---|
38 | } |
---|
39 | |
---|
40 | /** |
---|
41 | * |
---|
42 | * @param param |
---|
43 | * @return |
---|
44 | */ |
---|
45 | public VloPageParameters convert (org.apache.wicket.PageParameters param){ |
---|
46 | |
---|
47 | // move page parameters in array of objects |
---|
48 | Set <Map.Entry<String,Object>> entries; |
---|
49 | entries = param.entrySet(); |
---|
50 | |
---|
51 | // iterate over the set, and put entries in new page parameters |
---|
52 | VloPageParameters VloPageParameters; |
---|
53 | VloPageParameters = new VloPageParameters (); |
---|
54 | for (Iterator<Map.Entry<String, Object>> it = entries.iterator(); it.hasNext();) { |
---|
55 | Map.Entry<String, Object> entry = it.next(); |
---|
56 | VloPageParameters.add(entry.getKey(), entry.getValue()); |
---|
57 | } |
---|
58 | |
---|
59 | return VloPageParameters; |
---|
60 | } |
---|
61 | |
---|
62 | /** |
---|
63 | * Add this, VLO page parameters, to the parameters that are already |
---|
64 | * associated with the session |
---|
65 | * |
---|
66 | */ |
---|
67 | public void addToSession() { |
---|
68 | |
---|
69 | // get a themed session from the current thread |
---|
70 | VloSession themedSession; |
---|
71 | themedSession = (VloSession)Session.get(); |
---|
72 | |
---|
73 | // store the parameters in the session object |
---|
74 | themedSession.addVloSessionPageParameters (this); |
---|
75 | } |
---|
76 | } |
---|