1Webapp.retrieveFunction(3kaya)Kaya module referencWeebapp.retrieveFunction(3kaya)
2
3
4
6 Webapp::retrieveFunction - Retrieve saved state
7
9 b retrieveFunction( b() defn, String(String) retriever, String key )
10
12 defn The default function to call if the state key does not exist.
13
14 retriever A function that returns the encoded state when given the key
15
16 key The key to find the state
17
19 In some circumstances you may need to store application state in an
20 external source, so that a user may save their session and return to it
21 later. This function lets you retrieve a saved state from an external
22 source based on a key. The function represented by the saved state is
23 then executed. The retrieval function should throw an Exception if it
24 can't find the key, which will cause the default function defn to be
25 executed instead. Otherwise, it should, given the key, return the state
26 string that was stored using Webapp.storeFunction (3kaya)
27
28
29 One use of this is to generate links to be sent via email, where the
30 links generated by Kaya containing the state data itself are too long
31 to be practical.
32
33 You should consider when writing the retrieval function whether the
34 action of retrieving the state should delete it from the persistent
35 storage.
36
38 Kaya standard library by Edwin Brady, Chris Morris and others
39 (kaya@kayalang.org). For further information see http://kayalang.org/
40
42 The Kaya standard library is free software; you can redistribute it
43 and/or modify it under the terms of the GNU Lesser General Public
44 License (version 2.1 or any later version) as published by the Free
45 Software Foundation.
46
48 Webapp.runHandler (3kaya)
49 Webapp.storeFunction (3kaya)
50
51
52
53Kaya December 2010 Webapp.retrieveFunction(3kaya)